5 #include "TStopwatch.h"
14 cout <<
"vtx("<<p.X()<<
"/"<<p.Y()<<
"/"<<p.Z()<<
") p4("<<l.Px()<<
"/"<<l.Py()<<
"/"<<l.Pz()<<
")="<<l.Vect().Mag()<<endl;
22 FairLogger::GetLogger()->SetLogToFile ( kFALSE );
25 FairRunAna*
fRun =
new FairRunAna();
26 FairRuntimeDb*
rtdb = fRun->GetRuntimeDb();
27 fRun->SetInputFile (
"sim_fast.root" );
28 fRun->SetOutputFile (
"dummyout.root" );
30 FairParRootFileIo* parIO =
new FairParRootFileIo();
31 parIO->open (
"dummypar.root" );
32 rtdb->setFirstInput ( parIO );
33 rtdb->setOutput ( parIO );
37 PndAnalysis* theAnalysis =
new PndAnalysis (
"SttMvdGemGenTrack" ,
"FtsIdealGenTrack",
"PidChargedProbability",
"PidNeutralProbability" );
40 if ( nevts==0 ) nevts= theAnalysis->
GetEntries();
44 TH1F *jpsimass =
new TH1F(
"jpsimass",
"J/psi cands",100,3.1-0.3,3.1+0.3);
45 TH1F *jpsi2mass =
new TH1F(
"jpsi2mass",
"J/psi cands 4C fit",100,3.1-0.3,3.1+0.3);
47 TH1F *ppmass =
new TH1F(
"ppmass",
"pbarp cands",100,3.68598-0.3,3.68598+0.3);
48 TH1F *pp2mass =
new TH1F(
"pp2mass",
"pbarp fitted",100,3.68598-0.02,3.68598+0.02);
57 TLorentzVector ini(0,0,6.23164,7.24015);
63 while ( theAnalysis->
GetEvent() && i++<nevts )
66 cout <<
"evt "<<i<<endl;
70 theAnalysis->
FillList(pip,
"PionVeryLoosePlus",
"PidChargedProbability");
71 theAnalysis->
FillList(pim,
"PionVeryLooseMinus",
"PidChargedProbability");
72 theAnalysis->
FillList(ep,
"ElectronVeryLoosePlus",
"PidChargedProbability");
73 theAnalysis->
FillList(em,
"ElectronVeryLooseMinus",
"PidChargedProbability");
89 jpsimass->Fill(jpsi[j]->M());
97 ppmass->Fill(pp[j]->M());
105 pp2mass->Fill(ppfit->
M());
110 TLorentzVector sum=epfit->
P4()+emfit->
P4();
112 jpsi2mass->Fill(sum.Mag());
121 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
123 TCanvas *
c1=
new TCanvas(
"c1",
"c1",800,800);
125 c1->cd(1);jpsimass->Draw();
126 c1->cd(2);jpsi2mass->Draw();
127 c1->cd(3);ppmass->Draw();
128 c1->cd(4);pp2mass->Draw();
129 c1->Print(
"testplots.png");
133 Double_t mean_jpsimass=jpsimass->GetMean();
134 Double_t mean_jpsi2mass=jpsi2mass->GetMean();
136 Double_t mean_ppmass=ppmass->GetMean();
137 Double_t mean_pp2mass=pp2mass->GetMean();
139 if (mean_jpsimass>3.0 && mean_jpsimass<3.2 && mean_jpsi2mass>3.0 && mean_jpsi2mass<3.2)
141 cout<<
"\n J/Psi mass - ACCEPTABLE "<<endl;
145 cout<<
" \n J/Psi mass - SOMETHING WENT WRONG "<<endl;
146 cout<<
" Mean = " << mean_jpsimass << endl;
147 cout<<
" Mean (after kinfit) = " << mean_jpsi2mass << endl;
151 if (mean_ppmass>3.5 && mean_ppmass<3.7 && mean_pp2mass>3.5 && mean_pp2mass<3.7)
153 cout<<
"\n psi(2s) mass - ACCEPTABLE "<<endl;
157 cout<<
" \n psi(2s) mass - SOMETHING WENT WRONG "<<endl;
158 cout<<
" Mean = " << mean_ppmass << endl;
159 cout<<
" Mean (after kinfit) = " << mean_pp2mass << endl;
164 cout <<
" Test passed" << endl;
165 cout <<
" All ok " << endl;
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Bool_t FitConserveMasses()
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
RhoCandidate * Daughter(Int_t n)
void Combine(RhoCandList &l1, RhoCandList &l2)
TLorentzVector P4() const
int QAmacro_fastsim_2(int nevts=0)
void printCand(TLorentzVector l, TVector3 p)
Int_t GetEvent(Int_t n=-1)