Changeset 1880 for trunk/MagicSoft/Mars/mmontecarlo
- Timestamp:
- 03/31/03 10:37:56 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r1800 r1880 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! Author(s): Harald Kornmayer 1/2001 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 121 ! Copyright: MAGIC Software Development, 2000-2003 22 22 ! 23 23 ! Modified 4/7/2002 Abelardo Moralejo: now the dimension of fTrigger is … … 27 27 ! 28 28 \* ======================================================================== */ 29 30 29 #include "MMcTriggerRateCalc.h" 31 30 … … 105 104 if (fMcRunHeader->GetAllEvtsTriggered()) 106 105 { 107 *fLog << endl << all << endl << 108 "WARNING: the input data file contains only the" << endl << 109 "events that triggered. I will assume the standard value" << endl << 110 "for maximum impact parameter (400 m)" <<endl; 111 112 113 if (fTrigNSB[0] > 0) 114 *fLog << endl << all << 115 "WARNING: NSB rate can be overestimated by up to 5%." << endl << 116 "For a precise estimate of the total rate including NSB" << endl << 117 "accidental triggers I need a file containing all event headers." 118 << endl; 119 else 120 *fLog << endl << all << 121 "WARNING: calculating only shower rate (no NSB accidental triggers)" << endl; 106 *fLog << warn; 107 *fLog << "WARNING - the input data file contains only the" << endl; 108 *fLog << "events that triggered. I will assume the standard value" << endl; 109 *fLog << "for maximum impact parameter (400 m)" <<endl; 110 111 112 if (fTrigNSB[0] > 0) 113 { 114 *fLog << warn; 115 *fLog << "WARNING - NSB rate can be overestimated by up to 5%." << endl; 116 *fLog << "For a precise estimate of the total rate including NSB" << endl; 117 *fLog << "accidental triggers I need a file containing all event headers." << endl; 118 } 119 else 120 { 121 *fLog << warn << "WARNING - calculating only shower rate (no NSB accidental triggers)" << endl; 122 } 122 123 } 123 124 124 *fLog << endl << all<<125 *fLog << endl << warn << 125 126 "WARNING: I will assume the standard maximum off axis angle" << endl << 126 127 "(5 degrees) for the original showers" << endl; … … 168 169 // rate: rate of incident showers 169 170 // 170 171 171 MMcTriggerRateCalc::MMcTriggerRateCalc(float rate, int dim, 172 172 float *trigbg, float simbg, … … 325 325 if (fMcCorRunHeader->GetSlopeSpec() != -2.75) 326 326 { 327 *fLog << err << dbginf << 328 "Spectrum slope as read from input file ("<< 329 fMcCorRunHeader->GetSlopeSpec() << ") does not match the expectedone (-2.75) for protons" << endl << "... aborting." << endl;330 331 327 *fLog << err << dbginf << "Spectrum slope as read from input file ("; 328 *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected "; 329 *fLog << "one (-2.75) for protons" << endl << "... aborting." << endl; 330 return kFALSE; 331 } 332 332 rate.SetFlux(0.1091, 2.75); 333 333 break; … … 335 335 if (fMcCorRunHeader->GetSlopeSpec() != -2.62) 336 336 { 337 *fLog << err << dbginf << 338 "Spectrum slope as read from input file ("<< 339 fMcCorRunHeader->GetSlopeSpec() << ") does not match the expectedone (-2.75) for Helium" << endl << "... aborting." << endl;340 337 *fLog << err << dbginf << "Spectrum slope as read from input file ("; 338 *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected "; 339 *fLog << "one (-2.75) for Helium" << endl << "... aborting." << endl; 340 return kFALSE; 341 341 } 342 342 rate.SetFlux(0.0660, 2.62); … … 363 363 void MMcTriggerRateCalc::Draw() 364 364 { 365 /* 366 Commented out, because this is creating a memory leak! 367 The histograms are neither deleted anywhere, nor it is made 368 sure, that the histograms are not overwritten. 369 Also the comment for the function doesn't match the rules. 370 365 371 TCanvas *c = MH::MakeDefCanvas("Rate"); 366 372 367 373 Float_t xmin = GetRate(0)->GetMeanThreshold()-0.55; 368 374 Float_t xmax = GetRate(fNum-1)->GetMeanThreshold()+0.55; 369 Int_t nbins = 10*(xmax-xmin);375 Int_t nbins = (Int_t)((xmax-xmin)*10); 370 376 371 377 fHist[1] = new TH1F("Rate2","Trigger rate, mult. 2", nbins, xmin, xmax); … … 412 418 fHist[4]->Draw("same"); 413 419 fHist[4]->SetMarkerColor(4); 414 415 return; 416 } 417 420 */ 421 } 422
Note:
See TracChangeset
for help on using the changeset viewer.