7 #include "TClonesArray.h"
9 #include "FairRootManager.h"
10 #include "FairRunAna.h"
11 #include "FairRuntimeDb.h"
16 #include "TStopwatch.h"
19 #include "FairRuntimeDb.h"
44 FairTask(
"Panda Analysis Task")
68 hjpsim_nopid =
new TH1F(
"hjpsim_nopid",
"J/#psi mass (no pid)",200,0,4);
69 hpsim_nopid =
new TH1F(
"hpsim_nopid",
"#psi(2S) mass (no pid)",200,0,5);
70 hjpsim_lpid =
new TH1F(
"hjpsim_lpid",
"J/#psi mass (loose pid)",200,0,4);
71 hpsim_lpid =
new TH1F(
"hpsim_lpid",
"#psi(2S) mass (loose pid)",200,0,5);
72 hjpsim_tpid =
new TH1F(
"hjpsim_tpid",
"J/#psi mass (true pid)",200,0,4);
73 hpsim_tpid =
new TH1F(
"hpsim_tpid",
"#psi(2S) mass (true pid)",200,0,5);
75 hjpsim_ftm =
new TH1F(
"hjpsim_ftm",
"J/#psi mass (full truth match)",200,0,4);
76 hpsim_ftm =
new TH1F(
"hpsim_ftm",
"#psi(2S) mass ( truth match)",200,0,5);
77 hjpsim_nm =
new TH1F(
"hjpsim_nm",
"J/#psi mass (no truth match)",200,0,4);
78 hpsim_nm =
new TH1F(
"hpsim_nm",
"#psi(2S) mass (no truth match)",200,0,5);
80 hjpsim_diff =
new TH1F(
"hjpsim_diff",
"J/#psi mass diff to truth",100,-2,2);
81 hpsim_diff =
new TH1F(
"hpsim_diff",
"#psi(2S) mass diff to truth",100,-2,2);
83 hjpsim_vf =
new TH1F(
"hjpsim_vf",
"J/#psi mass vertex fit",200,0,4);
84 hjpsim_4cf =
new TH1F(
"hjpsim_4cf",
"J/#psi mass (4C fit)",200,0,4);
85 hjpsim_mcf =
new TH1F(
"hjpsim_mcf",
"J/#psi mass (mass constraint fit)",200,0,4);
87 hjpsi_chi2_vf =
new TH1F(
"hjpsi_chi2_vf",
"J/#psi, #chi^{2} vertex fit",100,0,10);
88 hpsi_chi2_4c =
new TH1F(
"hpsi_chi2_4c",
"#psi, #chi^{2} 4C fit",100,0,250);
89 hjpsi_chi2_mf =
new TH1F(
"hjpsi_chi2_mf",
"J/#psi, #chi^{2} mass fit",100,0,10);
91 hvpos =
new TH2F(
"hvpos",
"(x,y) projection of fitted decay vertex",100,-2,2,100,-2,2);
107 cout <<
"-I- PndMyAnalysisTask: Intialization successfull" << endl;
109 timer=
new TStopwatch();
119 FairRun*
run = FairRun::Instance();
120 if ( ! run ) { Fatal(
"SetParContainers",
"No analysis run"); }
140 cout <<
" t="<<
timer->CpuTime();
143 cout <<
" epmax:"<<
epmax;
144 cout <<
" emmax:"<<
emmax;
145 cout <<
" pipmax:"<<
pipmax;
146 cout <<
" pimmax:"<<
pimmax;
147 cout <<
" mcmax:"<<
mcmax;
159 TLorentzVector ini(0, 0, 6.231552, 7.240065);
196 else {
hjpsim_nm->Fill( jpsi[j]->M() ); }
205 TVector3 jVtx=jfit->
Pos();
207 double chi2_vtx=vtxfitter.
GetChi2();
212 hvpos->Fill(jVtx.X(),jVtx.Y());
223 ntp->
Column(
"jpsitht", jpsi[j]->P4().Theta(), -999.);
225 ntp->
Column(
"jpsiphi", jpsi[j]->P4().Phi(), -999.);
258 psi2s.
Combine(jpsi, piplus, piminus);
270 const RhoCandidate* trueJ = psi2s[j]->Daughter(0)->GetMcTruth();
272 hjpsim_diff->Fill(trueJ->
M()-psi2s[j]->Daughter(0)->M());
274 }
else {
hpsim_nm->Fill( psi2s[j]->M() ); }
282 double chi2_4c=fitter.
GetChi2();
287 const RhoCandidate* epfit = (psi2s[j]->Daughter(0)->Daughter(0))->GetFit();
288 const RhoCandidate* emfit = (psi2s[j]->Daughter(0)->Daughter(1))->GetFit();
290 TLorentzVector tlvepf = epfit->
P4();
291 TLorentzVector tlvemf = emfit->
P4();
311 ntp2->
Column(
"jfitm", (tlvepf+tlvemf).M(), -1.);
313 ntp->
Column(
"jpsitht", jpsic->
P4().Theta(), -999.);
362 double chi2_m = mfitter.
GetChi2();
365 if (chi2_m<2) {
hjpsim_mcf->Fill(jpsi[j]->M()); }
375 psi2s.
Combine(jpsi, piplus, piminus);
390 psi2s.
Combine(jpsi, piplus, piminus);
414 if (l.
GetLength()>0) { pdgcode = l[0]->PdgCode(); }
void AddMassConstraint(double mass)
Bool_t FitConserveMasses()
virtual void SetParContainers()
PndAnalysis * theAnalysis
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
void FillMassHisto(TH1F *h, RhoCandList &l)
void Combine(RhoCandList &l1, RhoCandList &l2)
int SelectPdgCode(RhoCandList &mct, RhoCandList &l)
TLorentzVector P4() const
virtual void Exec(Option_t *opt)
void Column(const char *label, Bool_t value, Bool_t defval=0, const char *block=0)
void SetType(const TParticlePDG *pdt, int start=0)
static RhoFactory * Instance()
Int_t Remove(RhoCandidate *)
static Int_t GetCandidateWatermark()
RhoMassParticleSelector * jpsiMassSel
TTree * GetInternalTree()
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
Int_t GetEvent(Int_t n=-1)
virtual InitStatus Init()
double GetPidInfo(int hypo)