Ignore:
Timestamp:
01/14/02 17:34:02 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r1132 r1172  
    3333//  MPedestalCam the NSB contribution.                                     //
    3434//  The number of photons from the diffuse NSB follows a poisson           //
    35 //  distribution with expected mean value X, then its standard desviation  //
     35//  distribution with expected mean value X, then its standard deviation   //
    3636//  is sqrt(X).                                                            //
    3737//  X is the number of phe per ns so we have to convert in FADC counts per //
     
    8585}
    8686
     87// --------------------------------------------------------------------------
     88//
     89// Check for the run type. Return kTRUE if it is a MC run or if there
     90// is no MC run header (old camera files) kFALSE in case of a different
     91// run type
     92//
    8793Bool_t MMcPedestalNSBAdd::CheckRunType(MParList *pList) const
    8894{
     
    141147
    142148    return kTRUE;
     149}
     150
     151Float_t MMcPedestalNSBAdd::GetDnsb(MParList *pList) const
     152{
     153    MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
     154    if (!mcrunheader && fDnsbPixel < 0 )
     155    {
     156        *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() ";
     157        *fLog << "only allowed if MMcRunHeader is available... aborting." << endl;
     158        return -1;
     159    }
     160
     161    if (!mcrunheader)
     162        return fDnsbPixel;
     163
     164    if (fDnsbPixel >= 0 && fDnsbPixel != mcrunheader->GetNumPheFromDNSB())
     165    {
     166        *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrunheader->GetNumPheFromDNSB();
     167        *fLog <<" but you set up the diffuse NSB to " << fDnsbPixel << endl;
     168
     169        return fDnsbPixel;
     170    }
     171
     172    return mcrunheader->GetNumPheFromDNSB();
    143173}
    144174
     
    158188//   - MPedestalCam
    159189//
    160 Float_t MMcPedestalNSBAdd::GetDnsb(MParList *pList) const
    161 {
    162     MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader");
    163     if (!mcrunheader && fDnsbPixel < 0 )
    164     {
    165         *fLog << err << dbginf << "Using the default argument of MMcPedestalNSB::MMcPedestalNSB() ";
    166         *fLog << "only allowed if MMcRunHeader is available... aborting." << endl;
    167         return -1;
    168     }
    169 
    170     if (!mcrunheader)
    171         return fDnsbPixel;
    172 
    173     if (fDnsbPixel >= 0 && fDnsbPixel != mcrunheader->GetNumPheFromDNSB())
    174     {
    175         *fLog << warn << dbginf << "The MC file has been generated with diffuse nsb " << mcrunheader->GetNumPheFromDNSB();
    176         *fLog <<" but you set up the diffuse NSB to " << fDnsbPixel << endl;
    177 
    178         return fDnsbPixel;
    179     }
    180 
    181     return mcrunheader->GetNumPheFromDNSB();
    182 }
    183 
    184190Bool_t MMcPedestalNSBAdd::ReInit(MParList *pList)
    185191{
Note: See TracChangeset for help on using the changeset viewer.