]>
Commit | Line | Data |
---|---|---|
1c5acb87 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
1c5acb87 | 15 | |
16 | //_________________________________________________________________________ | |
17 | // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and | |
18 | // Central Barrel Tracking detectors (CTS). | |
ff45398a | 19 | // Not all MC particles/tracks/clusters are kept, some kinematical/fiducial restrictions are done. |
591cc579 | 20 | // Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TObjArrays (PHOS, EMCAL, CTS) |
743aa53a | 21 | // : AliCaloTrackMCReader : Fills Kinematics data in 3 TObjArrays (PHOS, EMCAL, CTS) |
22 | // : AliCaloTrackAODReader: Fills AOD data in 3 TObjArrays (PHOS, EMCAL, CTS) | |
1c5acb87 | 23 | //-- Author: Gustavo Conesa (LNF-INFN) |
24 | ////////////////////////////////////////////////////////////////////////////// | |
25 | ||
26 | ||
27 | // --- ROOT system --- | |
49b53920 | 28 | #include <TFile.h> |
de0b770d | 29 | #include <TGeoManager.h> |
1c5acb87 | 30 | |
c5693f62 | 31 | // ---- ANALYSIS system ---- |
477d6cee | 32 | #include "AliMCEvent.h" |
591cc579 | 33 | #include "AliAODMCHeader.h" |
34 | #include "AliGenPythiaEventHeader.h" | |
48c37e02 | 35 | #include "AliESDEvent.h" |
8dacfd76 | 36 | #include "AliAODEvent.h" |
c8fe2783 | 37 | #include "AliVTrack.h" |
38 | #include "AliVParticle.h" | |
39 | #include "AliMixedEvent.h" | |
0ae57829 | 40 | #include "AliESDtrack.h" |
3a58eee6 | 41 | #include "AliESDtrackCuts.h" |
48c37e02 | 42 | #include "AliTriggerAnalysis.h" |
37285e29 | 43 | #include "AliESDVZERO.h" |
c5693f62 | 44 | #include "AliVCaloCells.h" |
029dea5a | 45 | #include "AliAnalysisManager.h" |
46 | #include "AliInputEventHandler.h" | |
1c5acb87 | 47 | |
c5693f62 | 48 | // ---- Detectors ---- |
49 | #include "AliPHOSGeoUtils.h" | |
50 | #include "AliEMCALGeometry.h" | |
f3138ecf | 51 | #include "AliEMCALRecoUtils.h" |
c5693f62 | 52 | |
0de1814a | 53 | // ---- CaloTrackCorr --- |
c5693f62 | 54 | #include "AliCalorimeterUtils.h" |
cfaba834 | 55 | #include "AliCaloTrackReader.h" |
56 | ||
1c5acb87 | 57 | ClassImp(AliCaloTrackReader) |
58 | ||
59 | ||
836b6989 | 60 | //________________________________________ |
61 | AliCaloTrackReader::AliCaloTrackReader() : | |
62 | TObject(), fEventNumber(-1), //fCurrentFileName(""), | |
63 | fDataType(0), fDebug(0), | |
64 | fFiducialCut(0x0), fCheckFidCut(kFALSE), | |
de0b770d | 65 | fComparePtHardAndJetPt(0), fPtHardAndJetPtFactor(0), |
dbb3de7b | 66 | fComparePtHardAndClusterPt(0),fPtHardAndClusterPtFactor(0), |
836b6989 | 67 | fCTSPtMin(0), fEMCALPtMin(0), fPHOSPtMin(0), |
4b7f6e01 | 68 | fCTSPtMax(0), fEMCALPtMax(0), fPHOSPtMax(0), |
69 | fUseEMCALTimeCut(1), fUseParamTimeCut(0), fUseTrackTimeCut(0), | |
d2655d46 | 70 | fEMCALTimeCutMin(-10000), fEMCALTimeCutMax(10000), |
ff440946 | 71 | fEMCALParamTimeCutMin(), fEMCALParamTimeCutMax(), |
975b29fa | 72 | fTrackTimeCutMin(-10000), fTrackTimeCutMax(10000), |
689d9f15 | 73 | fUseTrackDCACut(0), |
f3138ecf | 74 | fAODBranchList(0x0), |
75 | fCTSTracks(0x0), fEMCALClusters(0x0), fPHOSClusters(0x0), | |
836b6989 | 76 | fEMCALCells(0x0), fPHOSCells(0x0), |
77 | fInputEvent(0x0), fOutputEvent(0x0),fMC(0x0), | |
78 | fFillCTS(0), fFillEMCAL(0), fFillPHOS(0), | |
79 | fFillEMCALCells(0), fFillPHOSCells(0), | |
80 | fRecalculateClusters(kFALSE),fSelectEmbeddedClusters(kFALSE), | |
21812953 | 81 | fTrackStatus(0), fTrackFilterMask(0), |
d7601185 | 82 | fESDtrackCuts(0), fESDtrackComplementaryCuts(0), fConstrainTrack(kFALSE), |
f5500c7a | 83 | fSelectHybridTracks(0), fSelectSPDHitTracks(kFALSE), |
2644ead9 | 84 | fTrackMult(0), fTrackMultEtaCut(0.9), |
836b6989 | 85 | fReadStack(kFALSE), fReadAODMCParticles(kFALSE), |
029dea5a | 86 | fDeltaAODFileName(""), fFiredTriggerClassName(""), |
790dea42 | 87 | fEventTriggerMask(0), fMixEventTriggerMask(0), fEventTriggerAtSE(0), |
029dea5a | 88 | fAnaLED(kFALSE), |
836b6989 | 89 | fTaskName(""), fCaloUtils(0x0), |
de0b770d | 90 | fMixedEvent(NULL), fNMixedEvent(0), fVertex(NULL), |
d783becb | 91 | fListMixedTracksEvents(), fListMixedCaloEvents(), |
92 | fLastMixedTracksEvent(-1), fLastMixedCaloEvent(-1), | |
836b6989 | 93 | fWriteOutputDeltaAOD(kFALSE),fOldAOD(kFALSE), fCaloFilterPatch(kFALSE), |
94 | fEMCALClustersListName(""), fZvtxCut(0.), | |
55d66f31 | 95 | fAcceptFastCluster(kFALSE), fRemoveLEDEvents(kTRUE), |
2644ead9 | 96 | fDoEventSelection(kFALSE), fDoV0ANDEventSelection(kFALSE), |
97 | fDoVertexBCEventSelection(kFALSE), | |
98 | fDoRejectNoTrackEvents(kFALSE), | |
cc944149 | 99 | fUseEventsWithPrimaryVertex(kFALSE), |
034e885b | 100 | fTriggerAnalysis (0x0), fTimeStampEventSelect(0), |
101 | fTimeStampEventFracMin(0), fTimeStampEventFracMax(0), | |
102 | fTimeStampRunMin(0), fTimeStampRunMax(0), | |
3c1a2e95 | 103 | fNPileUpClusters(-1), fNNonPileUpClusters(-1), fNPileUpClustersCut(3), |
cc944149 | 104 | fVertexBC(-200), fRecalculateVertexBC(0), |
105 | fCentralityClass(""), fCentralityOpt(0), | |
de0b770d | 106 | fEventPlaneMethod(""), fImportGeometryFromFile(kFALSE), fImportGeometryFilePath("") |
af7b3903 | 107 | { |
1c5acb87 | 108 | //Ctor |
f3138ecf | 109 | |
1c5acb87 | 110 | //Initialize parameters |
111 | InitParameters(); | |
112 | } | |
1c5acb87 | 113 | |
836b6989 | 114 | //_______________________________________ |
115 | AliCaloTrackReader::~AliCaloTrackReader() | |
116 | { | |
1c5acb87 | 117 | //Dtor |
118 | ||
743aa53a | 119 | delete fFiducialCut ; |
29b2ceec | 120 | |
d2655d46 | 121 | if(fAODBranchList) |
122 | { | |
f37fa8d2 | 123 | fAODBranchList->Delete(); |
124 | delete fAODBranchList ; | |
125 | } | |
126 | ||
d2655d46 | 127 | if(fCTSTracks) |
128 | { | |
be518ab0 | 129 | if(fDataType!=kMC)fCTSTracks->Clear() ; |
130 | else fCTSTracks->Delete() ; | |
131 | delete fCTSTracks ; | |
1c5acb87 | 132 | } |
133 | ||
d2655d46 | 134 | if(fEMCALClusters) |
135 | { | |
be518ab0 | 136 | if(fDataType!=kMC)fEMCALClusters->Clear("C") ; |
137 | else fEMCALClusters->Delete() ; | |
138 | delete fEMCALClusters ; | |
1c5acb87 | 139 | } |
140 | ||
029dea5a | 141 | if(fPHOSClusters) |
142 | { | |
be518ab0 | 143 | if(fDataType!=kMC)fPHOSClusters->Clear("C") ; |
144 | else fPHOSClusters->Delete() ; | |
145 | delete fPHOSClusters ; | |
1c5acb87 | 146 | } |
147 | ||
d2655d46 | 148 | if(fVertex) |
149 | { | |
150 | for (Int_t i = 0; i < fNMixedEvent; i++) | |
151 | { | |
7e25653f | 152 | delete [] fVertex[i] ; |
836b6989 | 153 | |
7e25653f | 154 | } |
155 | delete [] fVertex ; | |
156 | } | |
836b6989 | 157 | |
743aa53a | 158 | delete fESDtrackCuts; |
d7601185 | 159 | delete fESDtrackComplementaryCuts; |
743aa53a | 160 | delete fTriggerAnalysis; |
3a58eee6 | 161 | |
836b6989 | 162 | // Pointers not owned, done by the analysis frame |
163 | // if(fInputEvent) delete fInputEvent ; | |
164 | // if(fOutputEvent) delete fOutputEvent ; | |
165 | // if(fMC) delete fMC ; | |
166 | // Pointer not owned, deleted by maker | |
167 | // if (fCaloUtils) delete fCaloUtils ; | |
168 | ||
c1ac3823 | 169 | } |
477d6cee | 170 | |
cc944149 | 171 | //________________________________________________________________________ |
172 | Bool_t AliCaloTrackReader::AcceptDCA(const Float_t pt, const Float_t dca) | |
173 | { | |
174 | // Accept track if DCA is smaller than function | |
175 | ||
176 | Float_t cut = fTrackDCACut[0]+fTrackDCACut[1]/TMath::Power(pt,fTrackDCACut[2]); | |
177 | ||
178 | if(TMath::Abs(dca) < cut) | |
179 | return kTRUE; | |
180 | else | |
181 | return kFALSE; | |
182 | ||
183 | } | |
184 | ||
836b6989 | 185 | //________________________________________________ |
186 | Bool_t AliCaloTrackReader::ComparePtHardAndJetPt() | |
187 | { | |
dbb3de7b | 188 | // Check the event, if the requested ptHard is much smaller than the jet pT, then there is a problem. |
90995603 | 189 | // Only for PYTHIA. |
a20fbb55 | 190 | |
191 | //printf("AliCaloTrackReader::ComparePtHardAndJetPt() - GenHeaderName : %s\n",GetGenEventHeader()->ClassName()); | |
90995603 | 192 | |
d2655d46 | 193 | if(!strcmp(GetGenEventHeader()->ClassName(), "AliGenPythiaEventHeader")) |
194 | { | |
90995603 | 195 | TParticle * jet = 0; |
196 | AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) GetGenEventHeader(); | |
197 | Int_t nTriggerJets = pygeh->NTriggerJets(); | |
198 | Float_t ptHard = pygeh->GetPtHard(); | |
199 | ||
a20fbb55 | 200 | if(fDebug > 1) |
201 | printf("AliCaloTrackReader::ComparePtHardAndJetPt() - Njets: %d, pT Hard %f\n",nTriggerJets, ptHard); | |
202 | ||
898c9d44 | 203 | Float_t tmpjet[]={0,0,0,0}; |
d2655d46 | 204 | for(Int_t ijet = 0; ijet< nTriggerJets; ijet++) |
205 | { | |
90995603 | 206 | pygeh->TriggerJet(ijet, tmpjet); |
207 | jet = new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0); | |
a20fbb55 | 208 | |
209 | if(fDebug > 1) | |
210 | printf("AliCaloTrackReader::ComparePtHardAndJetPt() - jet %d; pycell jet pT %f\n",ijet, jet->Pt()); | |
211 | ||
90995603 | 212 | //Compare jet pT and pt Hard |
d2655d46 | 213 | if(jet->Pt() > fPtHardAndJetPtFactor * ptHard) |
214 | { | |
a20fbb55 | 215 | printf("AliCaloTrackReader::ComparePtHardAndJetPt() - Reject jet event with : pT Hard %2.2f, pycell jet pT %2.2f, rejection factor %1.1f\n", |
216 | ptHard, jet->Pt(), fPtHardAndJetPtFactor); | |
cfaba834 | 217 | return kFALSE; |
90995603 | 218 | } |
219 | } | |
a20fbb55 | 220 | |
898c9d44 | 221 | if(jet) delete jet; |
90995603 | 222 | } |
223 | ||
224 | return kTRUE ; | |
225 | ||
591cc579 | 226 | } |
227 | ||
dbb3de7b | 228 | //____________________________________________________________________ |
229 | Bool_t AliCaloTrackReader::ComparePtHardAndClusterPt() | |
230 | { | |
231 | // Check the event, if the requested ptHard is smaller than the calorimeter cluster E, then there is a problem. | |
232 | // Only for PYTHIA. | |
233 | ||
234 | if(!strcmp(GetGenEventHeader()->ClassName(), "AliGenPythiaEventHeader")) | |
235 | { | |
236 | AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) GetGenEventHeader(); | |
237 | Float_t ptHard = pygeh->GetPtHard(); | |
238 | ||
239 | Int_t nclusters = fInputEvent->GetNumberOfCaloClusters(); | |
240 | for (Int_t iclus = 0; iclus < nclusters; iclus++) | |
241 | { | |
242 | AliVCluster * clus = fInputEvent->GetCaloCluster(iclus) ; | |
243 | Float_t ecluster = clus->E(); | |
244 | ||
245 | if(ecluster > fPtHardAndClusterPtFactor*ptHard) | |
246 | { | |
247 | printf("AliCaloTrackReader::ComparePtHardAndClusterPt() - Reject : ecluster %2.2f, calo %d, factor %2.2f, ptHard %f\n",ecluster,clus->GetType(),fPtHardAndClusterPtFactor,ptHard); | |
248 | ||
249 | return kFALSE; | |
250 | } | |
251 | } | |
252 | ||
253 | } | |
254 | ||
255 | return kTRUE ; | |
256 | ||
257 | } | |
258 | ||
836b6989 | 259 | //____________________________________________ |
260 | AliStack* AliCaloTrackReader::GetStack() const | |
261 | { | |
1c5acb87 | 262 | //Return pointer to stack |
263 | if(fMC) | |
264 | return fMC->Stack(); | |
d2655d46 | 265 | else |
266 | { | |
477d6cee | 267 | if(fDebug > 1) printf("AliCaloTrackReader::GetStack() - Stack is not available\n"); |
1c5acb87 | 268 | return 0x0 ; |
269 | } | |
270 | } | |
271 | ||
43074325 | 272 | //__________________________________________________ |
273 | TString AliCaloTrackReader::GetFiredTriggerClasses() | |
274 | { | |
275 | // List of triggered classes in a TString | |
276 | ||
277 | AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (GetInputEvent()); | |
278 | AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (GetInputEvent()); | |
279 | ||
280 | if (esdevent) return esdevent->GetFiredTriggerClasses(); | |
281 | else if(aodevent) return aodevent->GetFiredTriggerClasses(); | |
282 | else return ""; // Mixed Event, MC event, does not have this trigger info | |
283 | ||
284 | } | |
285 | ||
836b6989 | 286 | //______________________________________________ |
287 | AliHeader* AliCaloTrackReader::GetHeader() const | |
288 | { | |
1c5acb87 | 289 | //Return pointer to header |
290 | if(fMC) | |
029dea5a | 291 | { |
1c5acb87 | 292 | return fMC->Header(); |
029dea5a | 293 | } |
294 | else | |
295 | { | |
477d6cee | 296 | printf("AliCaloTrackReader::Header is not available\n"); |
1c5acb87 | 297 | return 0x0 ; |
298 | } | |
299 | } | |
836b6989 | 300 | |
301 | //______________________________________________________________ | |
302 | AliGenEventHeader* AliCaloTrackReader::GetGenEventHeader() const | |
303 | { | |
1c5acb87 | 304 | //Return pointer to Generated event header |
f1da7b44 | 305 | if (ReadStack() && fMC) |
029dea5a | 306 | { |
1c5acb87 | 307 | return fMC->GenEventHeader(); |
029dea5a | 308 | } |
f1da7b44 | 309 | else if(ReadAODMCParticles() && GetAODMCHeader()) |
310 | { | |
311 | //printf("AliCaloTrackReader::GetGenEventHeader() - N headers %d\n",GetAODMCHeader()->GetNCocktailHeaders()); | |
312 | if( GetAODMCHeader()->GetNCocktailHeaders() > 0) | |
313 | return GetAODMCHeader()->GetCocktailHeader(0) ; | |
a20fbb55 | 314 | else |
f1da7b44 | 315 | return 0x0; |
316 | } | |
317 | else | |
318 | { | |
ec58c056 | 319 | //printf("AliCaloTrackReader::GetGenEventHeader() - MC header not available! \n"); |
f1da7b44 | 320 | return 0; |
1c5acb87 | 321 | } |
322 | } | |
323 | ||
836b6989 | 324 | //____________________________________________________________________ |
2644ead9 | 325 | TClonesArray* AliCaloTrackReader::GetAODMCParticles() const |
836b6989 | 326 | { |
1e68a3f4 | 327 | //Return list of particles in AOD. Do it for the corresponding input event. |
328 | ||
c8fe2783 | 329 | TClonesArray * rv = NULL ; |
029dea5a | 330 | if(fDataType == kAOD) |
331 | { | |
2644ead9 | 332 | //Normal input AOD |
333 | AliAODEvent * evt = dynamic_cast<AliAODEvent*> (fInputEvent) ; | |
334 | if(evt) | |
335 | rv = (TClonesArray*)evt->FindListObject("mcparticles"); | |
336 | else | |
337 | printf("AliCaloTrackReader::GetAODMCParticles() - Null AOD event \n"); | |
029dea5a | 338 | } |
339 | else | |
340 | { | |
836b6989 | 341 | printf("AliCaloTrackReader::GetAODMCParticles() - Input are not AODs\n"); |
c8fe2783 | 342 | } |
1e68a3f4 | 343 | |
c8fe2783 | 344 | return rv ; |
591cc579 | 345 | } |
346 | ||
a20fbb55 | 347 | //________________________________________________________ |
348 | AliAODMCHeader* AliCaloTrackReader::GetAODMCHeader() const | |
836b6989 | 349 | { |
90995603 | 350 | //Return MC header in AOD. Do it for the corresponding input event. |
d2655d46 | 351 | |
1e68a3f4 | 352 | AliAODMCHeader *mch = NULL; |
d2655d46 | 353 | |
354 | if(fDataType == kAOD) | |
355 | { | |
a20fbb55 | 356 | AliAODEvent * aod = dynamic_cast<AliAODEvent*> (fInputEvent); |
357 | if(aod) mch = dynamic_cast<AliAODMCHeader*>(aod->FindListObject("mcHeader")); | |
90995603 | 358 | } |
d2655d46 | 359 | else |
360 | { | |
90995603 | 361 | printf("AliCaloTrackReader::GetAODMCHeader() - Input are not AODs\n"); |
362 | } | |
1e68a3f4 | 363 | |
364 | return mch; | |
591cc579 | 365 | } |
366 | ||
cc944149 | 367 | //___________________________________________________________ |
368 | Int_t AliCaloTrackReader::GetVertexBC(const AliVVertex * vtx) | |
369 | { | |
370 | // Get the vertex BC | |
371 | ||
372 | Int_t vertexBC=vtx->GetBC(); | |
373 | if(!fRecalculateVertexBC) return vertexBC; | |
374 | ||
375 | // In old AODs BC not stored, recalculate it | |
376 | // loop over the global track and select those which have small DCA to primary vertex (e.g. primary). | |
377 | // If at least one of these primaries has valid BC != 0, then this vertex is a pile-up candidate. | |
378 | // Execute after CTS | |
379 | Double_t bz = fInputEvent->GetMagneticField(); | |
380 | Bool_t bc0 = kFALSE; | |
381 | Int_t ntr = GetCTSTracks()->GetEntriesFast(); | |
382 | //printf("N Tracks %d\n",ntr); | |
383 | ||
384 | for(Int_t i = 0 ; i < ntr ; i++) | |
385 | { | |
386 | AliVTrack * track = (AliVTrack*) (GetCTSTracks()->At(i)); | |
387 | ||
388 | //Check if has TOF info, if not skip | |
389 | ULong_t status = track->GetStatus(); | |
390 | Bool_t okTOF = (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ; | |
391 | vertexBC = track->GetTOFBunchCrossing(bz); | |
392 | Float_t pt = track->Pt(); | |
393 | ||
394 | if(!okTOF) continue; | |
395 | ||
396 | // Get DCA x, y | |
397 | Double_t dca[2] = {1e6,1e6}; | |
398 | Double_t covar[3] = {1e6,1e6,1e6}; | |
399 | track->PropagateToDCA(vtx,bz,100.,dca,covar); | |
400 | ||
401 | if(AcceptDCA(pt,dca[0])) | |
402 | { | |
403 | if (vertexBC !=0 && fVertexBC != AliVTrack::kTOFBCNA) return vertexBC; | |
404 | else if(vertexBC == 0) bc0 = kTRUE; | |
405 | } | |
406 | } | |
407 | ||
408 | if( bc0 ) vertexBC = 0 ; | |
409 | else vertexBC = AliVTrack::kTOFBCNA ; | |
410 | ||
411 | return vertexBC; | |
412 | ||
413 | } | |
414 | ||
836b6989 | 415 | //_____________________________ |
591cc579 | 416 | void AliCaloTrackReader::Init() |
417 | { | |
90995603 | 418 | //Init reader. Method to be called in AliAnaPartCorrMaker |
de0b770d | 419 | |
420 | //printf(" AliCaloTrackReader::Init() %p \n",gGeoManager); | |
421 | ||
55d66f31 | 422 | if(fReadStack && fReadAODMCParticles) |
423 | { | |
90995603 | 424 | printf("AliCaloTrackReader::Init() - Cannot access stack and mcparticles at the same time, change them \n"); |
de0b770d | 425 | fReadStack = kFALSE; |
90995603 | 426 | fReadAODMCParticles = kFALSE; |
427 | } | |
428 | ||
de0b770d | 429 | // Init geometry, I do not like much to do it like this ... |
55d66f31 | 430 | if(fImportGeometryFromFile && !gGeoManager) |
431 | { | |
2d8f2b73 | 432 | if(fImportGeometryFilePath=="") // If not specified, set a default location |
eef481c6 | 433 | fImportGeometryFilePath = "$ALICE_ROOT/OADB/EMCAL/geometry_2011.root"; // "$ALICE_ROOT/EVE/alice-data/default_geo.root" |
2d8f2b73 | 434 | |
55d66f31 | 435 | printf("AliCaloTrackReader::Init() - Import %s\n",fImportGeometryFilePath.Data()); |
436 | TGeoManager::Import(fImportGeometryFilePath) ; // default need file "geometry.root" in local dir!!!! | |
de0b770d | 437 | } |
438 | ||
d7601185 | 439 | if(!fESDtrackCuts) |
440 | fESDtrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); //initialize with TPC only tracks | |
441 | ||
591cc579 | 442 | } |
765d44e7 | 443 | |
836b6989 | 444 | //_______________________________________ |
1c5acb87 | 445 | void AliCaloTrackReader::InitParameters() |
446 | { | |
1c5acb87 | 447 | //Initialize the parameters of the analysis. |
591cc579 | 448 | fDataType = kESD ; |
98ec971d | 449 | fCTSPtMin = 0.1 ; |
450 | fEMCALPtMin = 0.1 ; | |
451 | fPHOSPtMin = 0.1 ; | |
452 | fCTSPtMax = 1000. ; | |
453 | fEMCALPtMax = 1000. ; | |
454 | fPHOSPtMax = 1000. ; | |
455 | ||
689d9f15 | 456 | //Track DCA cuts |
cc944149 | 457 | // dca_xy cut = 0.0105+0.0350/TMath::Power(pt,1.1); |
458 | fTrackDCACut[0] = 0.0105; | |
459 | fTrackDCACut[1] = 0.0350; | |
460 | fTrackDCACut[2] = 1.1; | |
461 | ||
902aa95c | 462 | //Do not filter the detectors input by default. |
463 | fFillEMCAL = kFALSE; | |
464 | fFillPHOS = kFALSE; | |
465 | fFillCTS = kFALSE; | |
1c5acb87 | 466 | fFillEMCALCells = kFALSE; |
591cc579 | 467 | fFillPHOSCells = kFALSE; |
836b6989 | 468 | |
591cc579 | 469 | fReadStack = kFALSE; // Check in the constructor of the other readers if it was set or in the configuration file |
470 | fReadAODMCParticles = kFALSE; // Check in the constructor of the other readers if it was set or in the configuration file | |
42dc8e7d | 471 | fDeltaAODFileName = "deltaAODPartCorr.root"; |
743aa53a | 472 | fFiredTriggerClassName = ""; |
029dea5a | 473 | fEventTriggerMask = AliVEvent::kAny; |
790dea42 | 474 | fMixEventTriggerMask = AliVEvent::kAnyINT; |
029dea5a | 475 | fEventTriggerAtSE = kTRUE; // Use only events that pass event selection at SE base class |
836b6989 | 476 | |
de0b770d | 477 | fAcceptFastCluster = kTRUE; |
478 | fAnaLED = kFALSE; | |
0ae57829 | 479 | |
480 | //We want tracks fitted in the detectors: | |
3a58eee6 | 481 | //fTrackStatus=AliESDtrack::kTPCrefit; |
de0b770d | 482 | //fTrackStatus|=AliESDtrack::kITSrefit; |
483 | fTrackStatus = 0; | |
a5fb4114 | 484 | fTrackFilterMask = 128; //For AODs, but what is the difference between fTrackStatus and fTrackFilterMask? |
3a58eee6 | 485 | |
d7601185 | 486 | fESDtrackCuts = 0; |
487 | fESDtrackComplementaryCuts = 0; | |
836b6989 | 488 | |
a9b8c1d0 | 489 | fConstrainTrack = kFALSE ; // constrain tracks to vertex |
490 | ||
798a9b04 | 491 | fV0ADC[0] = 0; fV0ADC[1] = 0; |
492 | fV0Mul[0] = 0; fV0Mul[1] = 0; | |
836b6989 | 493 | |
0b13c1f9 | 494 | fZvtxCut = 10.; |
495 | ||
de0b770d | 496 | fNMixedEvent = 1; |
497 | ||
dbb3de7b | 498 | fPtHardAndJetPtFactor = 7.; |
499 | fPtHardAndClusterPtFactor = 1.; | |
500 | ||
32fd29fe | 501 | //Centrality |
de0b770d | 502 | fCentralityClass = "V0M"; |
503 | fCentralityOpt = 10; | |
504 | fCentralityBin[0] = fCentralityBin[1]=-1; | |
836b6989 | 505 | |
9929c80b | 506 | fEventPlaneMethod = "V0"; |
de0b770d | 507 | |
f3138ecf | 508 | // Allocate memory (not sure this is the right place) |
509 | fCTSTracks = new TObjArray(); | |
510 | fEMCALClusters = new TObjArray(); | |
511 | fPHOSClusters = new TObjArray(); | |
512 | fTriggerAnalysis = new AliTriggerAnalysis; | |
513 | fAODBranchList = new TList ; | |
514 | ||
de0b770d | 515 | fImportGeometryFromFile = kFALSE; |
f3138ecf | 516 | |
3c1a2e95 | 517 | fPileUpParamSPD[0] = 3 ; fPileUpParamSPD[1] = 0.8 ; |
518 | fPileUpParamSPD[2] = 3.0 ; fPileUpParamSPD[3] = 2.0 ; fPileUpParamSPD[4] = 5.0; | |
4b75cb39 | 519 | |
ff440946 | 520 | // Parametrized time cut (LHC11d) |
521 | fEMCALParamTimeCutMin[0] =-5; fEMCALParamTimeCutMin[1] =-1 ; fEMCALParamTimeCutMin[2] = 3.5 ; fEMCALParamTimeCutMin[3] = 1. ; | |
522 | fEMCALParamTimeCutMax[0] = 5; fEMCALParamTimeCutMax[1] = 50; fEMCALParamTimeCutMax[2] = 0.45; fEMCALParamTimeCutMax[3] = 1.25; | |
523 | ||
524 | // Parametrized time cut (LHC11c) | |
525 | //fEMCALParamTimeCutMin[0] =-5; fEMCALParamTimeCutMin[1] =-1 ; fEMCALParamTimeCutMin[2] = 1.87; fEMCALParamTimeCutMin[3] = 0.4; | |
b8d661af | 526 | //fEMCALParamTimeCutMax[0] = 3.5; fEMCALParamTimeCutMax[1] = 50; fEMCALParamTimeCutMax[2] = 0.15; fEMCALParamTimeCutMax[3] = 1.6; |
527 | ||
528 | fTimeStampRunMin = -1; | |
b370e713 | 529 | fTimeStampRunMax = 1e12; |
b8d661af | 530 | fTimeStampEventFracMin = -1; |
531 | fTimeStampEventFracMax = 2; | |
532 | ||
47454666 | 533 | for(Int_t i = 0; i < 19; i++) |
534 | { | |
535 | fEMCalBCEvent [i] = 0; | |
536 | fEMCalBCEventCut[i] = 0; | |
537 | fTrackBCEvent [i] = 0; | |
538 | fTrackBCEventCut[i] = 0; | |
539 | } | |
540 | ||
4e2b43d8 | 541 | } |
1c5acb87 | 542 | |
3c1a2e95 | 543 | //___________________________________________________________ |
544 | Bool_t AliCaloTrackReader::IsInTimeWindow(const Double_t tof, const Float_t energy) const | |
545 | { | |
546 | // Cluster time selection window | |
547 | ||
548 | // Parametrized cut depending on E | |
549 | if(fUseParamTimeCut) | |
550 | { | |
551 | Float_t minCut= fEMCALParamTimeCutMin[0]+fEMCALParamTimeCutMin[1]*TMath::Exp(-(energy-fEMCALParamTimeCutMin[2])/fEMCALParamTimeCutMin[3]); | |
552 | Float_t maxCut= fEMCALParamTimeCutMax[0]+fEMCALParamTimeCutMax[1]*TMath::Exp(-(energy-fEMCALParamTimeCutMax[2])/fEMCALParamTimeCutMax[3]); | |
553 | //printf("tof %f, minCut %f, maxCut %f\n",tof,minCut,maxCut); | |
554 | if( tof < minCut || tof > maxCut ) return kFALSE ; | |
555 | } | |
556 | ||
557 | //In any case, the time should to be larger than the fixed window ... | |
558 | if( tof < fEMCALTimeCutMin || tof > fEMCALTimeCutMax ) return kFALSE ; | |
559 | ||
560 | return kTRUE ; | |
561 | } | |
64c78c5f | 562 | |
563 | //________________________________________________ | |
564 | Bool_t AliCaloTrackReader::IsPileUpFromSPD() const | |
565 | { | |
566 | // Check if event is from pile-up determined by SPD | |
567 | // Default values: (3, 0.8, 3., 2., 5.) | |
3c1a2e95 | 568 | return fInputEvent->IsPileupFromSPD((Int_t) fPileUpParamSPD[0] , fPileUpParamSPD[1] , |
569 | fPileUpParamSPD[2] , fPileUpParamSPD[3] , fPileUpParamSPD[4] ); | |
570 | //printf("Param : %d, %2.2f, %2.2f, %2.2f, %2.2f\n",(Int_t) fPileUpParamSPD[0], fPileUpParamSPD[1], fPileUpParamSPD[2], fPileUpParamSPD[3], fPileUpParamSPD[4]); | |
571 | ||
572 | } | |
573 | ||
574 | //__________________________________________________ | |
575 | Bool_t AliCaloTrackReader::IsPileUpFromEMCal() const | |
576 | { | |
577 | // Check if event is from pile-up determined by EMCal | |
578 | if(fNPileUpClusters > fNPileUpClustersCut) return kTRUE ; | |
579 | else return kFALSE; | |
580 | } | |
581 | ||
582 | //________________________________________________________ | |
583 | Bool_t AliCaloTrackReader::IsPileUpFromSPDAndEMCal() const | |
584 | { | |
585 | // Check if event is from pile-up determined by SPD and EMCal | |
586 | if( IsPileUpFromSPD() && IsPileUpFromEMCal()) return kTRUE ; | |
587 | else return kFALSE; | |
588 | } | |
099de61e | 589 | |
3c1a2e95 | 590 | //_______________________________________________________ |
591 | Bool_t AliCaloTrackReader::IsPileUpFromSPDOrEMCal() const | |
592 | { | |
593 | // Check if event is from pile-up determined by SPD or EMCal | |
594 | if( IsPileUpFromSPD() || IsPileUpFromEMCal()) return kTRUE ; | |
595 | else return kFALSE; | |
596 | } | |
597 | ||
598 | //___________________________________________________________ | |
599 | Bool_t AliCaloTrackReader::IsPileUpFromSPDAndNotEMCal() const | |
600 | { | |
601 | // Check if event is from pile-up determined by SPD and not by EMCal | |
602 | if( IsPileUpFromSPD() && !IsPileUpFromEMCal()) return kTRUE ; | |
603 | else return kFALSE; | |
604 | } | |
605 | ||
606 | //___________________________________________________________ | |
607 | Bool_t AliCaloTrackReader::IsPileUpFromEMCalAndNotSPD() const | |
608 | { | |
609 | // Check if event is from pile-up determined by EMCal, not by SPD | |
610 | if( !IsPileUpFromSPD() && IsPileUpFromEMCal()) return kTRUE ; | |
611 | else return kFALSE; | |
612 | } | |
613 | ||
614 | //______________________________________________________________ | |
615 | Bool_t AliCaloTrackReader::IsPileUpFromNotSPDAndNotEMCal() const | |
616 | { | |
617 | // Check if event not from pile-up determined neither by SPD nor by EMCal | |
618 | if( !IsPileUpFromSPD() && !IsPileUpFromEMCal()) return kTRUE ; | |
619 | else return kFALSE; | |
64c78c5f | 620 | } |
621 | ||
836b6989 | 622 | //________________________________________________________ |
1c5acb87 | 623 | void AliCaloTrackReader::Print(const Option_t * opt) const |
624 | { | |
836b6989 | 625 | |
1c5acb87 | 626 | //Print some relevant parameters set for the analysis |
627 | if(! opt) | |
628 | return; | |
836b6989 | 629 | |
029dea5a | 630 | printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; |
631 | printf("Task name : %s\n", fTaskName.Data()) ; | |
632 | printf("Data type : %d\n", fDataType) ; | |
1c5acb87 | 633 | printf("CTS Min pT : %2.1f GeV/c\n", fCTSPtMin) ; |
634 | printf("EMCAL Min pT : %2.1f GeV/c\n", fEMCALPtMin) ; | |
635 | printf("PHOS Min pT : %2.1f GeV/c\n", fPHOSPtMin) ; | |
98ec971d | 636 | printf("CTS Max pT : %2.1f GeV/c\n", fCTSPtMax) ; |
637 | printf("EMCAL Max pT : %2.1f GeV/c\n", fEMCALPtMax) ; | |
638 | printf("PHOS Max pT : %2.1f GeV/c\n", fPHOSPtMax) ; | |
d2655d46 | 639 | printf("EMCAL Time Cut: %3.1f < TOF < %3.1f\n", fEMCALTimeCutMin, fEMCALTimeCutMax); |
029dea5a | 640 | printf("Use CTS = %d\n", fFillCTS) ; |
641 | printf("Use EMCAL = %d\n", fFillEMCAL) ; | |
642 | printf("Use PHOS = %d\n", fFillPHOS) ; | |
643 | printf("Use EMCAL Cells = %d\n", fFillEMCALCells) ; | |
644 | printf("Use PHOS Cells = %d\n", fFillPHOSCells) ; | |
591cc579 | 645 | printf("Track status = %d\n", (Int_t) fTrackStatus) ; |
f5500c7a | 646 | printf("AODs Track filter mask = %d or hybrid %d, SPD hit %d\n", (Int_t) fTrackFilterMask,fSelectHybridTracks,fSelectSPDHitTracks) ; |
3a58eee6 | 647 | printf("Track Mult Eta Cut = %d\n", (Int_t) fTrackMultEtaCut) ; |
029dea5a | 648 | printf("Write delta AOD = %d\n", fWriteOutputDeltaAOD) ; |
649 | printf("Recalculate Clusters = %d\n", fRecalculateClusters) ; | |
650 | ||
790dea42 | 651 | printf("Use Triggers selected in SE base class %d; If not what trigger Mask? %d; Trigger max for mixed %d \n", |
652 | fEventTriggerAtSE, fEventTriggerMask,fMixEventTriggerMask); | |
3bfc4732 | 653 | |
dbb3de7b | 654 | if(fComparePtHardAndClusterPt) |
591cc579 | 655 | printf("Compare jet pt and pt hard to accept event, factor = %2.2f",fPtHardAndJetPtFactor); |
836b6989 | 656 | |
dbb3de7b | 657 | if(fComparePtHardAndClusterPt) |
658 | printf("Compare cluster pt and pt hard to accept event, factor = %2.2f",fPtHardAndClusterPtFactor); | |
659 | ||
42dc8e7d | 660 | printf("Read Kine from, stack? %d, AOD ? %d \n", fReadStack, fReadAODMCParticles) ; |
42dc8e7d | 661 | printf("Delta AOD File Name = %s\n", fDeltaAODFileName.Data()) ; |
8a3f4796 | 662 | printf("Centrality: Class %s, Option %d, Bin [%d,%d] \n", fCentralityClass.Data(),fCentralityOpt,fCentralityBin[0], fCentralityBin[1]) ; |
836b6989 | 663 | |
1c5acb87 | 664 | printf(" \n") ; |
32fd29fe | 665 | |
1c5acb87 | 666 | } |
667 | ||
836b6989 | 668 | //_________________________________________________________________________ |
669 | Bool_t AliCaloTrackReader::FillInputEvent(const Int_t iEntry, | |
670 | const char * /*currentFileName*/) | |
671 | { | |
6639984f | 672 | //Fill the event counter and input lists that are needed, called by the analysis maker. |
cc944149 | 673 | |
6639984f | 674 | fEventNumber = iEntry; |
1510eee3 | 675 | //fCurrentFileName = TString(currentFileName); |
55d66f31 | 676 | if(!fInputEvent) |
677 | { | |
f7c2338a | 678 | if(fDebug >= 0) printf("AliCaloTrackReader::FillInputEvent() - Input event not available, skip event analysis\n"); |
be1f5fa4 | 679 | return kFALSE; |
680 | } | |
55d66f31 | 681 | |
72d2488e | 682 | //Select events only fired by a certain trigger configuration if it is provided |
be1f5fa4 | 683 | Int_t eventType = 0; |
684 | if(fInputEvent->GetHeader()) | |
685 | eventType = ((AliVHeader*)fInputEvent->GetHeader())->GetEventType(); | |
836b6989 | 686 | |
55d66f31 | 687 | if (GetFiredTriggerClasses().Contains("FAST") && !GetFiredTriggerClasses().Contains("ALL") && !fAcceptFastCluster) |
688 | { | |
836b6989 | 689 | if(fDebug > 0) printf("AliCaloTrackReader::FillInputEvent - Do not count events from fast cluster, trigger name %s\n",fFiredTriggerClassName.Data()); |
cd2e4ce6 | 690 | return kFALSE; |
691 | } | |
692 | ||
693 | //------------------------------------------------------------------------------------- | |
694 | // Reject event if large clusters with large energy | |
695 | // Use only for LHC11a data for the moment, and if input is clusterizer V1 or V1+unfolding | |
696 | // If clusterzer NxN or V2 it does not help | |
697 | //------------------------------------------------------------------------------------- | |
55d66f31 | 698 | Int_t run = fInputEvent->GetRunNumber(); |
a1897f1e | 699 | if( fRemoveLEDEvents && run > 146857 && run < 146861 ) |
55d66f31 | 700 | { |
f5036bcb | 701 | //printf("Event %d\n",GetEventNumber()); |
cd2e4ce6 | 702 | |
703 | // Count number of cells with energy larger than 0.1 in SM3, cut on this number | |
75153e10 | 704 | Int_t ncellsSM3 = 0; |
55d66f31 | 705 | for(Int_t icell = 0; icell < fInputEvent->GetEMCALCells()->GetNumberOfCells(); icell++) |
706 | { | |
cd2e4ce6 | 707 | Int_t absID = fInputEvent->GetEMCALCells()->GetCellNumber(icell); |
55d66f31 | 708 | Int_t sm = GetCaloUtils()->GetEMCALGeometry()->GetSuperModuleNumber(absID); |
75153e10 | 709 | if(fInputEvent->GetEMCALCells()->GetAmplitude(icell) > 0.1 && sm==3) ncellsSM3++; |
cd2e4ce6 | 710 | } |
711 | ||
712 | Int_t ncellcut = 21; | |
713 | if(fFiredTriggerClassName.Contains("EMC")) ncellcut = 35; | |
714 | ||
a1897f1e | 715 | if(ncellsSM3 >= ncellcut) |
55d66f31 | 716 | { |
a1897f1e | 717 | if(fDebug > 0) printf(" AliCaloTrackReader::FillInputEvent() - reject event with ncells in SM3 %d\n",ncellsSM3); |
cd2e4ce6 | 718 | return kFALSE; |
719 | } | |
720 | }// Remove LED events | |
721 | ||
722 | // Reject pure LED events? | |
55d66f31 | 723 | if( fFiredTriggerClassName !="" && !fAnaLED) |
724 | { | |
f59ee2a0 | 725 | //printf("Event type %d\n",eventType); |
c8fe2783 | 726 | if(eventType!=7) |
727 | return kFALSE; //Only physics event, do not use for simulated events!!! | |
f59ee2a0 | 728 | |
729 | if(fDebug > 0) | |
7ec23b5a | 730 | printf("AliCaloTrackReader::FillInputEvent() - FiredTriggerClass <%s>, selected class <%s>, compare name %d\n", |
836b6989 | 731 | GetFiredTriggerClasses().Data(),fFiredTriggerClassName.Data(), GetFiredTriggerClasses().Contains(fFiredTriggerClassName)); |
f59ee2a0 | 732 | |
7ec23b5a | 733 | if( !GetFiredTriggerClasses().Contains(fFiredTriggerClassName) ) return kFALSE; |
4d8a2fe1 | 734 | else if(fDebug > 0) printf("AliCaloTrackReader::FillInputEvent() - Accepted triggered event\n"); |
72d2488e | 735 | } |
55d66f31 | 736 | else if(fAnaLED) |
737 | { | |
836b6989 | 738 | // kStartOfRun = 1, // START_OF_RUN |
739 | // kEndOfRun = 2, // END_OF_RUN | |
740 | // kStartOfRunFiles = 3, // START_OF_RUN_FILES | |
741 | // kEndOfRunFiles = 4, // END_OF_RUN_FILES | |
742 | // kStartOfBurst = 5, // START_OF_BURST | |
743 | // kEndOfBurst = 6, // END_OF_BURST | |
744 | // kPhysicsEvent = 7, // PHYSICS_EVENT | |
745 | // kCalibrationEvent = 8, // CALIBRATION_EVENT | |
746 | // kFormatError = 9, // EVENT_FORMAT_ERROR | |
747 | // kStartOfData = 10, // START_OF_DATA | |
748 | // kEndOfData = 11, // END_OF_DATA | |
749 | // kSystemSoftwareTriggerEvent = 12, // SYSTEM_SOFTWARE_TRIGGER_EVENT | |
750 | // kDetectorSoftwareTriggerEvent = 13 // DETECTOR_SOFTWARE_TRIGGER_EVENT | |
751 | ||
c1ac3823 | 752 | if(eventType!=7 && fDebug > 1 )printf("AliCaloTrackReader::FillInputEvent() - DO LED, Event Type <%d>, 8 Calibration \n", eventType); |
753 | if(eventType!=8)return kFALSE; | |
754 | } | |
cd2e4ce6 | 755 | |
29b2ceec | 756 | //In case of analysis of events with jets, skip those with jet pt > 5 pt hard |
a20fbb55 | 757 | if(fComparePtHardAndJetPt) |
55d66f31 | 758 | { |
7ec23b5a | 759 | if(!ComparePtHardAndJetPt()) return kFALSE ; |
29b2ceec | 760 | } |
836b6989 | 761 | |
dbb3de7b | 762 | if(fComparePtHardAndClusterPt) |
763 | { | |
764 | if(!ComparePtHardAndClusterPt()) return kFALSE ; | |
765 | } | |
766 | ||
48c37e02 | 767 | //Fill Vertex array |
768 | FillVertexArray(); | |
769 | //Reject events with Z vertex too large, only for SE analysis, if not, cut on the analysis code | |
770 | if(!GetMixedEvent() && TMath::Abs(fVertex[0][2]) > fZvtxCut) return kFALSE; | |
771 | ||
034e885b | 772 | //------------------------------------------------------ |
773 | //Event rejection depending on vertex, pileup, v0and | |
774 | //------------------------------------------------------ | |
775 | if(fDataType==kESD && fTimeStampEventSelect) | |
776 | { | |
777 | AliESDEvent* esd = dynamic_cast<AliESDEvent*> (fInputEvent); | |
47454666 | 778 | if(esd) |
779 | { | |
780 | Int_t timeStamp = esd->GetTimeStamp(); | |
781 | Float_t timeStampFrac = 1.*(timeStamp-fTimeStampRunMin) / (fTimeStampRunMax-fTimeStampRunMin); | |
782 | ||
783 | //printf("stamp0 %d, max0 %d, frac %f\n", timeStamp-fTimeStampRunMin,fTimeStampRunMax-fTimeStampRunMin, timeStampFrac); | |
784 | ||
785 | if(timeStampFrac < fTimeStampEventFracMin || timeStampFrac > fTimeStampEventFracMax) return kFALSE; | |
786 | } | |
034e885b | 787 | //printf("\t accept time stamp\n"); |
788 | } | |
789 | ||
790 | ||
48c37e02 | 791 | //------------------------------------------------------ |
792 | //Event rejection depending on vertex, pileup, v0and | |
793 | //------------------------------------------------------ | |
d2655d46 | 794 | |
795 | if(fUseEventsWithPrimaryVertex) | |
796 | { | |
797 | if( !CheckForPrimaryVertex() ) return kFALSE; | |
798 | if( TMath::Abs(fVertex[0][0] ) < 1.e-6 && | |
799 | TMath::Abs(fVertex[0][1] ) < 1.e-6 && | |
800 | TMath::Abs(fVertex[0][2] ) < 1.e-6 ) return kFALSE; | |
801 | } | |
802 | ||
099de61e | 803 | //printf("Reader : IsPileUp %d, Multi %d\n",IsPileUpFromSPD(),fInputEvent->IsPileupFromSPDInMultBins()); |
804 | ||
55d66f31 | 805 | if(fDoEventSelection) |
806 | { | |
807 | if(!fCaloFilterPatch) | |
808 | { | |
4b75cb39 | 809 | // Do not analyze events with pileup |
64c78c5f | 810 | Bool_t bPileup = IsPileUpFromSPD(); |
4b75cb39 | 811 | //IsPileupFromSPDInMultBins() // method to try |
3c1a2e95 | 812 | //printf("pile-up %d, %d, %2.2f, %2.2f, %2.2f, %2.2f\n",bPileup, (Int_t) fPileUpParamSPD[0], fPileUpParamSPD[1], fPileUpParamSPD[2], fPileUpParamSPD[3], fPileUpParamSPD[4]); |
48c37e02 | 813 | if(bPileup) return kFALSE; |
814 | ||
55d66f31 | 815 | if(fDoV0ANDEventSelection) |
816 | { | |
48c37e02 | 817 | Bool_t bV0AND = kTRUE; |
ad30b142 | 818 | AliESDEvent* esd = dynamic_cast<AliESDEvent*> (fInputEvent); |
819 | if(esd) | |
820 | bV0AND = fTriggerAnalysis->IsOfflineTriggerFired(esd, AliTriggerAnalysis::kV0AND); | |
48c37e02 | 821 | //else bV0AND = //FIXME FOR AODs |
822 | if(!bV0AND) return kFALSE; | |
823 | } | |
48c37e02 | 824 | }//CaloFilter patch |
55d66f31 | 825 | else |
826 | { | |
827 | if(fInputEvent->GetNumberOfCaloClusters() > 0) | |
828 | { | |
48c37e02 | 829 | AliVCluster * calo = fInputEvent->GetCaloCluster(0); |
029dea5a | 830 | if(calo->GetNLabels() == 4) |
831 | { | |
48c37e02 | 832 | Int_t * selection = calo->GetLabels(); |
833 | Bool_t bPileup = selection[0]; | |
834 | if(bPileup) return kFALSE; | |
835 | ||
836 | Bool_t bGoodV = selection[1]; | |
20218aea | 837 | if(fUseEventsWithPrimaryVertex && !bGoodV) return kFALSE; |
48c37e02 | 838 | |
029dea5a | 839 | if(fDoV0ANDEventSelection) |
840 | { | |
48c37e02 | 841 | Bool_t bV0AND = selection[2]; |
842 | if(!bV0AND) return kFALSE; | |
843 | } | |
844 | ||
845 | fTrackMult = selection[3]; | |
846 | if(fTrackMult == 0) return kFALSE; | |
029dea5a | 847 | } |
848 | else | |
849 | { | |
48c37e02 | 850 | //First filtered AODs, track multiplicity stored there. |
851 | fTrackMult = (Int_t) ((AliAODHeader*)fInputEvent->GetHeader())->GetCentrality(); | |
852 | if(fTrackMult == 0) return kFALSE; | |
853 | } | |
854 | }//at least one cluster | |
029dea5a | 855 | else |
856 | { | |
cfaba834 | 857 | //printf("AliCaloTrackReader::FillInputEvent() - No clusters in event\n"); |
48c37e02 | 858 | //Remove events with vertex (0,0,0), bad vertex reconstruction |
20218aea | 859 | if(fUseEventsWithPrimaryVertex && TMath::Abs(fVertex[0][0]) < 1.e-6 && TMath::Abs(fVertex[0][1]) < 1.e-6 && TMath::Abs(fVertex[0][2]) < 1.e-6) return kFALSE; |
48c37e02 | 860 | |
861 | //First filtered AODs, track multiplicity stored there. | |
862 | fTrackMult = (Int_t) ((AliAODHeader*)fInputEvent->GetHeader())->GetCentrality(); | |
863 | if(fTrackMult == 0) return kFALSE; | |
864 | }// no cluster | |
865 | }// CaloFileter patch | |
31864468 | 866 | }// Event selection/AliceSoft/AliRoot/trunk/PWG/CaloTrackCorrBase/AliCaloTrackReader.h |
48c37e02 | 867 | //------------------------------------------------------ |
836b6989 | 868 | |
32fd29fe | 869 | //Check if there is a centrality value, PbPb analysis, and if a centrality bin selection is requested |
870 | //If we need a centrality bin, we select only those events in the corresponding bin. | |
55d66f31 | 871 | if(GetCentrality() && fCentralityBin[0]>=0 && fCentralityBin[1]>=0 && fCentralityOpt==100) |
872 | { | |
32fd29fe | 873 | Int_t cen = GetEventCentrality(); |
874 | if(cen > fCentralityBin[1] || cen < fCentralityBin[0]) return kFALSE; //reject events out of bin. | |
875 | } | |
cc944149 | 876 | |
f8006433 | 877 | //Fill the arrays with cluster/tracks/cells data |
029dea5a | 878 | |
31864468 | 879 | if(!fEventTriggerAtSE) |
029dea5a | 880 | { |
31864468 | 881 | // In case of mixing analysis, accept MB events, not only Trigger |
882 | // Track and cluster arrays filled for MB in order to create the pool in the corresponding analysis | |
883 | // via de method in the base class FillMixedEventPool() | |
884 | ||
029dea5a | 885 | AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager(); |
886 | AliInputEventHandler *inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler()); | |
887 | ||
c6b4facc | 888 | if(!inputHandler) return kFALSE ; // to content coverity |
889 | ||
029dea5a | 890 | UInt_t isTrigger = inputHandler->IsEventSelected() & fEventTriggerMask; |
790dea42 | 891 | UInt_t isMB = inputHandler->IsEventSelected() & fMixEventTriggerMask; |
029dea5a | 892 | |
31864468 | 893 | if(!isTrigger && !isMB) return kFALSE; |
029dea5a | 894 | |
31864468 | 895 | //printf("Selected triggered event : %s\n",GetFiredTriggerClasses().Data()); |
896 | } | |
897 | ||
cc944149 | 898 | // Get the main vertex BC, in case not available |
899 | // it is calculated in FillCTS checking the BC of tracks | |
900 | // with DCA small (if cut applied, if open) | |
901 | fVertexBC=fInputEvent->GetPrimaryVertex()->GetBC(); | |
902 | ||
31864468 | 903 | if(fFillCTS) |
904 | { | |
905 | FillInputCTS(); | |
906 | //Accept events with at least one track | |
2644ead9 | 907 | if(fTrackMult == 0 && fDoRejectNoTrackEvents) return kFALSE ; |
029dea5a | 908 | } |
909 | ||
cc944149 | 910 | if(fDoVertexBCEventSelection) |
911 | { | |
912 | if(fVertexBC!=0 && fVertexBC!=AliVTrack::kTOFBCNA) return kFALSE ; | |
913 | } | |
914 | ||
31864468 | 915 | if(fFillEMCALCells) |
916 | FillInputEMCALCells(); | |
917 | ||
918 | if(fFillPHOSCells) | |
919 | FillInputPHOSCells(); | |
920 | ||
921 | if(fFillEMCAL) | |
922 | FillInputEMCAL(); | |
923 | ||
924 | if(fFillPHOS) | |
925 | FillInputPHOS(); | |
926 | ||
927 | FillInputVZERO(); | |
928 | ||
929 | ||
29b2ceec | 930 | return kTRUE ; |
1c5acb87 | 931 | } |
932 | ||
836b6989 | 933 | //___________________________________ |
934 | void AliCaloTrackReader::ResetLists() | |
935 | { | |
1c5acb87 | 936 | // Reset lists, called by the analysis maker |
836b6989 | 937 | |
6060ed91 | 938 | if(fCTSTracks) fCTSTracks -> Clear(); |
836b6989 | 939 | if(fEMCALClusters) fEMCALClusters -> Clear("C"); |
940 | if(fPHOSClusters) fPHOSClusters -> Clear("C"); | |
941 | ||
798a9b04 | 942 | fV0ADC[0] = 0; fV0ADC[1] = 0; |
943 | fV0Mul[0] = 0; fV0Mul[1] = 0; | |
836b6989 | 944 | |
1c5acb87 | 945 | } |
c8fe2783 | 946 | |
836b6989 | 947 | //____________________________________________________________ |
c8fe2783 | 948 | void AliCaloTrackReader::SetInputEvent(AliVEvent* const input) |
949 | { | |
950 | fInputEvent = input; | |
951 | fMixedEvent = dynamic_cast<AliMixedEvent*>(GetInputEvent()) ; | |
029dea5a | 952 | if (fMixedEvent) |
c8fe2783 | 953 | fNMixedEvent = fMixedEvent->GetNumberOfEvents() ; |
836b6989 | 954 | |
eb310db0 | 955 | //Delete previous vertex |
029dea5a | 956 | if(fVertex) |
957 | { | |
958 | for (Int_t i = 0; i < fNMixedEvent; i++) | |
959 | { | |
eb310db0 | 960 | delete [] fVertex[i] ; |
961 | } | |
962 | delete [] fVertex ; | |
963 | } | |
964 | ||
c8fe2783 | 965 | fVertex = new Double_t*[fNMixedEvent] ; |
029dea5a | 966 | for (Int_t i = 0; i < fNMixedEvent; i++) |
967 | { | |
c8fe2783 | 968 | fVertex[i] = new Double_t[3] ; |
969 | fVertex[i][0] = 0.0 ; | |
970 | fVertex[i][1] = 0.0 ; | |
971 | fVertex[i][2] = 0.0 ; | |
972 | } | |
973 | } | |
974 | ||
32fd29fe | 975 | //__________________________________________________ |
836b6989 | 976 | Int_t AliCaloTrackReader::GetEventCentrality() const |
977 | { | |
32fd29fe | 978 | //Return current event centrality |
979 | ||
029dea5a | 980 | if(GetCentrality()) |
981 | { | |
9929c80b | 982 | if (fCentralityOpt==100) return (Int_t) GetCentrality()->GetCentralityPercentile(fCentralityClass); // 100 bins max |
983 | else if(fCentralityOpt==10) return GetCentrality()->GetCentralityClass10(fCentralityClass);// 10 bins max | |
984 | else if(fCentralityOpt==20) return GetCentrality()->GetCentralityClass5(fCentralityClass); // 20 bins max | |
029dea5a | 985 | else |
986 | { | |
9929c80b | 987 | printf("AliCaloTrackReader::GetEventCentrality() - Unknown centrality option %d, use 10, 20 or 100\n",fCentralityOpt); |
988 | return -1; | |
32fd29fe | 989 | } |
990 | } | |
9929c80b | 991 | else return -1; |
992 | ||
993 | } | |
994 | ||
995 | //_____________________________________________________ | |
996 | Double_t AliCaloTrackReader::GetEventPlaneAngle() const | |
997 | { | |
998 | //Return current event centrality | |
999 | ||
1000 | if(GetEventPlane()) | |
1001 | { | |
1002 | Float_t ep = GetEventPlane()->GetEventplane(GetEventPlaneMethod(), GetInputEvent()); | |
1003 | ||
1004 | if(GetEventPlaneMethod()=="Q" && (ep < 0 || ep > TMath::Pi())) | |
1005 | { | |
b14c2b20 | 1006 | if(fDebug > 0 ) printf("AliCaloTrackReader::GetEventPlaneAngle() - Bad EP for <Q> method : %f\n",ep); |
9929c80b | 1007 | return -1000; |
1008 | } | |
1009 | else if(GetEventPlaneMethod().Contains("V0") ) | |
1010 | { | |
1011 | if((ep > TMath::Pi()/2 || ep < -TMath::Pi()/2)) | |
1012 | { | |
b14c2b20 | 1013 | if(fDebug > 0 ) printf("AliCaloTrackReader::GetEventPlaneAngle() - Bad EP for <%s> method : %f\n",GetEventPlaneMethod().Data(), ep); |
9929c80b | 1014 | return -1000; |
1015 | } | |
1016 | ||
1017 | ep+=TMath::Pi()/2; // put same range as for <Q> method | |
1018 | ||
1019 | } | |
1020 | ||
1021 | //printf("AliCaloTrackReader::GetEventPlaneAngle() = %f\n",ep); | |
b14c2b20 | 1022 | if(fDebug > 0 ) |
1023 | { | |
1024 | if (ep > TMath::Pi()) printf("AliCaloTrackReader::GetEventPlaneAngle() - Too large angle = %f\n",ep); | |
1025 | else if(ep < 0 ) printf("AliCaloTrackReader::GetEventPlaneAngle() - Negative angle = %f\n" ,ep); | |
1026 | } | |
9929c80b | 1027 | |
8fd30003 | 1028 | return ep; |
9929c80b | 1029 | } |
1030 | else | |
1031 | { | |
b14c2b20 | 1032 | if(fDataType!=kMC && fDebug > 0) printf("AliCaloTrackReader::GetEventPlaneAngle() - No EP pointer\n"); |
9929c80b | 1033 | return -1000; |
1034 | } | |
32fd29fe | 1035 | |
1036 | } | |
1037 | ||
836b6989 | 1038 | //__________________________________________________________ |
1039 | void AliCaloTrackReader::GetVertex(Double_t vertex[3]) const | |
1040 | { | |
f8006433 | 1041 | //Return vertex position to be used for single event analysis |
1042 | vertex[0]=fVertex[0][0]; | |
1043 | vertex[1]=fVertex[0][1]; | |
1044 | vertex[2]=fVertex[0][2]; | |
1045 | } | |
1046 | ||
836b6989 | 1047 | //____________________________________________________________ |
1048 | void AliCaloTrackReader::GetVertex(Double_t vertex[3], | |
1049 | const Int_t evtIndex) const | |
1050 | { | |
f8006433 | 1051 | //Return vertex position for mixed event, recover the vertex in a particular event. |
1052 | ||
f8006433 | 1053 | vertex[0]=fVertex[evtIndex][0]; vertex[1]=fVertex[evtIndex][1]; vertex[2]=fVertex[evtIndex][2]; |
1054 | ||
1055 | } | |
f8006433 | 1056 | |
836b6989 | 1057 | //________________________________________ |
1058 | void AliCaloTrackReader::FillVertexArray() | |
1059 | { | |
f8006433 | 1060 | |
1061 | //Fill data member with vertex | |
1062 | //In case of Mixed event, multiple vertices | |
1063 | ||
1064 | //Delete previous vertex | |
d2655d46 | 1065 | if(fVertex) |
1066 | { | |
1067 | for (Int_t i = 0; i < fNMixedEvent; i++) | |
1068 | { | |
f8006433 | 1069 | delete [] fVertex[i] ; |
1070 | } | |
1071 | delete [] fVertex ; | |
1072 | } | |
1073 | ||
1074 | fVertex = new Double_t*[fNMixedEvent] ; | |
d2655d46 | 1075 | for (Int_t i = 0; i < fNMixedEvent; i++) |
1076 | { | |
f8006433 | 1077 | fVertex[i] = new Double_t[3] ; |
1078 | fVertex[i][0] = 0.0 ; | |
1079 | fVertex[i][1] = 0.0 ; | |
1080 | fVertex[i][2] = 0.0 ; | |
1081 | } | |
1082 | ||
d2655d46 | 1083 | if (!fMixedEvent) |
1084 | { //Single event analysis | |
1085 | if(fDataType!=kMC) | |
1086 | { | |
836b6989 | 1087 | |
d2655d46 | 1088 | if(fInputEvent->GetPrimaryVertex()) |
1089 | { | |
79395d30 | 1090 | fInputEvent->GetPrimaryVertex()->GetXYZ(fVertex[0]); |
1091 | } | |
d2655d46 | 1092 | else |
1093 | { | |
79395d30 | 1094 | printf("AliCaloTrackReader::FillVertexArray() - NULL primary vertex\n"); |
1095 | fVertex[0][0]=0.; fVertex[0][1]=0.; fVertex[0][2]=0.; | |
1096 | }//Primary vertex pointer do not exist | |
1097 | ||
d2655d46 | 1098 | } else |
1099 | {//MC read event | |
edffc439 | 1100 | fVertex[0][0]=0.; fVertex[0][1]=0.; fVertex[0][2]=0.; |
1101 | } | |
836b6989 | 1102 | |
f8006433 | 1103 | if(fDebug > 1) |
1104 | printf("AliCaloTrackReader::FillVertexArray() - Single Event Vertex : %f,%f,%f\n",fVertex[0][0],fVertex[0][1],fVertex[0][2]); | |
836b6989 | 1105 | |
d2655d46 | 1106 | } else |
1107 | { // MultiEvent analysis | |
1108 | for (Int_t iev = 0; iev < fNMixedEvent; iev++) | |
1109 | { | |
8e7bdfa9 | 1110 | if (fMixedEvent->GetVertexOfEvent(iev)) |
1111 | fMixedEvent->GetVertexOfEvent(iev)->GetXYZ(fVertex[iev]); | |
d2655d46 | 1112 | else |
1113 | { // no vertex found !!!! | |
8e7bdfa9 | 1114 | AliWarning("No vertex found"); |
1115 | } | |
836b6989 | 1116 | |
f8006433 | 1117 | if(fDebug > 1) |
1118 | printf("AliCaloTrackReader::FillVertexArray() - Multi Event %d Vertex : %f,%f,%f\n",iev,fVertex[iev][0],fVertex[iev][1],fVertex[iev][2]); | |
836b6989 | 1119 | |
f8006433 | 1120 | } |
c8fe2783 | 1121 | } |
f8006433 | 1122 | |
c8fe2783 | 1123 | } |
1124 | ||
836b6989 | 1125 | //_____________________________________ |
1126 | void AliCaloTrackReader::FillInputCTS() | |
1127 | { | |
f37fa8d2 | 1128 | //Return array with Central Tracking System (CTS) tracks |
1129 | ||
1130 | if(fDebug > 2 ) printf("AliCaloTrackReader::FillInputCTS()\n"); | |
1131 | ||
da91abdb | 1132 | Double_t pTrack[3] = {0,0,0}; |
1133 | ||
1134 | Int_t nTracks = fInputEvent->GetNumberOfTracks() ; | |
1135 | fTrackMult = 0; | |
3a58eee6 | 1136 | Int_t nstatus = 0; |
4b7f6e01 | 1137 | Double_t bz = GetInputEvent()->GetMagneticField(); |
1138 | ||
975b29fa | 1139 | for(Int_t i = 0; i < 19; i++) |
1140 | { | |
1141 | fTrackBCEvent [i] = 0; | |
1142 | fTrackBCEventCut[i] = 0; | |
1143 | } | |
d7601185 | 1144 | |
cc944149 | 1145 | Bool_t bc0 = kFALSE; |
1146 | if(fRecalculateVertexBC) fVertexBC=AliVTrack::kTOFBCNA; | |
1147 | ||
975b29fa | 1148 | for (Int_t itrack = 0; itrack < nTracks; itrack++) |
d2655d46 | 1149 | {////////////// track loop |
c8fe2783 | 1150 | AliVTrack * track = (AliVTrack*)fInputEvent->GetTrack(itrack) ; // retrieve track from esd |
836b6989 | 1151 | |
3a58eee6 | 1152 | //Select tracks under certain conditions, TPCrefit, ITSrefit ... check the set bits |
975b29fa | 1153 | ULong_t status = track->GetStatus(); |
1154 | ||
1155 | if (fTrackStatus && !((status & fTrackStatus) == fTrackStatus)) | |
c8fe2783 | 1156 | continue ; |
1157 | ||
3a58eee6 | 1158 | nstatus++; |
1159 | ||
438953f7 | 1160 | Float_t dcaTPC =-999; |
1161 | ||
a9b8c1d0 | 1162 | if (fDataType==kESD) |
a5fb4114 | 1163 | { |
a9b8c1d0 | 1164 | AliESDtrack* esdTrack = dynamic_cast<AliESDtrack*> (track); |
1165 | ||
d7601185 | 1166 | if(esdTrack) |
a9b8c1d0 | 1167 | { |
d7601185 | 1168 | if(fESDtrackCuts->AcceptTrack(esdTrack)) |
1169 | { | |
1170 | track->GetPxPyPz(pTrack) ; | |
a9b8c1d0 | 1171 | |
d7601185 | 1172 | if(fConstrainTrack) |
1173 | { | |
1174 | if(esdTrack->GetConstrainedParam()) | |
1175 | { | |
1176 | const AliExternalTrackParam* constrainParam = esdTrack->GetConstrainedParam(); | |
1177 | esdTrack->Set(constrainParam->GetX(),constrainParam->GetAlpha(),constrainParam->GetParameter(),constrainParam->GetCovariance()); | |
1178 | esdTrack->GetConstrainedPxPyPz(pTrack); | |
1179 | } | |
1180 | else continue; | |
1181 | ||
1182 | } // use constrained tracks | |
1183 | ||
1184 | if(fSelectSPDHitTracks) | |
1185 | {//Not much sense to use with TPC only or Hybrid tracks | |
1186 | if(!esdTrack->HasPointOnITSLayer(0) && !esdTrack->HasPointOnITSLayer(1)) continue ; | |
1187 | } | |
1188 | } | |
1189 | // Complementary track to global : Hybrids (make sure that the previous selection is for Global) | |
1190 | else if(fESDtrackComplementaryCuts && fESDtrackComplementaryCuts->AcceptTrack(esdTrack)) | |
a9b8c1d0 | 1191 | { |
d7601185 | 1192 | // constrain the track |
a9b8c1d0 | 1193 | if(esdTrack->GetConstrainedParam()) |
1194 | { | |
d7601185 | 1195 | esdTrack->Set(esdTrack->GetConstrainedParam()->GetX(),esdTrack->GetConstrainedParam()->GetAlpha(),esdTrack->GetConstrainedParam()->GetParameter(),esdTrack->GetConstrainedParam()->GetCovariance()); |
1196 | ||
1197 | track->GetPxPyPz(pTrack) ; | |
1198 | ||
a9b8c1d0 | 1199 | } |
1200 | else continue; | |
f5500c7a | 1201 | } |
d7601185 | 1202 | else continue; |
a9b8c1d0 | 1203 | } |
da91abdb | 1204 | } // ESD |
a5fb4114 | 1205 | else if(fDataType==kAOD) |
1206 | { | |
743aa53a | 1207 | AliAODTrack *aodtrack = dynamic_cast <AliAODTrack*>(track); |
a9b8c1d0 | 1208 | |
d2655d46 | 1209 | if(aodtrack) |
1210 | { | |
21812953 | 1211 | if(fDebug > 2 ) printf("AliCaloTrackReader::FillInputCTS():AOD track type: %d (primary %d), hybrid? %d \n", |
1212 | aodtrack->GetType(),AliAODTrack::kPrimary, | |
1213 | aodtrack->IsHybridGlobalConstrainedGlobal()); | |
1214 | ||
da91abdb | 1215 | |
1216 | if (fSelectHybridTracks) | |
21812953 | 1217 | { |
da91abdb | 1218 | if (!aodtrack->IsHybridGlobalConstrainedGlobal()) continue ; |
21812953 | 1219 | } |
da91abdb | 1220 | else |
1221 | { | |
1222 | if ( aodtrack->TestFilterBit(fTrackFilterMask)==kFALSE) continue ; | |
1223 | } | |
1224 | ||
f5500c7a | 1225 | if(fSelectSPDHitTracks) |
1226 | {//Not much sense to use with TPC only or Hybrid tracks | |
1227 | if(!aodtrack->HasPointOnITSLayer(0) && !aodtrack->HasPointOnITSLayer(1)) continue ; | |
1228 | } | |
1229 | ||
da91abdb | 1230 | if (aodtrack->GetType()!= AliAODTrack::kPrimary) continue ; |
1231 | ||
1232 | if (fDebug > 2 ) printf("AliCaloTrackReader::FillInputCTS(): \t accepted track! \n"); | |
a9b8c1d0 | 1233 | |
438953f7 | 1234 | //In case of AODs, TPC tracks cannot be propagated back to primary vertex, |
1235 | // info stored here | |
1236 | dcaTPC = aodtrack->DCA(); | |
1237 | ||
a9b8c1d0 | 1238 | track->GetPxPyPz(pTrack) ; |
da91abdb | 1239 | |
1240 | } // aod track exists | |
1241 | else continue ; | |
1242 | ||
1243 | } // AOD | |
3b13c34c | 1244 | |
a9b8c1d0 | 1245 | TLorentzVector momentum(pTrack[0],pTrack[1],pTrack[2],0); |
c8fe2783 | 1246 | |
cc944149 | 1247 | Bool_t okTOF = ( (status & AliVTrack::kTOFout) == AliVTrack::kTOFout ) ; |
1248 | Double_t tof = -1000; | |
4b7f6e01 | 1249 | Int_t trackBC = -1000 ; |
1250 | ||
975b29fa | 1251 | if(okTOF) |
d2655d46 | 1252 | { |
4b7f6e01 | 1253 | trackBC = track->GetTOFBunchCrossing(bz); |
1254 | SetTrackEventBC(trackBC+9); | |
1255 | ||
975b29fa | 1256 | tof = track->GetTOFsignal()*1e-3; |
975b29fa | 1257 | } |
cc944149 | 1258 | |
689d9f15 | 1259 | if(fUseTrackDCACut) |
1260 | { | |
cc944149 | 1261 | //normal way to get the dca, cut on dca_xy |
1262 | if(dcaTPC==-999) | |
689d9f15 | 1263 | { |
1264 | Double_t dca[2] = {1e6,1e6}; | |
1265 | Double_t covar[3] = {1e6,1e6,1e6}; | |
438953f7 | 1266 | Bool_t okDCA = track->PropagateToDCA(fInputEvent->GetPrimaryVertex(),bz,100.,dca,covar); |
1267 | if( okDCA) okDCA = AcceptDCA(momentum.Pt(),dca[0]); | |
1268 | if(!okDCA) | |
1269 | { | |
1270 | //printf("AliCaloTrackReader::FillInputCTS() - Reject track pt %2.2f, dca_xy %2.4f, BC %d\n",momentum.Pt(),dca[0],trackBC); | |
1271 | continue ; | |
1272 | } | |
689d9f15 | 1273 | } |
1274 | }// DCA cuts | |
1275 | ||
cc944149 | 1276 | if(okTOF) |
1277 | { | |
1278 | //SetTrackEventBCcut(bc); | |
1279 | SetTrackEventBCcut(trackBC+9); | |
1280 | ||
1281 | //After selecting tracks with small DCA, pointing to vertex, set vertex BC depeding on tracks BC | |
1282 | if(fRecalculateVertexBC) | |
1283 | { | |
1284 | if (trackBC !=0 && trackBC != AliVTrack::kTOFBCNA) fVertexBC = trackBC; | |
1285 | else if(trackBC == 0) bc0 = kTRUE; | |
1286 | } | |
1287 | ||
1288 | //In any case, the time should to be larger than the fixed window ... | |
1289 | if( fUseTrackTimeCut && (trackBC!=0 || tof < fTrackTimeCutMin || tof > fTrackTimeCutMax) ) | |
1290 | { | |
1291 | //printf("Remove track time %f and bc = %d\n",tof,trackBC); | |
1292 | continue ; | |
1293 | } | |
1294 | //else printf("Accept track time %f and bc = %d\n",tof,trackBC); | |
1295 | ||
1296 | } | |
1297 | ||
2644ead9 | 1298 | //Count the tracks in eta < 0.9 |
1299 | //printf("Eta %f cut %f\n",TMath::Abs(track->Eta()),fTrackMultEtaCut); | |
1300 | if(TMath::Abs(track->Eta())< fTrackMultEtaCut) fTrackMult++; | |
1301 | ||
1302 | if(fCTSPtMin > momentum.Pt() || fCTSPtMax < momentum.Pt()) continue ; | |
1303 | ||
1304 | if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"CTS")) continue; | |
1305 | ||
975b29fa | 1306 | if(fDebug > 2 && momentum.Pt() > 0.1) |
1307 | printf("AliCaloTrackReader::FillInputCTS() - Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", | |
1308 | momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); | |
1309 | ||
1310 | if (fMixedEvent) track->SetID(itrack); | |
1311 | ||
1312 | fCTSTracks->Add(track); | |
1313 | ||
c8fe2783 | 1314 | }// track loop |
1315 | ||
cc944149 | 1316 | if(fVertexBC ==0 || fVertexBC == AliVTrack::kTOFBCNA) |
1317 | { | |
1318 | if( bc0 ) fVertexBC = 0 ; | |
1319 | else fVertexBC = AliVTrack::kTOFBCNA ; | |
1320 | } | |
1321 | ||
975b29fa | 1322 | if(fDebug > 1) |
be518ab0 | 1323 | printf("AliCaloTrackReader::FillInputCTS() - aod entries %d, input tracks %d, pass status %d, multipliticy %d\n", fCTSTracks->GetEntriesFast(), nTracks, nstatus, fTrackMult);//fCTSTracksNormalInputEntries); |
836b6989 | 1324 | |
c8fe2783 | 1325 | } |
1326 | ||
836b6989 | 1327 | //__________________________________________________________________ |
1328 | void AliCaloTrackReader::FillInputEMCALAlgorithm(AliVCluster * clus, | |
1329 | const Int_t iclus) | |
1330 | { | |
c4eec29f | 1331 | //Fill the EMCAL data in the array, do it |
f46af216 | 1332 | |
c4eec29f | 1333 | Int_t vindex = 0 ; |
1334 | if (fMixedEvent) | |
1335 | vindex = fMixedEvent->EventIndexForCaloCluster(iclus); | |
1336 | ||
a38a48f2 | 1337 | //Reject clusters with bad channels, close to borders and exotic; |
a7e5a381 | 1338 | if(!GetCaloUtils()->GetEMCALRecoUtils()->IsGoodCluster(clus,GetCaloUtils()->GetEMCALGeometry(),GetEMCALCells(),fInputEvent->GetBunchCrossNumber())) return; |
48c37e02 | 1339 | |
a5fb4114 | 1340 | //Mask all cells in collumns facing ALICE thick material if requested |
d2655d46 | 1341 | if(GetCaloUtils()->GetNMaskCellColumns()) |
1342 | { | |
a5fb4114 | 1343 | Int_t absId = -1; |
1344 | Int_t iSupMod = -1; | |
1345 | Int_t iphi = -1; | |
1346 | Int_t ieta = -1; | |
1347 | Bool_t shared = kFALSE; | |
1348 | GetCaloUtils()->GetEMCALRecoUtils()->GetMaxEnergyCell(GetCaloUtils()->GetEMCALGeometry(), GetEMCALCells(),clus,absId,iSupMod,ieta,iphi,shared); | |
1349 | if(GetCaloUtils()->MaskFrameCluster(iSupMod, ieta)) return; | |
1350 | } | |
1351 | ||
029dea5a | 1352 | if(fSelectEmbeddedClusters) |
1353 | { | |
1407394b | 1354 | if(clus->GetNLabels()==0 || clus->GetLabel() < 0) return; |
6060ed91 | 1355 | //else printf("Embedded cluster, %d, n label %d label %d \n",iclus,clus->GetNLabels(),clus->GetLabel()); |
1356 | } | |
836b6989 | 1357 | |
b487d080 | 1358 | //Float_t pos[3]; |
1359 | //clus->GetPosition(pos); | |
1360 | //printf("Before Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]); | |
cfaba834 | 1361 | |
d2655d46 | 1362 | if(fRecalculateClusters) |
1363 | { | |
b487d080 | 1364 | //Recalibrate the cluster energy |
d2655d46 | 1365 | if(GetCaloUtils()->IsRecalibrationOn()) |
1366 | { | |
b487d080 | 1367 | Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, GetEMCALCells()); |
9e8998b1 | 1368 | |
b487d080 | 1369 | clus->SetE(energy); |
1370 | //printf("Recalibrated Energy %f\n",clus->E()); | |
9e8998b1 | 1371 | |
b487d080 | 1372 | GetCaloUtils()->RecalculateClusterShowerShapeParameters(GetEMCALCells(),clus); |
1373 | GetCaloUtils()->RecalculateClusterPID(clus); | |
9e8998b1 | 1374 | |
b487d080 | 1375 | } // recalculate E |
1376 | ||
1377 | //Recalculate distance to bad channels, if new list of bad channels provided | |
1378 | GetCaloUtils()->RecalculateClusterDistanceToBadChannel(GetEMCALCells(),clus); | |
1379 | ||
1380 | //Recalculate cluster position | |
d2655d46 | 1381 | if(GetCaloUtils()->IsRecalculationOfClusterPositionOn()) |
1382 | { | |
b487d080 | 1383 | GetCaloUtils()->RecalculateClusterPosition(GetEMCALCells(),clus); |
1384 | //clus->GetPosition(pos); | |
1385 | //printf("After Corrections: e %f, x %f, y %f, z %f\n",clus->E(),pos[0],pos[1],pos[2]); | |
1386 | } | |
c4eec29f | 1387 | |
f46af216 | 1388 | // Recalculate TOF |
d2655d46 | 1389 | if(GetCaloUtils()->GetEMCALRecoUtils()->IsTimeRecalibrationOn()) |
1390 | { | |
f46af216 | 1391 | Double_t tof = clus->GetTOF(); |
1392 | Float_t frac =-1; | |
1393 | Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(fEMCALCells, clus,frac); | |
1394 | ||
d2655d46 | 1395 | if(fDataType==AliCaloTrackReader::kESD) |
1396 | { | |
f46af216 | 1397 | tof = fEMCALCells->GetCellTime(absIdMax); |
1398 | } | |
1399 | ||
1400 | GetCaloUtils()->GetEMCALRecoUtils()->RecalibrateCellTime(absIdMax,fInputEvent->GetBunchCrossNumber(),tof); | |
1401 | ||
1402 | clus->SetTOF(tof); | |
1403 | ||
1404 | }// Time recalibration | |
1405 | } | |
b487d080 | 1406 | |
1407 | //Correct non linearity | |
d2655d46 | 1408 | if(GetCaloUtils()->IsCorrectionOfClusterEnergyOn()) |
1409 | { | |
b487d080 | 1410 | GetCaloUtils()->CorrectClusterEnergy(clus) ; |
1411 | //printf("Linearity Corrected Energy %f\n",clus->E()); | |
1412 | ||
1413 | //In case of MC analysis, to match resolution/calibration in real data | |
1414 | Float_t rdmEnergy = GetCaloUtils()->GetEMCALRecoUtils()->SmearClusterEnergy(clus); | |
1415 | // printf("\t Energy %f, smeared %f\n", clus->E(),rdmEnergy); | |
1416 | clus->SetE(rdmEnergy); | |
c4eec29f | 1417 | } |
b487d080 | 1418 | |
975b29fa | 1419 | Double_t tof = clus->GetTOF()*1e9; |
1420 | ||
1421 | Int_t bc = TMath::Nint(tof/50) + 9; | |
1422 | //printf("tof %2.2f, bc+5=%d\n",tof,bc); | |
1423 | ||
1424 | SetEMCalEventBC(bc); | |
1425 | ||
1426 | if(fEMCALPtMin > clus->E() || fEMCALPtMax < clus->E()) return ; | |
1427 | ||
b487d080 | 1428 | TLorentzVector momentum ; |
1429 | ||
975b29fa | 1430 | clus->GetMomentum(momentum, fVertex[vindex]); |
b487d080 | 1431 | |
ff440946 | 1432 | if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"EMCAL")) return ; |
ca0c58aa | 1433 | |
975b29fa | 1434 | SetEMCalEventBCcut(bc); |
ff440946 | 1435 | |
975b29fa | 1436 | if(!IsInTimeWindow(tof,clus->E())) |
ff440946 | 1437 | { |
3c1a2e95 | 1438 | fNPileUpClusters++ ; |
4b7f6e01 | 1439 | if(fUseEMCALTimeCut) return ; |
ff440946 | 1440 | } |
3c1a2e95 | 1441 | else |
1442 | fNNonPileUpClusters++; | |
975b29fa | 1443 | |
b487d080 | 1444 | if(fDebug > 2 && momentum.E() > 0.1) |
1445 | printf("AliCaloTrackReader::FillInputEMCAL() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", | |
1446 | momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); | |
836b6989 | 1447 | |
b487d080 | 1448 | if (fMixedEvent) |
1449 | clus->SetID(iclus) ; | |
1450 | ||
2644ead9 | 1451 | //Correct MC label for AODs |
1452 | ||
2644ead9 | 1453 | fEMCALClusters->Add(clus); |
1454 | ||
c4eec29f | 1455 | } |
1456 | ||
836b6989 | 1457 | //_______________________________________ |
1458 | void AliCaloTrackReader::FillInputEMCAL() | |
1459 | { | |
f37fa8d2 | 1460 | //Return array with EMCAL clusters in aod format |
c8fe2783 | 1461 | |
f37fa8d2 | 1462 | if(fDebug > 2 ) printf("AliCaloTrackReader::FillInputEMCAL()\n"); |
1463 | ||
3bfc4732 | 1464 | // First recalibrate cells, time or energy |
1465 | // if(GetCaloUtils()->IsRecalibrationOn()) | |
1466 | // GetCaloUtils()->GetEMCALRecoUtils()->RecalibrateCells(GetCaloUtils()->GetEMCALGeometry(), | |
1467 | // GetEMCALCells(), | |
1468 | // fInputEvent->GetBunchCrossNumber()); | |
1469 | ||
3c1a2e95 | 1470 | fNPileUpClusters = 0; // Init counter |
1471 | fNNonPileUpClusters = 0; // Init counter | |
975b29fa | 1472 | for(Int_t i = 0; i < 19; i++) |
1473 | { | |
1474 | fEMCalBCEvent [i] = 0; | |
1475 | fEMCalBCEventCut[i] = 0; | |
1476 | } | |
3c1a2e95 | 1477 | |
f37fa8d2 | 1478 | //Loop to select clusters in fiducial cut and fill container with aodClusters |
029dea5a | 1479 | if(fEMCALClustersListName=="") |
1480 | { | |
c4eec29f | 1481 | Int_t nclusters = fInputEvent->GetNumberOfCaloClusters(); |
d2655d46 | 1482 | for (Int_t iclus = 0; iclus < nclusters; iclus++) |
1483 | { | |
c4eec29f | 1484 | AliVCluster * clus = 0; |
d2655d46 | 1485 | if ( (clus = fInputEvent->GetCaloCluster(iclus)) ) |
1486 | { | |
029dea5a | 1487 | if (IsEMCALCluster(clus)) |
1488 | { | |
c4eec29f | 1489 | FillInputEMCALAlgorithm(clus, iclus); |
1490 | }//EMCAL cluster | |
1491 | }// cluster exists | |
1492 | }// cluster loop | |
385b7abf | 1493 | |
1494 | //Recalculate track matching | |
a38a48f2 | 1495 | GetCaloUtils()->RecalculateClusterTrackMatching(fInputEvent); |
385b7abf | 1496 | |
c4eec29f | 1497 | }//Get the clusters from the input event |
d2655d46 | 1498 | else |
1499 | { | |
a757b40b | 1500 | TClonesArray * clusterList = 0x0; |
7842c845 | 1501 | |
1502 | if (fInputEvent->FindListObject(fEMCALClustersListName)) | |
1503 | { | |
24026a5c | 1504 | clusterList = dynamic_cast<TClonesArray*> (fInputEvent->FindListObject(fEMCALClustersListName)); |
7842c845 | 1505 | } |
1506 | else if(fOutputEvent) | |
24026a5c | 1507 | { |
7842c845 | 1508 | clusterList = dynamic_cast<TClonesArray*> (fOutputEvent->FindListObject(fEMCALClustersListName)); |
1509 | } | |
1510 | ||
d2655d46 | 1511 | if(!clusterList) |
1512 | { | |
1407394b | 1513 | printf("AliCaloTrackReader::FillInputEMCAL() - Wrong name of list with clusters? <%s>\n",fEMCALClustersListName.Data()); |
1514 | return; | |
c4eec29f | 1515 | } |
ca0c58aa | 1516 | |
c4eec29f | 1517 | Int_t nclusters = clusterList->GetEntriesFast(); |
d2655d46 | 1518 | for (Int_t iclus = 0; iclus < nclusters; iclus++) |
1519 | { | |
c4eec29f | 1520 | AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus)); |
1521 | //printf("E %f\n",clus->E()); | |
e615d952 | 1522 | if (clus) FillInputEMCALAlgorithm(clus, iclus); |
1523 | else printf("AliCaloTrackReader::FillInputEMCAL() - Null cluster in list!\n"); | |
c4eec29f | 1524 | }// cluster loop |
385b7abf | 1525 | |
24026a5c | 1526 | // Recalculate the pile-up time, in case long time clusters removed during clusterization |
1527 | //printf("Input event INIT : Pile-up clusters %d, NO pile-up %d\n",fNPileUpClusters,fNNonPileUpClusters); | |
1528 | ||
1529 | fNPileUpClusters = 0; // Init counter | |
1530 | fNNonPileUpClusters = 0; // Init counter | |
975b29fa | 1531 | for(Int_t i = 0; i < 19; i++) |
1532 | { | |
1533 | fEMCalBCEvent [i] = 0; | |
1534 | fEMCalBCEventCut[i] = 0; | |
1535 | } | |
24026a5c | 1536 | |
1537 | for (Int_t iclus = 0; iclus < fInputEvent->GetNumberOfCaloClusters(); iclus++) | |
1538 | { | |
1539 | AliVCluster * clus = 0; | |
1540 | ||
1541 | if ( (clus = fInputEvent->GetCaloCluster(iclus)) ) | |
1542 | { | |
1543 | if (IsEMCALCluster(clus)) | |
1544 | { | |
1545 | ||
24026a5c | 1546 | Float_t frac =-1; |
1547 | Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(fEMCALCells, clus,frac); | |
1548 | Double_t tof = clus->GetTOF(); | |
1549 | GetCaloUtils()->GetEMCALRecoUtils()->RecalibrateCellTime(absIdMax,fInputEvent->GetBunchCrossNumber(),tof); | |
1550 | tof*=1e9; | |
1551 | ||
1552 | //printf("Input event cluster : AbsIdMax %d, E %2.2f, time %2.2f \n", absIdMax,clus->E(),tof); | |
1553 | ||
1554 | //Reject clusters with bad channels, close to borders and exotic; | |
1555 | if(!GetCaloUtils()->GetEMCALRecoUtils()->IsGoodCluster(clus,GetCaloUtils()->GetEMCALGeometry(),GetEMCALCells(),fInputEvent->GetBunchCrossNumber())) continue; | |
1556 | ||
975b29fa | 1557 | Int_t bc = TMath::Nint(tof/50) + 9; |
1558 | SetEMCalEventBC(bc); | |
1559 | ||
1560 | if(fEMCALPtMin > clus->E() || fEMCALPtMax < clus->E()) continue ; | |
1561 | ||
1562 | TLorentzVector momentum ; | |
1563 | ||
1564 | clus->GetMomentum(momentum, fVertex[0]); | |
1565 | ||
1566 | if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"EMCAL")) return ; | |
1567 | ||
1568 | SetEMCalEventBCcut(bc); | |
1569 | ||
24026a5c | 1570 | if(!IsInTimeWindow(tof,clus->E())) |
24026a5c | 1571 | fNPileUpClusters++ ; |
24026a5c | 1572 | else |
1573 | fNNonPileUpClusters++; | |
975b29fa | 1574 | |
24026a5c | 1575 | } |
1576 | } | |
1577 | } | |
1578 | ||
1579 | //printf("Input event : Pile-up clusters %d, NO pile-up %d\n",fNPileUpClusters,fNNonPileUpClusters); | |
1580 | ||
cb5780f4 | 1581 | // Recalculate track matching, not necessary if already done in the reclusterization task. |
1582 | // in case it was not done ... | |
1583 | GetCaloUtils()->RecalculateClusterTrackMatching(fInputEvent,clusterList); | |
385b7abf | 1584 | |
c4eec29f | 1585 | } |
3c1a2e95 | 1586 | |
1587 | if(fDebug > 1) printf("AliCaloTrackReader::FillInputEMCAL() - aod entries %d, n pile-up clusters %d, n non pile-up %d \n", fEMCALClusters->GetEntriesFast(),fNPileUpClusters,fNNonPileUpClusters); | |
c8fe2783 | 1588 | |
c8fe2783 | 1589 | } |
1590 | ||
836b6989 | 1591 | //______________________________________ |
1592 | void AliCaloTrackReader::FillInputPHOS() | |
1593 | { | |
f37fa8d2 | 1594 | //Return array with PHOS clusters in aod format |
c8fe2783 | 1595 | |
f37fa8d2 | 1596 | if(fDebug > 2 ) printf("AliCaloTrackReader::FillInputPHOS()\n"); |
b487d080 | 1597 | |
f37fa8d2 | 1598 | //Loop to select clusters in fiducial cut and fill container with aodClusters |
c8fe2783 | 1599 | Int_t nclusters = fInputEvent->GetNumberOfCaloClusters(); |
d2655d46 | 1600 | for (Int_t iclus = 0; iclus < nclusters; iclus++) |
1601 | { | |
c8fe2783 | 1602 | AliVCluster * clus = 0; |
d2655d46 | 1603 | if ( (clus = fInputEvent->GetCaloCluster(iclus)) ) |
1604 | { | |
029dea5a | 1605 | if (IsPHOSCluster(clus)) |
1606 | { | |
f37fa8d2 | 1607 | //Check if the cluster contains any bad channel and if close to calorimeter borders |
c8fe2783 | 1608 | Int_t vindex = 0 ; |
1609 | if (fMixedEvent) | |
1610 | vindex = fMixedEvent->EventIndexForCaloCluster(iclus); | |
1611 | if( GetCaloUtils()->ClusterContainsBadChannel("PHOS",clus->GetCellsAbsId(), clus->GetNCells())) | |
1612 | continue; | |
1613 | if(!GetCaloUtils()->CheckCellFiducialRegion(clus, fInputEvent->GetPHOSCells(), fInputEvent, vindex)) | |
1614 | continue; | |
836b6989 | 1615 | |
d2655d46 | 1616 | if(fRecalculateClusters) |
1617 | { | |
b487d080 | 1618 | //Recalibrate the cluster energy |
d2655d46 | 1619 | if(GetCaloUtils()->IsRecalibrationOn()) |
1620 | { | |
b487d080 | 1621 | Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, (AliAODCaloCells*)GetPHOSCells()); |
1622 | clus->SetE(energy); | |
1623 | } | |
b487d080 | 1624 | } |
c8fe2783 | 1625 | |
1626 | TLorentzVector momentum ; | |
1627 | ||
1628 | clus->GetMomentum(momentum, fVertex[vindex]); | |
1629 | ||
ca0c58aa | 1630 | if(fCheckFidCut && !fFiducialCut->IsInFiducialCut(momentum,"PHOS")) continue; |
1631 | ||
1632 | if(fPHOSPtMin > momentum.E() || fPHOSPtMax < momentum.E()) continue; | |
b487d080 | 1633 | |
1634 | if(fDebug > 2 && momentum.E() > 0.1) | |
1635 | printf("AliCaloTrackReader::FillInputPHOS() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", | |
1636 | momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); | |
1637 | ||
b487d080 | 1638 | |
d2655d46 | 1639 | if (fMixedEvent) |
1640 | { | |
b487d080 | 1641 | clus->SetID(iclus) ; |
1642 | } | |
1643 | ||
1644 | fPHOSClusters->Add(clus); | |
1645 | ||
c8fe2783 | 1646 | }//PHOS cluster |
1647 | }//cluster exists | |
1648 | }//esd cluster loop | |
1649 | ||
b487d080 | 1650 | if(fDebug > 1) printf("AliCaloTrackReader::FillInputPHOS() - aod entries %d\n", fPHOSClusters->GetEntriesFast()); |
1651 | ||
c8fe2783 | 1652 | } |
1653 | ||
836b6989 | 1654 | //____________________________________________ |
1655 | void AliCaloTrackReader::FillInputEMCALCells() | |
1656 | { | |
743aa53a | 1657 | //Return array with EMCAL cells in aod format |
c8fe2783 | 1658 | |
1659 | fEMCALCells = fInputEvent->GetEMCALCells(); | |
1660 | ||
1661 | } | |
1662 | ||
836b6989 | 1663 | //___________________________________________ |
1664 | void AliCaloTrackReader::FillInputPHOSCells() | |
1665 | { | |
743aa53a | 1666 | //Return array with PHOS cells in aod format |
c8fe2783 | 1667 | |
1668 | fPHOSCells = fInputEvent->GetPHOSCells(); | |
1669 | ||
1670 | } | |
1671 | ||
836b6989 | 1672 | //_______________________________________ |
1673 | void AliCaloTrackReader::FillInputVZERO() | |
1674 | { | |
be518ab0 | 1675 | //Fill VZERO information in data member, add all the channels information. |
1676 | AliVVZERO* v0 = fInputEvent->GetVZEROData(); | |
1677 | //printf("Init V0: ADC (%d,%d), Multiplicity (%d,%d) \n",fV0ADC[0],fV0ADC[1],fV0Mul[0],fV0Mul[1]); | |
1678 | ||
1679 | if (v0) | |
1680 | { | |
1681 | AliESDVZERO* esdV0 = dynamic_cast<AliESDVZERO*> (v0); | |
1682 | for (Int_t i = 0; i < 32; i++) | |
1683 | { | |
029dea5a | 1684 | if(esdV0) |
1685 | {//Only available in ESDs | |
be518ab0 | 1686 | fV0ADC[0] += (Int_t)esdV0->GetAdcV0C(i); |
1687 | fV0ADC[1] += (Int_t)esdV0->GetAdcV0A(i); | |
1688 | } | |
029dea5a | 1689 | |
be518ab0 | 1690 | fV0Mul[0] += (Int_t)v0->GetMultiplicityV0C(i); |
1691 | fV0Mul[1] += (Int_t)v0->GetMultiplicityV0A(i); | |
1692 | } | |
1693 | if(fDebug > 0) | |
1694 | printf("V0: ADC (%d,%d), Multiplicity (%d,%d) \n",fV0ADC[0],fV0ADC[1],fV0Mul[0],fV0Mul[1]); | |
1695 | } | |
1696 | else | |
1697 | { | |
713a258b | 1698 | if(fDebug > 0) |
1699 | printf("Cannot retrieve V0 ESD! Run w/ null V0 charges\n "); | |
be518ab0 | 1700 | } |
1701 | } | |
1702 | ||
798a9b04 | 1703 | |
c5693f62 | 1704 | //___________________________________________________________________ |
1705 | Bool_t AliCaloTrackReader::IsEMCALCluster(AliVCluster* cluster) const | |
1706 | { | |
f37fa8d2 | 1707 | // Check if it is a cluster from EMCAL. For old AODs cluster type has |
1708 | // different number and need to patch here | |
836b6989 | 1709 | |
f37fa8d2 | 1710 | if(fDataType==kAOD && fOldAOD) |
1711 | { | |
1712 | if (cluster->GetType() == 2) return kTRUE; | |
1713 | else return kFALSE; | |
1714 | } | |
1715 | else | |
1716 | { | |
1717 | return cluster->IsEMCAL(); | |
1718 | } | |
836b6989 | 1719 | |
f37fa8d2 | 1720 | } |
1721 | ||
c5693f62 | 1722 | //___________________________________________________________________ |
1723 | Bool_t AliCaloTrackReader::IsPHOSCluster(AliVCluster * cluster) const | |
1724 | { | |
f37fa8d2 | 1725 | //Check if it is a cluster from PHOS.For old AODs cluster type has |
1726 | // different number and need to patch here | |
1727 | ||
1728 | if(fDataType==kAOD && fOldAOD) | |
1729 | { | |
1730 | Int_t type = cluster->GetType(); | |
1731 | if (type == 0 || type == 1) return kTRUE; | |
1732 | else return kFALSE; | |
1733 | } | |
1734 | else | |
1735 | { | |
1736 | return cluster->IsPHOS(); | |
1737 | } | |
1738 | ||
1739 | } | |
1740 | ||
c5693f62 | 1741 | //________________________________________________ |
1742 | Bool_t AliCaloTrackReader::CheckForPrimaryVertex() | |
1743 | { | |
48c37e02 | 1744 | //Check if the vertex was well reconstructed, copy from V0Reader of conversion group |
1745 | //Only for ESDs ... | |
ad30b142 | 1746 | |
48c37e02 | 1747 | AliESDEvent * event = dynamic_cast<AliESDEvent*> (fInputEvent); |
20218aea | 1748 | if(!event) return kTRUE; |
ad30b142 | 1749 | |
d2655d46 | 1750 | if(event->GetPrimaryVertexTracks()->GetNContributors() > 0) |
1751 | { | |
ad30b142 | 1752 | return kTRUE; |
1753 | } | |
1754 | ||
d2655d46 | 1755 | if(event->GetPrimaryVertexTracks()->GetNContributors() < 1) |
1756 | { | |
ad30b142 | 1757 | // SPD vertex |
d2655d46 | 1758 | if(event->GetPrimaryVertexSPD()->GetNContributors() > 0) |
1759 | { | |
ad30b142 | 1760 | //cout<<"spd vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl; |
48c37e02 | 1761 | return kTRUE; |
ad30b142 | 1762 | |
48c37e02 | 1763 | } |
d7601185 | 1764 | if(event->GetPrimaryVertexSPD()->GetNContributors() < 1) |
d2655d46 | 1765 | { |
ad30b142 | 1766 | // cout<<"bad vertex type::"<< event->GetPrimaryVertex()->GetName() << endl; |
1767 | return kFALSE; | |
48c37e02 | 1768 | } |
48c37e02 | 1769 | } |
1770 | ||
ad30b142 | 1771 | return kFALSE; |
48c37e02 | 1772 | |
1773 | } | |
1774 | ||
c5693f62 | 1775 | //____________________________________________________________ |
1776 | void AliCaloTrackReader::SetTrackCuts(AliESDtrackCuts * cuts) | |
1777 | { | |
1778 | // Set Track cuts | |
1779 | ||
1780 | if(fESDtrackCuts) delete fESDtrackCuts ; | |
1781 | ||
1782 | fESDtrackCuts = cuts ; | |
836b6989 | 1783 | |
c5693f62 | 1784 | } |
48c37e02 | 1785 | |
d7601185 | 1786 | //_________________________________________________________________________ |
1787 | void AliCaloTrackReader::SetTrackComplementaryCuts(AliESDtrackCuts * cuts) | |
1788 | { | |
1789 | // Set Track cuts for complementary tracks (hybrids) | |
1790 | ||
1791 | if(fESDtrackComplementaryCuts) delete fESDtrackComplementaryCuts ; | |
1792 | ||
1793 | fESDtrackComplementaryCuts = cuts ; | |
1794 | ||
1795 | } | |
1796 | ||
1797 |