Changeset 1131 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
12/19/01 15:39:46 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/MagicHillas.C

    r1103 r1131  
    6868    // read.AddFile("data/cer000019.root");
    6969
    70     MMcPedestalCopy pcopy;
    71     MMcPedestalNSB  pnsb;
    72     MCerPhotCalc    ncalc;
    73     MImgCleanStd    clean;
    74     MHillasCalc     hcalc;
    75     MFillH          hfill("MHillas", "MHHillas");
    76     MFillH          sfill("MHillas", "MHStarMap");
     70    MMcPedestalCopy   pcopy;
     71    MMcPedestalNSBAdd pnsb;
     72    MCerPhotCalc      ncalc;
     73    MImgCleanStd      clean;
     74    MHillasCalc       hcalc;
     75    MFillH            hfill("MHillas", "MHHillas");
     76    MFillH            sfill("MHillas", "MHStarMap");
    7777
    7878    //
     
    104104    if (!evtloop.Eventloop())
    105105        return;
     106
    106107    tlist.PrintStatistics();
    107108
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r1103 r1131  
    3838    plist.AddToList(&tlist);
    3939
    40     MReadMarsFile   read("Events", "~/data/camera.root");
    41     MMcPedestalCopy pcopy;
    42     MMcPedestalNSB  pnsb;
    43     MCerPhotCalc    ncalc;
    44     MClone          clone("MCerPhotEvt");
    45     MImgCleanStd    clean;
    46     MHillasCalc     hcalc;
     40    MReadMarsFile     read("Events", "~/data/camera.root");
     41    MMcPedestalCopy   pcopy;
     42    MMcPedestalNSBAdd pnsb;
     43    MCerPhotCalc      ncalc;
     44    MClone            clone("MCerPhotEvt");
     45    MImgCleanStd      clean;
     46    MHillasCalc       hcalc;
    4747
    4848    tlist.AddToList(&read);
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc

    r1123 r1131  
    6464}
    6565
     66Bool_t MMcPedestalCopy::CheckRunType(MParList *pList) const
     67{
     68    MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     69    if (!run)
     70    {
     71        *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
     72        return kTRUE;
     73    }
     74
     75    return run->GetRunType() == kRTMonteCarlo;
     76}
     77
    6678Bool_t MMcPedestalCopy::PreProcess(MParList *pList)
    6779{
    68     ReInit(pList);
     80    if (!CheckRunType(pList))
     81    {
     82        *fLog << warn << dbginf << " MMcPedestalCopy is for Monte Carlo files only... ";
     83        *fLog << "removing task from list." << endl;
     84        return kSKIP;
     85    }
     86
     87    fPedCam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     88    if (!fPedCam)
     89        return kFALSE;
     90
     91    fMcPed = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
     92    if (!fMcPed)
     93    {
     94        *fLog << warn << dbginf << "MMcFadcHeader not found... aborting." << endl;
     95        return kFALSE;
     96    }
    6997
    7098    return kTRUE;
     
    73101Bool_t MMcPedestalCopy::ReInit(MParList *pList)
    74102{
    75     MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    76     if (run)
    77     {
    78         if (run->GetRunType() != kRTMonteCarlo)
    79         {
    80             *fLog << warn << dbginf << "MMcPedestalCopy is for Monte Carlo files only... removing this task from list." << endl;
    81             return kSKIP;
    82         }
    83     }   
    84     else
    85         *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl;
    86    
    87 
    88     const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    89     if (!mcped)
    90     {
    91         *fLog << warn << dbginf << "MMcFadcHeader not found... aborting." << endl;
    92         return kFALSE;
    93     }
    94 
    95     MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    96     if (!pedcam)
     103    if (!CheckRunType(pList))
    97104        return kFALSE;
    98105
    99     const int num = mcped->GetNumPixel();
     106    const int num = fMcPed->GetNumPixel();
    100107
    101     pedcam->InitSize(num);
    102 
    103     *fLog << "Pixels: " << num << endl;
     108    fPedCam->InitSize(num);
    104109
    105110    for (int i=0; i<num; i++)
    106111    {
    107         MPedestalPix &pix = (*pedcam)[i];
     112        MPedestalPix &pix = (*fPedCam)[i];
    108113
    109114        // Here one should compute the Pedestal taking into account how
    110115        // the MC makes the transformation analogic-digital for the FADC.
    111116
    112         const Float_t pedest = mcped->GetPedestal(i);
     117        const Float_t pedest = fMcPed->GetPedestal(i);
    113118        const Float_t pedrms = pedest/sqrt(num);
    114119
    115         const Float_t sigma  = mcped->GetPedestalRms(i);
     120        const Float_t sigma  = fMcPed->GetPedestalRms(i);
    116121        const Float_t sigrms = sigma/sqrt(num*2);
    117122
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSB.cc

    r1118 r1131  
    6363}
    6464
    65 Bool_t MMcPedestalNSB::PreProcess(MParList *pList)
     65Bool_t MMcPedestalNSB::ReInit(MParList *pList)
    6666{
    6767    MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
Note: See TracChangeset for help on using the changeset viewer.