1 /*************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 // ---------------------------------------------------
17 // ESD event level cuts for azimuthal isotropic
18 // expansion in highly central collisions analysis
19 // author: Cristian Andrei
20 // acristian@niham.nipne.ro
21 // --------------------------------------------------
24 #include <TObjArray.h>
27 #include "AliESDEvent.h"
28 #include "AliESDtrack.h"
29 #include "AliESDtrackCuts.h"
30 #include "AliMultiplicity.h"
32 #include "AliAnalysisCentralCutESD.h"
33 #include "AliAnalysisCentralCutEvtESD.h"
38 //____________________________________________________________________
39 ClassImp(AliAnalysisCentralCutEvtESD)
41 //____________________________________________________________________
42 AliAnalysisCentralCutEvtESD::AliAnalysisCentralCutEvtESD(const Char_t* name, const Char_t* title)
43 :AliAnalysisCuts(name,title)
59 for(Int_t i=0; i<10; i++){
65 Printf("ERROR: fCutsList not available");
71 AliAnalysisCentralCutEvtESD::~AliAnalysisCentralCutEvtESD() {
81 Bool_t AliAnalysisCentralCutEvtESD::IsSelected(TObject *obj, TObject * /* obj2 */){
82 // check whether the event passes the cuts
83 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent *>(obj);
85 printf("AliAnalysisCentralCutEvtESD:IsSelected ->Can't get ESD event!\n");
90 Int_t mult = CalcMult(esdEvent);
91 if((mult<fMultMin)||(mult>fMultMax)){
97 Double_t dir = CalcDir(esdEvent);
98 if((dir<fDirMin)||(dir>fDirMax)){
104 Double_t spdMult = CalcSPDMult(esdEvent);
105 if((spdMult<fSPDMultMin)||(spdMult>fSPDMultMax)){
111 Double_t spdDir = CalcSPDDir(esdEvent);
112 if((spdDir<fSPDDirMin)||(spdDir>fSPDDirMax)){
120 //_________________________________________________________________________
121 void AliAnalysisCentralCutEvtESD::InitCuts(){
122 //Initialize internal cuts
124 //////////////// FULL ALICE ///////////////////
125 //------------General ESD Cuts------------------
126 AliESDtrackCuts *esdCutsGen = new AliESDtrackCuts("AliESDtrackCuts", "CutEvtESDInternal");
127 esdCutsGen->SetMinNClustersTPC(50);
128 esdCutsGen->SetMaxChi2PerClusterTPC(2.2);
129 esdCutsGen->SetMaxCovDiagonalElements(0.5,0.5,0.5,0.5,0.5);
130 esdCutsGen->SetRequireTPCRefit(kTRUE);
131 esdCutsGen->SetAcceptKinkDaughters(kFALSE);
132 esdCutsGen->SetMaxNsigmaToVertex(2.0);
133 esdCutsGen->SetRequireSigmaToVertex(kTRUE);
135 AliAnalysisCentralCutESD *esdCutsGen1 = new AliAnalysisCentralCutESD("AliAnalysisCentralCutESD","NIHAM");
136 esdCutsGen1->SetReqIsCharged();
138 //-------------Specific ESD Cuts------------------
139 AliESDtrackCuts *esdCutsMult = new AliESDtrackCuts("AliESDCutsMult", "midrapidity");
140 esdCutsMult->SetEtaRange(-0.5,0.5);
141 AliESDtrackCuts *esdCutsDir = new AliESDtrackCuts("AliESDCutsDir", "SPD coverage");
142 esdCutsDir->SetEtaRange(0.0,1.9);
144 /////////////////// SPD ONLY ////////////////////
145 AliESDtrackCuts *esdCutsSPD = new AliESDtrackCuts("AliESDtrackCuts", "CutEvtESDInternal");
146 esdCutsSPD->SetAcceptKinkDaughters(kFALSE);
147 esdCutsSPD->SetMaxNsigmaToVertex(2.0);
148 esdCutsSPD->SetRequireSigmaToVertex(kTRUE);
150 //--------------set the cuts ----------------------
151 TObjArray* esdListMult = new TObjArray();
152 esdListMult->AddLast(esdCutsGen);
153 esdListMult->AddLast(esdCutsGen1);
154 esdListMult->AddLast(esdCutsMult);
156 TObjArray* esdListDir = new TObjArray();
157 esdListDir->AddLast(esdCutsGen);
158 esdListDir->AddLast(esdCutsGen1);
159 esdListDir->AddLast(esdCutsDir);
161 TObjArray* esdListSPD = new TObjArray();
162 esdListSPD->AddLast(esdCutsSPD);
164 fCutsList[0]=esdListDir;
165 fCutsList[1]=esdListMult;
166 fCutsList[2]=esdListSPD;
171 //__________________________________________________________________________
172 Bool_t AliAnalysisCentralCutEvtESD::CheckIntCuts(Int_t no, TObject *obj) const{
173 // Check if the particle passes the internal cuts
176 printf("\n AliAnalysisCentralCutEvtESD::CheckIntCuts -> Cut number is not ok! \n");
181 printf("AliAnalysisCentralCutEvtESD::CheckIntCuts -> cuts list problem! \n");
186 TObjArrayIter iter(fCutsList[no]);
187 AliAnalysisCuts *cut = 0;
190 while((cut = (AliAnalysisCuts*)iter.Next())){
192 if(!cut->IsSelected(obj)) return kFALSE;
199 //__________________________________________________________________________
200 Double_t AliAnalysisCentralCutEvtESD::CalcDir(AliESDEvent* const esdEv) {
202 //Compute the directivity - FULL ALICE
213 printf("NULL tree\n");
217 Int_t totTracks=esdEv->GetNumberOfTracks();
219 for(Int_t itrack = 0; itrack < totTracks; itrack++){//first loop->compute event directivity
221 AliESDtrack* track = esdEv->GetTrack(itrack);
224 Printf("ERROR: Could not receive track %d", itrack);
228 if(!CheckIntCuts(0, track)) continue;
234 sumaPx = sumaPx + px;
235 sumaPy = sumaPy + py;
237 sumaPt = sumaPt + pt;
242 if(sumaPt < 0.0000001){
246 dir = (sqrt(pow(sumaPx,2)+pow(sumaPy,2)))/sumaPt;
251 //__________________________________________________________________________
252 Int_t AliAnalysisCentralCutEvtESD::CalcMult(AliESDEvent* const esdEv) {
254 //Compute multiplicity - FULL ALICE
259 printf("NULL tree\n");
263 Int_t totTracks=esdEv->GetNumberOfTracks();
265 for(Int_t iTrack = 0; iTrack < totTracks; iTrack++){//second track loop -> compute event multiplicity
267 AliESDtrack* track = esdEv->GetTrack(iTrack);
270 Printf("ERROR: Could not receive track %d", iTrack);
274 if(!CheckIntCuts(1, track)) continue;
277 charged++; //multiplicity
279 }//end second track loop
286 //__________________________________________________________________________
287 Double_t AliAnalysisCentralCutEvtESD::CalcSPDDir(AliESDEvent* const esdEv) {
289 //Compute directivity - SPD ONLY
293 Double_t sumaPxU = 0;
294 Double_t sumaPyU = 0;
296 Double_t goodtrack = 0;
297 Double_t spdEta = 0.;
299 const AliMultiplicity *spdMult=esdEv->GetMultiplicity();
301 printf("Unable to get multiplicity! \n");
305 Int_t spdTracks = spdMult->GetNumberOfTracklets(); //SPD multiplicity
307 for(Int_t iTrack = 0; iTrack< spdTracks; iTrack++){ //SPD track loop -> Directivity
309 AliESDtrack* track = esdEv->GetTrack(iTrack);
312 Printf("ERROR: Could not receive track %d", iTrack);
316 if(!CheckIntCuts(2, track)) continue;
318 spdEta = spdMult->GetEta(iTrack);
320 if((spdEta<0.0)||(spdEta>1.9)) continue;
322 Double_t phi = spdMult->GetPhi(iTrack);
324 pxU = TMath::Cos(phi);
325 pyU = TMath::Sin(phi);
327 sumaPxU = sumaPxU + pxU;
328 sumaPyU = sumaPyU + pyU;
332 }//end SPD track loop
334 if(goodtrack < 1.) return -1;
336 dirU = (sqrt(pow(sumaPxU,2)+pow(sumaPyU,2)))/goodtrack;
341 //__________________________________________________________________________
343 Int_t AliAnalysisCentralCutEvtESD::CalcSPDMult(AliESDEvent* const esdEv) {
345 //Compute multiplicity - SPD ONLY
347 const AliMultiplicity *spdMult=esdEv->GetMultiplicity();
349 printf("Unable to get multiplicity! \n");
353 Int_t spdTracks = spdMult->GetNumberOfTracklets(); //SPD multiplicity
358 for(Int_t iTrack = 0; iTrack< spdTracks; iTrack++){ //second SPD track loop -> Multiplicity
360 AliESDtrack* track = esdEv->GetTrack(iTrack);
363 Printf("ERROR: Could not receive track %d", iTrack);
367 if(!CheckIntCuts(2, track)) continue;
369 spdEta = spdMult->GetEta(iTrack);
371 if((spdEta<-0.5)||(spdEta>0.5)) continue;
375 }//end second SPD track loop