Changeset 2669 for trunk/MagicSoft/Mars/manalysis/MMcCalibrationCalc.cc
- Timestamp:
- 12/12/03 15:00:48 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.