Changeset 1123 for trunk


Ignore:
Timestamp:
12/18/01 17:24:18 (23 years ago)
Author:
blanch
Message:
The ReInit fuction has been added and all the actions needed to re-do
foe each run have been moved from PreProcess to ReInit.
A bug in the reading of Pedestals and Pedestal fluctuations has been fixed (it
did not effect the results because it was also done in MCerPhotCalc).
File:
1 edited

Legend:

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

    r1118 r1123  
    2626//                                                                         //
    2727//  MMcPedestalCopy                                                        //
     28//  This task looks for the ìnformation about FADC pedestals in            //
     29//  MMcFadcHeader and translates it to the pedestal values in              //
     30//  MPedestalCam                                                           //
    2831//                                                                         //
    2932//  Input Containers:                                                      //
     
    6366Bool_t MMcPedestalCopy::PreProcess(MParList *pList)
    6467{
     68    ReInit(pList);
     69
     70    return kTRUE;
     71}
     72
     73Bool_t MMcPedestalCopy::ReInit(MParList *pList)
     74{
    6575    MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    6676    if (run)
     77    {
    6778        if (run->GetRunType() != kRTMonteCarlo)
    6879        {
     
    7081            return kSKIP;
    7182        }
     83    }   
    7284    else
    7385        *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
     86   
    7487
    7588    const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
     
    94107        MPedestalPix &pix = (*pedcam)[i];
    95108
     109        // Here one should compute the Pedestal taking into account how
     110        // the MC makes the transformation analogic-digital for the FADC.
     111
    96112        const Float_t pedest = mcped->GetPedestal(i);
    97         const Float_t pedrms = mcped->GetPedestalRms(i);
     113        const Float_t pedrms = pedest/sqrt(num);
    98114
    99         const Float_t sigma  = pedest*sqrt(num);
     115        const Float_t sigma  = mcped->GetPedestalRms(i);
    100116        const Float_t sigrms = sigma/sqrt(num*2);
    101117
    102         pix.SetPedestal(pedest, sigma);
     118        pix.SetPedestal(pedest, sigma);
    103119        pix.SetPedestalRms(pedrms, sigrms);
    104120    }
Note: See TracChangeset for help on using the changeset viewer.