Ignore:
Timestamp:
07/12/03 22:01:34 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
2 edited

Legend:

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

    r2206 r2274  
    2929//
    3030//  This is the specific image cleaning for a list of pixels. This task
    31 //  sets the pixels listed in fPixelsID to unused so they should not be
     31//  sets the pixels listed in fPixelsIdx to unused so they should not be
    3232//  used for analysis (eg calculation of hillas parameters).
    3333//
     
    130130        return kTRUE;
    131131
    132     const UShort_t size = fPixelsID.GetSize();
     132    const UShort_t size = fPixelsIdx.GetSize();
    133133
    134134    if (size == 0)
     
    145145    // through the macros
    146146
    147     UShort_t numids = fPixelsID.GetSize();
     147    UShort_t numids = fPixelsIdx.GetSize();
    148148
    149149    for(Int_t i = 0; i<numids; i++)
    150         fPixels->SetPixelBlind(fPixelsID[i]);
     150        fPixels->SetPixelBlind(fPixelsIdx[i]);
    151151
    152152    return kTRUE;
     
    167167
    168168    //
    169     // remove the pixels in fPixelsID if they are set to be used,
     169    // remove the pixels in fPixelsIdx if they are set to be used,
    170170    // (set them to 'unused' state)
    171171    //
     
    174174        MCerPhotPix &pix = (*fEvt)[i];
    175175
    176         const Int_t id = pix.GetPixId();
    177 
    178         if (!fPixels->IsBlind(id))
     176        const Int_t idx = pix.GetPixId();
     177
     178        if (!fPixels->IsBlind(idx))
    179179            continue;
    180180
    181         const MGeomPix &gpix = (*fGeomCam)[id];
    182 
    183         const Int_t n = gpix.GetNumNeighbors();
     181        const MGeomPix &gpix = (*fGeomCam)[idx];
    184182
    185183        Int_t num = TESTBIT(fFlags, kUseCentralPixel) ? 1 : 0;
     
    188186        perr[i]  = TESTBIT(fFlags, kUseCentralPixel) ? pix.GetErrorPhot()  : 0;
    189187
    190         nphot[i] *= fGeomCam->GetPixRatio(id);
     188        nphot[i] *= fGeomCam->GetPixRatio(idx);
    191189        // FIXME: perr[i] ???
    192190
     191        const Int_t n = gpix.GetNumNeighbors();
    193192        for (int j=0; j<n; j++)
    194193        {
    195             const UShort_t nid = gpix.GetNeighbor(j);
    196 
    197             if (fPixels->IsBlind(nid))
     194            const UShort_t nidx = gpix.GetNeighbor(j);
     195
     196            if (fPixels->IsBlind(nidx))
    198197                continue;
    199198
    200             const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
     199            const MCerPhotPix *evtpix = fEvt->GetPixById(nidx);
    201200            if (evtpix)
    202201            {
    203                 nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nid);
     202                nphot[i] += evtpix->GetNumPhotons()*fGeomCam->GetPixRatio(nidx);
    204203                perr[i]  += evtpix->GetErrorPhot();
    205204                // FIXME: perr[i] ???
     
    208207        }
    209208
    210         nphot[i] /= num*fGeomCam->GetPixRatio(id);
     209        nphot[i] /= num*fGeomCam->GetPixRatio(idx);
    211210        perr[i]  /= num/*FIXME:???*/;
    212211    }
     
    235234
    236235    //
    237     // remove the pixels in fPixelsID if they are set to be used,
     236    // remove the pixels in fPixelsIdx if they are set to be used,
    238237    // (set them to 'unused' state)
    239238    //
     
    244243        if (fPixels->IsBlind(pix.GetPixId()))
    245244            pix.SetPixelUnused();
    246 
    247245    }
    248246}
     
    264262// --------------------------------------------------------------------------
    265263//
    266 //  Set pixels to no be used.
    267 //  This member function (public) should be called from the macro (or
    268 //  analysis program) setting the desired blind pixels.
    269 //  In the future, the blind pixels may be extracted from information which
    270 //  is already in the root file. 
    271 //
    272 void MBlindPixelCalc::SetPixels(Int_t num, Short_t *ids)
    273 {
    274     fPixelsID.Adopt(num, ids);
    275 }
    276 
    277 // --------------------------------------------------------------------------
    278 //
    279264//  - Check whether pixels to disable are available. If pixels are
    280265//    given by the user nothing more is done.
     
    290275    // If pixels are given by the user, we are already done
    291276    //
    292     if (fPixelsID.GetSize() > 0)
     277    if (fPixelsIdx.GetSize() > 0)
    293278        return kTRUE;
    294279
     
    355340        out << "   " << GetUniqueName() << ".SetUseCentralPixel();" << endl;
    356341
    357     if (fPixelsID.GetSize()==0)
     342    if (fPixelsIdx.GetSize()==0)
    358343        return;
    359344
    360345    out << "   {" << endl;
    361346    out << "      TArrayS dummy;" << endl;
    362     for (int i=0; i<fPixelsID.GetSize(); i++)
    363         out << "      dummy[" << i << "]=" << ((TArrayS)fPixelsID)[i] << ";" << endl;
     347    for (int i=0; i<fPixelsIdx.GetSize(); i++)
     348        out << "      dummy[" << i << "]=" << ((TArrayS)fPixelsIdx)[i] << ";" << endl;
    364349    out << "      " << GetUniqueName() << ".SetPixels(dummy);" << endl;
    365350    out << "   }" << endl;
  • trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h

    r2206 r2274  
    2121    MGeomCam     *fGeomCam; //!
    2222
    23     TArrayS fPixelsID;  // Pixel IDs for blind pixels, which are entered by the user.
     23    TArrayS fPixelsIdx;  // Pixel Indices for blind pixels, which are entered by the user.
    2424
    2525    Byte_t fFlags;      // flag for the method which is used
     
    5555    }
    5656
    57     void SetPixels(Int_t num, Short_t *ids);
    58     void SetPixels(const TArrayS pix) { SetPixels((Int_t)pix.GetSize(), (Short_t*)pix.GetArray()); }
     57    void SetPixelIndices(const TArrayS &pix) { fPixelsIdx = pix; }
    5958    virtual Bool_t ReInit(MParList *pList);
    6059
Note: See TracChangeset for help on using the changeset viewer.