59 TString parAsciiFile =
"all.par";
61 TString input =
"psi2s_Jpsi2pi_Jpsi_mumu.dec";
80 int i=0,j=0, k=0, l=0;
81 gStyle->SetOptFit(1011);
86 TFile *
out = TFile::Open(prefix+
"_output_ana.root",
"RECREATE");
89 TH1F *hmomtrk =
new TH1F(
"hmomtrk",
"track momentum (all)",200,0,5);
90 TH1F *hthttrk =
new TH1F(
"hthttrk",
"track theta (all)",200,0,3.1415);
92 TH1F *hjpsim_all =
new TH1F(
"hjpsim_all",
"J/#psi mass (all)",200,0,4.5);
93 TH1F *hpsim_all =
new TH1F(
"hpsim_all",
"#psi(2S) mass (all)",200,0,5);
95 TH1F *hjpsim_lpid =
new TH1F(
"hjpsim_lpid",
"J/#psi mass (loose pid)",200,0,4.5);
96 TH1F *hpsim_lpid =
new TH1F(
"hpsim_lpid",
"#psi(2S) mass (loose pid)",200,0,5);
98 TH1F *hjpsim_tpid =
new TH1F(
"hjpsim_tpid",
"J/#psi mass (tight pid)",200,0,4.5);
99 TH1F *hpsim_tpid =
new TH1F(
"hpsim_tpid",
"#psi(2S) mass (tight pid)",200,0,5);
101 TH1F *hjpsim_trpid =
new TH1F(
"hjpsim_trpid",
"J/#psi mass (true pid)",200,0,4.5);
102 TH1F *hpsim_trpid =
new TH1F(
"hpsim_trpid",
"#psi(2S) mass (true pid)",200,0,5);
105 TH1F *hjpsim_ftm =
new TH1F(
"hjpsim_ftm",
"J/#psi mass (full truth match)",200,0,4.5);
106 TH1F *hpsim_ftm =
new TH1F(
"hpsim_ftm",
"#psi(2S) mass (full truth match)",200,0,5);
108 TH1F *hjpsim_nm =
new TH1F(
"hjpsim_nm",
"J/#psi mass (no truth match)",200,0,4.5);
109 TH1F *hpsim_nm =
new TH1F(
"hpsim_nm",
"#psi(2S) mass (no truth match)",200,0,5);
111 TH1F *hjpsim_diff =
new TH1F(
"hjpsim_diff",
"J/#psi mass diff to truth",100,-2,2);
112 TH1F *hpsim_diff =
new TH1F(
"hpsim_diff",
"#psi(2S) mass diff to truth",100,-2,2);
115 TH1F *hjpsim_vf =
new TH1F(
"hjpsim_vf",
"J/#psi mass (vertex fit)",200,0,4.5);
116 TH1F *hjpsim_4cf =
new TH1F(
"hjpsim_4cf",
"J/#psi mass (4C fit)",200,0,4.5);
117 TH1F *hjpsim_mcf =
new TH1F(
"hjpsim_mcf",
"J/#psi mass (mass constraint fit)",200,0,4.5);
119 TH1F *hjpsi_chi2_vf =
new TH1F(
"hjpsi_chi2_vf",
"J/#psi: #chi^{2} vertex fit",100,0,10);
120 TH1F *hpsi_chi2_4c =
new TH1F(
"hpsi_chi2_4c",
"#psi(2S): #chi^{2} 4C fit",100,0,250);
121 TH1F *hjpsi_chi2_mf =
new TH1F(
"hjpsi_chi2_mf",
"J/#psi: #chi^{2} mass fit",100,0,10);
123 TH1F *hjpsi_prob_vf =
new TH1F(
"hjpsi_prob_vf",
"J/#psi: Prob vertex fit",100,0,1);
124 TH1F *hpsi_prob_4c =
new TH1F(
"hpsi_prob_4c",
"#psi(2S): Prob 4C fit",100,0,1);
125 TH1F *hjpsi_prob_mf =
new TH1F(
"hjpsi_prob_mf",
"J/#psi: Prob mass fit",100,0,1);
127 TH2F *
hvpos =
new TH2F(
"hvpos",
"(x,y) projection of fitted decay vertex",100,-2,2,100,-2,2);
136 if (nevts==0) nevts= theAnalysis->
GetEntries();
142 double m0_jpsi = TDatabasePDG::Instance()->GetParticle(
"J/psi")->Mass();
146 TLorentzVector ini(0, 0, 6.231552, 7.240065);
152 int cntdbltrk=0, cntdblmc=0, cntdblboth=0, cnttrk=0, cnt_dbl_jpsi=0, cnt_dbl_psip=0;
154 while (theAnalysis->
GetEvent() && i++<nevts)
156 if ((i%100)==0) cout<<
"evt " << i << endl;
159 theAnalysis->
FillList(chrg,
"Charged");
160 theAnalysis->
FillList(muplus,
"MuonAllPlus");
161 theAnalysis->
FillList(muminus,
"MuonAllMinus");
162 theAnalysis->
FillList(piplus,
"PionAllPlus");
163 theAnalysis->
FillList(piminus,
"PionAllMinus");
168 hmomtrk->Fill(muplus[j]->
P());
169 hthttrk->Fill(muplus[j]->P4().Theta());
173 hmomtrk->Fill(muminus[j]->
P());
174 hthttrk->Fill(muminus[j]->P4().Theta());
198 hjpsim_all->Fill( jpsi[j]->M() );
203 hjpsim_ftm->Fill( jpsi[j]->M() );
204 hjpsim_diff->Fill( jpsi[j]->GetMcTruth()->M() - jpsi[j]->M() );
207 hjpsim_nm->Fill( jpsi[j]->M() );
210 if (nm>1) cnt_dbl_jpsi++;
219 double chi2_vtx = vtxfitter.GetChi2();
220 double prob_vtx = vtxfitter.GetProb();
221 hjpsi_chi2_vf->Fill(chi2_vtx);
222 hjpsi_prob_vf->Fill(prob_vtx);
224 if ( prob_vtx > 0.01 )
227 TVector3 jVtx=jfit->
Pos();
229 hjpsim_vf->Fill(jfit->
M());
230 hvpos->Fill(jVtx.X(),jVtx.Y());
238 psi2s.
Combine(jpsi, piplus, piminus);
249 hpsim_all->Fill( psi2s[j]->M() );
254 hpsim_ftm->Fill( psi2s[j]->M() );
255 hpsim_diff->Fill( psi2s[j]->GetMcTruth()->M() - psi2s[j]->M() );
258 hpsim_nm->Fill( psi2s[j]->M() );
260 if (nm>1) cnt_dbl_psip++;
269 fitter.Add4MomConstraint(ini);
272 double chi2_4c = fitter.GetChi2();
273 double prob_4c = fitter.GetProb();
274 hpsi_chi2_4c->Fill(chi2_4c);
275 hpsi_prob_4c->Fill(prob_4c);
277 if ( prob_4c > 0.01 )
281 hjpsim_4cf->Fill(jfit->
M());
292 mfitter.AddMassConstraint(m0_jpsi);
295 double chi2_m = mfitter.GetChi2();
296 double prob_m = mfitter.GetProb();
297 hjpsi_chi2_mf->Fill(chi2_m);
298 hjpsi_prob_mf->Fill(prob_m);
303 hjpsim_mcf->Fill(jfit->
M());
320 for (j=0;j<jpsi.
GetLength();++j) hjpsim_trpid->Fill( jpsi[j]->M() );
323 psi2s.
Combine(jpsi, piplus, piminus);
324 for (j=0;j<psi2s.
GetLength();++j) hpsim_trpid->Fill( psi2s[j]->M() );
332 theAnalysis->
FillList(muplus,
"MuonLoosePlus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
333 theAnalysis->
FillList(muminus,
"MuonLooseMinus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
334 theAnalysis->
FillList(piplus,
"PionLoosePlus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
335 theAnalysis->
FillList(piminus,
"PionLooseMinus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
338 for (j=0;j<jpsi.
GetLength();++j) hjpsim_lpid->Fill( jpsi[j]->M() );
341 psi2s.
Combine(jpsi, piplus, piminus);
342 for (j=0;j<psi2s.
GetLength();++j) hpsim_lpid->Fill( psi2s[j]->M() );
350 theAnalysis->
FillList(muplus,
"MuonTightPlus",
"PidAlgoMdtHardCuts");
351 theAnalysis->
FillList(muminus,
"MuonTightMinus",
"PidAlgoMdtHardCuts");
352 theAnalysis->
FillList(piplus,
"PionLoosePlus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
353 theAnalysis->
FillList(piminus,
"PionLooseMinus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
356 for (j=0;j<jpsi.
GetLength();++j) hjpsim_tpid->Fill( jpsi[j]->M() );
359 psi2s.
Combine(jpsi, piplus, piminus);
360 for (j=0;j<psi2s.
GetLength();++j) hpsim_tpid->Fill( psi2s[j]->M() );
372 hjpsim_lpid->Write();
374 hjpsim_tpid->Write();
376 hjpsim_trpid->Write();
377 hpsim_trpid->Write();
385 hjpsim_diff->Write();
391 hjpsi_chi2_vf->Write();
392 hpsi_chi2_4c->Write();
393 hjpsi_chi2_mf->Write();
395 hjpsi_prob_vf->Write();
396 hpsi_prob_4c->Write();
397 hjpsi_prob_mf->Write();
404 if (gROOT->GetVersionInt() >= 60602) {
int SelectTruePid(PndAnalysis *ana, RhoCandList &l)
Class for the master reconstruction chain.
Bool_t Setup(TString outprefix="")
Initial setup.
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
TGeoManager * gGeoManager
void AddFriend(TString par)
Setter of friend root files.
FairParRootFileIo * output
void SetInput(TString par)
Input of the macro.
void Combine(RhoCandList &l1, RhoCandList &l2)
void Select(RhoParticleSelectorBase *pidmgr)
void SetType(const TParticlePDG *pdt, int start=0)
void countDoubles(RhoCandList &l, int &n1, int &n2, int &n3)
void Finish()
Final diagnostics.
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
Int_t GetEvent(Int_t n=-1)
void SetOutput(TString par)
Tag of the output file of the macro.
void SetParamAsciiFile(TString par)
Setter of the parameter ascii file.