Ignore:
Timestamp:
02/24/03 20:10:47 (22 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmontecarlo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc

    r1789 r1790  
    4141#include "MMcTrigHeader.hxx"
    4242#include "MMcCorsikaRunHeader.h"
     43
     44#include "MH.h"
     45#include <TCanvas.h>
    4346
    4447ClassImp(MMcTriggerRateCalc);
     
    350353    return kTRUE;
    351354}
     355
     356
     357// Draw rate as a funtion of discriminator threshold.
     358
     359void 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  
    88#include "MTask.h"
    99#endif
     10
     11#include <TGraphErrors.h>
    1012
    1113class MParList;
     
    4648    MMcTrig  *GetTrig(UInt_t i) const { return (MMcTrig*)((*fMcTrig)[i]); }
    4749
     50    TH1F*     fHist[5];
     51
    4852public:
    4953    MMcTriggerRateCalc(int dim=0, float *trigbg=NULL, float simbg=100000,
     
    6165    Bool_t PostProcess();
    6266
     67    void Draw();
     68
    6369    ClassDef(MMcTriggerRateCalc, 0)     // Task to compute the trigger rate
    6470};
Note: See TracChangeset for help on using the changeset viewer.