Changeset 13780 for fact/tools


Ignore:
Timestamp:
05/18/12 21:20:42 (12 years ago)
Author:
Jens Buss
Message:
changed all savelists from objarray to list, extracted SetHostPath to rootfilehandler, drawing and filling whole camera histos added, working no seg fault
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/PulseTemplates/FCalcPulseTemplate.C

    r13656 r13780  
    8484//----------------------------------------------------------------------------
    8585int FCalcPulseTemplate(
    86     TString     InRootFileName        = "pulseoverlay.root",
    87     TString     InputPath           = "/home_nfs/isdc/jbbuss/analysis/FPulseTemplate/20111109_006/Overlay/",
    88     TString     OutputRootFileName     = "20111109_006.pulses.root",
    89     TString     OutPutPath          = "/home_nfs/isdc/jbbuss/analysis/FPulseTemplate/20111109_006/Template/",
    90     bool        ProduceGraphic      = false,
     86    TString     InRootFileName        = "20120309_018.root",
     87    TString     InputPath           = "analysis/FPulseTemplate/20120309_018/Overlay/",
     88    TString     OutputRootFileName     = "test.root",
     89    TString     OutPutPath          = "analysis/FPulseTemplate/20120309_018/",
     90    bool        ProduceGraphic      = true,
    9191//    bool        fitdata             = false,
    9292    bool        stats               = false,
     
    9595    int         maxPulseOrder       = 3,
    9696//    int         refresh_rate        = 500,      //refresh rate for canvases
    97     int         verbosityLevel      = 4,        // different verbosity levels can be implemented here
     97    int         verbosityLevel      = 5,        // different verbosity levels can be implemented here
    9898    int         firstpixel          = 0,
    99     int         npixel              = -1
     99    int         npixel              = 2
    100100        )
    101101{
     102
     103
     104    InputPath = SetHostsPaths(true, InputPath );
     105    OutPutPath = SetHostsPaths(true, OutPutPath );
     106
    102107
    103108//----------------------------------------------------------------------------
     
    286291                       verbosityLevel,
    287292                       stats,
     293                       "L",
     294                       70,   ///TODO: get it from the root file
     295                       230,  ///TODO: get it from the root file
     296                       -1,   ///TODO: get it from the root file
     297                       9,    ///TODO: get it from the root file
    288298                       inputRootFile
    289299                    );
     
    304314                            verbosityLevel,
    305315                            stats,
    306                             outputRootFile,
     316                            "",
    307317                            pixel[pixelID]->mPixelOverlayXaxisLeft,
    308318                            pixel[pixelID]->mPixelOverlayXaxisRight ,
    309319                            pixel[pixelID]->mBSLMean ,
    310320                            pixel[pixelID]->mGainMean ,
    311                             pixel[pixelID]->mOptions
     321                            outputRootFile
    312322                            );
    313323                first_pass = false;
     
    374384                            verbosityLevel
    375385                            );
    376 
     386                if (ProduceGraphic)
     387                {
    377388                pixel[pixelID]->DrawTemplateHistograms(
    378389                            cgpPixelPulses,
     
    384395                            PixelCanvasFrameNrs
    385396                            );
    386 
     397                }
    387398                //-------------------------------------
    388399                // Fill Histogramms of Camera
    389400                //-------------------------------------
    390 
     401                cout << "1" << endl;
    391402                wholeCamera->hMaxOverlay[pulse_order]->Add(
    392403                            pixel[pixelID]->hMaxOverlay[pulse_order]
    393404                            );
    394 
     405                cout << wholeCamera->hMaxOverlay[pulse_order]->GetName() << endl;
     406cout << "2" << endl;
    395407                wholeCamera->hMaxProfile[pulse_order]->Add(
    396408                            pixel[pixelID]->hMaxProfile[pulse_order]
    397409                            );
    398 
     410cout << "3" << endl;
    399411                wholeCamera->hEdgeOverlay[pulse_order]->Add(
    400412                            pixel[pixelID]->hEdgeOverlay[pulse_order]
    401413                            );
    402 
     414cout << "4" << endl;
    403415                wholeCamera->hEdgeProfile[pulse_order]->Add(
    404416                            pixel[pixelID]->hEdgeProfile[pulse_order]
    405417                            );
    406 
     418cout << "5" << endl;
     419
     420                if (verbosityLevel > 2)
     421                {
     422                cout << endl << "...End of pulseorder "
     423                    << pulse_order
     424                    << endl;
     425                }
    407426
    408427            }
     
    436455            //deleteCurrent Pixel from Heap
    437456            delete pixel[pixelID];
    438 
     457            pixel[pixelID] = NULL;
    439458            if (verbosityLevel > 2)
    440459            {
     
    462481    }
    463482
     483    delete[] pixel;
     484    pixel = NULL;
    464485//-------------------------------------
    465486// Draw All Pixel Histograms
     
    476497        }
    477498
    478         // Calculate Max Prop. Value of each slice
    479         //-------------------------------------
     499//        Calculate Max Prop. Value of each slice
     500//        -------------------------------------
    480501
    481502        //from Maximum Overlay
     
    511532                    );
    512533
    513         wholeCamera->DrawTemplateHistograms(
    514                     cgpPixelPulses,
    515                     PixelCanvasFrameNrs
    516                     );
    517 
    518         wholeCamera->DrawEdgeTemplateHistograms(
    519                     cgpPixelPulses,
    520                     PixelCanvasFrameNrs
    521                     );
    522     }
     534//        wholeCamera->DrawTemplateHistograms(
     535//                    cgpPixelPulses,
     536//                    PixelCanvasFrameNrs
     537//                    );
     538
     539//        wholeCamera->DrawEdgeTemplateHistograms(
     540//                    cgpPixelPulses,
     541//                    PixelCanvasFrameNrs
     542//                    );
     543    } //EOF: Draw All Pixel Histograms
     544
     545//-------------------------------------
     546// Save All Pixel Histograms
     547//-------------------------------------
     548
    523549//    SaveHistograms(     //save histograms of all pixel into output root file
    524550//                OutInRootFileName,
     
    541567//        UpdateCanvases(
    542568//                    verbosityLevel,
    543 //                    MAX_PULS_ORDER
     569//                    MAX_PULS_ORDER,
     570//                    false
    544571//                    );
    545572//    }
    546573
    547 //    WriteAllPixelTemplateToCsv(
    548 //                OutPutPath,
    549 //                "PulseTemplate_PointSet",
    550 //                "Maximum",
    551 //                verbosityLevel
    552 //                );
    553 
    554     delete pixel;
    555574    delete wholeCamera;
    556     DeletePixelCanvases( maxPulseOrder ,verbosityLevel );
     575    if (ProduceGraphic)
     576    {
     577        DeletePixelCanvases( maxPulseOrder ,verbosityLevel );
     578    }
    557579    delete inputRootFile;
    558580    delete outputRootFile;
     
    575597        )
    576598{
    577     if (verbosityLevel > 2) cout << endl << "...delete pixel Canvases" ;
     599    if (verbosityLevel > 2)
     600    {
     601        cout << endl << "...delete pixel Canvases" << endl;
     602    }
    578603    for (int pulse_order = 0; pulse_order < maxPulseOrder; pulse_order++ )
    579604    {
    580605        delete cgpPixelPulses[pulse_order];
     606        cgpPixelPulses[pulse_order] = NULL;
    581607        delete cgpDistributions[pulse_order];
     608        cgpDistributions[pulse_order] = NULL;
    582609    }
    583610    delete[] cgpPixelPulses;
     611    cgpPixelPulses = NULL;
    584612    delete[] cgpDistributions;
     613    cgpDistributions = NULL;
    585614}
    586615
Note: See TracChangeset for help on using the changeset viewer.