Changeset 7188 for trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
- Timestamp:
- 07/13/05 19:06:26 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
r7005 r7188 71 71 using namespace std; 72 72 73 MMcCalibrationCalc::MMcCalibrationCalc(const char *name, const char *title) 73 // -------------------------------------------------------------------------- 74 // 75 // Constructor. Default value for fMinSize is 1000 ADC counts. This must be 76 // set in general by the user (SetMinSize), since it depends among other things 77 // on the signal extractor used. 78 // 79 MMcCalibrationCalc::MMcCalibrationCalc(const char *name, const char *title): fMinSize(1000) 74 80 { 75 81 fName = name ? name : "MMcCalibrationCalc"; 76 82 fTitle = title ? title : "Calculate and write conversion factors into MCalibrationChargeCam and MCalibrationQECam containers"; 77 78 fHistADC2PhotEl = new TH1F(AddSerialNumber("ADC2PhotEl"), "log10(fPhotElfromShower/fSize)", 1500, -3., 3.);79 fHistADC2PhotEl->SetXTitle("log_{10}(fPhotElfromShower / fSize) [photel/ADC count]");80 81 82 fHistPhot2PhotEl = new TH1F(AddSerialNumber("Phot2PhotEl"), "Photon conversion efficiency", 1000, 0., 1.);83 fHistPhot2PhotEl->SetXTitle("Overall photon conversion efficiency [photoelectron/photon]");84 85 83 } 86 84 … … 93 91 Bool_t MMcCalibrationCalc::CheckRunType(MParList *pList) const 94 92 { 95 const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject( "MRawRunHeader");93 const MRawRunHeader *run = (MRawRunHeader*)pList->FindObject(AddSerialNumber("MRawRunHeader")); 96 94 if (!run) 97 95 { 98 *fLog << warn << "Warning - cannot check file type, MRawRunHeader not found." << endl; 99 return kTRUE; 96 *fLog << warn << "Warning - cannot check file type, " << AddSerialNumber("MRawRunHeader") 97 << " not found." << endl; 98 return kTRUE; 100 99 } 101 100 … … 105 104 // -------------------------------------------------------------------------- 106 105 // 107 // Make sure, that there is an MCalibrationCam Object in the Parameter List.106 // Look for all necessary containers and create histograms 108 107 // 109 108 Int_t MMcCalibrationCalc::PreProcess(MParList *pList) 110 109 { 111 fHistADC2PhotEl->Reset();112 fHistPhot2PhotEl->Reset();113 114 110 fADC2PhotEl = 0; 115 111 fPhot2PhotEl = 0; … … 156 152 return kFALSE; 157 153 } 154 155 // 156 // Create histograms: 157 // 158 159 fHistADC2PhotEl = new TH1F(AddSerialNumber("ADC2PhotEl"), "log10(fPhotElfromShower/fSize)", 1500, -3., 3.); 160 fHistADC2PhotEl->SetXTitle("log_{10}(fPhotElfromShower / fSize) [photel/ADC count]"); 161 162 163 fHistPhot2PhotEl = new TH1F(AddSerialNumber("Phot2PhotEl"), "Photon conversion efficiency", 1000, 0., 1.); 164 fHistPhot2PhotEl->SetXTitle("Overall photon conversion efficiency [photoelectron/photon]"); 165 158 166 159 167 return kTRUE; … … 210 218 // perpendicular to the camera plane. 211 219 // 212 // FIXME! We should look for AddSerialNumber("MMcConfigRunHeader") but 213 // for the moment the stereo version of camera does not write one such 214 // header per telescope (it should!) 215 // 216 MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject("MMcConfigRunHeader"); 220 MMcConfigRunHeader* mcconfig = (MMcConfigRunHeader*) pList->FindObject(AddSerialNumber("MMcConfigRunHeader")); 217 221 if (!mcconfig) 218 222 { 219 *fLog << err << "MMcConfigRunHeader"<< " not found... aborting." << endl;223 *fLog << err << AddSerialNumber("MMcConfigRunHeader") << " not found... aborting." << endl; 220 224 return kFALSE; 221 225 } … … 253 257 // 254 258 // Exclude events with low Size (larger fluctuations) 255 // FIXME? The present cut (1000 "inner-pixel-counts") is somehow256 // arbitrary. Might it be optimized?257 259 // 258 260 259 if (size < 1000)261 if (size < fMinSize) 260 262 return kTRUE; 261 263 … … 288 290 } 289 291 290 fPhot2PhotEl = fHistPhot2PhotEl->GetMean(); // Average quantum efficiency 292 fPhot2PhotEl = fHistPhot2PhotEl->GetMean(); 293 // Average quantum efficiency. For now we will set this value for all pixels, although 294 // even in MC there may be differences from pixel to pixel, if the .dat file containing 295 // QE vs lambda, input of the camera simulation, has different QE curves for different 296 // pixels. FIXME? 297 298 MCalibrationQEPix &avqepix = (MCalibrationQEPix&)(fQECam->GetAverageArea(0)); 299 avqepix.SetAverageQE(fPhot2PhotEl); // Needed by MCalibrateData! 291 300 292 301 // … … 335 344 // FIXME: we are now assuming that all inner pixels have the same gain, and all 336 345 // outer pixels have the same gain (different from inner ones though). This can 337 // only be like this in camera 0.7, but m aychange in future versions of camera.346 // only be like this in camera 0.7, but might change in future versions of camera. 338 347 // 339 348 … … 347 356 } 348 357 358 349 359 return kTRUE; 350 360 }
Note:
See TracChangeset
for help on using the changeset viewer.