Ignore:
Timestamp:
11/06/01 13:44:26 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
2 edited

Legend:

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

    r1017 r1035  
    4343
    4444#include "MPedestalCam.h"
     45#include "MRawRunHeader.h"
    4546#include "MMcFadcHeader.hxx"
    4647
     
    5859Bool_t MMcPedestalCopy::PreProcess(MParList *pList)
    5960{
    60     fMcPedestals = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    61     if (!fMcPedestals)
     61    MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     62    if (run)
     63    {
     64        if (run->GetRunType() != kRTMonteCarlo)
     65            return kTRUE;
     66    }
     67
     68    const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
     69    if (!mcped)
    6270    {
    6371        *fLog << dbginf << "MMcFadcHeader not found... aborting." << endl;
     
    6573    }
    6674
    67     fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    68     if (!fPedestals)
     75    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     76    if (!pedcam)
    6977        return kFALSE;
    7078
    71     return kTRUE;
    72 }
     79    const int num = mcped->GetNumPixel();
    7380
    74 Bool_t MMcPedestalCopy::Process()
    75 {
    76     const int num = fMcPedestals->GetNumPixel();
    77 
    78     fPedestals->InitSize(num);
     81    pedcam->InitSize(num);
    7982
    8083    for (int i=0; i<num; i++)
    8184    {
    82         MPedestalPix &pix = (*fPedestals)[i];
     85        MPedestalPix &pix = (*pedcam)[i];
    8386
    84         const Float_t pedest = fMcPedestals->GetPedestal(i);
    85         const Float_t pedrms = fMcPedestals->GetPedestalRms(i);
     87        const Float_t pedest = mcped->GetPedestal(i);
     88        const Float_t pedrms = mcped->GetPedestalRms(i);
    8689
    8790        const Float_t sigma  = pedest*sqrt(num);
    88         const Float_t sigrms = sigma/sqrt(2*num);
     91        const Float_t sigrms = sigma/sqrt(num*2);
    8992
    9093        pix.SetPedestal(pedest, sigma);
    9194        pix.SetPedestalRms(pedrms, sigrms);
    92 
    93         *fLog << pedest << " " << sigma << " " << pedrms << " " << sigrms << endl;
    9495    }
    9596
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.h

    r1017 r1035  
    2323class MMcPedestalCopy : public MTask
    2424{
    25     const MMcFadcHeader *fMcPedestals;  //
    26           MPedestalCam  *fPedestals;    //
    27 
    28           TString       *fSrc;
     25    TString *fSrc;
    2926
    3027public:
     
    3229
    3330    Bool_t PreProcess(MParList *pList);
    34     Bool_t Process();
    3531
    3632    ClassDef(MMcPedestalCopy, 0)   // Task which copies the pedestals from the MC into the standard container
Note: See TracChangeset for help on using the changeset viewer.