Ignore:
Timestamp:
05/18/12 21:14:31 (12 years ago)
Author:
Jens Buss
Message:
changed all savelists from objarray to
list, extracted SetHostPath to
rootfilehandler,
File:
1 edited

Legend:

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

    r13735 r13779  
    3939
    4040#define NPIX  1440
    41 #define NCELL 1024
    4241#define FAD_MAX_SAMPLES 1024
    4342#define HAVE_ZLIB
     
    160159    //Root-File Objects
    161160//    TObjArray*  hList[pixelSetSize] = {NULL};
    162     TObjArray*  hRootList           = NULL;
     161    TList*  hRootList           = NULL;
    163162
    164163    TCanvas**   cgpPixelPulses      = NULL;
     
    183182void UpdateCanvases( int, int, bool);
    184183void DeletePixelCanvases( int, int );
    185 TString SetHostsPaths(TString filename, bool Input);
    186184
    187185TString gDataDirectory;
     
    195193//----------------------------------------------------------------------------
    196194int FPulseOverlay(
    197         TString     datafilename        = "raw/2011/11/09/20111109_006.fits.gz",
    198         TString     drsfilename         = "raw/2011/11/09/20111109_003.drs.fits.gz",
    199         TString     OutRootFileName     = "analysis/FPulseTemplate/20111109_006/Overlay/20111109_006.root",
     195        TString     datafilename        = "raw/2012/03/09/20120309_018.fits.gz",
     196        TString     drsfilename         = "raw/2012/03/09/20120309_012.drs.fits.gz",
     197        TString     OutRootFileName     = "analysis/FPulseTemplate/20120309_018/Overlay/20120309_018.root",
    200198        bool            ProduceGraphic      = false,
    201199        bool            spikeDebug          = false,
     
    203201        bool            testmode            = false,
    204202        bool            saveResults         = true,
    205         int             verbosityLevel      = 0,        // different verbosity levels can be implemented here
     203        int             verbosityLevel      = 1,        // different verbosity levels can be implemented here
    206204        int             firstevent          = 1,        // Hast to be between 1 and infinity NOT 0!!!!
    207         int             nevents             = 1,
     205        int             nevents             = -1,
    208206        int             firstpixel          = 0,
    209         int             npixel              = 1,
    210         int             pixelSetSize       = 200,
    211         int             maxPulseOrder       = 4,
    212         int             AmplWindowWidth     = 14,       //Width of Window for selection of pulses to histograms
     207        int             npixel              = 2,
     208        int             pixelSetSize       = 150,
     209        int             maxPulseOrder       = 5,
     210        int             AmplWindowWidth     = 16,       //Width of Window for selection of pulses to histograms
    213211        TString         histoOptions        = "SRM",
    214212        float           GainMean            = 9,
     
    225223//      Save-Root-File Settings
    226224//----------------------------------------------------------------------------
    227     datafilename        = SetHostsPaths(datafilename      , true );
    228     drsfilename         = SetHostsPaths(drsfilename       , true );
    229     OutRootFileName     = SetHostsPaths(OutRootFileName   , false );
     225    datafilename        = SetHostsPaths(false,   datafilename );
     226    drsfilename         = SetHostsPaths(false,   drsfilename );
     227    OutRootFileName     = SetHostsPaths(true,  OutRootFileName );
    230228
    231229    if (saveResults)
    232230    {
    233         CreateRootFile( OutRootFileName, false, verbosityLevel );
     231        CreateRootFile( OutRootFileName, true, verbosityLevel );
    234232    }
    235233
     
    487485                                verbosityLevel,
    488486                                false,
     487                                histoOptions,
    489488                                NULL,
    490489                                gPixelOverlayXaxisLeft,
    491490                                gPixelOverlayXaxisRight,
    492491                                gBSLMean,
    493                                 gGainMean,
    494                                 histoOptions
     492                                gGainMean
    495493                                );
    496494                }
     
    716714// Draw Histograms
    717715//-------------------------------------
    718 
     716    TString test = "root";
    719717    SaveHistograms(     //save histograms of generell results into output root file
    720718                OutRootFileName,
    721                 "root",
     719                test,
    722720                hRootList,
    723721                saveResults,
     
    815813{
    816814    if (verbosityLevel > 2) cout << endl << "...book histograms" << endl;
    817     hRootList = new TObjArray;
     815    hRootList = new TList();
    818816    debugHistos = new TH1F[ Number_Of_Debug_Histo_Types ];
    819817    for ( int type = 0; type < Number_Of_Debug_Histo_Types; type++){
     
    12161214
    12171215
    1218 TString
    1219 SetHostsPaths(TString filename, bool Input)
    1220 {
    1221     ghostname = gSystem->HostName();
    1222 
    1223     TString temp_filename;
    1224 
    1225     if ( ghostname.Contains("isdc") ) //IF ONE IS WORKING AT ISDC
    1226     {
    1227         gDataDirectory = "/fact/";
    1228         gHomeDirectory = "/home_nfs/isdc/jbbuss/";
    1229     }
    1230     if ( ghostname.Contains("hpc") ) //IF ONE IS WORKING AT PHIDO
    1231     {
    1232         gDataDirectory = "/fhgfs/groups/app/fact-construction/";
    1233         gHomeDirectory = "/home/jbuss/";
    1234     }
    1235 
    1236     if (Input)
    1237     {
    1238         temp_filename = gDataDirectory;
    1239         temp_filename += filename;
    1240         filename = temp_filename;
    1241     }
    1242     else if (!Input)
    1243     {
    1244         temp_filename = gHomeDirectory;
    1245         temp_filename += filename;
    1246         filename = temp_filename;
    1247     }
    1248 
    1249     return filename;
    1250 }
     1216
    12511217
    12521218
Note: See TracChangeset for help on using the changeset viewer.