Changeset 1790


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1789 r1790  
    33 2003/02/24: Abelardo Moralejo
    44
    5     * mmontecarlo/MMcTriggerRateCalc.cc
     5    * mmontecarlo/MMcTriggerRateCalc.[h,cc]
    66      - Fixed mistake when analysing camera files containing all events
    77        (including non-triggers): fShowers was always zero.
    88      - Added reading of MMcTrigHeaders in ReInit
     9      - Added procedure Draw for graphics output: rate versus discriminator
     10        threshold (useful for camera files with several trigger conditions).
    911
    1012    * macros/trigrate.C
    1113      - Added some explanations. Style improvements in function GetNSBEvents.
     14        Added call to MMcTriggerRateCalc::Draw
    1215
    1316    * mhist/MHMcRate.[h,cc]
  • trunk/MagicSoft/Mars/macros/trigrate.C

    r1788 r1790  
    3434!
    3535\* ======================================================================== */
     36
     37
    3638
    3739Float_t GetNSBEvents(TString name, Float_t *BgR, int dim)
     
    180182
    181183    hists.Print();
     184
     185    gStyle->SetOptStat(0);
     186    rate->Draw();
    182187}
     188
     189
     190
     191
  • 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.