19 int i=0,j=0, k=0, l=0;
20 gStyle->SetOptFit(1011);
23 TString OutFile=
"out_dummy.root";
28 TFile *
out = TFile::Open(prefix+
"_ana_fit.root",
"RECREATE");
31 TH1F *hjpsim_all =
new TH1F(
"hjpsim_all",
"J/#psi mass",200,0,4.5);
32 TH1F *hpsim_all =
new TH1F(
"hpsim_all",
"#psi(2S) mass",200,0,5);
34 TH1F *hjpsim_vf =
new TH1F(
"hjpsim_vf",
"J/#psi mass (vertex fit)",200,0,4.5);
35 TH1F *hjpsim_4cf =
new TH1F(
"hjpsim_4cf",
"J/#psi mass (4C fit)",200,0,4.5);
36 TH1F *hjpsim_mcf =
new TH1F(
"hjpsim_mcf",
"J/#psi mass (mass constraint fit)",200,0,4.5);
38 TH1F *hjpsi_chi2_vf =
new TH1F(
"hjpsi_chi2_vf",
"J/#psi: #chi^{2} vertex fit",100,0,10);
39 TH1F *hpsi_chi2_4c =
new TH1F(
"hpsi_chi2_4c",
"#psi(2S): #chi^{2} 4C fit",100,0,250);
40 TH1F *hjpsi_chi2_mf =
new TH1F(
"hjpsi_chi2_mf",
"J/#psi: #chi^{2} mass fit",100,0,10);
42 TH1F *hjpsi_prob_vf =
new TH1F(
"hjpsi_prob_vf",
"J/#psi: Prob vertex fit",100,0,1);
43 TH1F *hpsi_prob_4c =
new TH1F(
"hpsi_prob_4c",
"#psi(2S): Prob 4C fit",100,0,1);
44 TH1F *hjpsi_prob_mf =
new TH1F(
"hjpsi_prob_mf",
"J/#psi: Prob mass fit",100,0,1);
46 TH2F *
hvpos =
new TH2F(
"hvpos",
"(x,y) projection of fitted decay vertex",100,-2,2,100,-2,2);
55 if (nevts==0) nevts= theAnalysis->
GetEntries();
61 double m0_jpsi = TDatabasePDG::Instance()->GetParticle(
"J/psi")->Mass();
65 TLorentzVector ini(0, 0, 6.231552, 7.240065);
70 while (theAnalysis->
GetEvent() && i++<nevts)
72 if ((i%100)==0) cout<<
"evt " << i << endl;
75 theAnalysis->
FillList(muplus,
"MuonAllPlus");
76 theAnalysis->
FillList(muminus,
"MuonAllMinus");
77 theAnalysis->
FillList(piplus,
"PionAllPlus");
78 theAnalysis->
FillList(piminus,
"PionAllMinus");
88 hjpsim_all->Fill(jpsi[j]->M());
93 double chi2_vtx = vtxfitter.GetChi2();
94 double prob_vtx = vtxfitter.GetProb();
95 hjpsi_chi2_vf->Fill(chi2_vtx);
96 hjpsi_prob_vf->Fill(prob_vtx);
98 if ( prob_vtx > 0.01 )
101 TVector3 jVtx=jfit->
Pos();
103 hjpsim_vf->Fill(jfit->
M());
104 hvpos->Fill(jVtx.X(),jVtx.Y());
112 psi2s.
Combine(jpsi, piplus, piminus);
119 hpsim_all->Fill(psi2s[j]->M());
122 fitter.Add4MomConstraint(ini);
125 double chi2_4c = fitter.GetChi2();
126 double prob_4c = fitter.GetProb();
127 hpsi_chi2_4c->Fill(chi2_4c);
128 hpsi_prob_4c->Fill(prob_4c);
130 if ( prob_4c > 0.01 )
134 hjpsim_4cf->Fill(jfit->
M());
144 mfitter.AddMassConstraint(m0_jpsi);
147 double chi2_m = mfitter.GetChi2();
148 double prob_m = mfitter.GetProb();
149 hjpsi_chi2_mf->Fill(chi2_m);
150 hjpsi_prob_mf->Fill(prob_m);
155 hjpsim_mcf->Fill(jfit->
M());
169 cout<<
"Writing "<<nhist<<
" histograms to file"<<endl;
FairRunAna * initrun(TString prefix, TString outfile, int min=-1, int max=-1)
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
void Combine(RhoCandList &l1, RhoCandList &l2)
void Select(RhoParticleSelectorBase *pidmgr)
Int_t GetEvent(Int_t n=-1)
int writemyhistos(int maxy=800, double asp=1.1)
void plotmyhistos(std::vector< TH1 * > h, int maxy=700, double asp=1.1)