1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: Boris Polishchuk (Boris.Polishchuk@cern.ch) *
6 * Permission to use, copy, modify and distribute this software and its *
7 * documentation strictly for non-commercial purposes is hereby granted *
8 * without fee, provided that the above copyright notice appears in all *
9 * copies and that both the copyright notice and this permission notice *
10 * appear in the supporting documentation. The authors make no claims *
11 * about the suitability of this software for any purpose. It is *
12 * provided "as is" without express or implied warranty. *
13 **************************************************************************/
15 ////////////////////////////////////////////////////////////////////////////
16 //------------------------------------------------------------------------//
17 // Class used to do omega(782) -> pi0 pi+ pi- analysis. //
18 //------------------------------------------------------------------------//
19 ////////////////////////////////////////////////////////////////////////////
21 #include "AliAnalysisTaskOmegaPi0PiPi.h"
25 #include "AliESDEvent.h"
26 #include "TRefArray.h"
27 #include "TLorentzVector.h"
28 #include "AliESDCaloCluster.h"
30 #include "AliESDtrack.h"
33 #include "AliPHOSGeoUtils.h"
35 ClassImp(AliAnalysisTaskOmegaPi0PiPi)
37 AliAnalysisTaskOmegaPi0PiPi::AliAnalysisTaskOmegaPi0PiPi() :
38 AliAnalysisTaskSE(),fOutputContainer(0x0),fhM2piSel(0x0),fhDxy(0x0),fhMggSel(0x0),
39 fhImpXY(0x0),fhM3pi0to2(0x0),fhM3pi2to4(0x0),fhM3pi4to6(0x0),fhM3pi6to8(0x0),
40 fhM3pi8to10(0x0),fhM3pi10to12(0x0),fhM3pi12(0x0),fhM3pi0to8(0x0),fModules("123")
42 //Default constructor.
46 AliAnalysisTaskOmegaPi0PiPi::AliAnalysisTaskOmegaPi0PiPi(const char* name) :
47 AliAnalysisTaskSE(name),fOutputContainer(0x0),fhM2piSel(0x0),fhDxy(0x0),fhMggSel(0x0),
48 fhImpXY(0x0),fhM3pi0to2(0x0),fhM3pi2to4(0x0),fhM3pi4to6(0x0),fhM3pi6to8(0x0),
49 fhM3pi8to10(0x0),fhM3pi10to12(0x0),fhM3pi12(0x0),fhM3pi0to8(0x0),fModules("123")
51 //Constructor used to create a named task.
53 DefineOutput(1,TList::Class());
57 AliAnalysisTaskOmegaPi0PiPi::~AliAnalysisTaskOmegaPi0PiPi()
62 fOutputContainer->Delete() ;
63 delete fOutputContainer ;
68 void AliAnalysisTaskOmegaPi0PiPi::UserCreateOutputObjects()
70 //Allocates histograms and puts it to the output container.
72 fOutputContainer = new TList();
74 fhM2piSel = new TH1F("hM2pi_sel","V0 inv. mass, Dxy<2cm",100,0.,1.);
75 fOutputContainer->Add(fhM2piSel);
77 fhDxy = new TH1F("hDxy","Distance from V0 to primary vertex in XY-plane", 500, 0.,500.);
78 fOutputContainer->Add(fhDxy);
80 fhMggSel = new TH1F("hMgg_sel","Inv. mass of two clusters, pT>1GeV",100,0.,0.3);
81 fOutputContainer->Add(fhMggSel);
83 fhImpXY = new TH1F("hImpXY","Impact parameters in XY-plane",1000,0.,1.);
84 fOutputContainer->Add(fhImpXY);
87 //M(3pi) vs pT(3pi), ptrack < 2GeV
88 fhM3pi0to2 = new TH2F("hM3pi_0_2","pTrack: 0-2GeV",100,0.,10., 200,0.4,1.);
89 fOutputContainer->Add(fhM3pi0to2);
91 //M(3pi) vs pT(3pi), 2GeV < ptrack < 4GeV
92 fhM3pi2to4 = new TH2F("hM3pi_2_4","pTrack: 2-4GeV",100,0.,10., 200,0.4,1.);
93 fOutputContainer->Add(fhM3pi2to4);
95 //M(3pi) vs pT(3pi), 4GeV < ptrack < 6GeV
96 fhM3pi4to6 = new TH2F("hM3pi_4_6","pTrack: 4-6GeV",100,0.,10., 200,0.4,1.);
97 fOutputContainer->Add(fhM3pi4to6);
99 //M(3pi) vs pT(3pi), 6GeV < ptrack < 8GeV
100 fhM3pi6to8 = new TH2F("hM3pi_6_8","pTrack: 6-8GeV",100,0.,10., 200,0.4,1.);
101 fOutputContainer->Add(fhM3pi6to8);
103 //M(3pi) vs pT(3pi), 8GeV < ptrack < 10GeV
104 fhM3pi8to10 = new TH2F("hM3pi_8_10","pTrack: 8-10GeV",100,0.,10., 200,0.4,1.);
105 fOutputContainer->Add(fhM3pi8to10);
107 //M(3pi) vs pT(3pi), 10GeV < ptrack < 12GeV
108 fhM3pi10to12 = new TH2F("hM3pi_10_12","pTrack: 10-12GeV",100,0.,10., 200,0.4,1.);
109 fOutputContainer->Add(fhM3pi10to12);
111 //M(3pi) vs pT(3pi), ptrack > 12GeV
112 fhM3pi12 = new TH2F("hM3pi_12","pTrack>12GeV",100,0.,10., 200,0.4,1.);
113 fOutputContainer->Add(fhM3pi12);
115 //M(3pi) vs pT(3pi), ptrack < 8GeV
116 fhM3pi0to8 = new TH2F("hM3pi_0_8","pTrack: 0-8GeV",100,0.,10., 200,0.4,1.);
117 fOutputContainer->Add(fhM3pi0to8);
122 void AliAnalysisTaskOmegaPi0PiPi::UserExec(Option_t* /* option */)
124 //Main function that does all the job.
126 AliVEvent* event = InputEvent();
127 AliESDEvent* esd = (AliESDEvent*)event ;
129 Double_t v[3] ; //vertex ;
130 esd->GetVertex()->GetXYZ(v) ;
133 AliDebug(2,Form("Vertex: (%.3f,%.3f,%.3f)\n",vtx.X(),vtx.Y(),vtx.Z()));
135 TRefArray * caloClustersArr = new TRefArray();
136 esd->GetPHOSClusters(caloClustersArr);
138 const Int_t kNumberOfTracks = esd->GetNumberOfTracks();
139 const Int_t kNumberOfV0s = esd->GetNumberOfV0s();
141 AliDebug(2,Form("Tracks: %d. V0s: %d\n",kNumberOfTracks,kNumberOfV0s));
143 Float_t xyImp,zImp,imp1,imp2;
145 const Int_t kNumberOfPhosClusters = caloClustersArr->GetEntries() ;
146 AliDebug(2,Form("CaloClusters: %d\n", kNumberOfPhosClusters));
147 if(kNumberOfPhosClusters<2){
148 delete caloClustersArr;
151 TLorentzVector pc1; //4-momentum of PHOS cluster 1
152 TLorentzVector pc2; //4-momentum of PHOS cluster 2
155 TLorentzVector ppos; //4-momentum of positive track
156 TLorentzVector pneg; //4-momentum of negative track
157 TLorentzVector ptr12;
159 TLorentzVector pomega;
161 Double_t p1,p2; // 3-momentum of tracks
166 Int_t minCells=3; //Ncells>2
167 const Double_t kMpi = 0.1396;
168 AliPHOSGeoUtils* geom = new AliPHOSGeoUtils("IHEP","");
170 for(Int_t iClu=0; iClu<kNumberOfPhosClusters; iClu++) {
171 AliESDCaloCluster *c1 = (AliESDCaloCluster *) caloClustersArr->At(iClu);
172 if(c1->GetNCells()<minCells) continue;
174 absIds = c1->GetCellsAbsId();
175 geom->AbsToRelNumbering(absIds[0], relid) ;
177 phosMod1 += relid[0];
179 if(!fModules.Contains(phosMod1.Data())) continue;
180 c1->GetMomentum(pc1,v);
182 for (Int_t jClu=iClu; jClu<kNumberOfPhosClusters; jClu++) {
183 AliESDCaloCluster *c2 = (AliESDCaloCluster *) caloClustersArr->At(jClu);
184 if(c2->IsEqual(c1)) continue;
185 if(c2->GetNCells()<minCells) continue;
187 absIds = c2->GetCellsAbsId();
188 geom->AbsToRelNumbering(absIds[0], relid) ;
190 phosMod2 += relid[0];
192 if(!fModules.Contains(phosMod2.Data())) continue;
193 c2->GetMomentum(pc2,v);
196 AliDebug(2,Form("pc12.M(): %.3f\n",pc12.M()));
198 if(pc12.M()<0.100 || pc12.M()>0.160) continue; //not a pi0 candidate!
199 if(pc12.Pt()<1.5) continue; //pT(pi0) > 1.5GeV
201 fhMggSel->Fill(pc12.M());
203 for(Int_t iTrack=0; iTrack<kNumberOfTracks; iTrack++) {
204 AliESDtrack* tr1 = esd->GetTrack(iTrack);
206 tr1->GetImpactParameters(xyImp,zImp);
207 imp1 = TMath::Abs(xyImp);
209 Short_t charge = tr1->Charge();
210 if(imp1>0.004) continue; // not from the primary vertex!
212 etrack = TMath::Sqrt(p1*p1 + kMpi*kMpi);
213 ppos.SetPxPyPzE(tr1->Px(),tr1->Py(),tr1->Pz(),etrack);
215 for(Int_t jTrack=iTrack; jTrack<kNumberOfTracks; jTrack++) {
216 AliESDtrack* tr2 = esd->GetTrack(jTrack);
218 if(tr2->Charge()==charge) continue; //same sign track (WRONG!!)
219 tr2->GetImpactParameters(xyImp,zImp);
220 imp2=TMath::Abs(xyImp);
221 if(imp2>0.004) continue; // not from the primary vertex!
223 etrack = TMath::Sqrt(p2*p2 + kMpi*kMpi);
224 pneg.SetPxPyPzE(tr2->Px(),tr2->Py(),tr2->Pz(),etrack);
228 // printf("ptr12.M()=%.3f, xyImp1=%f, xyImp2=%f, ch1=%d, ch2=%d,
229 // p1=%.3f, p2=%.3f, m1=%.3f, m2=%.3f\n",
230 // ptr12.M(),imp1,imp2,tr1->Charge(),tr2->Charge(),
231 // tr1->P(),tr2->P(),tr1->M(),tr2->M());
233 pomega = pc12 + ptr12;
234 AliDebug(2,Form("pomega.M(): %f\n",pomega.M()));
237 fhM3pi0to2->Fill(pomega.Pt(),pomega.M());
239 if( (p1>=2. && p1<4.) && (p2>=2. && p2<4.) )
240 fhM3pi2to4->Fill(pomega.Pt(),pomega.M());
242 if( (p1>=4. && p1<6.) && (p2>=4. && p2<6.) )
243 fhM3pi4to6->Fill(pomega.Pt(),pomega.M());
245 if( (p1>=6. && p1<8.) && (p2>=6. && p2<8.) )
246 fhM3pi6to8->Fill(pomega.Pt(),pomega.M());
248 if( (p1>=8. && p1<10.) && (p2>=8. && p2<10.) )
249 fhM3pi8to10->Fill(pomega.Pt(),pomega.M());
251 if( (p1>=10. && p1<12.) && (p2>=10. && p2<12.) )
252 fhM3pi10to12->Fill(pomega.Pt(),pomega.M());
254 if( (p1>=12.) && (p2>=12.) )
255 fhM3pi12->Fill(pomega.Pt(),pomega.M());
258 fhM3pi0to8->Fill(pomega.Pt(),pomega.M());
263 for(Int_t iVert=0; iVert<kNumberOfV0s; iVert++) {
264 AliESDv0* v0 = esd->GetV0(iVert);
265 AliESDtrack* ptrack = esd->GetTrack(v0->GetPindex()); //positive track
266 AliESDtrack* ntrack = esd->GetTrack(v0->GetNindex()); //negative track
268 etrack = TMath::Sqrt(ptrack->P()*ptrack->P() + kMpi*kMpi);
269 ppos.SetPxPyPzE(ptrack->Px(),ptrack->Py(),ptrack->Pz(),etrack);
271 etrack = TMath::Sqrt(ntrack->P()*ntrack->P() + kMpi*kMpi);
272 pneg.SetPxPyPzE(ntrack->Px(),ntrack->Py(),ntrack->Pz(),etrack);
276 Double_t dx = vtx.X() - v0->Xv();
277 Double_t dy = vtx.Y() - v0->Yv();
278 Double_t dxy = TMath::Sqrt(dx*dx + dy*dy);
281 AliDebug(2,Form("V0: dxy=%.3f\n",dxy));
283 if(dxy<2.) fhM2piSel->Fill(ptr12.M());
289 delete caloClustersArr;
290 PostData(1,fOutputContainer);