Ignore:
Timestamp:
11/04/02 10:06:08 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
8 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
  • trunk/MagicSoft/Mars/manalysis/MBlindPixelCalc.h

    r1572 r1574  
    2828    {
    2929        kUseInterpolation = 1,
    30         kUseCentralPixel  = 2
     30        kUseCentralPixel  = 2,
     31        kUseBlindPixels   = 3
    3132    };
    3233
     
    4647        b ? SETBIT(fFlags, kUseCentralPixel) : CLRBIT(fFlags, kUseCentralPixel);
    4748    }
     49    void SetUseBlindPixels(Bool_t b=kTRUE)
     50    {
     51        b ? SETBIT(fFlags, kUseBlindPixels) : CLRBIT(fFlags, kUseBlindPixels);
     52    }
    4853
    4954    Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/manalysis/MCameraSmooth.cc

    r1568 r1574  
    111111            const Int_t n = gpix.GetNumNeighbors();
    112112
    113             photons[i] = fUseCentralPixel ? (*fEvt)[id].GetNumPhotons() : 0;
    114             errors[i]  = fUseCentralPixel ? (*fEvt)[id].GetErrorPhot()  : 0;
     113            Int_t num  = fUseCentralPixel ? 1 : 0;
     114            photons[i] = fUseCentralPixel ? pix.GetNumPhotons() : 0;
     115            errors[i]  = fUseCentralPixel ? pix.GetErrorPhot()  : 0;
     116
    115117            for (int j=0; j<n; j++)
    116118            {
    117119                const UShort_t nid = gpix.GetNeighbor(j);
    118120
    119                 photons[i] += (*fEvt)[nid].GetNumPhotons();
    120                 errors[i]  += (*fEvt)[nid].GetErrorPhot();
     121                const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
     122                if (evtpix)
     123                {
     124                    photons[i] += evtpix->GetNumPhotons();
     125                    errors[i]  += evtpix->GetErrorPhot();
     126                }
     127                num++;
    121128            }
    122129
    123             photons[i] /= fUseCentralPixel ? n+1 : n;
    124             errors[i]  /= fUseCentralPixel ? n+1 : n;
     130            photons[i] /= num;
     131            errors[i]  /= num;
    125132        }
    126133
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r1540 r1574  
    306306}
    307307
     308// --------------------------------------------------------------------------
     309//
     310// Return a pointer to the pixel with the requested id. NULL if it doesn't
     311// exist.
     312//
     313MCerPhotPix *MCerPhotEvt::GetPixById(int id) const
     314{
     315    TIter Next(fPixels);
     316    MCerPhotPix *pix = NULL;
     317
     318    while ((pix=(MCerPhotPix*)Next()))
     319        if (pix->GetPixId()==id)
     320            return pix;
     321
     322    return NULL;
     323}
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r1540 r1574  
    4747    MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); }
    4848
     49    MCerPhotPix *GetPixById(int id) const;
     50
    4951    void Reset();
    5052
  • trunk/MagicSoft/Mars/manalysis/MCompProbCalc.cc

    r1571 r1574  
    7777//  - MHCompProb
    7878//  - all data values which were used to build the MHCompProb
    79 //  - MHadroness
     79//  - MHadronness
    8080//
    8181Bool_t MCompProbCalc::PreProcess(MParList *plist)
     
    136136//  - For all data members multiply the probabilities.
    137137//  - For normalization take the n-th root of the result.
    138 //  - This is the hadroness stored in the MHadroness container
     138//  - This is the hadroness stored in the MHadronness container
    139139//
    140140Bool_t MCompProbCalc::Process()
  • trunk/MagicSoft/Mars/manalysis/MCompProbCalc.h

    r1571 r1574  
    1313{
    1414private:
    15     MHadronness *fHadronness; //! Output container (Hadroness)
     15    MHadronness *fHadronness; //! Output container (Hadronness)
    1616
    1717    TList *fData;           //! List of MDataChains to be used
  • trunk/MagicSoft/Mars/manalysis/MHillasExt.cc

    r1540 r1574  
    3939//
    4040// WARNING: Before you can use fAsym, fM3Long and fM3Trans you must
    41 //          multiply by the sign of MHillasSrc::fCosAlphaDelta
     41//          multiply by the sign of MHillasSrc::fCosDeltaAlpha
    4242//
    4343////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.