Ignore:
Timestamp:
07/13/05 19:06:26 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
4 edited

Legend:

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

    r5844 r7188  
    133133    {
    134134        MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
    135         if (cam)
    136             cam->Init(geom);
     135        if (!cam)
     136            continue;
     137
     138        // If the MGeomApply task has a serial number >0 (indicating most likely
     139        // a specific telescope in a multi-telescope file), then apply the
     140        // geometry only to objects with the same serial number. This is important
     141        // for stereo setups in which the telescopes have cameras with different
     142        // numbers of pixels. If the MGeomApply task has serial number 0 (default),
     143        // it will apply the geometry to all found objects as it used to do.
     144        const TString name(o->GetName());
     145
     146        // Extract serial number from name:
     147        const Int_t serial = atoi(name.Data()+name.Last(';')+1);
     148
     149        // Compare with the serial number of this task:
     150        if (serial>0 && serial!=GetSerialNumber())
     151            continue;
     152
     153        // Initialize object according to camera geometry:
     154        cam->Init(geom);
    137155    }
    138156}
     
    186204
    187205    // FIXME, workaround: this call to CalcPixRatio is here just to allow
    188     // the use of some camera files from the 0.7 beta version in which the
     206    // the use of some MC camera files from the 0.7 beta version in which the
    189207    // array containing pixel ratios is not initialized.
    190208    geom->CalcPixRatio();
  • trunk/MagicSoft/Mars/manalysis/MMcCalibrationUpdate.cc

    r7005 r7188  
    9595Bool_t MMcCalibrationUpdate::CheckRunType(MParList *pList) const
    9696{
    97     const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     97    const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader"));
    9898    if (!run)
    9999    {
     
    176176    }
    177177
    178     MMcRunHeader* mcrunh = (MMcRunHeader*) pList->FindObject("MMcRunHeader");
     178    MMcRunHeader* mcrunh = (MMcRunHeader*) pList->FindObject(AddSerialNumber("MMcRunHeader"));
     179    if (!mcrunh)
     180    {
     181        *fLog << err << AddSerialNumber("MMcRunHeader") << " not found... aborting." << endl;
     182        return kFALSE;
     183    }
    179184
    180185    //
     
    247252    // perpendicular to the camera plane.
    248253    //
    249     // FIXME! We look for AddSerialNumber("MMcConfigRunHeader") but
    250     // for the moment the stereo version of camera does not write one such
    251     // header per telescope (it should!)
     254    // As it happens with most containers, we look for AddSerialNumber("MMcConfigRunHeader")
     255    // because in the stereo option the camera simulation writes one such header
     256    // per telescope.
    252257    //
    253258    MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject(AddSerialNumber("MMcConfigRunHeader"));
  • trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc

    r3795 r7188  
    1717!
    1818!   Author(s): Antonio Stamerra  1/2003 <mailto:antono.stamerra@pi.infn.it>
    19 !   Author(s): Marcos Lopez 1/2003 <mailto:marcos@gae.ucm.es>
    2019!
    2120!   Copyright: MAGIC Software Development, 2000-2003
     
    7170// run type
    7271//
    73 Bool_t MMcTriggerLvl2Calc::CheckRunType(MParList *pList) const
     72Bool_t MMcTriggerLvl2Calc::IsMCRun(MParList *pList) const
    7473{
    7574  const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     
    9089Bool_t MMcTriggerLvl2Calc::ReInit(MParList *pList)
    9190{
    92     //
    93     // If it is no MC file skip this function...
    94     //
    95     if (!CheckRunType(pList))
    96     {
    97         *fLog << inf << "This is no MC file... skipping." << endl;
    98         return kTRUE;
    99     }
    100        
    101     //
    102     // Check all necessary containers
    103     //
    104     fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    105      if (!fMcEvt)
    106      {
    107          *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
    108          return kFALSE;
    109      }
    110 
    111     fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
    112     if (!fMcTrig)
    113     {
    114         *fLog << err << dbginf << "MMcTrig not found... exit." << endl;
    115         return kFALSE;
    116     }
    117 
    118     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
    119     if (!fCam)
    120     {
    121         *fLog << dbginf << "MGeomCam not found (no geometry information available)... aborting." << endl;
    122         return kFALSE;
    123     }
    124     // Check if fCam is a Magic geometry: only MGeomCamMagic geometry and
    125     // geometries with 577 pixels are now accepted by MMcTriggerLvl2
    126     if (fCam->GetNumPixels()!= 577)
    127       {
    128         *fLog << dbginf << "MGeomCam has a wrong geometry; only MAGIC geometry (577 pixels) is accepted by now... aborting" <<endl;
    129         return kFALSE;
    130       }
    131 
    13291    return kTRUE;
    13392}
     93
    13494
    13595
     
    168128      *fLog << "Compact pixel is set with at least "<<fMMcTriggerLvl2->GetCompactNN() << " NN" <<endl;
    169129
     130    //------------------------------------------------------------
     131    //
     132    // If it is no MC file skip this function...
     133    //
     134    if (!IsMCRun(pList))
     135    {
     136        *fLog << inf << "Reading a data file...skipping the rest of PreProcess()" << endl;
     137        return kTRUE;
     138    }
     139       
     140    //
     141    // Check all necessary containers in case of a MC run
     142    //
     143    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
     144     if (!fMcEvt)
     145     {
     146         *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
     147         return kFALSE;
     148     }
     149
     150    fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
     151    if (!fMcTrig)
     152    {
     153        *fLog << err << dbginf << "MMcTrig not found... exit." << endl;
     154        return kFALSE;
     155    }
     156
     157    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
     158    if (!fCam)
     159    {
     160        *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
     161        return kFALSE;
     162    }
     163    // Check if fCam is a Magic geometry: only MGeomCamMagic geometry and
     164    // geometries with 577 pixels are now accepted by MMcTriggerLvl2
     165    if (fCam->GetNumPixels()!= 577)
     166      {
     167        *fLog << warn << "MGeomCam has a wrong geometry; only MAGIC geometry (577 pixels) is accepted by now... the Task is skipped." <<endl;
     168        return kSKIP;
     169      }
    170170
    171171    return kTRUE;
     172
    172173}
    173174
  • trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.h

    r3795 r7188  
    3333
    3434  Bool_t ReInit(MParList *pList);
    35   Bool_t CheckRunType(MParList *pList) const;
     35  Bool_t IsMCRun(MParList *pList) const;
    3636
    3737 public:
Note: See TracChangeset for help on using the changeset viewer.