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

Go to the source code of this file.

Functions

void tut_ana_comb (int nevts=0, TString prefix="signal")
 

Function Documentation

void tut_ana_comb ( int  nevts = 0,
TString  prefix = "signal" 
)

Definition at line 17 of file thailand2017/tut_ana_comb.C.

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

18 {
19  // *** some variables
20  int i=0,j=0, k=0, l=0;
21  gStyle->SetOptFit(1011);
22 
23  // *** Initialize FairRunAna with defaults
24  TString OutFile="out_dummy.root";
25  FairRunAna* fRun = initrun(prefix, OutFile);
26  fRun->Init();
27 
28  // *** create an output file for all histograms
29  TFile *out = TFile::Open(prefix+"_ana_comb.root","RECREATE");
30 
31  // #### EXERCISE: create some histograms
32  //TH1F *hjpsiMass = ...
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  // #### EXERCISE: ---> Declare mu+, mu-, pi+, pi-, jpsi and pbarp RhoCandLists
43 
44  // RhoCandList muplus...
45 
46 
47  // *** Mass selector for the jpsi cands
48  RhoMassParticleSelector *jpsiMassSel=new RhoMassParticleSelector("jpsi",3.096,1.0);
49 
50  // ***
51  // the event loop
52  // ***
53  while (theAnalysis->GetEvent() && i++<nevts)
54  {
55  if ((i%100)==0) cout<<"evt " << i << endl;
56 
57  // #### EXERCISE: ---> Fill mu+, mu-, pi+ and pi- lists
58 
59  // theAnalysis->FillList(muplus, "MuonAllPlus");
60  // ....
61 
62  // #### EXERCISE: Do combinatorics with the generic lists to form J/psi -> mu+ mu- and pbarp -> J/psi pi+ pi-
63 
64  //jpsi.Combine(...)
65  //pbarp.Combine(...)
66 
67  // #### EXERCISE: Fill histograms with masses of J/psi and ppbar candidates
68  // fillM(jpsi, hjpsiMass);
69  // ...
70 
71  }
72 
73  // *** change to directory where histograms are created
74  out->cd();
75 
76  // *** plot all histos
77  plotmyhistos();
78 
79  // *** write out all the histos to file
80  int nhist = writemyhistos();
81  cout<<"Writing "<<nhist<<" histograms to file"<<endl;
82  out->Save();
83 
84  // *** temporaty fix to avoid error on macro exit
86 }
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