Changeset 8977 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 06/18/08 19:09:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r8976 r8977 242 242 } 243 243 244 TH1D *vstime = (TH1D*)arr.FindObjectInCanvas("Theta", "TH1D", "OnTime"); 245 TH1D *size = (TH1D*)arr.FindObjectInCanvas("Excess", "TH1D", "Hist"); 246 TH1D *time = (TH1D*)arr.FindObjectInCanvas("ExcessTime", "TH1D", "Hist"); 244 TH1D *vstime = (TH1D*)arr.FindObjectInCanvas("Theta", "TH1D", "OnTime"); 245 TH1D *size = (TH1D*)arr.FindObjectInCanvas("Excess", "TH1D", "Hist"); 247 246 if (!vstime) 248 247 { … … 253 252 { 254 253 *fLog << err << dbginf << "ERROR - Excess [TH1D] not found in Hist-tab... abort." << endl; 255 return -1;256 }257 if (!size)258 {259 *fLog << err << dbginf << "ERROR - ExcessTime [TH1D] not found in Hist-tab... abort." << endl;260 254 return -1; 261 255 } … … 297 291 return -1; 298 292 299 if (vstime->GetBinContent(0)>0) 300 { 301 *fLog << err << "ERROR - Undeflow bin of OnTime histogram not empty as it ought to be." << endl; 293 const Double_t ufl = vstime->GetBinContent(0); 294 if (ufl>0) 295 { 296 if (vstime->GetBinLowEdge(1)<=0) 297 { 298 *fLog << err << "ERROR - Undeflow bin of OnTime histogram not empty as it ought to be." << endl; 299 return -1; 300 } 301 *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ufl/eff, ufl) << " of the eff. observation time is in the underflow bin." << endl; 302 } 303 304 const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1); 305 const Double_t eff = vstime->Integral()+ufl+ofl; 306 if (ofl>0) 307 *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ofl/eff, ofl) << " of the eff. observation time is in the overflow bin." << endl; 308 309 if (!fForceRunTime) 310 return eff; 311 312 TH1D *time = (TH1D*)arr.FindObjectInCanvas("ExcessTime", "TH1D", "Hist"); 313 if (!size) 314 { 315 *fLog << err; 316 *fLog << "ERROR - ExcessTime [TH1D] not found in Hist-tab... abort." << endl; 317 *fLog << " Did you try to process Monte Carlos with --force-runtime?" <<endl; 302 318 return -1; 303 319 } 304 320 305 const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1);306 const Double_t eff = vstime->Integral()+ofl;307 if (ofl>0)308 *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ofl/eff, ofl) << " of the eff. observation time is out of histogram range." << endl;309 310 321 const Double_t obs = time->GetXaxis()->GetXmax()-time->GetXaxis()->GetXmin(); 311 if (fForceRunTime) 312 { 313 *fLog << inf; 314 *fLog << "Total run time: " << obs/60 << "min" << endl; 315 *fLog << "Eff. obs. time: " << eff/60 << "min (" << Form("%.1f%%", 100*eff/obs) << ")" << endl; 316 } 317 318 return fForceRunTime ? obs : eff; 322 323 *fLog << inf; 324 *fLog << "Total run time: " << obs/60 << "min" << endl; 325 *fLog << "Eff. obs. time: " << eff/60 << "min (" << Form("%.1f%%", 100*eff/obs) << ")" << endl; 326 327 return obs; 319 328 } 320 329
Note:
See TracChangeset
for help on using the changeset viewer.