Ignore:
Timestamp:
11/03/03 15:41:36 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
2 deleted
4 edited

Legend:

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

    r2440 r2454  
    8989// --------------------------------------------------------------------------
    9090//
     91// Check for the runtype.
    9192// Search for MPedestalCam and MMcFadcHeader.
    9293//
    93 Int_t MMcPedestalCopy::PreProcess(MParList *pList)
     94Bool_t MMcPedestalCopy::ReInit(MParList *pList)
    9495{
    95     fMcRun = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
    96     if (!fMcRun)
     96    //
     97    // If it is no MC file skip this function...
     98    //
     99    if (!CheckRunType(pList))
     100        return kTRUE;
     101
     102    //
     103    // Now check the existance of all necessary containers. This has
     104    // to be done only if this is a MC file.
     105    //
     106    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     107    if (!pedcam)
     108        return kFALSE;
     109
     110    MMcRunHeader *mcrun = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     111    if (!mcrun)
    97112        *fLog << warn << dbginf << "MMcRunHeader not found... assuming camera<0.7" << endl;
    98113
    99     fPedCam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    100     if (!fPedCam)
    101         return kFALSE;
    102 
    103     fMcPed = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    104     if (!fMcPed)
     114    MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
     115    if (!fadc)
    105116    {
    106117        *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
     
    108119    }
    109120
    110     return kTRUE;
    111 }
     121    const int num = pedcam->GetSize();
    112122
    113 // --------------------------------------------------------------------------
    114 //
    115 // Check for the runtype.
    116 // Initialize the size of MPedestalCam to the number of pixels from
    117 // MMcFadcHeader.
    118 //
    119 Bool_t MMcPedestalCopy::ReInit(MParList *pList)
    120 {
    121     if (!CheckRunType(pList))
    122         return kFALSE;
    123 
    124     const int num = fPedCam->GetSize();
    125 
    126     const Bool_t camver70 = fMcRun && fMcRun->GetCamVersion()>=70;
     123    const Bool_t camver70 = mcrun && mcrun->GetCamVersion()>=70;
    127124
    128125    for (int i=0; i<num; i++)
    129126    {
    130         MPedestalPix &pix = (*fPedCam)[i];
     127        MPedestalPix &pix = (*pedcam)[i];
    131128
    132129        // Here one should compute the Pedestal taking into account how
    133130        // the MC makes the transformation analogic-digital for the FADC.
     131        // This is done only once per file -> not time critical.
    134132
    135         const Float_t pedest = fMcPed->GetPedestal(i);
    136         const Float_t sigma  = camver70 ? fMcPed->GetPedestalRmsHigh(i) : fMcPed->GetElecNoise(i);
     133        const Float_t pedest = fadc->GetPedestal(i);
     134        const Float_t sigma  = camver70 ? fadc->GetPedestalRmsHigh(i) : fadc->GetElecNoise(i);
    137135
    138136        pix.Set(pedest, sigma);
     
    140138
    141139    if (camver70)
    142         fPedCam->SetReadyToSave();
     140        pedcam->SetReadyToSave();
    143141
    144142    return kTRUE;
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.h

    r2440 r2454  
    66#endif
    77
    8 class MMcFadcHeader;
    9 class MMcRunHeader;
    10 class MPedestalCam;
    11 
    128class MMcPedestalCopy : public MTask
    139{
    1410private:
    15     const MMcFadcHeader *fMcPed;
    16     const MMcRunHeader  *fMcRun;
    17 
    18     MPedestalCam *fPedCam;
    19 
    2011    Bool_t CheckRunType(MParList *pList) const;
    21 
    22     Int_t  PreProcess(MParList *pList);
    2312    Bool_t ReInit(MParList *pList);
    2413
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc

    r2440 r2454  
    125125// --------------------------------------------------------------------------
    126126//
    127 // - check whether we have a monte carlo file. if not skip this task
    128 // - try to get MMcFadcHeader, MGeomCam and MPedestalCam from the parameter
    129 //   list
    130 // - try to find a MMcRunHeader, too
    131 //
    132 Int_t MMcPedestalNSBAdd::PreProcess(MParList *pList)
    133 {
    134     fFadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
    135     if (!fFadc)
    136     {
    137         *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
    138         return kFALSE;
    139     }
    140 
    141     fGeom = (MGeomCam*)pList->FindObject("MGeomCam");
    142     if (!fGeom)
    143     {
    144         *fLog << err << dbginf << "MGeomCam not found... aborting." << endl;
    145         return kFALSE;
    146     }
    147 
    148     fPedCam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    149     if (!fPedCam)
    150         return kFALSE;
    151 
    152     return kTRUE;
    153 }
    154 
    155 // --------------------------------------------------------------------------
    156 //
    157127// If a MMcRunHeader is available the DNSB MMcRunHeader::GetNumPheFromDNSB
    158128// is returned. Otherwise the user given number is used.
     
    199169Bool_t MMcPedestalNSBAdd::ReInit(MParList *pList)
    200170{
     171    //
     172    // If it is no MC file skip this function...
     173    //
    201174    if (!CheckRunType(pList))
    202         return kFALSE;
    203 
     175        return kTRUE;
     176
     177    //
     178    // If it is the wrong camera version this algorithm is not needed...
     179    //
    204180    if (!CheckCamVersion(pList))
    205181        return kTRUE;
    206182
     183    //
     184    // Now check the existance of all necessary containers. This has
     185    // to be done only if this is a MC file and the camera version
     186    // is correct.
     187    //
     188    MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
     189    if (!pedcam)
     190        return kFALSE;
     191
     192    MMcFadcHeader *fadc = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
     193    if (!fadc)
     194    {
     195        *fLog << err << dbginf << "MMcFadcHeader not found... aborting." << endl;
     196        return kFALSE;
     197    }
     198
     199    MGeomCam *geom = (MGeomCam*)pList->FindObject("MGeomCam");
     200    if (!geom)
     201    {
     202        *fLog << err << dbginf << "MGeomCam not found... aborting." << endl;
     203        return kFALSE;
     204    }
     205
    207206    const Float_t dnsbpix = GetDnsb(pList) * 50.0/15.0;
    208207
     
    210209        return kFALSE;
    211210
    212     const int num = fPedCam->GetSize();
     211    const int num = pedcam->GetSize();
    213212
    214213    for (int i=0; i<num; i++)
    215214    {
    216         MPedestalPix &pix    = (*fPedCam)[i];
     215        MPedestalPix &pix    = (*pedcam)[i];
    217216
    218217        const Float_t pedrms = pix.GetPedestalRms();
    219         const Float_t ratio  = fGeom->GetPixRatio(i);
    220         const Float_t ampl   = fFadc->GetAmplitud();
     218        const Float_t ratio  = geom->GetPixRatio(i);
     219        const Float_t ampl   = fadc->GetAmplitud();
    221220
    222221        pix.SetPedestalRms(sqrt(pedrms*pedrms + dnsbpix*ampl*ampl/ratio));
    223222    }
    224223
    225     fPedCam->SetReadyToSave();
     224    pedcam->SetReadyToSave();
    226225
    227226    return kTRUE;
    228227}
    229 
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.h

    r2442 r2454  
    66#endif
    77
    8 class MMcFadcHeader;
    9 class MGeomCam;
    10 class MPedestalCam;
    11 
    128class MMcPedestalNSBAdd : public MTask
    139{
    1410private:
    15     const MGeomCam      *fGeom;
    16     const MMcFadcHeader *fFadc;
    17 
    18     MPedestalCam *fPedCam;
    19 
    2011    Float_t fDnsbPixel;
    2112
     
    2516    Float_t GetDnsb(MParList *pList) const;
    2617
    27     Int_t  PreProcess(MParList *pList);
    2818    Bool_t ReInit(MParList *pList);
    29 
    3019
    3120public:
Note: See TracChangeset for help on using the changeset viewer.