7 #include "TClonesArray.h"
9 #include "FairRootManager.h"
10 #include "FairRunAna.h"
11 #include "FairRuntimeDb.h"
17 #include "TStopwatch.h"
20 #include "FairRuntimeDb.h"
67 FairTask(
"Panda Analysis Task") {
92 h_mom=
new TH1F(
"h_mom",
"Momenta",200,0,5);
93 h_momc=
new TH1F(
"h_momc",
"Momenta charged",200,0,5);
94 h_momn=
new TH1F(
"h_momn",
"Momenta neutral",200,0,5);
95 h_mult=
new TH1F(
"h_mult",
"Multiplicity",50,-0.5,49.5);
96 h_multc=
new TH1F(
"h_multc",
"Multiplicity charged",30,-0.5,29.5);
97 h_multn=
new TH1F(
"h_multn",
"Multiplicity neutral",50,-0.5,49.5);
98 h_multrem=
new TH1F(
"h_multrem",
"Removed",50,-0.5,49.5);
101 h_jpsi=
new TH1F(
"h_jpsi",
"J/psi",200,0,max);
102 h_jpsit=
new TH1F(
"h_jpsit",
"J/psi true",200,0,max);
103 h_jpsisel=
new TH1F(
"h_jpsisel",
"J/psi selected",200,0,max);
107 h_d0=
new TH1F(
"h_d0",
"D0",200,0,max);
108 h_d0t=
new TH1F(
"h_d0t",
"D0 true",200,0,max);
109 h_d0sel=
new TH1F(
"h_d0sel",
"D0 selected",200,0,max);
112 h_d0_pocx=
new TH1F(
"h_d0_pocx",
"D0 poca X",100,-1,1);
113 h_d0_pocy=
new TH1F(
"h_d0_pocy",
"D0 poca Y",100,-1,1);
114 h_d0_pocz=
new TH1F(
"h_d0_pocz",
"D0 poca Z",100,-1,1);
116 h_d0_pocxm=
new TH1F(
"h_d0_pocxm",
"D0 poca X match",100,-1,1);
117 h_d0_pocym=
new TH1F(
"h_d0_pocym",
"D0 poca Y match",100,-1,1);
118 h_d0_poczm=
new TH1F(
"h_d0_poczm",
"D0 poca Z match",100,-1,1);
120 h_d0_l =
new TH1F(
"h_d0_l",
"flight length",100,0,1);
121 h_d0_lm =
new TH1F(
"h_d0_lm",
"flight length match",100,0,1);
129 h_dpm=
new TH1F(
"h_dpm",
"D#pm",200,0,max);
130 h_dpmt=
new TH1F(
"h_dpmt",
"D#pm true",200,0,max);
131 h_dpmsel=
new TH1F(
"h_dpmsel",
"D#pm selected",200,0,max);
135 h_ds=
new TH1F(
"h_ds",
"Ds",200,0,max);
136 h_dst=
new TH1F(
"h_dst",
"Ds true",200,0,max);
137 h_dssel=
new TH1F(
"h_dssel",
"Ds selected",200,0,max);
141 h_phi=
new TH1F(
"h_phi",
"Phi",200,0,max);
142 h_phit=
new TH1F(
"h_phit",
"Phi true",200,0,max);
143 h_phisel=
new TH1F(
"h_phisel",
"Phi selected",200,0,max);
147 h_lamc=
new TH1F(
"h_lamc",
"Lam_c",200,0,max);
148 h_lamct=
new TH1F(
"h_lamct",
"Lam_c true",200,0,max);
149 h_lamcsel=
new TH1F(
"h_lamcsel",
"Lam_c selected",200,0,max);
175 cout <<
"-I- PndSoftTriggerTask: Intialization successfull" << endl;
177 timer=
new TStopwatch();
186 FairRun*
run = FairRun::Instance();
187 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
208 cout <<
" t="<<
timer->CpuTime();
211 cout <<
" allmax:"<<
chmax;
212 cout <<
" chmax:"<<
chmax;
214 cout <<
" mcmax:"<<
mcmax;
225 RhoCandList Jpsi, D0, D0b, Dpm, Dm, Ds, Dsb, Lamc, Lamcb, Phi;
314 double m=Jpsi[j]->M();
351 double m=Dpm[j]->M();
355 double beta = Dpm[j]->P4().Beta();
356 double gamma = Dpm[j]->P4().Gamma();
364 h_d0_l->Fill(vtx.Mag()/(beta*gamma));
378 h_d0_lm->Fill(vtx.Mag()/(beta*gamma));
412 double m=Phi[j]->M();
430 double m=Lamc[j]->M();
447 if (foundd0>0)
cntd0++;
449 if (foundds>0)
cntds++;
459 htrue->SetLineColor(2);
460 hsel->SetFillStyle(3001);
461 hsel->SetFillColor(602);
462 hsel->SetLineStyle(3);
463 hsel->SetLineColor(602);
492 fabs(l[i]->Px()-l[j]->Px())<limit &&
493 fabs(l[i]->Py()-l[j]->Py())<limit &&
494 fabs(l[i]->Pz()-l[j]->Pz())<limit &&
501 if (sim) {l.
Remove(l[i--]); rem++;}
515 for (
int j=0;j<N;++j)
517 cout <<*(l[j])<<
" PDG:"<<l[j]->PdgCode()<<
" MC pointer:"<<l[j]->GetMcTruth()<<endl;
530 if (
fabs(l[j]->Charge()-
double(chrg))<0.001 && l[j]->GetPidInfo(type)>=
cut)
537 for (
int j=0;j<lpid.
GetLength();++j) lpid[j]->SetType(pdg);
550 if (l.
GetLength()>0) pdgcode = l[0]->PdgCode();
570 cout <<
"Efficiency (ev):" << (double)
cntsel / (
double)evcount <<endl;
571 cout <<"Efficiency J/psi (
ev):"<< (
double)
cntjpsi/ (
double)evcount <<endl;
572 cout <<"Efficiency D0 (
ev):"<< (
double)
cntd0 / (
double)evcount <<endl;
573 cout <<"Efficiency D+- (
ev):"<< (
double)
cntdpm / (
double)evcount <<endl;
574 cout <<"Efficiency Ds (
ev):"<< (
double)
cntds / (
double)evcount <<endl;
575 cout <<"Efficiency Phi (
ev):"<< (
double)
cntphi / (
double)evcount <<endl;
576 cout <<"Efficiency Lamc (
ev):"<< (
double)
cntlamc/ (
double)evcount <<endl;
621 ntp->GetInternalTree()->Write();
622 ntp2->GetInternalTree()->Write();
sim(Int_t nEvents=1, TString SimEngine="TGeant4", Float_t mom=6.231552)
void Append(const RhoCandidate *c)
const double fLamcMassCut
PndAnalysis * theAnalysis
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
virtual void Exec(Option_t *opt)
virtual void SetParContainers()
void CombineAndAppend(RhoCandList &l1, RhoCandList &l2)
void Combine(RhoCandList &l1, RhoCandList &l2)
void ConfigureHistos(TH1F *hall, TH1F *htrue, TH1F *hsel)
void PrintList(RhoCandList &l, int max=10)
Double_t GetPocaVtx(TVector3 &vertex, RhoCandidate *composite)
void FillMassHisto(TH1F *h, RhoCandList &l)
virtual InitStatus Init()
int RemoveDoubles(RhoCandList &l, double limit=0.0001)
void SetType(const TParticlePDG *pdt, int start=0)
friend F32vec4 fabs(const F32vec4 &a)
static RhoFactory * Instance()
Int_t Remove(RhoCandidate *)
void SelectPid(int type, int pdg, int chrg, RhoCandList &l, RhoCandList &lpid, double cut=0.2)
static Int_t GetCandidateWatermark()
void Put(const RhoCandidate *, Int_t i=-1)
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
Int_t GetEvent(Int_t n=-1)
int SelectPdgCode(RhoCandList &mct, RhoCandList &l)
RhoCandidate * Get(Int_t)