Changeset 1790 for trunk/MagicSoft/Mars/mmontecarlo
- Timestamp:
- 02/24/03 20:10:47 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mmontecarlo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r1789 r1790 41 41 #include "MMcTrigHeader.hxx" 42 42 #include "MMcCorsikaRunHeader.h" 43 44 #include "MH.h" 45 #include <TCanvas.h> 43 46 44 47 ClassImp(MMcTriggerRateCalc); … … 350 353 return kTRUE; 351 354 } 355 356 357 // Draw rate as a funtion of discriminator threshold. 358 359 void MMcTriggerRateCalc::Draw() 360 { 361 TCanvas *c = MH::MakeDefCanvas("Rate"); 362 363 Float_t xmin = GetRate(0)->GetMeanThreshold()-0.55; 364 Float_t xmax = GetRate(fNum-1)->GetMeanThreshold()+0.55; 365 Int_t nbins = 10*(xmax-xmin); 366 367 fHist[1] = new TH1F("Rate2","Trigger rate, mult. 2", nbins, xmin, xmax); 368 fHist[2] = new TH1F("Rate3","Trigger rate, mult. 3", nbins, xmin, xmax); 369 fHist[3] = new TH1F("Rate4","Trigger rate, mult. 4", nbins, xmin, xmax); 370 fHist[4] = new TH1F("Rate5","Trigger rate, mult. 5", nbins, xmin, xmax); 371 372 for (UInt_t i=0; i<fNum; i++) 373 { 374 Short_t mult = GetRate(i)->GetMultiplicity(); 375 376 fHist[mult-1]->SetBinContent(fHist[mult-1]->FindBin(GetRate(i)->GetMeanThreshold()), GetRate(i)->GetTriggerRate()); 377 378 fHist[mult-1]->SetBinError(fHist[mult-1]->FindBin(GetRate(i)->GetMeanThreshold()), GetRate(i)->GetTriggerRateError()); 379 } 380 381 for (Int_t i = 1; i <=4; i++) 382 { 383 fHist[i]->SetLineWidth(2); 384 fHist[i]->SetMarkerStyle(20); 385 fHist[i]->SetMarkerSize(.5); 386 fHist[i]->SetMaximum(1.2*GetRate(0)->GetTriggerRate()); 387 fHist[i]->SetMinimum(0.5*GetRate(fNum-1)->GetTriggerRate()); 388 } 389 390 fHist[2]->SetLineColor(1); 391 fHist[2]->SetMarkerColor(1); 392 fHist[2]->Draw(); 393 394 fHist[3]->SetLineColor(3); 395 fHist[3]->SetMarkerColor(3); 396 fHist[3]->Draw("same"); 397 398 fHist[4]->SetLineColor(4); 399 fHist[4]->Draw("same"); 400 fHist[4]->SetMarkerColor(4); 401 402 c->SetLogy(); 403 c->SetGridy(); 404 c->SetGridx(); 405 406 return; 407 } 408 -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h
r1783 r1790 8 8 #include "MTask.h" 9 9 #endif 10 11 #include <TGraphErrors.h> 10 12 11 13 class MParList; … … 46 48 MMcTrig *GetTrig(UInt_t i) const { return (MMcTrig*)((*fMcTrig)[i]); } 47 49 50 TH1F* fHist[5]; 51 48 52 public: 49 53 MMcTriggerRateCalc(int dim=0, float *trigbg=NULL, float simbg=100000, … … 61 65 Bool_t PostProcess(); 62 66 67 void Draw(); 68 63 69 ClassDef(MMcTriggerRateCalc, 0) // Task to compute the trigger rate 64 70 };
Note:
See TracChangeset
for help on using the changeset viewer.