Ignore:
Timestamp:
02/15/09 13:47:00 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc

    r8354 r9337  
    8989// --------------------------------------------------------------------------
    9090//
    91 // Check for the run type. Return kTRUE if it is a MC run or if there
    92 // is no MC run header (old camera files) kFALSE in case of a different
    93 // run type
    94 //
    95 Bool_t MMcCalibrationUpdate::CheckRunType(MParList *pList) const
    96 {
    97     const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
    98     if (!run)
    99     {
    100         *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
    101         return kTRUE;
    102     }
    103 
    104     return run->IsMonteCarloRun();
    105 }
    106 
    107 // --------------------------------------------------------------------------
    108 //
    10991// Make sure, that there is an MCalibrationCam Object in the Parameter List.
    11092//
     
    150132Bool_t MMcCalibrationUpdate::ReInit(MParList *pList)
    151133{
     134    const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
     135    if (!run)
     136    {
     137        *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
     138        return kTRUE;
     139    }
     140
    152141    //
    153142    // If it is no MC file skip this function...
    154143    //
    155144    fGeom = 0;
    156     if (!CheckRunType(pList))
     145    if (run->IsMonteCarloRun())
    157146    {
    158147        *fLog << inf << "This is no MC file... skipping." << endl;
    159148        return kTRUE;
    160149    }
     150
     151    const MMcRunHeader* mcrunh = (MMcRunHeader*) pList->FindObject(AddSerialNumber("MMcRunHeader"));
     152    if (!mcrunh)
     153    {
     154        *fLog << err << AddSerialNumber("MMcRunHeader") << " not found... aborting." << endl;
     155        return kFALSE;
     156    }
     157
     158    if (mcrunh->IsCeres())
     159    {
     160        *fLog << inf;
     161        *fLog << "This is a ceres file... skipping." << endl;
     162        *fLog << "   MCalibrationChargeCam (calibration constants), MCalibrationQECam (avg quantum efficiency)" << endl;
     163        *fLog << "   and MPedPhotCam (randomly extracted pedestal) not updated." << endl;
     164        return kTRUE;
     165    }
    161166       
    162167    //
     
    174179    {
    175180        *fLog << err << AddSerialNumber("MMcFadcHeader") << " not found... aborting." << endl;
    176         return kFALSE;
    177     }
    178 
    179     MMcRunHeader* mcrunh = (MMcRunHeader*) pList->FindObject(AddSerialNumber("MMcRunHeader"));
    180     if (!mcrunh)
    181     {
    182         *fLog << err << AddSerialNumber("MMcRunHeader") << " not found... aborting." << endl;
    183181        return kFALSE;
    184182    }
Note: See TracChangeset for help on using the changeset viewer.