Ignore:
Timestamp:
11/04/02 10:06:08 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1496 r1574  
    9393Bool_t MBlindPixelCalc::PreProcess (MParList *pList)
    9494{
    95     fPixels = (MBlindPixels*)pList->FindCreateObj("MBlindPixels");
     95    if (TESTBIT(fFlags, kUseBlindPixels))
     96        fPixels = (MBlindPixels*)pList->FindObject("MBlindPixels");
     97    else
     98        fPixels = (MBlindPixels*)pList->FindCreateObj("MBlindPixels");
    9699    if (!fPixels)
    97100        return kFALSE;
     
    106109    fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
    107110    if (!fGeomCam)
    108         *fLog << warn << dbginf << "No camera geometry available... can't ude interpolation." << endl;
     111        *fLog << warn << dbginf << "No camera geometry available... can't use interpolation." << endl;
     112
     113    if (TESTBIT(fFlags, kUseBlindPixels))
     114        return kTRUE;
    109115
    110116    const UShort_t size = fPixelsID.GetSize();
     
    162168        Int_t num = TESTBIT(fFlags, kUseCentralPixel) ? 1 : 0;
    163169
    164         nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? (*fEvt)[id].GetNumPhotons() : 0;
    165         perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? (*fEvt)[id].GetErrorPhot()  : 0;
     170        nphot[i] = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetNumPhotons() : 0;
     171        perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot()  : 0;
    166172        for (int j=0; j<n; j++)
    167173        {
     
    171177                continue;
    172178
    173             nphot[i] += (*fEvt)[nid].GetNumPhotons();
    174             perr[i]  += (*fEvt)[nid].GetErrorPhot();
    175 
     179            const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
     180            if (evtpix)
     181            {
     182                nphot[i] += evtpix->GetNumPhotons();
     183                perr[i]  += evtpix->GetErrorPhot();
     184            }
    176185            num++;
    177186        }
     
    253262Bool_t MBlindPixelCalc::ReInit(MParList *pList)
    254263{
     264    if (TESTBIT(fFlags, kUseBlindPixels))
     265        return kTRUE;
     266
    255267    //
    256268    // If pixels are given by the user, we are already done
Note: See TracChangeset for help on using the changeset viewer.