Changeset 3761 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 04/15/04 22:54:38 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.cc
r3374 r3761 18 18 ! Author(s): Josep Flix 1/2004 <mailto:jflix@ifae.es> 19 19 ! Author(s): Javier Rico 1/2004 <mailto:jrico@ifae.es> 20 ! Author(s): Markus Gaug 4/2004 <mailto:markus@ifae.es> 20 21 ! 21 22 ! Copyright: MAGIC Software Development, 2000-2004 … … 55 56 #include "MPedPhotCam.h" 56 57 58 #include "MBadPixelsPix.h" 59 #include "MBadPixelsCam.h" 60 57 61 ClassImp(MPedPhotCalc); 58 62 … … 63 67 // 64 68 MPedPhotCalc::MPedPhotCalc(const char *name, const char *title) 69 : fPedestals(NULL), fCerPhot(NULL), fBadPixels(NULL) 65 70 { 66 71 fName = name ? name : "MPedPhotCalc"; 67 fTitle = title ? title : "Task to calculate pedestals from the charge computed from pedestal runs (in units of photons)";72 fTitle = title ? title : "Task to calculate pedestals in units of photons"; 68 73 } 69 74 … … 73 78 // 74 79 // - MCerPhotEvt 80 // - MBadPixelsCam 75 81 // 76 82 // The following output containers are also searched and created if … … 87 93 *fLog << err << "MPedPhotCalc::PreProcess Error: MCerPhotEvt not found... aborting." << endl; 88 94 return kFALSE; 95 } 96 97 98 fBadPixels = (MBadPixelsCam*)pList->FindObject("MBadPixelsCam"); 99 if (!fBadPixels) 100 { 101 *fLog << warn << "MPedPhotCalc::PreProcess Warning: No MBadPixelsCam found." << endl; 89 102 } 90 103 … … 130 143 } 131 144 145 132 146 return kTRUE; 133 147 } … … 142 156 for(UInt_t i=0;i<fCerPhot->GetNumPixels();i++) 143 157 { 144 const MCerPhotPix &pix = (*fCerPhot)[i]; 158 159 const MCerPhotPix &pix = (*fCerPhot)[i]; 160 161 if (fBadPixels) 162 { 163 const MBadPixelsPix &bad = (*fBadPixels)[i]; 164 if (bad.IsBad()) 165 continue; 166 } 145 167 146 168 const Float_t nphot = pix.GetNumPhotons(); 147 const Int_t idx = pix.GetPixId(); 148 149 fSumx[idx] += nphot; 150 fSumx2[idx] += nphot*nphot; 169 170 fSumx[i] += nphot; 171 fSumx2[i] += nphot*nphot; 151 172 } 152 173 … … 168 189 for(Int_t i=0; i<npix; i++) 169 190 { 170 const Float_t sum = fSumx[i]; 171 const Float_t sum2 = fSumx2[i]; 172 173 const Float_t photped = sum/n; 174 const Float_t photrms = TMath::Sqrt((sum2-sum*sum/n)/(n-1.)); 175 176 (*fPedestals)[i].Set(photped,photrms); 191 192 if (fBadPixels) 193 { 194 const MBadPixelsPix &bad = (*fBadPixels)[i]; 195 if (bad.IsBad()) 196 continue; 197 } 198 199 const Float_t sum = fSumx[i]; 200 const Float_t sum2 = fSumx2[i]; 201 202 const Float_t photped = sum/n; 203 const Float_t photrms = TMath::Sqrt((sum2-sum*sum/n)/(n-1.)); 204 205 (*fPedestals)[i].Set(photped,photrms); 177 206 } 178 207 -
trunk/MagicSoft/Mars/manalysis/MPedPhotCalc.h
r2848 r3761 12 12 class MPedPhotCam; 13 13 class MCerPhotEvt; 14 14 class MBadPixelsCam; 15 15 class MPedPhotCalc : public MTask 16 16 { 17 MPedPhotCam *fPedestals; // Pedestals of all pixels in the camera18 MCerPhotEvt *fCerPhot;19 17 20 TArrayF fSumx; // sum of values 21 TArrayF fSumx2; // sum of squared values 18 MPedPhotCam *fPedestals; // Pedestals of all pixels in the camera 19 MCerPhotEvt *fCerPhot; // Calibrated Cherenkov events 20 MBadPixelsCam *fBadPixels; // Bad Pixels 21 22 TArrayF fSumx; // sum of values 23 TArrayF fSumx2; // sum of squared values 22 24 23 25 Bool_t ReInit(MParList *pList); 24 26 25 Int_t PreProcess(MParList *pList); 26 Int_t Process(); 27 Int_t PostProcess(); 27 Int_t PreProcess(MParList *pList); 28 Int_t Process(); 29 Int_t PostProcess(); 30 31 public: 32 MPedPhotCalc(const char *name=NULL, const char *title=NULL); 28 33 29 public: 30 MPedPhotCalc(const char *name=NULL, const char *title=NULL); 31 32 ClassDef(MPedPhotCalc, 0)//Task to calculate pedestals from the charge computed from pedestal runs (in units of photons) 34 ClassDef(MPedPhotCalc, 0) //Task to calculate pedestals in units of photons 33 35 }; 34 36
Note:
See TracChangeset
for help on using the changeset viewer.