Changeset 2237


Ignore:
Timestamp:
06/26/03 17:00:06 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2236 r2237  
    3535     - added GetNumMaxLoGainSample
    3636
     37   * manalysis/MCT1PadSchweizer.cc, manalysis/MMcPedestalNSBAdd.cc,
     38     manalysis/MSigmabar.cc:
     39     - adapted to new function names in MPedestalPix
     40     
     41   * manalysis/MCerPhotAnal.cc:
     42     - adapted to new function names in MPedestalPix
     43     - fixed to work with real data and monte carlo data
     44     - preliminarily removed error of pedestal and pedestalrms
     45     
     46   * manalysis/MCerPhotCalc.[h,cc]:
     47     - adapted to new function names in MPedestalPix
     48     - fixed to work with real data and monte carlo data
     49   
     50   * manalysis/MMcPedestalCopy.cc, manalysis/MPedCalcPedRun.[h,cc]:
     51     - adapted to new function names in MPedestalPix
     52     - preliminarily removed error of pedestal and pedestalrms
     53 
     54   * manalysis/MPedestalCam.[h,cc]:
     55     - adapted to new function names in MPedestalPix
     56     - preliminarily removed error of pedestal and pedestalrms
     57     - fixed GetPixelContent (do not return Pedestal*PixRatio)
     58     
     59   * manalysis/MPedestalPix.[h,cc]:
     60     - removed old variables
     61     - introduced Pedestal for pedestal
     62     - introduced pedestalRMS for the rms of the pedestal
     63     - error of both values still missing
     64     
     65   * meventdisp/MGCamDisplay.cc:
     66     - fixed display, displays now:
     67       + Number Of Photons
     68       + Pedestal
     69       + PedestalRMS
     70       + Number of Photons/PedestalRMS
     71       
     72   * mimage/MImgCleanStd.[h,cc]:
     73     - fixed image cleaning in the sense that erronously the error
     74       of the number of photons was used instead of the error of
     75       the PMT offset (pedestal)
     76     - introduced some debugging option
     77     
     78   * mmontecarlo/MMcCollectionAreaCalc.cc:
     79     - minor change
     80     
     81
     82 
    3783
    3884
  • trunk/MagicSoft/Mars/manalysis/MCT1PadSchweizer.cc

    r2206 r2237  
    293293      continue;
    294294
    295     fEvt->AddPixel(i, 0.0, (*fPed)[i].GetMeanRms());
     295    fEvt->AddPixel(i, 0.0, (*fPed)[i].GetPedestalRms());
    296296  }
    297297
     
    543543
    544544    MPedestalPix &ppix = (*fPed)[j];
    545     Double_t oldsigma = ppix.GetMeanRms();
     545    Double_t oldsigma = ppix.GetPedestalRms();
    546546    Double_t oldsigma2 = oldsigma*oldsigma;
    547547
     
    691691    Double_t oldphotons = pix.GetNumPhotons();
    692692    Double_t newphotons = oldphotons + NSB;
    693     pix.SetNumPhotons(  newphotons );
     693    pix.SetNumPhotons(newphotons);
    694694
    695695
     
    700700    // error: add sigma of padded noise quadratically
    701701    Double_t olderror = pix.GetErrorPhot();
    702     Double_t newerror = sqrt( olderror*olderror + addSig2 );
    703     pix.SetErrorPhot( newerror );
    704 
    705 
    706     Double_t newsigma = sqrt( oldsigma2 + addSig2 );
    707     ppix.SetMeanRms( newsigma );
    708 
    709     fHSigmaPedestal->Fill( oldsigma, newsigma );
     702    Double_t newerror = sqrt(olderror*olderror + addSig2);
     703    pix.SetErrorPhot(newerror);
     704
     705
     706    Double_t newsigma = sqrt(oldsigma2 + addSig2);
     707    ppix.SetPedestalRms(newsigma);
     708
     709    fHSigmaPedestal->Fill(oldsigma, newsigma);
    710710  }
    711711  //----------   end of loop over pixels   ---------------------------------
  • trunk/MagicSoft/Mars/manalysis/MCerPhotAnal.cc

    r2211 r2237  
    9999    }
    100100
    101     fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    102     if (!fPedestals)
    103     {
    104         *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
    105         return kFALSE;
    106     }
    107 
    108101    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
    109102    if (!fCerPhotEvt)
     103        return kFALSE;
     104
     105    const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     106    if (!runheader)
     107        *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
     108    else
     109        if (runheader->GetRunType() == kRTMonteCarlo)
     110        {
     111            fPedestals=NULL;
     112            return kTRUE;
     113        }
     114
     115    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     116    if (runheader && !fPedestals)
    110117        return kFALSE;
    111118
     
    184191        const UInt_t pixid = pixel.GetPixelId();
    185192
    186         MPedestalPix &ped = (*fPedestals)[pixid];
    187 
    188193        //
    189194        // sanity check (old MC files sometimes have pixids>577)
    190195        //
    191         if (!fPedestals->CheckBounds(pixid))
     196        if (fPedestals && !fPedestals->CheckBounds(pixid))
    192197        {
    193198            *fLog << inf << "Pixel ID larger than camera... skipping event." << endl;
     
    196201
    197202        fCerPhotEvt->AddPixel(pixid, nphot, sigmaped/2.236);
    198         ped.SetPedestal(pedes, sigmaped);
    199         ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5.),
    200                            sigmaped/sqrt(2.*(fRawEvt->GetNumHiGainSamples()-5)));
    201 
     203
     204        if (fPedestals)
     205            (*fPedestals)[pixid].Set(pedes, sigmaped);
     206
     207        /*
     208         ped.SetPedestalRms(sigmaped/sqrt(fRawEvt->GetNumHiGainSamples()-5.),
     209                            sigmaped/sqrt(2.*(fRawEvt->GetNumHiGainSamples()-5)));
     210                            */
    202211        // FIXME! Handling of Lo Gains is missing!
    203212    }
     
    206215    fCerPhotEvt->SetReadyToSave();
    207216
     217    if (fPedestals)
     218        fPedestals->SetReadyToSave();
     219
    208220    return kTRUE;
    209221}
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r2213 r2237  
    107107    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    108108    if (!fPedestals)
    109         return kFALSE;
     109    {
     110        *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
     111        return kFALSE;
     112    }
    110113
    111114    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
     
    148151    }
    149152
    150     if (runheader->GetRunType() != kRTMonteCarlo)
     153    Bool_t fIsMcFile = runheader->GetRunType() == kRTMonteCarlo;
     154    if (!fIsMcFile)
    151155        return kTRUE;
     156
     157    ScalePedestals();
    152158
    153159    MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     
    165171}
    166172
     173void MCerPhotCalc::ScalePedestals()
     174{
     175    Int_t n = 577; //FIXME: fPedestals->GetNumPixel();
     176
     177    for (int idx=0; idx<n; idx++)
     178    {
     179        MPedestalPix &ped = (*fPedestals)[idx];
     180
     181        const Double_t offset = fEnableFix ? ped.GetPedestal()-0.5 : ped.GetPedestal();
     182        ped.Set(offset*fSumWeights, ped.GetPedestalRms()*fSumQuadWeights);
     183    }
     184
     185    fPedestals->SetReadyToSave();
     186}
     187
    167188// --------------------------------------------------------------------------
    168189//
     
    174195    //fCerPhotEvt->InitSize(fRawEvt->GetNumPixels());
    175196
     197    if (fIsMcFile)
     198        ScalePedestals();
     199
    176200    MRawEvtPixelIter pixel(fRawEvt);
    177201
    178202    while (pixel.Next())
    179203    {
    180         const UInt_t pixid = pixel.GetPixelId();
    181         const MPedestalPix &ped = (*fPedestals)[pixid];
     204        const UInt_t idx = pixel.GetPixelId();
     205        MPedestalPix &ped = (*fPedestals)[idx];
    182206
    183207        //
    184208        // sanity check (old MC files sometimes have pixids>577)
    185209        //
    186         if (!fPedestals->CheckBounds(pixid))
     210        if (!fPedestals->CheckBounds(idx))
    187211        {
    188             *fLog << inf << "Pixel ID larger than camera... skipping event." << endl;
     212            *fLog << inf << "Pixel Index larger than camera... skipping event." << endl;
    189213            return kCONTINUE;
    190214        }
    191 
    192         //
    193         // Mean pedestal:
    194         //
    195         const Double_t mean = fEnableFix ? ped.GetMean()-0.5 : ped.GetMean();
    196215
    197216        //
     
    204223            nphot += ptr[i]*fWeight[i];
    205224
    206         nphot -= mean*fSumWeights;
    207 
    208         const Float_t nphoterr = ped.GetSigma()* fSumQuadWeights;
    209 
    210         fCerPhotEvt->AddPixel(pixid, nphot, nphoterr);
     225        nphot -= ped.GetPedestal();
     226
     227        fCerPhotEvt->AddPixel(idx, nphot, 0);
    211228
    212229        // FIXME! Handling of Lo Gains is missing!
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h

    r2213 r2237  
    3131 
    3232    Bool_t          fEnableFix;  // fix for a bug in files from older camera versions (<=40)
     33    Bool_t          fIsMcFile;
    3334
    3435    TArrayF         fWeight;  // Weights for adding up the ADC slices
     
    4243
    4344    Bool_t ReInit(MParList *pList);
     45    void ScalePedestals();
    4446
    4547public:
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r2206 r2237  
    138138
    139139        const Float_t pedest = fMcPed->GetPedestal(i);
    140         const Float_t pedrms = pedest/sqrt((float)num);
     140        //const Float_t pedrms = pedest/sqrt((float)num);
    141141
    142142        const Float_t sigma  = fMcPed->GetPedestalRms(i);
    143         const Float_t sigrms = sigma/sqrt(num*2.);
     143        //const Float_t sigrms = sigma/sqrt(num*2.);
    144144
    145         pix.SetPedestal(pedest, sigma);
    146         pix.SetPedestalRms(pedrms, sigrms);
     145        //pix.SetPedestalRms(pedrms, sigrms);
     146        pix.Set(pedest, sigma);
    147147    }
    148148
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc

    r2206 r2237  
    215215        MPedestalPix &pix    = (*fPedCam)[i];
    216216
    217         const Float_t pedrms = pix.GetSigma();
     217        const Float_t pedrms = pix.GetPedestalRms();
    218218        const Float_t ratio  = fGeom->GetPixRatio(i);
    219219        const Float_t ampl   = fFadc->GetAmplitud();
    220220
    221         pix.SetSigma(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl/ratio));
     221        pix.SetPedestalRms(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl/ratio));
    222222    }
    223223
  • trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc

    r2206 r2237  
    9595        const Float_t higainrms = CalcHiGainRms(ptr, end, higainped);
    9696
    97         const Float_t higainpederr = CalcHiGainMeanErr(higainrms);
    98         const Float_t higainrmserr = CalcHiGainRmsErr(higainrms);
     97        //const Float_t higainpederr = CalcHiGainMeanErr(higainrms);
     98        //const Float_t higainrmserr = CalcHiGainRmsErr(higainrms);
    9999
    100100        const UInt_t pixid = pixel.GetPixelId();
    101101        MPedestalPix &pix = (*fPedestals)[pixid];
    102102
    103         pix.SetPedestal(higainped, higainrms);
    104         pix.SetPedestalRms(higainpederr, higainrmserr);
     103        pix.Set(higainped, higainrms);
     104        //pix.SetPedestalRms(higainpederr, higainrmserr);
    105105    }
    106106
     
    132132    } while (++ptr != end);
    133133
    134     return sqrt(rms/(fNumHiGainSamples-1));
     134    return sqrt(rms/fNumHiGainSamples);
    135135}
    136 
     136/*
    137137Float_t MPedCalcPedRun::CalcHiGainMeanErr(Float_t higainrms) const
    138138{
     
    144144    return higainrms/sqrt(2.*fNumHiGainSamples);
    145145}
    146 
     146*/
  • trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.h

    r2206 r2237  
    2626    Float_t CalcHiGainMean(Byte_t *ptr, const Byte_t *end) const;
    2727    Float_t CalcHiGainRms(Byte_t *ptr, const Byte_t *end, Float_t higainped) const;
    28     Float_t CalcHiGainMeanErr(Float_t higainrms) const;
    29     Float_t CalcHiGainRmsErr(Float_t higainrms) const;
     28    //Float_t CalcHiGainMeanErr(Float_t higainrms) const;
     29    //Float_t CalcHiGainRmsErr(Float_t higainrms) const;
    3030
    3131    Int_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r2206 r2237  
    133133
    134134        *fLog << id-1 << ": ";
    135         *fLog << pix->GetMean() << " " << pix->GetSigma() << " ";
    136         *fLog << pix->GetMeanRms() << " " << pix->GetSigmaRms() << endl;
     135        *fLog << pix->GetPedestal() << " " << pix->GetPedestalRms() << endl;
    137136    }
    138137}
    139138
    140 Float_t MPedestalCam::GetMeanMin(const MGeomCam *geom) const
     139Float_t MPedestalCam::GetPedestalMin(const MGeomCam *geom) const
    141140{
    142141    if (fArray->GetEntries() <= 0)
    143142        return 50.;
    144143
    145     Float_t minval = (*this)[0].GetMean();
     144    Float_t minval = (*this)[0].GetPedestalRms();
    146145
    147146    for (Int_t i=1; i<fArray->GetEntries(); i++)
     
    149148        const MPedestalPix &pix = (*this)[i];
    150149
    151         Float_t testval = pix.GetMean();
     150        Float_t testval = pix.GetPedestalRms();
    152151
    153152        if (geom)
     
    160159}
    161160
    162 Float_t MPedestalCam::GetMeanMax(const MGeomCam *geom) const
     161Float_t MPedestalCam::GetPedestalMax(const MGeomCam *geom) const
    163162{
    164163    if (fArray->GetEntries() <= 0)
    165164        return 50.;
    166165
    167     Float_t maxval = (*this)[0].GetMean();
     166    Float_t maxval = (*this)[0].GetPedestalRms();
    168167
    169168    for (Int_t i=1; i<fArray->GetEntries(); i++)
     
    171170        const MPedestalPix &pix = (*this)[i];
    172171
    173         Float_t testval = pix.GetMean();
     172        Float_t testval = pix.GetPedestalRms();
    174173
    175174        if (geom)
     
    184183Bool_t MPedestalCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
    185184{
    186     val = (*this)[idx].GetMean()*cam.GetPixRatio(idx);
     185    switch (type)
     186    {
     187    case 0:
     188        val = (*this)[idx].GetPedestal();
     189        break;
     190    case 1:
     191        val = (*this)[idx].GetPedestalRms();
     192        break;
     193    }
    187194    return kTRUE;
    188195}
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.h

    r2206 r2237  
    2828    MPedestalPix &operator[](Int_t i) const;
    2929
    30     Float_t GetMeanMin(const MGeomCam *cam) const;
    31     Float_t GetMeanMax(const MGeomCam *cam) const;
     30    Float_t GetPedestalMin(const MGeomCam *cam) const;
     31    Float_t GetPedestalMax(const MGeomCam *cam) const;
    3232
    3333    Bool_t CheckBounds(Int_t i);
  • trunk/MagicSoft/Mars/manalysis/MPedestalPix.cc

    r1540 r2237  
    4848void MPedestalPix::Clear(Option_t *o)
    4949{
    50     fMean = -1;
    51     fSigma = -1;
    52     fMeanRms = -1;
    53     fSigmaRms = -1;
     50    fPedestal = -1;
     51    fPedestalRms = -1;
    5452}
    5553
  • trunk/MagicSoft/Mars/manalysis/MPedestalPix.h

    r1540 r2237  
    99{
    1010private:
    11     Float_t fMean;     // mean value of pedestal (PMT offset)
    12     Float_t fSigma;    // sigma (standard deviation) of pedestal
    13     Float_t fMeanRms;  // root mean square of pedestal
    14     Float_t fSigmaRms; // root mean sqare of sigma of the pedestal
     11    Float_t fPedestal;     // mean value of pedestal (PMT offset)
     12    Float_t fPedestalRms;  // root mean square / sigma  / standard deviation of pedestal
    1513
    1614public:
     
    1917    void Clear(Option_t *o="");
    2018
    21     Float_t GetMean() const     { return fMean;     }
    22     Float_t GetSigma() const    { return fSigma;    }
    23     Float_t GetMeanRms() const  { return fMeanRms;  }
    24     Float_t GetSigmaRms() const { return fSigmaRms; }
    25 
     19    Float_t GetPedestal() const    { return fPedestal; }
     20    Float_t GetPedestalRms() const { return fPedestalRms; }
     21/*
    2622    void SetMean(Float_t f)     { fMean = f;     }
    2723    void SetSigma(Float_t f)    { fSigma = f;    }
    2824    void SetMeanRms(Float_t f)  { fMeanRms = f;  }
    2925    void SetSigmaRms(Float_t f) { fSigmaRms = f; }
     26    */
    3027
    31     void SetPedestal(Float_t m, Float_t s) { fMean = m; fSigma = s; }
    32     void SetPedestalRms(Float_t m, Float_t s) { fMeanRms = m; fSigmaRms = s; }
     28    void SetPedestal(Float_t f)    { fPedestal = f; }
     29    void SetPedestalRms(Float_t f) { fPedestalRms = f; }
     30    void Set(Float_t m, Float_t r) { fPedestal = m; fPedestalRms = r; }
    3331
    34     Bool_t IsValid() const { return fMean>=0||fSigma>=0||fMeanRms>=0||fSigmaRms>=0; }
     32    Bool_t IsValid() const { return fPedestal>=0||fPedestalRms>=0; }
    3533
    3634    ClassDef(MPedestalPix, 1)   // Storage Container for Pedestal information of one pixel
  • trunk/MagicSoft/Mars/manalysis/MSigmabar.cc

    r2209 r2237  
    135135        */
    136136
    137         const Int_t id = cerpix.GetPixId();
    138         const Double_t area = geom.GetPixRatio(id);
    139 
    140         if (id == 0)
     137        const Int_t idx = cerpix.GetPixId();
     138        const Double_t area = geom.GetPixRatio(idx);
     139
     140        if (idx == 0)
    141141        {
    142142          //*fLog << "MSigmabar : id = 0;  pixel '0' is used, ignore it"
     
    145145        }
    146146
    147         const MGeomPix &gpix = geom[id];
     147        const MGeomPix &gpix = geom[idx];
    148148
    149149        Int_t sector = (Int_t)(atan2(gpix.GetY(),gpix.GetX())*6 / (TMath::Pi()*2));
     
    152152
    153153        // count only those pixels which have a sigma != 0.0
    154         const Float_t sigma = ped[id].GetMeanRms();
     154        const Float_t sigma = ped[idx].GetPedestalRms();
    155155
    156156        if ( sigma <= 0 )
  • trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc

    r2230 r2237  
    3939#include "MHillasCalc.h"         // MHillasCalc
    4040#include "MHillasSrcCalc.h"      // MHillasSrcCalc
     41#include "MPedestalPix.h"        // MPedestalPix
    4142#include "MPedestalCam.h"        // MPedestalCam
    42 #include "MCerPhotCalc.h"        // MCerPhotCalc
     43#include "MCerPhotEvt.h"         // MCerPhotEvt::GetPixById
     44#include "MCerPhotCalc.h"       // MCerPhotCalc
    4345#include "MMcPedestalCopy.h"     // MMcPedestalCopy
    4446#include "MMcPedestalNSBAdd.h"   // MMcPedestalNSBAdd
     
    166168
    167169    fCanvas2[0] = fCanvas;
    168     fCanvas2[1] = AddTab("Errors");
    169     fCanvas2[2] = AddTab("Phot/Err");
     170    fCanvas2[1] = AddTab("PedRMS");
     171    fCanvas2[2] = AddTab("Phot/PedRMS");
    170172    fCanvas2[3] = AddTab("Levels");
    171173    fCanvas2[4] = AddTab("Pedestals");
     
    184186    }
    185187
    186     fDisplay[0]->SetNameTitle("photons",   "Number of Photons");
    187     fDisplay[1]->SetNameTitle("errors",    "Error of Photons");
    188     fDisplay[2]->SetNameTitle("photerr",   "Number of Photons / Error");
    189     fDisplay[3]->SetNameTitle("levels",    "Cleaning Levels");
    190     fDisplay[4]->SetNameTitle("pedestals", "Pedestals");
     188    fDisplay[0]->SetNameTitle("photons",    "Number of Photons");
     189    fDisplay[1]->SetNameTitle("pedrms",     "Pedestal RMS");
     190    fDisplay[2]->SetNameTitle("photpedrms", "Number of Photons / Pedestal RMS");
     191    fDisplay[3]->SetNameTitle("levels",     "Cleaning Levels");
     192    fDisplay[4]->SetNameTitle("pedestals",  "Pedestals");
    191193
    192194    ReadFirstEvent();
     
    247249    const MPedestalCam *ped   = (MPedestalCam*)plist->FindObject("MPedestalCam");
    248250
    249     fDisplay[0]->SetCamContent((MCamEvent&)*evt, 0);
    250     fDisplay[1]->SetCamContent((MCamEvent&)*evt, 1);
    251     fDisplay[2]->SetCamContent((MCamEvent&)*evt, 2);
     251    // FIXME: Make this publicly available
     252    TArrayD val(577);
     253    TArrayC use(577);
     254    for (int i=0; i<577;i++)
     255    {
     256        // FIXME: photon event first!
     257        MCerPhotPix *pix = evt->GetPixById(i);
     258        if (!pix)
     259            continue;
     260        MPedestalPix &ppix = (*ped)[i];
     261        if (ppix.GetPedestalRms()<0)
     262            continue;
     263        val[i] = pix->GetNumPhotons()/ppix.GetPedestalRms();
     264        use[i] = 1;
     265    }
     266
     267    fDisplay[0]->SetCamContent(*evt, 0);
     268    fDisplay[1]->SetCamContent(*ped, 1);
     269    fDisplay[2]->SetCamContent(val, &use);
    252270    fDisplay[3]->FillLevels(*evt, *clean);
    253     fDisplay[4]->SetCamContent((MCamEvent&)*ped);
     271    fDisplay[4]->SetCamContent(*ped, 0);
    254272
    255273    if (fDisplayHillas)
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r2233 r2237  
    263263
    264264#include "MParList.h"
     265#include "MSigmabar.h"
     266
    265267#include "MGeomPix.h"
    266268#include "MGeomCam.h"
     269
    267270#include "MCerPhotPix.h"
    268271#include "MCerPhotEvt.h"
    269 #include "MSigmabar.h"
     272
     273#include "MPedestalPix.h"
     274#include "MPedestalCam.h"
    270275
    271276#include "MGGroupFrame.h" // MGGroupFrame
     
    328333        MCerPhotPix &pix = (*fEvt)[i];
    329334
    330         const Int_t id = pix.GetPixId();
    331 
    332         const Float_t  entry = pix.GetNumPhotons();
    333         const Float_t  noise = pix.GetErrorPhot();
    334 
    335         //
     335        const Int_t idx = pix.GetPixId();
     336
     337        const Float_t entry = pix.GetNumPhotons();
     338        const Float_t noise = (*fPed)[idx].GetSigma();
     339
     340        //
    336341        // We calculate a correction factor which accounts for the
    337342        // fact that pixels have different size (see TDAS 02-14).
    338343        //
    339         const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(id));
     344        const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(idx));
    340345
    341346        // COBB: '<=' to skip entry=noise=0
     
    485490    // get pixel id of this entry
    486491    //
    487     const Int_t id = pix.GetPixId();
     492    const Int_t idx = pix.GetPixId();
    488493
    489494    //
    490495    // check the num of photons against the noise level
    491496    //
    492     const Float_t  entry = pix.GetNumPhotons();
    493     const Float_t  noise = pix.GetErrorPhot();
     497    const Float_t entry = pix.GetNumPhotons();
     498    const Float_t noise = (*fPed)[idx].GetSigma();
    494499
    495500    //
     
    497502    // fact that pixels have different size (see TDAS 02-14).
    498503    //
    499     const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(id));
     504    const Double_t factor = TMath::Sqrt(fCam->GetPixRatio(idx));
    500505
    501506    return (entry * factor <= fCleanLvl2 * noise);
     
    653658    }
    654659
    655     if (fCleaningMethod != kDemocratic)
    656         return kTRUE;
    657 
    658     fSgb = (MSigmabar*)pList->FindObject("MSigmabar");
    659     if (!fSgb)
    660     {
    661         *fLog << dbginf << "MSigmabar not found... aborting." << endl;
    662         return kFALSE;
     660    if (fCleaningMethod == kDemocratic)
     661    {
     662        fSgb = (MSigmabar*)pList->FindObject("MSigmabar");
     663        if (!fSgb)
     664        {
     665            *fLog << dbginf << "MSigmabar not found... aborting." << endl;
     666            return kFALSE;
     667        }
     668    }
     669    else
     670    {
     671        fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
     672        if (!fPed)
     673        {
     674            *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
     675            return kFALSE;
     676        }
    663677    }
    664678
     
    674688    if (fSgb)
    675689        fInnerNoise = fSgb->GetSigmabarInner();
    676 
     690#ifdef DEBUG
     691    *fLog << all << "CleanStep 1" << endl;
     692#endif
    677693    CleanStep1();
     694#ifdef DEBUG
     695    *fLog << all << "CleanStep 2" << endl;
     696#endif
    678697    CleanStep2();
     698#ifdef DEBUG
     699    *fLog << all << "CleanStep 3" << endl;
     700#endif
    679701    CleanStep3();
     702#ifdef DEBUG
     703    *fLog << all << "Done." << endl;
     704#endif
    680705
    681706    return kTRUE;
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.h

    r2209 r2237  
    1010class MCerPhotPix;
    1111class MCerPhotEvt;
     12class MPedestalCam;
    1213
    1314class MGGroupFrame;
     
    2223
    2324private:
    24     const MGeomCam    *fCam;  //!
    25           MCerPhotEvt *fEvt;  //!
    26           MSigmabar   *fSgb;  //!
     25    const MGeomCam     *fCam;  //!
     26          MCerPhotEvt  *fEvt;  //!
     27          MSigmabar    *fSgb;  //!
     28          MPedestalCam *fPed;  //!
    2729
    2830    CleaningMethod_t fCleaningMethod;
  • trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc

    r2207 r2237  
    8484    fEmax                     =  -1;
    8585    fSlope                    =   0;
    86     fTotalNumSimulatedShowers =  0;
    87     fCorsikaVersion           =  0;
     86    fTotalNumSimulatedShowers =   0;
     87    fCorsikaVersion           =   0;
    8888    fAllEvtsTriggered         = kFALSE;
    8989
Note: See TracChangeset for help on using the changeset viewer.