Changeset 2886 for trunk/MagicSoft/Mars/mcalib
- Timestamp:
- 01/22/04 20:54:16 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mcalib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.cc
r2885 r2886 71 71 fEvents = 0; 72 72 73 fHistRatio = new TH1F("HistRatio", "Ratio fPassPhotCone/fSize", 1000., 0., 10.); 73 fHistRatio = new TH1F("HistRatio", "log10(fPassPhotCone/fSize)", 1500., -3., 3.); 74 fHistRatio->GetXaxis()->SetTitle("log_{10}(fPassPhotCone / fSize) (in photons/ADC count)"); 74 75 } 75 76 … … 165 166 } 166 167 168 for (UInt_t ipix = 0; ipix < fGeom->GetNumPixels(); ipix++) 169 { 170 if (fHeaderFadc->GetPedestalRmsHigh(ipix) > 0 || 171 fHeaderFadc->GetPedestalRmsLow(ipix) > 0 ) 172 { 173 *fLog << err << endl << endl << dbginf << "You are trying to calibrate the data using a Camera file produced with added noise. Please use a noiseless file for calibration. Aborting..." << endl << endl; 174 return kFALSE; 175 } 176 } 177 167 178 // 168 179 // FIXME: Check that the relevant parameters in the FADC header are the 169 // same for all the analyzed data !180 // same for all the analyzed data, both Calibration and Analyzed data! 170 181 // 171 182 … … 181 192 { 182 193 194 // 195 // Exclude events with some saturated pixel 196 // 183 197 if ( fNew->GetNumSaturatedPixels() > 0 ) 184 198 return kTRUE; 185 199 200 // 201 // Exclude events with low Size (larger fluctuations) 202 // FIXME? The present cut (1000 "inner-pixel-counts") is somehow arbitrary. 203 // Might it be optimized? 204 // 205 if ( fHillas->GetSize() < 1000 ) 206 return kTRUE; 207 186 208 fADC2Phot += fMcEvt->GetPassPhotCone() / fHillas->GetSize(); 187 209 fEvents ++; 188 210 189 fHistRatio->Fill( fMcEvt->GetPassPhotCone()/fHillas->GetSize());211 fHistRatio->Fill(log10(fMcEvt->GetPassPhotCone()/fHillas->GetSize())); 190 212 191 213 return kTRUE; … … 207 229 } 208 230 231 // 232 // For the calibration we no longer use the mean, but thepeak of the distribution: 233 // 234 235 Float_t summax = 0.; 236 Int_t mode = 0; 237 Int_t reach = 2; 238 for (Int_t ibin = 1+reach; ibin <= fHistRatio->GetNbinsX()-reach; ibin++) 239 { 240 Float_t sum = 0; 241 for(Int_t k = ibin-reach; k <= ibin+reach; k++) 242 sum += fHistRatio->GetBinContent(k); 243 if (sum > summax) 244 { 245 summax = sum; 246 mode = ibin; 247 } 248 } 249 250 fADC2Phot = pow(10., fHistRatio->GetXaxis()->GetBinCenter(mode)); 251 209 252 const int num = fCalCam->GetSize(); 210 253 -
trunk/MagicSoft/Mars/mcalib/MMcCalibrationCalc.h
r2885 r2886 28 28 Long_t fEvents; 29 29 30 TH1F* fHistRatio; 30 TH1F* fHistRatio; // Histogram for monitoring the calibration. 31 31 32 32 Bool_t CheckRunType(MParList *pList) const; … … 39 39 MMcCalibrationCalc(const char *name=NULL, const char *title=NULL); 40 40 41 TH1F* GetHist() { return fHistRatio; } 42 41 43 ClassDef(MMcCalibrationCalc, 0) // Task which obtains, for MC files, the calibration factor from ADC counts to photons. 42 44 };
Note:
See TracChangeset
for help on using the changeset viewer.