3 .L $ALICE_ROOT/STEER/AliGenInfo.C+
4 .L $ALICE_ROOT/STEER/AliESDComparisonMI.C+
5 .L AliESDComparisonV0MI.C
8 AliKalmanTrack::SetConvConst(1);
9 AliESDComparisonDraw compv0;
10 AliESDComparisonDraw comp;
13 TFile fv0("cmpESDTracks.root");
14 TTree * treev0 = (TTree*)fv0.Get("ESDcmpV0");
15 TTree * tree = (TTree*)fv0.Get("ESDcmpTracks");
16 compv0.fTree = treev0;
18 MakeV0Aliases(&compv0);
23 TChain * chain1 = new TChain("ESDcmpV0","ESDcmpV0");
24 chain1->AddFile("k0merge/cmpESDTracks.root");
25 chain1->AddFile("k0merge1000/cmpESDTracks.root");
26 chain1->AddFile("strangemerge/newv1/cmpESDTracks.root");
27 compv0.fTree = chain1;
28 MakeV0Aliases(&compv0);
31 TChain * chain3 = new TChain("ESDcmpV0","ESDcmpV0");
33 chain3->AddFile("750801/cmpESDTracks.root");
34 chain3->AddFile("751760/cmpESDTracks.root");
35 chain3->AddFile("751764/cmpESDTracks.root");
36 chain3->AddFile("751765/cmpESDTracks.root");
37 chain3->AddFile("751766/cmpESDTracks.root");
38 chain3->AddFile("751767/cmpESDTracks.root");
39 chain3->AddFile("751768/cmpESDTracks.root");
40 chain3->AddFile("751769/cmpESDTracks.root");
41 chain3->AddFile("751772/cmpESDTracks.root");
43 chain3->AddFile("751774/cmpESDTracks.root");
44 chain3->AddFile("751775/cmpESDTracks.root");
45 chain3->AddFile("751776/cmpESDTracks.root");
46 chain3->AddFile("751778/cmpESDTracks.root");
47 chain3->AddFile("751779/cmpESDTracks.root");
48 chain3->AddFile("751781/cmpESDTracks.root");
49 chain3->AddFile("751782/cmpESDTracks.root");
50 chain3->AddFile("751784/cmpESDTracks.root");
52 chain3->AddFile("751788/cmpESDTracks.root");
53 chain3->AddFile("751789/cmpESDTracks.root");
54 chain3->AddFile("751790/cmpESDTracks.root");
55 chain3->AddFile("751791/cmpESDTracks.root");
56 chain3->AddFile("751792/cmpESDTracks.root");
57 chain3->AddFile("751793/cmpESDTracks.root");
58 chain3->AddFile("751794/cmpESDTracks.root");
59 chain3->AddFile("751796/cmpESDTracks.root");
61 compv0.fTree = chain3;
62 MakeV0Aliases(&compv0);
64 TChain * chain3 = new TChain("ESDcmpTracks","ESDcmpTracks");
65 chain3->AddFile("751790/cmpESDTracks.root");
66 chain3->AddFile("751791/cmpESDTracks.root");
67 chain3->AddFile("751792/cmpESDTracks.root");
68 chain3->AddFile("751793/cmpESDTracks.root");
69 chain3->AddFile("751794/cmpESDTracks.root");
70 chain3->AddFile("751796/cmpESDTracks.root");
74 TChain * chain2 = new TChain("ESDcmpV0","ESDcmpV0");
75 chain2->AddFile("run50_100/newv6/cmpESDTracks.root");
76 chain2->AddFile("run20_100/newv6/cmpESDTracks.root");
77 compv0.fTree = chain2;
78 MakeV0Aliases(&compv0);
82 TChain * chain3 = new TChain("ESDcmpV0","ESDcmpV0");
83 chain3->AddFile("~/data/HEAD0205/cent1_0/newv7cmpESDTracks.root");
87 TH1F hrel("hrel","hrel",100,-1,1);
88 TCut cbase("cbase","RC.fV0Status>-1");
89 TCut cr("cr","RC.fV0Status==3");
90 TCut cp("cp","MC.fMotherP.fVx<0.2&&MC.fMotherP.fVy<0.2");
91 TCut clambda("clambda","MC.fMotherP.fPdgCode==3122");
92 TCut calambda("calambda","MC.fMotherP.fPdgCode==-3122");
93 TCut clam("clam","abs(MC.fMotherP.fPdgCode)==3122");
94 TCut cgamma("cgamma","abs(MC.fMotherP.fPdgCode)==22");
95 TCut ck0s("ck0s","MC.fMotherP.fPdgCode==313");
96 TCut ck0b("ck0b","MC.fMotherP.fPdgCode==-313");
97 TCut cks0("cks0","MC.fMotherP.fPdgCode==310");
98 TCut crho0("crho0","MC.fMotherP.fPdgCode==113");
99 TCut cpi("cpi","abs(MC.fMotherP.fPdgCode)==211");
100 TCut cpa("cpa","MC.fPointAngle>0.999");
101 TCut cint("cint","abs(MC.fMotherP.fPdgCode)==3122||abs(MC.fMotherP.fPdgCode)==22||MC.fMotherP.fPdgCode==310"+cpa);
102 TH1F hpull("hpull","hpull",100,-5,5);
103 TF1 fim("fim","[2]*exp(-(x-[0])**2/(2*[1]**2))+abs([3])+[4]*(x-0.495)",0,1);
106 void MakeV0Aliases(AliESDComparisonDraw * compv0)
109 // Make base, resol and cut aliases
111 MakeAliasBase(compv0);
112 MakeResolAlias(compv0);
113 MakeCutsAliases(compv0);
114 MakeCutsAliasesPID(compv0);
117 void MakeAliasBase(AliESDComparisonDraw * compv0){
119 // aliases based on MC data
120 // and on Reconstructed data
122 // comp->fTree->SetAlias("locphi","(100*(180+180*atan2(MC.fParticle.fPy,MC.fParticle.fPx)/pi)%1000.)*0.01");
123 compv0->fTree->SetAlias("minlab","min(abs(RC.fV0rec.fLab[0]),abs(RC.fV0rec.fLab[1]))");
124 compv0->fTree->SetAlias("maxlab","max(abs(RC.fV0rec.fLab[0]),abs(RC.fV0rec.fLab[1]))");
125 compv0->fTree->SetAlias("MCE","sqrt((MC.fMCm.fParticle.fPx+MC.fMCd.fParticle.fPx)**2+(MC.fMCm.fParticle.fPy+MC.fMCd.fParticle.fPy)**2+(MC.fMCm.fParticle.fPz+MC.fMCd.fParticle.fPz)**2)");
126 compv0->fTree->SetAlias("Ptpc","sqrt((RC.fV0tpc.fPM[0]+RC.fV0tpc.fPP[0])**2+(RC.fV0tpc.fPM[1]+RC.fV0tpc.fPP[1])**2+(RC.fV0tpc.fPM[2]+RC.fV0tpc.fPP[2])**2)");
127 compv0->fTree->SetAlias("Pits","sqrt((RC.fV0its.fPM[0]+RC.fV0its.fPP[0])**2+(RC.fV0its.fPM[1]+RC.fV0its.fPP[1])**2+(RC.fV0its.fPM[2]+RC.fV0its.fPP[2])**2)");
128 compv0->fTree->SetAlias("Prec","sqrt((RC.fV0rec.fPM[0]+RC.fV0rec.fPP[0])**2+(RC.fV0rec.fPM[1]+RC.fV0rec.fPP[1])**2+(RC.fV0rec.fPM[2]+RC.fV0rec.fPP[2])**2)");
130 compv0->fTree->SetAlias("PTtpc","sqrt((RC.fV0tpc.fPM[0]+RC.fV0tpc.fPP[0])**2+(RC.fV0tpc.fPM[1]+RC.fV0tpc.fPP[1])**2)");
131 compv0->fTree->SetAlias("PTits","sqrt((RC.fV0its.fPM[0]+RC.fV0its.fPP[0])**2+(RC.fV0its.fPM[1]+RC.fV0its.fPP[1])**2)");
132 compv0->fTree->SetAlias("PTrec","sqrt((RC.fV0rec.fPM[0]+RC.fV0rec.fPP[0])**2+(RC.fV0rec.fPM[1]+RC.fV0rec.fPP[1])**2)");
133 compv0->fTree->SetAlias("PhiRec","atan2(RC.fV0rec.fPP[1]+RC.fV0rec.fPM[1],RC.fV0rec.fPP[0]+RC.fV0rec.fPM[0])");
134 compv0->fTree->SetAlias("PhiTpc","atan2(RC.fV0tpc.fPP[1]+RC.fV0tpc.fPM[1],RC.fV0tpc.fPP[0]+RC.fV0tpc.fPM[0])");
135 compv0->fTree->SetAlias("PhiIts","atan2(RC.fV0its.fPP[1]+RC.fV0its.fPM[1],RC.fV0its.fPP[0]+RC.fV0its.fPM[0])");
136 compv0->fTree->SetAlias("PhiMC","atan2(MC.fMotherP.fPy,MC.fMotherP.fPx)");
138 compv0->fTree->SetAlias("minpt","min(abs(MC.fMCm.fParticle.Pt()),abs(MC.fMCd.fParticle.Pt()))");
139 compv0->fTree->SetAlias("minpt2","min(abs(MC.fMCm.fTrackRef.Pt()),abs(MC.fMCd.fTrackRef.Pt()))");
140 compv0->fTree->SetAlias("minrows","min(MC.fMCm.fRowsWithDigits,MC.fMCd.fRowsWithDigits)");
141 compv0->fTree->SetAlias("maxtan","tan(max(abs(MC.fMCm.fParticle.Theta()-1.578),abs(MC.fMCd.fParticle.Theta()-1.578)))");
142 compv0->fTree->SetAlias("maxtanr","max(abs(RC.fV0rec.fParamP.fParam[3]),abs(RC.fV0rec.fParamM.fParam[3]))");
144 compv0->fTree->SetAlias("findable","RC.fRecStatus>=0&&MC.fMCR>0.8&&MC.fMCR<120&&minrows>100&&minpt>0.2&&maxtan<1.0&&sqrt(MC.fMotherP.fVx**2+MC.fMotherP.fVy**2)<0.00001&&MC.fPointAngle>0.9999");
146 compv0->fTree->SetAlias("findable2","RC.fRecStatus>=0&&MC.fMCR>0.6&&MC.fMCR<120&&MC.fPointAngle>0.9999&&min(MC.fMCm.fRowsWithDigits,MC.fMCd.fRowsWithDigits)>120&&max(abs(MC.fMCm.fTrackRef.fZ),abs(MC.fMCd.fTrackRef.fZ))<90&&min(abs(MC.fMCm.fParticle.Pt()),abs(MC.fMCd.fParticle.Pt()))>0.2");
148 compv0->fTree->SetAlias("EMC2","(MC.fMCd.fParticle.fE+MC.fMCm.fParticle.fE)*(MC.fMCd.fParticle.fE+MC.fMCm.fParticle.fE)");
149 compv0->fTree->SetAlias("PMC2","(MC.fMCd.fParticle.fPx+MC.fMCm.fParticle.fPx)**2+(MC.fMCd.fParticle.fPy+MC.fMCm.fParticle.fPy)**2+(MC.fMCd.fParticle.fPz+MC.fMCm.fParticle.fPz)**2");
152 ////////////////////////////////////////////
153 ////////////////////////////////////////////
154 ////////////////////////////////////////////
156 void MakeResolAlias(AliESDComparisonDraw * compv0){
158 // Resolution estimates
159 // SigmaAP0 and SigmaD0 - uses Covariance matrix
160 // SigmaAP2 and SigmaD2 - "Restricted Sigma" in ( 0.5 to 1.5) window from effective sigma parameterization
162 compv0->fTree->SetAlias("CausalityB","(1-RC.fV0rec.fCausality[0])*(1-RC.fV0rec.fCausality[1])");
163 compv0->fTree->SetAlias("CausalityA","sqrt((min(RC.fV0rec.fCausality[2],0.7))*(min(RC.fV0rec.fCausality[3],0.7)))");
164 compv0->fTree->SetAlias("p12","sqrt(RC.fV0rec.fParamP.fParam[4]**2+RC.fV0rec.fParamM.fParam[4]**2)");
165 compv0->fTree->SetAlias("ptminrec","1./max(abs(RC.fV0rec.fParamP.fParam[4]),abs(RC.fV0rec.fParamM.fParam[4]))");
166 compv0->fTree->SetAlias("P0","(exp(-RC.fV0rec.fDistNorm)+0.1)*(RC.fV0rec.fDist2<0.5)*(RC.fV0rec.fDistNorm<5)");
168 // resolution estimates in Y and Z
170 compv0->fTree->SetAlias("SigmaY","sqrt(RC.fV0rec.fParamP.fCovar[0]+RC.fV0rec.fParamM.fCovar[0]+(RC.fV0rec.fParamP.fCovar[5])*(RC.fV0rec.fParamP.fX-RC.fV0rec.fRr)**2+(RC.fV0rec.fParamM.fCovar[5])*(RC.fV0rec.fParamM.fX-RC.fV0rec.fRr)**2)");
171 compv0->fTree->SetAlias("SigmaZ","sqrt(RC.fV0rec.fParamP.fCovar[2]+RC.fV0rec.fParamM.fCovar[2]+(RC.fV0rec.fParamP.fCovar[9])*(RC.fV0rec.fParamP.fX-RC.fV0rec.fRr)**2+(RC.fV0rec.fParamM.fCovar[9])*(RC.fV0rec.fParamM.fX-RC.fV0rec.fRr)**2)");
173 // Normalize distance sigma
174 compv0->fTree->SetAlias("SigmaD00","RC.fV0rec.fParamP.fCovar[0]+RC.fV0rec.fParamM.fCovar[0]+RC.fV0rec.fParamP.fCovar[2]+RC.fV0rec.fParamM.fCovar[2]");
176 compv0->fTree->SetAlias("SigmaD01","min(RC.fV0rec.fRr-RC.fV0rec.fParamP.fX,0)**2*(RC.fV0rec.fParamP.fCovar[5]+RC.fV0rec.fParamP.fCovar[9])+min(RC.fV0rec.fRr-RC.fV0rec.fParamM.fX,0)**2*(RC.fV0rec.fParamM.fCovar[5]+RC.fV0rec.fParamM.fCovar[9])");
177 compv0->fTree->SetAlias("SigmaD0","sqrt(SigmaD00+SigmaD01+0.03**2)");
180 compv0->fTree->SetAlias("Norm0","sqrt(RC.fV0rec.fPM[0]**2+RC.fV0rec.fPM[1]**2+RC.fV0rec.fPM[2]**2)/Prec");
181 compv0->fTree->SetAlias("Norm1","sqrt(RC.fV0rec.fPP[0]**2+RC.fV0rec.fPP[1]**2+RC.fV0rec.fPP[2]**2)/Prec");
182 compv0->fTree->SetAlias("SigmaA","(RC.fV0rec.fParamP.fCovar[5]+RC.fV0rec.fParamP.fCovar[9])*(Norm1**2)+(RC.fV0rec.fParamP.fCovar[5]+RC.fV0rec.fParamM.fCovar[9])*(Norm0**2)");
183 compv0->fTree->SetAlias("SigmaAP0","sqrt(0.005**2+0.5*((SigmaD0/RC.fV0rec.fRr)**2+SigmaA))");
184 //compv0->fTree->SetAlias("SigmaAP0","sqrt(0.0001**2+0.5*((SigmaD0/RC.fV0rec.fRr)**2+SigmaA))");
186 // Effective sigma definition
188 compv0->fTree->SetAlias("SigmaAPE0","min((0.005+0.02/(0.1+RC.fV0rec.fRr))*0.4*(0.7+0.3*p12),0.06)");
189 compv0->fTree->SetAlias("SigmaAP2","max(min((SigmaAP0+SigmaAPE0)*0.5,1.5*SigmaAPE0),0.5*SigmaAPE0+0.003)");
190 compv0->fTree->SetAlias("SigmaDE0","min(sqrt( ((0.02*max(sqrt(RC.fV0rec.fRr)-2.7,0))*p12**2)**2**2+0.06**2),0.5)");
191 compv0->fTree->SetAlias("SigmaD2","max(min((SigmaD0+SigmaDE0)*0.5,1.5*SigmaDE0),0.5*SigmaDE0)");
195 void MakeCutsAliases(AliESDComparisonDraw * compv0){
197 // Defines likelihood variables
198 // LikeAP - likelihood acoording point angle
199 // LikeD - likelihood according DCA
200 // LCausal - causality likelihood
202 // CLow1 cut - cut on log(LikeAP*LogD)
203 // CHigh cut - Causality likehood also used - cut on log(LikeAP*LikeD*LCausal)
205 compv0->fTree->SetAlias("APNorm0","acos(RC.fV0rec.fPointAngle)/SigmaAP0");
206 compv0->fTree->SetAlias("DNorm0", "RC.fV0rec.fDist2/SigmaD0");
207 compv0->fTree->SetAlias("APNorm2","acos(RC.fV0rec.fPointAngle)/SigmaAP2");
208 compv0->fTree->SetAlias("DNorm2", "RC.fV0rec.fDist2/SigmaD2");
210 compv0->fTree->SetAlias("LikeAP","(10^-50+exp(-APNorm2**2/2)+0.5*exp(-APNorm2**2/4)+0.25*exp(-APNorm2**2/8))/1.75");
211 compv0->fTree->SetAlias("LikeD","10^-50+(exp(-DNorm2*2)+0.5*exp(-DNorm2)+0.25*exp(-DNorm2/2))/1.75");
213 compv0->fTree->SetAlias("LikeAP0","10^-50+exp(-APNorm0**2/2)");
214 compv0->fTree->SetAlias("LikeD0","10^-50+exp(-DNorm0*2.0)");
216 compv0->fTree->SetAlias("LikeAP1","10^-50+(exp(-APNorm0**2/2)+0.5*exp(-APNorm0**2/4))/1.5");
217 compv0->fTree->SetAlias("LikeD1","10^-50+(exp(-DNorm0*2.0)+0.3*exp(-DNorm0))/1.3");
219 compv0->fTree->SetAlias("LikeAP3","10^-50+exp(-APNorm2**2/2)");
220 compv0->fTree->SetAlias("LikeD3","10^-50+exp(-DNorm2*2.0)");
223 compv0->fTree->SetAlias("MinCausal","min(RC.fV0rec.fCausality[0],RC.fV0rec.fCausality[1])");
224 compv0->fTree->SetAlias("MeanCausal","0.5*(RC.fV0rec.fCausality[0]+RC.fV0rec.fCausality[1])");
225 compv0->fTree->SetAlias("MaxCausal","max(RC.fV0rec.fCausality[0],RC.fV0rec.fCausality[1])");
226 // compv0->fTree->SetAlias("LCausal","(1.05-(3*(0.8-exp(-MaxCausal))+(0.8-exp(-MinCausal)))/2)**4");
227 compv0->fTree->SetAlias("LCausal","(1.05-(2*(0.8-exp(-max(RC.fV0rec.fCausality[0],RC.fV0rec.fCausality[1])))+2*(0.8-exp(-min(RC.fV0rec.fCausality[0],RC.fV0rec.fCausality[1]))))/2)**4");
228 // compv0->fTree->SetAlias("LCausal","(1.05-(2*(0.8-exp(-max(RC.fV0rec.fCausality[0],RC.fV0rec.fCausality[1])))))**4");
231 compv0->fTree->SetAlias("CLow1","RC.fV0rec.fPointAngle>0.99&&RC.fV0rec.fRr<210&&log(LikeD*LikeAP)>-5.");
232 compv0->fTree->SetAlias("CHigh","CLow1&&log(LikeD*LikeAP*LCausal)>-5.0");
233 compv0->fTree->SetAlias("CHigh4","CLow1&&log(LikeD*LikeAP*LCausal)>-4.0");
234 compv0->fTree->SetAlias("CHigh3","CLow1&&log(LikeD*LikeAP*LCausal)>-3.0");
235 compv0->fTree->SetAlias("CHigh2","CLow1&&log(LikeD*LikeAP*LCausal)>-2.0");
236 compv0->fTree->SetAlias("CHigh1","CLow1&&log(LikeD*LikeAP*LCausal)>-1.0");
238 compv0->fTree->SetAlias("minCB","min(RC.fV0rec.fCausality[0],RC.fV0rec.fCausality[1])<0.5");
242 void MakeCutsAliasesPID(AliESDComparisonDraw * compv0){
244 // Cuts optimized for different types of particle
245 // use PID of daughter particles as additional criteria
247 compv0->fTree->SetAlias("Spid0","RC.fT1.fESDTrack.fTPCr[0]+RC.fT1.fESDTrack.fTPCr[2]+RC.fT1.fESDTrack.fTPCr[3]+RC.fT1.fESDTrack.fTPCr[4]");
248 compv0->fTree->SetAlias("Spid1","RC.fT2.fESDTrack.fTPCr[0]+RC.fT2.fESDTrack.fTPCr[2]+RC.fT2.fESDTrack.fTPCr[3]+RC.fT2.fESDTrack.fTPCr[4]");
250 compv0->fTree->SetAlias("Crecks0_0","RC.fT1.fESDTrack.fTPCr[0]/Spid0<0.9&&RC.fT1.fESDTrack.fTPCr[4]/Spid0<0.8&RC.fT1.fESDTrack.fTPCr[3]/Spid0<0.9&&RC.fT2.fESDTrack.fTPCr[0]/Spid1<0.9&&RC.fT2.fESDTrack.fTPCr[4]/Spid1<0.8&&RC.fT2.fESDTrack.fTPCr[3]/Spid1<0.9");
251 compv0->fTree->SetAlias("Crecks0_1","RC.fV0rec.fNormDCAPrim[0]>4&&RC.fV0rec.fNormDCAPrim[0]>4");
252 compv0->fTree->SetAlias("Crecks0","Crecks0_0&&Crecks0_1&&RC.fV0rec.fRr<25");
255 compv0->fTree->SetAlias("CrecLambda_0","RC.fT1.fESDTrack.fTPCr[4]/Spid0>0.19&&RC.fT2.fESDTrack.fTPCr[2]/Spid0>0.19");
256 compv0->fTree->SetAlias("CrecLambda_1","RC.fT1.fESDTrack.fTPCr[0]/Spid0<0.9&&RC.fT2.fESDTrack.fTPCr[0]/Spid0<0.9");
257 compv0->fTree->SetAlias("CrecLambda","CrecLambda_0&&CrecLambda_1");
259 // GAMMA CONVERSION CUTS
260 compv0->fTree->SetAlias("CrecGamma_0","RC.fT1.fESDTrack.fTPCr[0]/Spid0+RC.fT2.fESDTrack.fTPCr[0]/Spid1>0.4");
261 compv0->fTree->SetAlias("CrecGamma_1","RC.fT1.fESDTrack.fTPCr[4]/Spid0<0.8&&RC.fT2.fESDTrack.fTPCr[4]/Spid1<0.8");
262 compv0->fTree->SetAlias("CrecGamma_2","RC.fT1.fESDTrack.fTPCr[2]/Spid0<0.9&&RC.fT2.fESDTrack.fTPCr[2]/Spid1<0.9");
263 compv0->fTree->SetAlias("CrecGamma","CrecGamma_0&&CrecGamma_1&&CrecGamma_2");
267 //----------------------------------------------------------------------------------------------
268 TH1F * GetInvMass(AliESDComparisonDraw* compv0, TCut cut, Int_t pdg=310, Bool_t all=kFALSE){
270 // return invariant mass histogram
271 // pdg - specify type of particle - (mass window)
272 // all - kTRUE - all particles shown
273 // kFALSE - only particle with given pdg
275 TH1F * himk0 = new TH1F("himk0","himk0",100,0.46,0.54);
277 compv0->fTree->Draw("RC.fV0rec.GetEffMass(2,2)>>himk0",cut);
279 compv0->fTree->Draw("RC.fV0rec.GetEffMass(2,2)>>himk0",cut+cks0);
281 himk0->SetXTitle("Invariant Mass (GeV)");
282 fim.SetParameter(0,0.4975);
283 fim.SetParameter(1,0.003);
284 fim.SetParameter(2,himk0->GetMaximum());
285 fim.SetParameter(3,(himk0->GetBinContent(1)+himk0->GetBinContent(99))*0.5);
286 fim.SetParameter(4,0);
292 TH1F * hlam0 = new TH1F("hlam0","hlam0",100,1.1,1.13);
294 compv0->fTree->Draw("RC.fV0rec.GetEffMass(4,2)>>hlam0",cut);
296 compv0->fTree->Draw("RC.fV0rec.GetEffMass(4,2)>>hlam0",cut+clambda);
298 hlam0->SetXTitle("Invariant Mass (GeV)");
299 fim.SetParameter(0,1.11568);
300 fim.SetParameter(1,0.0011);
301 fim.SetParameter(2,himk0->GetMaximum());
302 fim.SetParameter(3,(himk0->GetBinContent(1)+himk0->GetBinContent(99))*0.5);
303 fim.SetParameter(4,0);
309 TH1F * hgamma = new TH1F("hgamma","hgamma",100,0.0,0.2);
311 compv0->fTree->Draw("RC.fV0rec.GetEffMass(0,0)>>hgamma",cut);
313 compv0->fTree->Draw("RC.fV0rec.GetEffMass(0,0)>>hgamma",cut+cgamma);
315 hgamma->SetXTitle("Invariant Mass (GeV)");
323 TH1F * GetInvMassPtMin(AliESDComparisonDraw* compv0, TCut cut="RC.fRecStatus==1&&CHigh", Int_t pdg=310)
326 // effective mass resolution vs. particle momenta
329 compv0->DrawXY("minpt","1000*(RC.fV0rec.GetEffMass(2,2)-0.49767)",cut,"RC.fRecStatus==1",5,0.2,1,-10,10);
332 compv0->DrawXY("minpt","1000*(RC.fV0rec.GetEffMass(4,2)-1.11568)",cut,"RC.fRecStatus==1",5,0.2,0.5,-10,10);
334 TH1F * his = (TH1F*)compv0->fRes->Clone();
335 his->SetXTitle("Pt(GeV)");
336 his->SetYTitle("Invariant mass sigma (MeV)");
341 TH1F * GetLogLikelihood(AliESDComparisonDraw* compv0, char * var0="LCausal*LikeAP*LikeD",
342 TCut cut="RC.fRecStatus==1&&CHigh", Int_t min=-10)
347 //char *var0 = "LCausal";
348 TH1F * his = new TH1F("loglikelihood","loglikelihood",50,min,0);
350 sprintf(var,"log(%s)>>loglikelihood",var0);
351 compv0->fTree->Draw(var,cut);
352 his->SetXTitle("Logarithm of likelihood");
358 //----------------------------------------------------------------------------------------------
359 TH1F * GetDeltaR(AliESDComparisonDraw* compv0, TCut cut){
361 // resolution of vertex position in radial direction
363 TH1F * hdr = new TH1F("hdr","hdr",100,-0.5,0.5);
364 compv0->fTree->Draw("RC.fV0rec.fRr-MC.fMCR>>hdr",cut);
365 hdr->SetXTitle("Delta r (cm)");
372 //----------------------------------------------------------------------------------------------
373 TH1F* GetResolP2(AliESDComparisonDraw* compv0, TCut cut, Float_t pmin=0.6, Float_t pmax=2.){
377 compv0->DrawXY("MC.fMotherP.P()","100*(MC.fMotherP.P()-Prec)/MC.fMotherP.P()",cut,"RC.fRecStatus==1",5,pmin,pmax,-6,6);
378 TH1F * hdp0 = (TH1F*)compv0->fRes->Clone();
379 compv0->DrawXY("MC.fMotherP.P()","100*(MC.fMotherP.P()-Pits)/MC.fMotherP.P()",cut,"RC.fRecStatus==1",5,pmin,pmax,-6,6);
380 TH1F * hdp1 = (TH1F*)compv0->fRes->Clone();
381 compv0->DrawXY("MC.fMotherP.P()","100*(MC.fMotherP.P()-Ptpc)/MC.fMotherP.P()",cut,"RC.fRecStatus==1",5,pmin,pmax,-6,6);
382 TH1F * hdp2 = (TH1F*)compv0->fRes->Clone();
383 hdp0->SetXTitle("P(GeV)");
384 hdp0->SetYTitle("dP/P(%)");
385 hdp0->SetMarkerStyle(26);
386 hdp1->SetMarkerStyle(27);
387 hdp2->SetMarkerStyle(28);
392 TLegend *legend = new TLegend(0.35,0.15,0.85,0.3, "Momentum resolution");
393 legend->SetBorderSize(1);
394 legend->AddEntry(hdp0,"Combined V0 finder");
395 legend->AddEntry(hdp1,"ESD V0 finder");
396 legend->AddEntry(hdp2,"TPC V0 finder");
402 //----------------------------------------------------------------------------------------------
403 TH1F* GetResolPhi(AliESDComparisonDraw* compv0, TCut cut, Float_t pmin=0.6, Float_t pmax=2.){
406 compv0->DrawXY("MC.fMotherP.P()","1000*(PhiMC-PhiRec)",cut,"RC.fRecStatus==1",5,pmin,pmax,-15,15,20);
407 TH1F * hdp0 = (TH1F*)compv0->fRes->Clone();
408 compv0->DrawXY("MC.fMotherP.P()","1000*(PhiMC-PhiIts)",cut,"RC.fRecStatus==1",5,pmin,pmax,-15,15,20);
409 TH1F * hdp1 = (TH1F*)compv0->fRes->Clone();
410 compv0->DrawXY("MC.fMotherP.P()","1000*(PhiMC-PhiTpc)",cut,"RC.fRecStatus==1",5,pmin,pmax,-15,15,20);
411 TH1F * hdp2 = (TH1F*)compv0->fRes->Clone();
412 hdp0->SetXTitle("P(GeV)");
413 hdp0->SetYTitle("d#varphi(mrad)");
414 hdp0->SetMarkerStyle(26);
415 hdp1->SetMarkerStyle(27);
416 hdp2->SetMarkerStyle(28);
421 TLegend *legend = new TLegend(0.2,0.15,0.55,0.3, "#varphi resolution");
422 legend->SetBorderSize(1);
423 legend->AddEntry(hdp0,"Combined V0 finder");
424 legend->AddEntry(hdp1,"ESD V0 finder");
425 legend->AddEntry(hdp2,"TPC V0 finder");
432 //-----------------------------------------------------------------------------------------------------
433 TH1F * EffR(AliESDComparisonDraw* compv0, TCut cut, Float_t minr=0.8, Float_t maxr=30, Int_t ndiv=10){
435 // make efficiency plots
437 compv0->Eff("MC.fMCR",cut,"RC.fV0Status==3",ndiv,minr,maxr);
438 TH1F * heff0 = (TH1F*)compv0->fRes->Clone();
439 compv0->Eff("MC.fMCR",cut,"RC.fRecStatus==1",ndiv,minr,maxr);
440 TH1F * heff1 = (TH1F*)compv0->fRes->Clone();
441 compv0->Eff("MC.fMCR",cut,"RC.fRecStatus==1&&CLow1",ndiv,minr,maxr);
442 TH1F * heff2 = (TH1F*)compv0->fRes->Clone();
443 compv0->Eff("MC.fMCR",cut,"RC.fRecStatus==1&&CHigh",ndiv,minr,maxr);
444 TH1F * heff3 = (TH1F*)compv0->fRes->Clone();
445 heff0->SetXTitle("Decay radii (cm)");
446 heff0->SetMarkerStyle(25);
447 heff1->SetMarkerStyle(26);
448 heff2->SetMarkerStyle(27);
449 heff3->SetMarkerStyle(28);
450 heff0->Draw(); heff1->Draw("same");heff2->Draw("same");heff3->Draw("same");
451 TLegend *legend = new TLegend(0.2,0.15,0.55,0.3, "Efficiency");
452 legend->SetBorderSize(1);
453 legend->AddEntry(heff0,"Efficiency to find both decay product");
454 legend->AddEntry(heff1,"After rough cuts during tracking");
455 legend->AddEntry(heff2,"After resolution cuts");
456 legend->AddEntry(heff3,"After resolution and causality cuts");
463 //-----------------------------------------------------------------------------------------------------
464 TH1F * EffPt(AliESDComparisonDraw* compv0, TCut cut, Float_t min=0.5, Float_t max=1., Int_t ndiv=10){
466 // make efficiency plots
468 compv0->Eff("MC.fMotherP.Pt()",cut,"RC.fV0Status==3",ndiv,min,max);
469 TH1F * heff0 = (TH1F*)compv0->fRes->Clone();
470 compv0->Eff("MC.fMotherP.Pt()",cut,"RC.fRecStatus==1",ndiv,min,max);
471 TH1F * heff1 = (TH1F*)compv0->fRes->Clone();
472 compv0->Eff("MC.fMotherP.Pt()",cut,"RC.fRecStatus==1&&CLow1",ndiv,min,max);
473 TH1F * heff2 = (TH1F*)compv0->fRes->Clone();
474 compv0->Eff("MC.fMotherP.Pt()",cut,"RC.fRecStatus==1&&CHigh",ndiv,min,max);
475 TH1F * heff3 = (TH1F*)compv0->fRes->Clone();
476 heff0->SetXTitle("Pt(GeV)");
477 heff0->SetMarkerStyle(25);
478 heff1->SetMarkerStyle(26);
479 heff2->SetMarkerStyle(27);
480 heff3->SetMarkerStyle(28);
481 heff0->Draw(); heff1->Draw("same");heff2->Draw("same");heff3->Draw("same");
482 TLegend *legend = new TLegend(0.2,0.15,0.55,0.3, "Efficiency");
483 legend->SetBorderSize(1);
484 legend->AddEntry(heff0,"Efficiency to find both decay product");
485 legend->AddEntry(heff1,"After rough cuts during tracking");
486 legend->AddEntry(heff2,"After resolution cuts");
487 legend->AddEntry(heff3,"After resolution and causality cuts");
494 //-----------------------------------------------------------------------------------------------------
495 TH1F * EffMinPt(AliESDComparisonDraw* compv0, TCut cut, Float_t min=0.5, Float_t max=1., Int_t ndiv=10){
497 // make efficiency plots
499 compv0->Eff("min(MC.fMCm.fParticle.Pt(),MC.fMCd.fParticle.Pt())",cut,"RC.fV0Status==3",ndiv,min,max);
500 TH1F * heff0 = (TH1F*)compv0->fRes->Clone();
501 compv0->Eff("min(MC.fMCm.fParticle.Pt(),MC.fMCd.fParticle.Pt())",cut,"RC.fRecStatus==1",ndiv,min,max);
502 TH1F * heff1 = (TH1F*)compv0->fRes->Clone();
503 compv0->Eff("min(MC.fMCm.fParticle.Pt(),MC.fMCd.fParticle.Pt())",cut,"RC.fRecStatus==1&&CLow1",ndiv,min,max);
504 TH1F * heff2 = (TH1F*)compv0->fRes->Clone();
505 compv0->Eff("min(MC.fMCm.fParticle.Pt(),MC.fMCd.fParticle.Pt())",cut,"RC.fRecStatus==1&&CHigh",ndiv,min,max);
506 TH1F * heff3 = (TH1F*)compv0->fRes->Clone();
507 heff0->SetXTitle("Pt(GeV)");
508 heff0->SetMarkerStyle(25);
509 heff1->SetMarkerStyle(26);
510 heff2->SetMarkerStyle(27);
511 heff3->SetMarkerStyle(28);
512 heff0->Draw(); heff1->Draw("same");heff2->Draw("same");heff3->Draw("same");
513 TLegend *legend = new TLegend(0.2,0.15,0.55,0.3, "Efficiency");
514 legend->SetBorderSize(1);
515 legend->AddEntry(heff0,"Efficiency to find both decay product");
516 legend->AddEntry(heff1,"After rough cuts during tracking");
517 legend->AddEntry(heff2,"After resolution cuts");
518 legend->AddEntry(heff3,"After resolution and causality cuts");
525 TH1F * GetCumulative(AliESDComparisonDraw* compv0, char * var0,TCut cut = "RC.fRecStatus==1", Float_t min=0, Float_t max=30, Int_t ndiv=20)
528 // Make cumulative function
530 TH1F his("his","his",ndiv,min,max);
532 sprintf(var,"%s>>his",var0);
533 compv0->fTree->Draw(var,cut);
534 TH1F *hcumul = new TH1F("hcumul","hcumul",ndiv,min,max);
535 Float_t all = (Float_t)his.GetSum();
537 for (Int_t i=0;i<=ndiv;i++){
538 hcumul->SetBinContent(i,his.Integral(0,i)/all);
541 hcumul->SetFillColor(0);
542 hcumul->SetXTitle("Threshold (unit)");
543 hcumul->SetYTitle("Cumulative function");
548 TH1F * CompareLikeCumulative(AliESDComparisonDraw* compv0,TCut cut = "RC.fRecStatus==1", Float_t min=0, Float_t max=30, Int_t ndiv=20)
553 TH1F * h0 = GetCumulative(compv0,"-log(LikeAP*LikeD*LCausal)",cut,min,max,ndiv);
554 TH1F * h1 = GetCumulative(compv0,"-log(LikeAP1*LikeD1*LCausal)",cut,min,max,ndiv);
555 TH1F * h3 = GetCumulative(compv0,"-log(LikeAP3*LikeD3*LCausal)",cut,min,max,ndiv);
556 h0->SetXTitle("Threshold (unit)");
558 h0->SetLineColor(1); h0->SetLineStyle(1);
559 h1->SetLineColor(2); h1->SetLineStyle(2);
560 h3->SetLineColor(3); h3->SetLineStyle(3);
564 TLegend *legend = new TLegend(0.4,0.12,0.88,0.5, "Cumulative as function of threshold");
565 legend->SetBorderSize(1);
566 legend->AddEntry(h0,"Likelihhod (P0 parameterization) with three components");
567 legend->AddEntry(h1,"Likelihood (P1 parameterization) with one component");
568 legend->AddEntry(h3,"Likelihood (P0 parameterization) with one component");
575 TH1F * CompareLikeCumulative2(AliESDComparisonDraw* compv0,TCut cut = "RC.fRecStatus==1", Float_t min=0, Float_t max=30, Int_t ndiv=20)
580 TH1F * h0 = GetCumulative(compv0,"-log(LikeAP*LikeD*LCausal)",cut,min,max,ndiv);
581 TH1F * h1 = GetCumulative(compv0,"-log(LikeAP1*LikeD1*LCausal)",cut,min,max,ndiv);
582 TH1F * h3 = GetCumulative(compv0,"-log(LikeAP3*LikeD3*LCausal)",cut,min,max,ndiv);
583 TH1F * h4 = GetCumulative(compv0,"-log(RC.fV0rec.GetLikelihoodC(0,0)*RC.fV0rec.GetLikelihoodAP(2,2)*RC.fV0rec.GetLikelihoodD(2,2))",cut,min,max,ndiv);
584 h0->SetXTitle("Threshold (unit)");
586 h0->SetLineColor(1); h0->SetLineStyle(1);
587 h1->SetLineColor(2); h1->SetLineStyle(2);
588 h3->SetLineColor(3); h3->SetLineStyle(3);
589 h4->SetLineColor(4); h4->SetLineStyle(4);
595 TLegend *legend = new TLegend(0.4,0.12,0.88,0.5, "Cumulative as function of threshold");
596 legend->SetBorderSize(1);
597 legend->AddEntry(h0,"Likelihhod (P0 parameterization) with three components");
598 legend->AddEntry(h1,"Likelihood (P1 parameterization) with one component");
599 legend->AddEntry(h3,"Likelihood (P0 parameterization) with one component");
600 legend->AddEntry(h4,"Likelihood default");
608 TH1F * CompareCumulativeSec(AliESDComparisonDraw* compv0, Float_t min=0, Float_t max=30, Int_t ndiv=20)
613 // Float_t min=0; Float_t max=20; Int_t ndiv=1000;
614 TH1F * hks0 = GetCumulative(&compv0,"abs(RC.fT1.fITStrack.fP0/sqrt(RC.fT1.fITStrack.fC00))","RC.fV0Status==3&&MC.fMCR>0.5"+cint+cks0,min,max,ndiv);
615 TH1F * hks1 = GetCumulative(&compv0,"sqrt((RC.fT1.fITStrack.fP0/sqrt(RC.fT1.fITStrack.fC00))**2+((RC.fT1.fITStrack.fP1-MC.fMotherP.fVz)/sqrt(RC.fT1.fITStrack.fC11))**2)","RC.fV0Status==3&&MC.fMCR>0.5"+cint+cks0,min,max,ndiv);
617 TH1F * hlam0 = GetCumulative(&compv0,"abs(RC.fT1.fITStrack.fP0/sqrt(RC.fT1.fITStrack.fC00))","RC.fV0Status==3&&MC.fMCR>0.5"+cint+clam,min,max,ndiv);
618 TH1F * hlam1 = GetCumulative(&compv0,"sqrt((RC.fT1.fITStrack.fP0/sqrt(RC.fT1.fITStrack.fC00))**2+((RC.fT1.fITStrack.fP1-MC.fMotherP.fVz)/sqrt(RC.fT1.fITStrack.fC11))**2)","RC.fV0Status==3&&MC.fMCR>0.5"+cint+clam,min,max,ndiv);
620 TH1F * hgamma0 = GetCumulative(&compv0,"abs(RC.fT1.fITStrack.fP0/sqrt(RC.fT1.fITStrack.fC00))","RC.fV0Status==3&&MC.fMCR>0.5"+cint+cgamma,min,max,ndiv);
621 TH1F * hgamma1 = GetCumulative(&compv0,"sqrt((RC.fT1.fITStrack.fP0/sqrt(RC.fT1.fITStrack.fC00))**2+((RC.fT1.fITStrack.fP1-MC.fMotherP.fVz)/sqrt(RC.fT1.fITStrack.fC11))**2)","RC.fV0Status==3&&MC.fMCR>0.5"+cint+cgamma,min,max,ndiv);
623 hks0->SetXTitle("Threshold (sigma)");
624 hks0->SetYTitle("Cumulative probability");
625 hks0->SetMaximum(0.8);
626 hks0->SetLineColor(1); hks0->SetLineStyle(1); hks0->SetLineWidth(1)
627 hks1->SetLineColor(1); hks1->SetLineStyle(2); hks1->SetLineWidth(2);
628 hlam0->SetLineColor(1); hlam0->SetLineStyle(3); hlam0->SetLineWidth(1);
629 hlam1->SetLineColor(1); hlam1->SetLineStyle(4); hlam1->SetLineWidth(2)
630 hgamma0->SetLineColor(1); hgamma0->SetLineStyle(5); hgamma0->SetLineWidth(1);
631 hgamma1->SetLineColor(1); hgamma1->SetLineStyle(6);hgamma1->SetLineWidth(2);
637 hgamma0->Draw("same");
638 hgamma1->Draw("same");
640 TLegend *legend = new TLegend(0.4,0.12,0.88,0.5, "Cumulative probability");
641 legend->SetBorderSize(1);
642 legend->AddEntry(hks0,"K^{0}_{s} decay - normalized DCA in r#varphi");
643 legend->AddEntry(hks1,"K^{0}_{s} decay - normalized DCA 3D");
644 legend->AddEntry(hlam0,"#Lambda decay - normalized DCA in r#varphi");
645 legend->AddEntry(hlam1,"#Lambda decay - normalized DCA 3D");
646 legend->AddEntry(hgamma0,"#gamma conversion - normalized DCA in r#varphi");
647 legend->AddEntry(hgamma1,"#gamma conversion - normalized DCA 3D");