FairRoot/PandaRoot
Functions
thailand2017/tut_ana.C File Reference
#include "auxtut.C"

Go to the source code of this file.

Functions

int SelectTruePid (PndAnalysis *ana, RhoCandList &l)
 
void tut_ana (int nevts=0, TString prefix="signal")
 

Function Documentation

int SelectTruePid ( PndAnalysis ana,
RhoCandList l 
)
void tut_ana ( int  nevts = 0,
TString  prefix = "signal" 
)

Definition at line 20 of file thailand2017/tut_ana.C.

References fRun, PndAnalysis::GetEntries(), PndAnalysis::GetEvent(), i, initrun(), out, plotmyhistos(), PndAnalysis::PndAnalysis(), RemoveGeoManager(), TString, and writemyhistos().

21 {
22  // *** some variables
23  int i=0,j=0, k=0, l=0;
24  gStyle->SetOptFit(1011);
25 
26  // *** Initialize FairRunAna with defaults
27  TString OutFile="out_dummy.root";
28  FairRunAna* fRun = initrun(prefix, OutFile);
29  fRun->Init();
30 
31  // *** create an output file for all histograms
32  TFile *out = TFile::Open(prefix+"_ana.root","RECREATE");
33 
34  // ------------------------------
35  // Now the analysis stuff comes...
36  // ------------------------------
37 
38  // *** the data reader object
39  PndAnalysis* theAnalysis = new PndAnalysis();
40  if (nevts==0) nevts= theAnalysis->GetEntries();
41 
42  // ---------------------------------------------------------------------
43  // ---------------------------------------------------------------------
44  // ---------------------------------------------------------------------
45  // This macro combines all tasks (combinatorics, MC truth, PID, fitting)
46  // try to complete everything, perhaps for a different decay mode
47  // ---------------------------------------------------------------------
48  // ---------------------------------------------------------------------
49  // ---------------------------------------------------------------------
50 
51  // #### EXERCISE: create all necessary histograms
52  // ...
53 
54  // #### EXERCISE: create RhoCandLists for the analysis, mass selector, etc...
55 
56  // ***
57  // the event loop
58  // ***
59  while (theAnalysis->GetEvent() && i++<nevts)
60  {
61  // #### EXERCISE
62  // (1) combinatorics with desired PID algorithms and tightness, and PDG set for truth match
63  // (2) select rought mass window for resonances
64  // (3) do vertex fitting for resonances to charged particles
65  // (4) fill final histograms, with and without truth match
66  }
67 
68  // *** change to directory where histograms are created
69  out->cd();
70 
71  // *** plot all histos
72  plotmyhistos();
73 
74  // *** write out all the histos to file
75  int nhist = writemyhistos();
76  cout<<"Writing "<<nhist<<" histograms to file"<<endl;
77  out->Save();
78 
79  // *** temporaty fix to avoid error on macro exit
81 }
Int_t GetEntries()
FairRunAna * initrun(TString prefix, TString outfile, int min=-1, int max=-1)
Definition: QA/auxi.C:32
Int_t i
Definition: run_full.C:25
void RemoveGeoManager()
Definition: auxtut.C:11
FairRunAna * fRun
Definition: hit_dirc.C:58
TFile * out
Definition: reco_muo.C:20
Int_t GetEvent(Int_t n=-1)
int writemyhistos(int maxy=800, double asp=1.1)
Definition: QA/auxi.C:121
void plotmyhistos(std::vector< TH1 * > h, int maxy=700, double asp=1.1)
Definition: QA/auxi.C:62