Changeset 2669 for trunk/MagicSoft/Mars
- Timestamp:
- 12/12/03 15:00:48 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2668 r2669 4 4 5 5 -*-*- END OF LINE -*-*- 6 2003/12/12: Abelardo Moralejo 7 8 * manalysis/MMcCalibrationCalc.[h,cc] 9 - added fADC2PheInner, fADC2PheOuter and setter functions. Put 10 these values into MCalibrationCam. Look for MExtractedSignalCam 11 to check which gain branch has been used (relevant for the 12 conversion factor) for each pixel. 13 6 14 7 15 2003/12/12: Markus Gaug -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationCalc.cc
r2648 r2669 28 28 // 29 29 // This task looks for the ìnformation about FADC pedestals in 30 // MMcFadcHeader and translates it to the pedestal mean and rms ,30 // MMcFadcHeader and translates it to the pedestal mean and rms (in adc counts), 31 31 // and in the conversion factor between photons and ADC counts in 32 32 // MCalibrationCam. 33 // Then we create and fill also the MPedPhotCam object containing the pedestal 34 // rms in units of photons. 33 35 // 34 36 // Input Containers: … … 38 40 // Output Containers: 39 41 // MCalibrationCam 42 // MPedPhotCam 40 43 // 41 44 ///////////////////////////////////////////////////////////////////////////// … … 49 52 #include "MCalibrationPix.h" 50 53 #include "MCalibrationCam.h" 54 #include "MExtractedSignalCam.h" 55 #include "MExtractedSignalPix.h" 56 #include "MPedPhotCam.h" 57 #include "MPedPhotPix.h" 51 58 52 59 #include "MRawRunHeader.h" … … 61 68 fName = name ? name : "MMcCalibrationCalc"; 62 69 fTitle = title ? title : "Write MC pedestals and conversion factors into MCalibration Container"; 70 71 fADC2PheInner = 1.; 72 fADC2PheOuter = 1.; 63 73 64 74 } … … 94 104 return kTRUE; 95 105 96 return pList->FindCreateObj(AddSerialNumber("MCalibrationCam")) ? kTRUE : kFALSE; 106 if ( ! pList->FindCreateObj(AddSerialNumber("MCalibrationCam"))) 107 { 108 *fLog << err << dbginf << "Cannot create MCalibrationCam... aborting." << endl; 109 return kFALSE; 110 } 111 112 fSignalCam = (MExtractedSignalCam*) pList->FindObject(AddSerialNumber("MExtractedSignalCam")); 113 if ( ! fSignalCam) 114 { 115 *fLog << err << dbginf << "Cannot find MExtractedSignalCam... aborting." << endl; 116 return kFALSE; 117 } 118 119 return kTRUE; 120 97 121 } 98 122 … … 122 146 } 123 147 124 fCalCam = (MCalibrationCam*)pList->Find CreateObj(AddSerialNumber("MCalibrationCam"));148 fCalCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationCam")); 125 149 126 150 if (!fCalCam) … … 144 168 for (int i=0; i<num; i++) 145 169 { 146 MCalibrationPix &pix = (*fCalCam)[i]; 170 MCalibrationPix &calpix = (*fCalCam)[i]; 171 MExtractedSignalPix &sigpix = (*fSignalCam)[i]; 147 172 148 const Float_t pedestmean = fHeaderFadc->GetPedestal(i);149 const Float_t pedestrms = fHeaderFadc->GetPedestalRmsHigh(i);150 // per slice173 const Float_t pedestmean = sigpix.IsLoGainUsed()? 174 fSignalCam->GetNumUsedLoGainFADCSlices()*fHeaderFadc->GetPedestal(i) : 175 fSignalCam->GetNumUsedHiGainFADCSlices()*fHeaderFadc->GetPedestal(i); 151 176 152 pix.SetPedestal(pedestmean, pedestrms); 177 const Float_t pedestrms = sigpix.IsLoGainUsed()? 178 sqrt((Double_t)(fSignalCam->GetNumUsedLoGainFADCSlices())) * fHeaderFadc->GetPedestalRmsLow(i) : 179 sqrt((Double_t)(fSignalCam->GetNumUsedHiGainFADCSlices())) * fHeaderFadc->GetPedestalRmsHigh(i); 180 181 // ped mean and rms per pixel, according to signal calculation: 182 183 calpix.SetPedestal(pedestmean, pedestrms); 184 185 if (i < 397) // FIXME! 186 calpix.SetConversionBlindPixelMethod(fADC2PheInner, 0., 0.); 187 else 188 calpix.SetConversionBlindPixelMethod(fADC2PheOuter, 0., 0.); 189 153 190 } 154 191 -
trunk/MagicSoft/Mars/manalysis/MMcCalibrationCalc.h
r2648 r2669 8 8 class MCalibrationCam; 9 9 class MMcFadcHeader; 10 class MExtractedSignalCam; 10 11 11 12 class MMcCalibrationCalc : public MTask … … 17 18 Bool_t ReInit(MParList *pList); 18 19 19 MCalibrationCam *fCalCam; 20 MMcFadcHeader *fHeaderFadc; 20 MCalibrationCam *fCalCam; 21 MMcFadcHeader *fHeaderFadc; 22 MExtractedSignalCam *fSignalCam; 23 24 Float_t fADC2PheInner; 25 Float_t fADC2PheOuter; 21 26 22 27 public: 23 28 MMcCalibrationCalc(const char *name=NULL, const char *title=NULL); 29 30 void SetADC2PheInner(Float_t x) {fADC2PheInner = x; } 31 void SetADC2PheOuter(Float_t x) {fADC2PheOuter = x; } 24 32 25 33 ClassDef(MMcCalibrationCalc, 0) // Task which obtains, for MC files, the pedestal mean and rms, and the calibration factor from ADC counts to photons.
Note:
See TracChangeset
for help on using the changeset viewer.