Changeset 1291 for trunk/MagicSoft/Mars
- Timestamp:
- 04/24/02 09:23:07 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc
r1180 r1291 44 44 #include "MLog.h" 45 45 #include "MLogManip.h" 46 47 #include "MMcRunHeader.hxx" 46 48 47 49 #include "MRawRunHeader.h" … … 113 115 // -------------------------------------------------------------------------- 114 116 // 117 // Check for the run type and camera version. 118 // If the file is a MC file and the used camera version is <= 40 119 // we enable a fix for truncated pedestal means in this version. 120 // 121 Bool_t MCerPhotCalc::ReInit(MParList *pList) 122 { 123 const MRawRunHeader *runheader = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 124 if (!runheader) 125 { 126 *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl; 127 return kTRUE; 128 } 129 130 if (runheader->GetRunType() != kRTMonteCarlo) 131 return kTRUE; 132 133 MMcRunHeader *mcrunheader = (MMcRunHeader*)pList->FindObject("MMcRunHeader"); 134 if (!mcrunheader) 135 { 136 *fLog << warn << dbginf << "Warning - cannot check for camera version, MC run header not found." << endl; 137 return kTRUE; 138 } 139 140 if (mcrunheader->GetCamVersion() <= 40) 141 fEnableFix = kTRUE; 142 143 return kTRUE; 144 } 145 146 // -------------------------------------------------------------------------- 147 // 115 148 // Calculate the integral of the FADC time slices and store them as a new 116 149 // pixel in the MCerPhotEvt container. … … 144 177 // 0 signal in all the slices. 145 178 // 179 const Double_t mean = fEnableFix ? ped.GetMean()-0.5 : ped.GetMean(); 146 180 if (nphot!=0) 147 nphot -= fRunHeader->GetNumSamplesHiGain()* ped.GetMean();181 nphot -= fRunHeader->GetNumSamplesHiGain()*mean; 148 182 149 183 fCerPhotEvt->AddPixel(pixid, nphot, sqrt(fRunHeader->GetNumSamplesHiGain())*ped.GetSigma()); -
trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h
r1144 r1291 26 26 MCerPhotEvt *fCerPhotEvt; // Cerenkov Photon Event used for calculation 27 27 MRawRunHeader *fRunHeader; // RunHeader information 28 28 29 Bool_t fEnableFix; // fix for a bug in files from older camera versions (<=40) 30 29 31 public: 30 32 MCerPhotCalc(const char *name=NULL, const char *title=NULL); … … 33 35 Bool_t Process(); 34 36 37 Bool_t ReInit(MParList *pList); 38 35 39 ClassDef(MCerPhotCalc, 0) // Task to calculate cerenkov photons from raw data 36 40 };
Note:
See TracChangeset
for help on using the changeset viewer.