20 #include "FairRootManager.h"
21 #include "FairRunAna.h"
22 #include "FairRuntimeDb.h"
24 #include "FairRuntimeDb.h"
27 #include "TClonesArray.h"
52 FairTask(
"Panda Tutorial Analysis Task") {
94 hjpsim_all =
new TH1F(
"hjpsim_all",
"J/#psi mass (all)",200,0,4.5);
95 hpsim_all =
new TH1F(
"hpsim_all",
"#psi(2S) mass (all)",200,0,5);
97 hjpsim_lpid =
new TH1F(
"hjpsim_lpid",
"J/#psi mass (loose pid)",200,0,4.5);
98 hpsim_lpid =
new TH1F(
"hpsim_lpid",
"#psi(2S) mass (loose pid)",200,0,5);
100 hjpsim_tpid =
new TH1F(
"hjpsim_tpid",
"J/#psi mass (tight pid)",200,0,4.5);
101 hpsim_tpid =
new TH1F(
"hpsim_tpid",
"#psi(2S) mass (tight pid)",200,0,5);
103 hjpsim_trpid =
new TH1F(
"hjpsim_trpid",
"J/#psi mass (true pid)",200,0,4.5);
104 hpsim_trpid =
new TH1F(
"hpsim_trpid",
"#psi(2S) mass (true pid)",200,0,5);
106 hjpsim_ftm =
new TH1F(
"hjpsim_ftm",
"J/#psi mass (full truth match)",200,0,4.5);
107 hpsim_ftm =
new TH1F(
"hpsim_ftm",
"#psi(2S) mass (full truth match)",200,0,5);
109 hjpsim_nm =
new TH1F(
"hjpsim_nm",
"J/#psi mass (no truth match)",200,0,4.5);
110 hpsim_nm =
new TH1F(
"hpsim_nm",
"#psi(2S) mass (no truth match)",200,0,5);
112 hjpsim_diff =
new TH1F(
"hjpsim_diff",
"J/#psi mass diff to truth",100,-2,2);
113 hpsim_diff =
new TH1F(
"hpsim_diff",
"#psi(2S) mass diff to truth",100,-2,2);
115 hjpsim_vf =
new TH1F(
"hjpsim_vf",
"J/#psi mass (vertex fit)",200,0,4.5);
116 hjpsim_4cf =
new TH1F(
"hjpsim_4cf",
"J/#psi mass (4C fit)",200,0,4.5);
117 hjpsim_mcf =
new TH1F(
"hjpsim_mcf",
"J/#psi mass (mass constraint fit)",200,0,4.5);
119 hjpsi_chi2_vf =
new TH1F(
"hjpsi_chi2_vf",
"J/#psi: #chi^{2} vertex fit",100,0,10);
120 hpsi_chi2_4c =
new TH1F(
"hpsi_chi2_4c",
"#psi(2S): #chi^{2} 4C fit",100,0,250);
121 hjpsi_chi2_mf =
new TH1F(
"hjpsi_chi2_mf",
"J/#psi: #chi^{2} mass fit",100,0,10);
123 hjpsi_prob_vf =
new TH1F(
"hjpsi_prob_vf",
"J/#psi: Prob vertex fit",100,0,1);
124 hpsi_prob_4c =
new TH1F(
"hpsi_prob_4c",
"#psi(2S): Prob 4C fit",100,0,1);
125 hjpsi_prob_mf =
new TH1F(
"hjpsi_prob_mf",
"J/#psi: Prob mass fit",100,0,1);
127 hvpos =
new TH2F(
"hvpos",
"(x,y) projection of fitted decay vertex",100,-2,2,100,-2,2);
131 fIni.SetXYZT(0, 0, 6.231552, 7.240065);
141 FairRun*
run = FairRun::Instance();
142 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
185 hjpsim_diff->Fill( jpsi[j]->GetMcTruth()->M() - jpsi[j]->M() );
199 double chi2_vtx = vtxfitter.GetChi2();
200 double prob_vtx = vtxfitter.GetProb();
204 if ( prob_vtx > 0.01 )
207 TVector3 jVtx=jfit->
Pos();
210 hvpos->Fill(jVtx.X(),jVtx.Y());
218 psi2s.
Combine(jpsi, piplus, piminus);
232 hpsim_diff->Fill( psi2s[j]->GetMcTruth()->M() - psi2s[j]->M() );
244 fitter.Add4MomConstraint(
fIni);
247 double chi2_4c = fitter.GetChi2();
248 double prob_4c = fitter.GetProb();
252 if ( prob_4c > 0.01 )
267 mfitter.AddMassConstraint(3.0965);
270 double chi2_m = mfitter.GetChi2();
271 double prob_m = mfitter.GetProb();
298 psi2s.
Combine(jpsi, piplus, piminus);
307 fAnalysis->
FillList(muplus,
"MuonLoosePlus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
308 fAnalysis->
FillList(muminus,
"MuonLooseMinus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
309 fAnalysis->
FillList(piplus,
"PionLoosePlus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
310 fAnalysis->
FillList(piminus,
"PionLooseMinus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
316 psi2s.
Combine(jpsi, piplus, piminus);
327 fAnalysis->
FillList(piplus,
"PionLoosePlus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
328 fAnalysis->
FillList(piminus,
"PionLooseMinus",
"PidAlgoMvd;PidAlgoStt;PidAlgoDrc");
334 psi2s.
Combine(jpsi, piplus, piminus);
virtual void SetParContainers()
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
virtual InitStatus Init()
int SelectTruePid(PndAnalysis *ana, RhoCandList &l)
void Combine(RhoCandList &l1, RhoCandList &l2)
void Select(RhoParticleSelectorBase *pidmgr)
void SetType(const TParticlePDG *pdt, int start=0)
virtual void Exec(Option_t *opt)
Int_t Remove(RhoCandidate *)
RhoMassParticleSelector * fJpsiMassSel
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)