AliRoot Core  3dc7879 (3dc7879)
AliAnalysisTaskESDfilter.cxx
Go to the documentation of this file.
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  **************************************************************************/
15 
16 #include <Riostream.h>
17 #include <TChain.h>
18 #include <TTree.h>
19 #include <TList.h>
20 #include <TArrayI.h>
21 #include <TParameter.h>
22 #include <TRandom.h>
23 #include <TParticle.h>
24 #include <TFile.h>
25 #include <TVector3.h>
26 
28 #include "AliAnalysisManager.h"
29 #include "AliESDEvent.h"
30 #include "AliESDRun.h"
31 #include "AliStack.h"
32 #include "AliAODEvent.h"
33 #include "AliMCEvent.h"
34 #include "AliMCEventHandler.h"
35 #include "AliESDInputHandler.h"
36 #include "AliAODHandler.h"
37 #include "AliAODMCParticle.h"
38 #include "AliAnalysisFilter.h"
39 #include "AliESDMuonTrack.h"
40 #include "AliESDVertex.h"
41 #include "AliCentrality.h"
42 #include "AliEventplane.h"
43 #include "AliESDv0.h"
44 #include "AliESDkink.h"
45 #include "AliESDcascade.h"
46 #include "AliESDPmdTrack.h"
47 #include "AliESDCaloCluster.h"
48 #include "AliESDCaloCells.h"
49 #include "AliMultiplicity.h"
50 #include "AliLog.h"
51 #include "AliCodeTimer.h"
52 #include "AliESDtrackCuts.h"
53 #include "AliESDpid.h"
54 #include "AliAODHMPIDrings.h"
55 #include "AliV0vertexer.h"
56 #include "AliCascadeVertexer.h"
57 #include "AliExternalTrackParam.h"
58 #include "AliTrackerBase.h"
59 #include "AliTPCdEdxInfo.h"
60 
61 #include "AliESDTrdTrack.h"
62 #include "AliESDTrdTracklet.h"
63 #include "AliAODTrdTrack.h"
64 #include "AliAODTrdTracklet.h"
65 #include "AliEMCALRecoUtilsBase.h"
66 #include "AliESDUtils.h"
67 
68 using std::cout;
69 using std::endl;
71 
74  fTrackFilter(0x0),
75  fKinkFilter(0x0),
76  fV0Filter(0x0),
77  fCascadeFilter(0x0),
78  fHighPthreshold(0),
79  fPtshape(0x0),
80  fEnableFillAOD(kTRUE),
81  fUsedTrack(0x0),
82  fUsedTrackCopy(0x0),
83  fUsedKink(0x0),
84  fUsedV0(0x0),
85  fAODTrackRefs(0x0),
86  fAODV0VtxRefs(0x0),
87  fAODV0Refs(0x0),
88  fMChandler(0x0),
89  fNumberOfTracks(0),
90  fNumberOfPositiveTracks(0),
91  fNumberOfV0s(0),
92  fNumberOfVertices(0),
93  fNumberOfCascades(0),
94  fNumberOfKinks(0),
95  fOldESDformat(kFALSE),
96  fPrimaryVertex(0x0),
97  fTPCConstrainedFilterMask(0),
98  fHybridFilterMaskTPCCG(0),
99  fWriteHybridTPCCOnly(kFALSE),
100  fGlobalConstrainedFilterMask(0),
101  fHybridFilterMaskGCG(0),
102  fWriteHybridGCOnly(kFALSE),
103  fIsVZEROEnabled(kTRUE),
104  fIsTZEROEnabled(kTRUE),
105  fIsZDCEnabled(kTRUE),
106  fIsADEnabled(kTRUE),
107  fIsHMPIDEnabled(kTRUE),
108  fIsV0CascadeRecoEnabled(kFALSE),
109  fAreCascadesEnabled(kTRUE),
110  fAreV0sEnabled(kTRUE),
111  fAreKinksEnabled(kTRUE),
112  fAreTracksEnabled(kTRUE),
113  fArePmdClustersEnabled(kTRUE),
114  fAreCaloClustersEnabled(kTRUE),
115  fAreEMCALCellsEnabled(kTRUE),
116  fArePHOSCellsEnabled(kTRUE),
117  fAreEMCALTriggerEnabled(kTRUE),
118  fArePHOSTriggerEnabled(kTRUE),
119  fAreTrackletsEnabled(kTRUE),
120  fIsTRDEnabled(kTRUE),
121  fESDpid(0x0),
122  fIsPidOwner(kFALSE),
123  fTPCaloneTrackCuts(0),
124  fDoPropagateTrackToEMCal(kTRUE),
125  fEMCalSurfaceDistance(440),
126  fRefitVertexTracks(-1),
127  fRefitVertexTracksNCuts(0),
128  fRefitVertexTracksCuts(0),
129  fIsMuonCaloPass(kFALSE),
130  fAddPCMv0s(kFALSE),
131  fbitfieldPCMv0sA(NULL),
132  fbitfieldPCMv0sB(NULL),
133  fv0Histos(NULL),
134  fHistov0List(NULL)
135 {
136  // Default constructor
137  fV0Cuts[0] = 33. ; // max allowed chi2
138  fV0Cuts[1] = 0.1 ; // min allowed impact parameter for the 1st daughter
139  fV0Cuts[2] = 0.1 ; // min allowed impact parameter for the 2nd daughter
140  fV0Cuts[3] = 1. ; // max allowed DCA between the daughter tracks
141  fV0Cuts[4] = .998; // min allowed cosine of V0's pointing angle
142  fV0Cuts[5] = 0.9 ; // min radius of the fiducial volume
143  fV0Cuts[6] = 100. ; // max radius of the fiducial volume
144 
145  fCascadeCuts[0] = 33. ; // max allowed chi2 (same as PDC07)
146  fCascadeCuts[1] = 0.05 ; // min allowed V0 impact parameter
147  fCascadeCuts[2] = 0.008; // "window" around the Lambda mass
148  fCascadeCuts[3] = 0.03 ; // min allowed bachelor's impact parameter
149  fCascadeCuts[4] = 0.3 ; // max allowed DCA between the V0 and the bachelor
150  fCascadeCuts[5] = 0.999; // min allowed cosine of the cascade pointing angle
151  fCascadeCuts[6] = 0.9 ; // min radius of the fiducial volume
152  fCascadeCuts[7] = 100. ; // max radius of the fiducial volume
153 }
154 
155 //______________________________________________________________________________
156 AliAnalysisTaskESDfilter::AliAnalysisTaskESDfilter(const char* name, Bool_t addPCMv0s):
157  AliAnalysisTaskSE(name),
158  fTrackFilter(0x0),
159  fKinkFilter(0x0),
160  fV0Filter(0x0),
161  fCascadeFilter(0x0),
162  fHighPthreshold(0),
163  fPtshape(0x0),
164  fEnableFillAOD(kTRUE),
165  fUsedTrack(0x0),
166  fUsedTrackCopy(0x0),
167  fUsedKink(0x0),
168  fUsedV0(0x0),
169  fAODTrackRefs(0x0),
170  fAODV0VtxRefs(0x0),
171  fAODV0Refs(0x0),
172  fMChandler(0x0),
173  fNumberOfTracks(0),
174  fNumberOfPositiveTracks(0),
175  fNumberOfV0s(0),
176  fNumberOfVertices(0),
177  fNumberOfCascades(0),
178  fNumberOfKinks(0),
179  fOldESDformat(kFALSE),
180  fPrimaryVertex(0x0),
181  fTPCConstrainedFilterMask(0),
182  fHybridFilterMaskTPCCG(0),
183  fWriteHybridTPCCOnly(kFALSE),
184  fGlobalConstrainedFilterMask(0),
185  fHybridFilterMaskGCG(0),
186  fWriteHybridGCOnly(kFALSE),
187  fIsVZEROEnabled(kTRUE),
188  fIsTZEROEnabled(kTRUE),
189  fIsZDCEnabled(kTRUE),
190  fIsADEnabled(kTRUE),
191  fIsHMPIDEnabled(kTRUE),
192  fIsV0CascadeRecoEnabled(kFALSE),
193  fAreCascadesEnabled(kTRUE),
194  fAreV0sEnabled(kTRUE),
195  fAreKinksEnabled(kTRUE),
196  fAreTracksEnabled(kTRUE),
197  fArePmdClustersEnabled(kTRUE),
198  fAreCaloClustersEnabled(kTRUE),
199  fAreEMCALCellsEnabled(kTRUE),
200  fArePHOSCellsEnabled(kTRUE),
201  fAreEMCALTriggerEnabled(kTRUE),
202  fArePHOSTriggerEnabled(kTRUE),
203  fAreTrackletsEnabled(kTRUE),
204  fIsTRDEnabled(kTRUE),
205  fESDpid(0x0),
206  fIsPidOwner(kFALSE),
207  fTPCaloneTrackCuts(0),
208  fDoPropagateTrackToEMCal(kTRUE),
209  fEMCalSurfaceDistance(440),
210  fRefitVertexTracks(-1),
211  fRefitVertexTracksNCuts(0),
212  fRefitVertexTracksCuts(0),
213  fIsMuonCaloPass(kFALSE),
214  fAddPCMv0s(addPCMv0s),
215  fbitfieldPCMv0sA(NULL),
216  fbitfieldPCMv0sB(NULL),
217  fv0Histos(NULL),
218  fHistov0List(NULL)
219 {
221 
222  fV0Cuts[0] = 33. ; // max allowed chi2
223  fV0Cuts[1] = 0.1 ; // min allowed impact parameter for the 1st daughter
224  fV0Cuts[2] = 0.1 ; // min allowed impact parameter for the 2nd daughter
225  fV0Cuts[3] = 1. ; // max allowed DCA between the daughter tracks
226  fV0Cuts[4] = .998; // min allowed cosine of V0's pointing angle
227  fV0Cuts[5] = 0.9 ; // min radius of the fiducial volume
228  fV0Cuts[6] = 100. ; // max radius of the fiducial volume
229 
230  fCascadeCuts[0] = 33. ; // max allowed chi2 (same as PDC07)
231  fCascadeCuts[1] = 0.05 ; // min allowed V0 impact parameter
232  fCascadeCuts[2] = 0.008; // "window" around the Lambda mass
233  fCascadeCuts[3] = 0.03 ; // min allowed bachelor's impact parameter
234  fCascadeCuts[4] = 0.3 ; // max allowed DCA between the V0 and the bachelor
235  fCascadeCuts[5] = 0.999; // min allowed cosine of the cascade pointing angle
236  fCascadeCuts[6] = 0.9 ; // min radius of the fiducial volume
237  fCascadeCuts[7] = 100. ; // max radius of the fiducial volume
238  if(fAddPCMv0s){
239  DefineInput(1,TBits::Class()); //Bit field for pcm v0s OfflineV0Finder
240  DefineInput(2,TBits::Class()); //Bit field for pcm v0s On-FlyV0Finder
241  DefineOutput(1,TList::Class()); //TList containing PCM v0 histos for consistency checks
242  }
243 }
244 
246 {
247  if(fIsPidOwner) delete fESDpid;
248  delete[] fRefitVertexTracksCuts;
249 }
250 
251 //______________________________________________________________________________
253 {
255 
256  if (fAddPCMv0s){
257  fHistov0List = new TList();
258  fHistov0List->SetName("PCMv0Checks");
259  fv0Histos = new TH1D("v0CheckHisto","",8,1,9);
260  fv0Histos->GetXaxis()->SetBinLabel(1,"All PCM On-Fly");
261  fv0Histos->GetXaxis()->SetBinLabel(2,"All PCM Offline");
262  fv0Histos->GetXaxis()->SetBinLabel(3,"PCM On-Fly & v0filter");
263  fv0Histos->GetXaxis()->SetBinLabel(4,"PCM Offline & v0filter");
264  fv0Histos->GetXaxis()->SetBinLabel(5,"PCM On-Fly & v0 cascades");
265  fv0Histos->GetXaxis()->SetBinLabel(6,"PCM Offline & v0 cascades");
266  fv0Histos->GetXaxis()->SetBinLabel(7,"PCM On-Fly not selected by filter");
267  fv0Histos->GetXaxis()->SetBinLabel(8,"PCM Offline not selected by filter");
268  fHistov0List->Add(fv0Histos);
269  fHistov0List->SetOwner(kTRUE);
271  }
272 
273  if(OutputTree())
274  {
275  OutputTree()->GetUserInfo()->Add(fTrackFilter);
276  }
277  else
278  {
279  AliError("No OutputTree() for adding the track filter");
280  }
281  if (!fIsMuonCaloPass)
282  {
284  }
285 }
286 
287 //______________________________________________________________________________
289 {
291 
292  if (fDebug > 1) AliInfo("Init() \n");
293 }
294 
295 //______________________________________________________________________________
297 {
299 
301  return kTRUE;
302 }
303 
304 //______________________________________________________________________________
306 {
308 
309  static Bool_t copyFirst = kFALSE;
310  if (!copyFirst) {
312  if (!mgr) {
313  AliError("AliAnalysisTaskESDfilter::AddMetadataToUserInfo() : No analysis manager !");
314  return kFALSE;
315  }
316  TTree *esdTree = mgr->GetTree()->GetTree();
317  if (!esdTree) return kFALSE;
318  TNamed *alirootVersion = (TNamed*)esdTree->GetUserInfo()->FindObject("alirootVersion");
319  if (!alirootVersion) return kFALSE;
321  if (!aodHandler) return kFALSE;
322  TTree *aodTree = aodHandler->GetTree();
323  if (!aodTree) return kFALSE;
324  aodTree->GetUserInfo()->Add(new TNamed(*alirootVersion));
325  copyFirst = kTRUE;
326  }
327  return kTRUE;
328 }
329 
330 //______________________________________________________________________________
331 void AliAnalysisTaskESDfilter::PrintTask(Option_t *option, Int_t indent) const
332 {
334 
335  AliInfo("");
336 
337  AliAnalysisTaskSE::PrintTask(option,indent);
338 
339  TString spaces(' ',indent+3);
340 
341  cout << spaces.Data() << Form("Cascades are %s",fAreCascadesEnabled ? "ENABLED":"DISABLED") << endl;
342  cout << spaces.Data() << Form("V0s are %s",fAreV0sEnabled ? "ENABLED":"DISABLED") << endl;
343  cout << spaces.Data() << Form("Kinks are %s",fAreKinksEnabled ? "ENABLED":"DISABLED") << endl;
344  cout << spaces.Data() << Form("Tracks are %s",fAreTracksEnabled ? "ENABLED":"DISABLED") << endl;
345  cout << spaces.Data() << Form("PmdClusters are %s",fArePmdClustersEnabled ? "ENABLED":"DISABLED") << endl;
346  cout << spaces.Data() << Form("CaloClusters are %s",fAreCaloClustersEnabled ? "ENABLED":"DISABLED") << endl;
347  cout << spaces.Data() << Form("EMCAL cells are %s",fAreEMCALCellsEnabled ? "ENABLED":"DISABLED") << endl;
348  cout << spaces.Data() << Form("EMCAL triggers are %s",fAreEMCALTriggerEnabled ? "ENABLED":"DISABLED") << endl;
349  cout << spaces.Data() << Form("PHOS triggers are %s",fArePHOSTriggerEnabled ? "ENABLED":"DISABLED") << endl;
350  cout << spaces.Data() << Form("Tracklets are %s",fAreTrackletsEnabled ? "ENABLED":"DISABLED") << endl;
351  cout << spaces.Data() << Form("HMPID is %s",fIsHMPIDEnabled ? "ENABLED":"DISABLED") << endl;
352  cout << spaces.Data() << Form("TRD is %s",fIsTRDEnabled ? "ENABLED":"DISABLED") << endl;
353  cout << spaces.Data() << Form("PropagateTrackToEMCal is %s", fDoPropagateTrackToEMCal ? "ENABLED":"DISABLED") << endl;
354  if (fRefitVertexTracks<0) cout << spaces.Data() << Form("RefitVerteTracks is DISABLED") << endl;
355  else cout << spaces.Data() << Form("RefitVerteTracks is ENABLED to %d",fRefitVertexTracks) << endl;
356 }
357 
358 //______________________________________________________________________________
359 void AliAnalysisTaskESDfilter::UserExec(Option_t */*option*/)
360 {
362 
363  Long64_t ientry = Entry();
364  if (fDebug > 0) {
365  printf("Filter: Analysing event # %5d\n", (Int_t) ientry);
366  if (fHighPthreshold == 0) AliInfo("detector PID signals are stored in each track");
367  if (!fPtshape) AliInfo("detector PID signals are not stored below the pt threshold");
368  }
369  // Filters must explicitely enable AOD filling in their UserExec (AG)
370  if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler())
371  AliFatal("Cannot run ESD filter without an output event handler");
372  if(fEnableFillAOD) {
375  }
376  ConvertESDtoAOD();
378 }
379 
380 //______________________________________________________________________________
382 {
383  return *(AODEvent()->GetCascades());
384 }
385 
386 //______________________________________________________________________________
388 {
389  return *(AODEvent()->GetTracks());
390 }
391 
392 //______________________________________________________________________________
394 {
395  return *(AODEvent()->GetV0s());
396 }
397 
398 //______________________________________________________________________________
400 {
401  return *(AODEvent()->GetVertices());
402 }
403 
404 //______________________________________________________________________________
406 {
408 
409  AliCodeTimerAuto("",0);
410  AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
411  if(!header) AliFatal("Not a standard AOD");
412 
413  header->SetRunNumber(esd.GetRunNumber());
414  header->SetOfflineTrigger(fInputHandler->IsEventSelected()); // propagate the decision of the physics selection
416  header->SetDAQAttributes(esd.GetDAQAttributes());
419 
420  TTree* tree = fInputHandler->GetTree();
421  if (tree) {
422  TFile* file = tree->GetCurrentFile();
423  if (file) header->SetESDFileName(file->GetName());
424  }
425 
426  if (fOldESDformat) {
427  header->SetBunchCrossNumber(0);
428  header->SetOrbitNumber(0);
429  header->SetPeriodNumber(0);
430  header->SetEventType(0);
431  header->SetMuonMagFieldScale(-999.);
432  header->SetCentrality(0);
433  header->SetEventplane(0);
434  } else {
436  header->SetOrbitNumber(esd.GetOrbitNumber());
437  header->SetPeriodNumber(esd.GetPeriodNumber());
438  header->SetEventType(esd.GetEventType());
439  header->SetTimeStamp(esd.GetTimeStamp());
440 
442  if(const_cast<AliESDEvent&>(esd).GetCentrality()){
443  header->SetCentrality(const_cast<AliESDEvent&>(esd).GetCentrality());
444  }
445  else{
446  header->SetCentrality(0);
447  }
448  if(const_cast<AliESDEvent&>(esd).GetEventplane()){
449  header->SetEventplane(const_cast<AliESDEvent&>(esd).GetEventplane());
450  }
451  else{
452  header->SetEventplane(0);
453  }
454  }
455 
456  // Trigger
458  header->SetTriggerMask(esd.GetTriggerMask());
460  header->SetTriggerCluster(esd.GetTriggerCluster());
464 
465  header->SetMagneticField(esd.GetMagneticField());
466  header->SetMuonMagFieldScale(esd.GetCurrentDip()/6000.);
467  header->SetZDCN1Energy(esd.GetZDCN1Energy());
468  header->SetZDCP1Energy(esd.GetZDCP1Energy());
469  header->SetZDCN2Energy(esd.GetZDCN2Energy());
470  header->SetZDCP2Energy(esd.GetZDCP2Energy());
471  header->SetZDCEMEnergy(esd.GetZDCEMEnergy(0),esd.GetZDCEMEnergy(1));
472 
475 
476  // Detector status
478 
479  // ITS Cluster Multiplicty
480  const AliMultiplicity *mult = esd.GetMultiplicity();
481  for (Int_t ilay = 0; ilay < 6; ilay++) header->SetITSClusters(ilay, mult->GetNumberOfITSClusters(ilay));
482 
483  // TPC only Reference Multiplicty
484  Int_t refMult = fTPCaloneTrackCuts ? (Short_t)fTPCaloneTrackCuts->GetReferenceMultiplicity(&esd, kTRUE) : -1;
485  header->SetTPConlyRefMultiplicity(refMult);
486  //
491  //
492  Float_t diamxy[2]={(Float_t)esd.GetDiamondX(),(Float_t)esd.GetDiamondY()};
493  Float_t diamcov[3];
494  esd.GetDiamondCovXY(diamcov);
495  header->SetDiamond(diamxy,diamcov);
496  header->SetDiamondZ(esd.GetDiamondZ(),esd.GetSigma2DiamondZ());
497 
498  // VZERO channel equalization factors for event-plane reconstruction
499  header->SetVZEROEqFactors(esd.GetVZEROEqFactors());
500 
501  // T0 Resolution information
502  const AliESDRun* esdRun = esd.GetESDRun();
503  for (Int_t i=0;i<AliESDRun::kT0spreadSize;i++) header->SetT0spread(i,esdRun->GetT0spread(i));
504 
505  return header;
506 }
507 
508 //______________________________________________________________________________
510 {
513 
514  AliCodeTimerAuto("",0);
515 
516  // Create vertices starting from the most complex objects
517  Double_t chi2 = 0.;
518 
519  const AliESDVertex* vtx = esd.GetPrimaryVertex();
520  Double_t pos[3] = { 0. };
521  Double_t covVtx[6] = { 0. };
522  Double_t momBach[3]={0.};
523  Double_t covTr[21]={0.};
524  // Double_t pid[10]={0.};
525  AliAODPid* detpid(0x0);
526  AliAODVertex* vV0FromCascade(0x0);
527  AliAODv0* aodV0(0x0);
528  AliAODcascade* aodCascade(0x0);
529  AliAODTrack* aodTrack(0x0);
530  Double_t momPos[3]={0.};
531  Double_t momNeg[3] = { 0. };
532  Double_t momPosAtV0vtx[3]={0.};
533  Double_t momNegAtV0vtx[3]={0.};
534  Int_t tofLabel[3] = {0};
535  TClonesArray& verticesArray = Vertices();
536  TClonesArray& tracksArray = Tracks();
537  TClonesArray& cascadesArray = Cascades();
538 
539  // Cascades (Modified by A.Maire - February 2009)
540  for (Int_t nCascade = 0; nCascade < esd.GetNumberOfCascades(); ++nCascade) {
541 
542  // 0- Preparation
543  //
544  AliESDcascade *esdCascade = esd.GetCascade(nCascade);
545  Int_t idxPosFromV0Dghter = esdCascade->GetPindex();
546  Int_t idxNegFromV0Dghter = esdCascade->GetNindex();
547  Int_t idxBachFromCascade = esdCascade->GetBindex();
548 
549  AliESDtrack *esdCascadePos = esd.GetTrack( idxPosFromV0Dghter);
550  AliESDtrack *esdCascadeNeg = esd.GetTrack( idxNegFromV0Dghter);
551  AliESDtrack *esdCascadeBach = esd.GetTrack( idxBachFromCascade);
552 
553  // Identification of the V0 within the esdCascade (via both daughter track indices)
554  AliESDv0 * currentV0 = 0x0;
555  Int_t idxV0FromCascade = -1;
556 
557  for (Int_t iV0=0; iV0<esd.GetNumberOfV0s(); ++iV0) {
558 
559  currentV0 = esd.GetV0(iV0);
560 
561  // Fix added on 2018-09-18 (ALIROOT-7980)
562  // cascades are built only from offline V0 -> skip on-fly V0 in this loop
563  if(currentV0->GetOnFlyStatus()==kTRUE) continue;
564 
565  Int_t posCurrentV0 = currentV0->GetPindex();
566  Int_t negCurrentV0 = currentV0->GetNindex();
567 
568  if (posCurrentV0==idxPosFromV0Dghter && negCurrentV0==idxNegFromV0Dghter) {
569  idxV0FromCascade = iV0;
570  break;
571  }
572  }
573 
574  if(idxV0FromCascade < 0){
575  printf("Cascade - no matching for the V0 (index V0 = -1) ! Skip ... \n");
576  continue;
577  }// a priori, useless check, but safer ... in case of pb with tracks "out of bounds"
578 
579  AliESDv0 *esdV0FromCascade = esd.GetV0(idxV0FromCascade);
580 
581  // 1 - Cascade selection
582 
583  // AliESDVertex *esdPrimVtx = new AliESDVertex(*(esd.GetPrimaryVertex()));
584  // TList cascadeObjects;
585  // cascadeObjects.AddAt(esdV0FromCascade, 0);
586  // cascadeObjects.AddAt(esdCascadePos, 1);
587  // cascadeObjects.AddAt(esdCascadeNeg, 2);
588  // cascadeObjects.AddAt(esdCascade, 3);
589  // cascadeObjects.AddAt(esdCascadeBach, 4);
590  // cascadeObjects.AddAt(esdPrimVtx, 5);
591  //
592  // UInt_t selectCascade = 0;
593  // if (fCascadeFilter) {
594  // // selectCascade = fCascadeFilter->IsSelected(&cascadeObjects);
595  // // FIXME AliESDCascadeCuts to be implemented ...
596  //
597  // // Here we may encounter a moot point at the V0 level
598  // // between the cascade selections and the V0 ones :
599  // // the V0 selected along with the cascade (secondary V0) may
600  // // usually be removed from the dedicated V0 selections (prim V0) ...
601  // // -> To be discussed !
602  //
603  // // this is a little awkward but otherwise the
604  // // list wants to access the pointer (delete it)
605  // // again when going out of scope
606  // delete cascadeObjects.RemoveAt(5); // esdPrimVtx created via copy construct
607  // esdPrimVtx = 0;
608  // if (!selectCascade)
609  // continue;
610  // }
611  // else{
612  // delete cascadeObjects.RemoveAt(5); // esdPrimVtx created via copy construct
613  // esdPrimVtx = 0;
614  // }
615 
616  // 2 - Add the cascade vertex
617 
618  esdCascade->GetXYZcascade(pos[0], pos[1], pos[2]);
619  esdCascade->GetPosCovXi(covVtx);
620  chi2 = esdCascade->GetChi2Xi();
621 
622  AliAODVertex *vCascade = new(verticesArray[fNumberOfVertices++]) AliAODVertex(pos,
623  covVtx,
624  chi2, // FIXME = Chi2/NDF will be needed
626  nCascade, // id
628  fPrimaryVertex->AddDaughter(vCascade);
629 
630  // 3 - Add the bachelor track from the cascade
631 
632  if (!fUsedTrack[idxBachFromCascade]) {
633 
634  esdCascadeBach->GetPxPyPz(momBach);
635  esdCascadeBach->GetXYZ(pos);
636  esdCascadeBach->GetCovarianceXYZPxPyPz(covTr);
637  // esdCascadeBach->GetESDpid(pid);
638  esdCascadeBach->GetTOFLabel(tofLabel);
639 
640  fUsedTrack[idxBachFromCascade] = kTRUE;
641  UInt_t selectInfo = 0;
642  if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadeBach);
643  if (fMChandler) fMChandler->SelectParticle(esdCascadeBach->GetLabel());
644  aodTrack = new(tracksArray[fNumberOfTracks++]) AliAODTrack(esdCascadeBach->GetID(),
645  esdCascadeBach->GetLabel(),
646  momBach,
647  kTRUE,
648  pos,
649  kFALSE, // Why kFALSE for "isDCA" ? FIXME
650  covTr,
651  (Short_t)esdCascadeBach->GetSign(),
652  esdCascadeBach->GetITSClusterMap(),
653  // pid,
654  vCascade,
655  kTRUE, // usedForVtxFit = kFALSE ? FIXME
656  vtx->UsesTrack(esdCascadeBach->GetID()),
658  selectInfo);
659  aodTrack->SetITSSharedMap(esdCascadeBach->GetITSSharedMap());
660  aodTrack->SetITSchi2(esdCascadeBach->GetITSchi2());
661  aodTrack->SetPIDForTracking(esdCascadeBach->GetPIDForTracking());
662  aodTrack->SetTPCFitMap(esdCascadeBach->GetTPCFitMap());
663  aodTrack->SetTPCClusterMap(esdCascadeBach->GetTPCClusterMap());
664  aodTrack->SetTPCSharedMap (esdCascadeBach->GetTPCSharedMap());
665  aodTrack->SetChi2perNDF(Chi2perNDF(esdCascadeBach));
666  aodTrack->SetTPCPointsF(esdCascadeBach->GetTPCNclsF());
667  aodTrack->SetTPCNCrossedRows(UShort_t(esdCascadeBach->GetTPCCrossedRows()));
668  aodTrack->SetIntegratedLength(esdCascadeBach->GetIntegratedLength());
669  aodTrack->SetTOFLabel(tofLabel);
670  CopyChi2TPCConstrainedVsGlobal(esdCascadeBach, aodTrack);
671  CopyCaloProps(esdCascadeBach,aodTrack);
672  fAODTrackRefs->AddAt(aodTrack,idxBachFromCascade);
673 
674  if (esdCascadeBach->GetSign() > 0) ++fNumberOfPositiveTracks;
675  aodTrack->ConvertAliPIDtoAODPID();
676  aodTrack->SetFlags(esdCascadeBach->GetStatus());
677  SetAODPID(esdCascadeBach,aodTrack,detpid);
678  }
679  else {
680  aodTrack = static_cast<AliAODTrack*>( fAODTrackRefs->At(idxBachFromCascade) );
681  }
682 
683  vCascade->AddDaughter(aodTrack);
684 
685  // 4 - Add the V0 from the cascade.
686  // = V0vtx + both pos and neg daughter tracks + the aodV0 itself
687  //
688 
689  if ( !fUsedV0[idxV0FromCascade] ) {
690  // 4.A - if VO structure hasn't been created yet
691 
692  // 4.A.1 - Create the V0 vertex of the cascade
693  esdV0FromCascade->GetXYZ(pos[0], pos[1], pos[2]);
694  esdV0FromCascade->GetPosCov(covVtx);
695  chi2 = esdV0FromCascade->GetChi2V0(); // = chi2/NDF since NDF = 2*2-3 ?
696 
697  vV0FromCascade = new(verticesArray[fNumberOfVertices++]) AliAODVertex(pos,
698  covVtx,
699  chi2,
700  vCascade,
701  idxV0FromCascade, //id of ESDv0
703  // Note:
704  // one V0 can be used by several cascades.
705  // So, one AOD V0 vtx can have several parent vtx.
706  // This is not directly allowed by AliAODvertex.
707  // Setting the parent vtx (here = param "vCascade") doesn't lead to a crash
708  // but to a problem of consistency within AODEvent.
709  // -> See below paragraph 4.B, for the proposed treatment of such a case.
710 
711  // Add the vV0FromCascade to the aodVOVtxRefs
712  fAODV0VtxRefs->AddAt(vV0FromCascade,idxV0FromCascade);
713 
714  // 4.A.2 - Add the positive tracks from the V0
715 
716  esdCascadePos->GetPxPyPz(momPos);
717  esdCascadePos->GetXYZ(pos);
718  esdCascadePos->GetCovarianceXYZPxPyPz(covTr);
719  // esdCascadePos->GetESDpid(pid);
720  esdCascadePos->GetTOFLabel(tofLabel);
721 
722  if (!fUsedTrack[idxPosFromV0Dghter]) {
723  fUsedTrack[idxPosFromV0Dghter] = kTRUE;
724 
725  UInt_t selectInfo = 0;
726  if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadePos);
727  if(fMChandler) fMChandler->SelectParticle(esdCascadePos->GetLabel());
728  aodTrack = new(tracksArray[fNumberOfTracks++]) AliAODTrack(esdCascadePos->GetID(),
729  esdCascadePos->GetLabel(),
730  momPos,
731  kTRUE,
732  pos,
733  kFALSE, // Why kFALSE for "isDCA" ? FIXME
734  covTr,
735  (Short_t)esdCascadePos->GetSign(),
736  esdCascadePos->GetITSClusterMap(),
737  //pid,
738  vV0FromCascade,
739  kTRUE, // usedForVtxFit = kFALSE ? FIXME
740  vtx->UsesTrack(esdCascadePos->GetID()),
742  selectInfo);
743  aodTrack->SetITSSharedMap(esdCascadePos->GetITSSharedMap());
744  aodTrack->SetITSchi2(esdCascadePos->GetITSchi2());
745  aodTrack->SetPIDForTracking(esdCascadePos->GetPIDForTracking());
746  aodTrack->SetTPCFitMap(esdCascadePos->GetTPCFitMap());
747  aodTrack->SetTPCClusterMap(esdCascadePos->GetTPCClusterMap());
748  aodTrack->SetTPCSharedMap (esdCascadePos->GetTPCSharedMap());
749  aodTrack->SetChi2perNDF(Chi2perNDF(esdCascadePos));
750  aodTrack->SetTPCPointsF(esdCascadePos->GetTPCNclsF());
751  aodTrack->SetTPCNCrossedRows(UShort_t(esdCascadePos->GetTPCCrossedRows()));
752  aodTrack->SetIntegratedLength(esdCascadePos->GetIntegratedLength());
753  aodTrack->SetTOFLabel(tofLabel);
754  CopyChi2TPCConstrainedVsGlobal(esdCascadePos, aodTrack);
755  CopyCaloProps(esdCascadePos,aodTrack);
756  fAODTrackRefs->AddAt(aodTrack,idxPosFromV0Dghter);
757 
758  if (esdCascadePos->GetSign() > 0) ++fNumberOfPositiveTracks;
759  aodTrack->ConvertAliPIDtoAODPID();
760  aodTrack->SetFlags(esdCascadePos->GetStatus());
761  SetAODPID(esdCascadePos,aodTrack,detpid);
762  }
763  else {
764  aodTrack = static_cast<AliAODTrack*>(fAODTrackRefs->At(idxPosFromV0Dghter));
765  }
766  vV0FromCascade->AddDaughter(aodTrack);
767 
768  // 4.A.3 - Add the negative tracks from the V0
769 
770  esdCascadeNeg->GetPxPyPz(momNeg);
771  esdCascadeNeg->GetXYZ(pos);
772  esdCascadeNeg->GetCovarianceXYZPxPyPz(covTr);
773  // esdCascadeNeg->GetESDpid(pid);
774  esdCascadeNeg->GetTOFLabel(tofLabel);
775 
776  if (!fUsedTrack[idxNegFromV0Dghter]) {
777  fUsedTrack[idxNegFromV0Dghter] = kTRUE;
778 
779  UInt_t selectInfo = 0;
780  if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdCascadeNeg);
781  if (fMChandler)
782  fMChandler->SelectParticle(esdCascadeNeg->GetLabel());
783  aodTrack = new(tracksArray[fNumberOfTracks++]) AliAODTrack(esdCascadeNeg->GetID(),
784  esdCascadeNeg->GetLabel(),
785  momNeg,
786  kTRUE,
787  pos,
788  kFALSE, // Why kFALSE for "isDCA" ? FIXME
789  covTr,
790  (Short_t)esdCascadeNeg->GetSign(),
791  esdCascadeNeg->GetITSClusterMap(),
792  // pid,
793  vV0FromCascade,
794  kTRUE, // usedForVtxFit = kFALSE ? FIXME
795  vtx->UsesTrack(esdCascadeNeg->GetID()),
797  selectInfo);
798  aodTrack->SetITSSharedMap(esdCascadeNeg->GetITSSharedMap());
799  aodTrack->SetITSchi2(esdCascadeNeg->GetITSchi2());
800  aodTrack->SetPIDForTracking(esdCascadeNeg->GetPIDForTracking());
801  aodTrack->SetTPCFitMap(esdCascadeNeg->GetTPCFitMap());
802  aodTrack->SetTPCClusterMap(esdCascadeNeg->GetTPCClusterMap());
803  aodTrack->SetTPCSharedMap (esdCascadeNeg->GetTPCSharedMap());
804  aodTrack->SetChi2perNDF(Chi2perNDF(esdCascadeNeg));
805  aodTrack->SetTPCPointsF(esdCascadeNeg->GetTPCNclsF());
806  aodTrack->SetTPCNCrossedRows(UShort_t(esdCascadeNeg->GetTPCCrossedRows()));
807  aodTrack->SetIntegratedLength(esdCascadeNeg->GetIntegratedLength());
808  aodTrack->SetTOFLabel(tofLabel);
809  CopyChi2TPCConstrainedVsGlobal(esdCascadeNeg, aodTrack);
810  CopyCaloProps(esdCascadeNeg,aodTrack);
811  fAODTrackRefs->AddAt(aodTrack,idxNegFromV0Dghter);
812 
813  if (esdCascadeNeg->GetSign() > 0) ++fNumberOfPositiveTracks;
814  aodTrack->ConvertAliPIDtoAODPID();
815  aodTrack->SetFlags(esdCascadeNeg->GetStatus());
816  SetAODPID(esdCascadeNeg,aodTrack,detpid);
817  }
818  else {
819  aodTrack = static_cast<AliAODTrack*>(fAODTrackRefs->At(idxNegFromV0Dghter));
820  }
821 
822  vV0FromCascade->AddDaughter(aodTrack);
823 
824  // 4.A.4 - Add the V0 from cascade to the V0 array
825 
826  Double_t dcaV0Daughters = esdV0FromCascade->GetDcaV0Daughters();
827  Double_t dcaV0ToPrimVertex = esdV0FromCascade->GetD(esd.GetPrimaryVertex()->GetX(),
828  esd.GetPrimaryVertex()->GetY(),
829  esd.GetPrimaryVertex()->GetZ() );
830  esdV0FromCascade->GetPPxPyPz( momPosAtV0vtx[0],momPosAtV0vtx[1],momPosAtV0vtx[2] );
831  esdV0FromCascade->GetNPxPyPz( momNegAtV0vtx[0],momNegAtV0vtx[1],momNegAtV0vtx[2] );
832 
833  Double_t dcaDaughterToPrimVertex[2] = { 999., 999.}; // ..[0] = DCA in (x,y) for Pos and ..[1] = Neg
834  dcaDaughterToPrimVertex[0] = TMath::Abs(esdCascadePos->GetD(esd.GetPrimaryVertex()->GetX(),
835  esd.GetPrimaryVertex()->GetY(),
836  esd.GetMagneticField()) );
837  dcaDaughterToPrimVertex[1] = TMath::Abs(esdCascadeNeg->GetD(esd.GetPrimaryVertex()->GetX(),
838  esd.GetPrimaryVertex()->GetY(),
839  esd.GetMagneticField()) );
840 
841  aodV0 = new(V0s()[fNumberOfV0s++]) AliAODv0(vV0FromCascade,
842  dcaV0Daughters,
843  dcaV0ToPrimVertex,
844  momPosAtV0vtx,
845  momNegAtV0vtx,
846  dcaDaughterToPrimVertex);
847  // set the aod v0 on-the-fly status
848  aodV0->SetOnFlyStatus(esdV0FromCascade->GetOnFlyStatus());
849 
850  // Add the aodV0 to the aodVORefs
851  fAODV0Refs->AddAt(aodV0,idxV0FromCascade);
852 
853  fUsedV0[idxV0FromCascade] = kTRUE;
854 
855  } else {
856  // 4.B - if V0 structure already used
857 
858  // Note :
859  // one V0 can be used by several cascades (frequent in PbPb evts) :
860  // same V0 which used but attached to different bachelor tracks
861  // -> aodVORefs and fAODV0VtxRefs are needed.
862  // Goal : avoid a redundancy of the info in "Vertices" and "v0s" clones array.
863 
864  vV0FromCascade = static_cast<AliAODVertex*>(fAODV0VtxRefs->At(idxV0FromCascade));
865  aodV0 = static_cast<AliAODv0*> (fAODV0Refs ->At(idxV0FromCascade));
866 
867  // - Treatment of the parent for such a "re-used" V0 :
868  // Insert the cascade that reuses the V0 vertex in the lineage chain
869  // Before : vV0 -> vCascade1 -> vPrimary
870  // - Hyp : cascade2 uses the same V0 as cascade1
871  // After : vV0 -> vCascade2 -> vCascade1 -> vPrimary
872 
873  AliAODVertex *vCascadePreviousParent = static_cast<AliAODVertex*> (vV0FromCascade->GetParent());
874  vV0FromCascade->SetParent(vCascade);
875  vCascade ->SetParent(vCascadePreviousParent);
876 
877  }// end if V0 structure already used
878 
879  // In any case (used V0 or not), add the V0 vertex to the cascade one.
880  vCascade->AddDaughter(vV0FromCascade);
881 
882  // 5 - Add the primary track of the cascade (if any)
883 
884  // 6 - Add the cascade to the AOD array of cascades
885  Double_t dcaBachToPrimVertexXY = TMath::Abs(esdCascadeBach->GetD(esd.GetPrimaryVertex()->GetX(),
886  esd.GetPrimaryVertex()->GetY(),
887  esd.GetMagneticField()) );
888 
889  Double_t momBachAtCascadeVtx[3]={0.};
890 
891  esdCascade->GetBPxPyPz(momBachAtCascadeVtx[0], momBachAtCascadeVtx[1], momBachAtCascadeVtx[2]);
892 
893  aodCascade = new(cascadesArray[fNumberOfCascades++]) AliAODcascade(vCascade,
894  esdCascade->Charge(),
895  esdCascade->GetDcaXiDaughters(),
896  -999.,
897  // DCAXiToPrimVtx -> needs to be calculated ----|
898  // doesn't exist at ESD level;
899  // See AODcascade::DcaXiToPrimVertex(Double, Double, Double)
900  dcaBachToPrimVertexXY,
901  momBachAtCascadeVtx,
902  *aodV0);
903  aodCascade->SetBit(AliAODcascade::kOnFlyCascadesFixed);
904  if (fDebug > 10) {
905  printf("---- Cascade / AOD cascade : \n\n");
907  }
908 
909  } // end of the loop on cascades
910 
911  Cascades().Expand(fNumberOfCascades);
912 }
913 
914 //______________________________________________________________________________
916 {
918 
919  AliCodeTimerAuto("",0);
920 
921  //
922  // V0s
923  //
924  Double_t pos[3] = { 0. };
925  Double_t chi2(0.0);
926  Double_t covVtx[6] = { 0. };
927  Double_t momPos[3]={0.};
928  Double_t covTr[21]={0.};
929  // Double_t pid[10]={0.};
930  AliAODTrack* aodTrack(0x0);
931  AliAODPid* detpid(0x0);
932  Double_t momNeg[3]={0.};
933  Double_t momPosAtV0vtx[3]={0.};
934  Double_t momNegAtV0vtx[3]={0.};
935  Int_t tofLabel[3] = {0};
936 
937  if (fAddPCMv0s){
938  fbitfieldPCMv0sA = (TBits*) GetInputData(1);
939  fbitfieldPCMv0sB = (TBits*) GetInputData(2);
940  }
941  UInt_t posInt;
942 
943  for (Int_t nV0 = 0; nV0 < esd.GetNumberOfV0s(); ++nV0) {
944  if (fAddPCMv0s) {posInt = (UInt_t) nV0;}
945  if (fUsedV0[nV0]){
946  if(fbitfieldPCMv0sA){
947  if(fbitfieldPCMv0sA->TestBitNumber(posInt) && posInt <= fbitfieldPCMv0sA->GetNbits()){
948  fv0Histos->Fill(5);
949  fv0Histos->Fill(1);
950  }
951  }
952  if(fbitfieldPCMv0sB){
953  if(fbitfieldPCMv0sB->TestBitNumber(posInt) && posInt <= fbitfieldPCMv0sB->GetNbits()){
954  fv0Histos->Fill(6);
955  fv0Histos->Fill(2);
956  }
957  }
958  continue; // skip if already added to the AOD
959  }
960 
961  AliESDv0 *v0 = esd.GetV0(nV0);
962  Int_t posFromV0 = v0->GetPindex();
963  Int_t negFromV0 = v0->GetNindex();
964 
965  // V0 selection
966  //
967  AliESDVertex *esdVtx = new AliESDVertex(*(esd.GetPrimaryVertex()));
968  AliESDtrack *esdV0Pos = esd.GetTrack(posFromV0);
969  AliESDtrack *esdV0Neg = esd.GetTrack(negFromV0);
970  TList v0objects;
971  v0objects.AddAt(v0, 0);
972  v0objects.AddAt(esdV0Pos, 1);
973  v0objects.AddAt(esdV0Neg, 2);
974  v0objects.AddAt(esdVtx, 3);
975  UInt_t selectV0 = 0;
976 
977  //Add PCM V0s
978  if(fbitfieldPCMv0sA){
979  if(fbitfieldPCMv0sA->TestBitNumber(posInt) && posInt <= fbitfieldPCMv0sA->GetNbits()){
980  selectV0 = 2;
981  fv0Histos->Fill(1);
982  }
983  }
984  if(fbitfieldPCMv0sB){
985  if(fbitfieldPCMv0sB->TestBitNumber(posInt) && posInt <= fbitfieldPCMv0sB->GetNbits()){
986  selectV0 = 2;
987  fv0Histos->Fill(2);
988  }
989  }
990  if (fV0Filter) {
991  selectV0 |= fV0Filter->IsSelected(&v0objects);
992  // this is a little awkward but otherwise the
993  // list wants to access the pointer (delete it)
994  // again when going out of scope
995  delete v0objects.RemoveAt(3); // esdVtx created via copy construct
996  esdVtx = 0;
997  if (!selectV0)
998  continue;
999  } else {
1000  delete v0objects.RemoveAt(3); // esdVtx created via copy construct
1001  esdVtx = 0;
1002  }
1003 
1004  if (fbitfieldPCMv0sA){
1005  if (selectV0==3 && fbitfieldPCMv0sA->TestBitNumber(posInt)){
1006  fv0Histos->Fill(3);
1007  }
1008  else if (selectV0==2 && fbitfieldPCMv0sA->TestBitNumber(posInt)){
1009  fv0Histos->Fill(7);
1010  }
1011  }
1012  if (fbitfieldPCMv0sB){
1013  if (selectV0==3 && fbitfieldPCMv0sB->TestBitNumber(posInt)){
1014  fv0Histos->Fill(4);
1015  }
1016  else if (selectV0==2 && fbitfieldPCMv0sB->TestBitNumber(posInt)){
1017  fv0Histos->Fill(8);
1018  }
1019  }
1020 
1021  v0->GetXYZ(pos[0], pos[1], pos[2]);
1022 
1023  if (!fOldESDformat) {
1024  chi2 = v0->GetChi2V0(); // = chi2/NDF since NDF = 2*2-3
1025  v0->GetPosCov(covVtx);
1026  } else {
1027  chi2 = -999.;
1028  for (Int_t i = 0; i < 6; i++) covVtx[i] = 0.;
1029  }
1030 
1031 
1032  AliAODVertex * vV0 =
1033  new(Vertices()[fNumberOfVertices++]) AliAODVertex(pos,
1034  covVtx,
1035  chi2,
1037  nV0,
1040 
1041 
1042  // Add the positive tracks from the V0
1043 
1044  esdV0Pos->GetPxPyPz(momPos);
1045  esdV0Pos->GetXYZ(pos);
1046  esdV0Pos->GetCovarianceXYZPxPyPz(covTr);
1047  // esdV0Pos->GetESDpid(pid);
1048  esdV0Pos->GetTOFLabel(tofLabel);
1049 
1050  const AliESDVertex *vtx = esd.GetPrimaryVertex();
1051 
1052  if (!fUsedTrack[posFromV0]) {
1053  fUsedTrack[posFromV0] = kTRUE;
1054  UInt_t selectInfo = 0;
1055  if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Pos);
1056  if(fMChandler)fMChandler->SelectParticle(esdV0Pos->GetLabel());
1057  aodTrack = new(Tracks()[fNumberOfTracks++]) AliAODTrack(esdV0Pos->GetID(),
1058  esdV0Pos->GetLabel(),
1059  momPos,
1060  kTRUE,
1061  pos,
1062  kFALSE,
1063  covTr,
1064  (Short_t)esdV0Pos->GetSign(),
1065  esdV0Pos->GetITSClusterMap(),
1066  // pid,
1067  vV0,
1068  kTRUE, // check if this is right
1069  vtx->UsesTrack(esdV0Pos->GetID()),
1071  selectInfo);
1072  aodTrack->SetITSSharedMap(esdV0Pos->GetITSSharedMap());
1073  aodTrack->SetITSchi2(esdV0Pos->GetITSchi2());
1074  aodTrack->SetPIDForTracking(esdV0Pos->GetPIDForTracking());
1075  aodTrack->SetTPCFitMap(esdV0Pos->GetTPCFitMap());
1076  aodTrack->SetTPCClusterMap(esdV0Pos->GetTPCClusterMap());
1077  aodTrack->SetTPCSharedMap (esdV0Pos->GetTPCSharedMap());
1078  aodTrack->SetChi2perNDF(Chi2perNDF(esdV0Pos));
1079  aodTrack->SetTPCPointsF(esdV0Pos->GetTPCNclsF());
1080  aodTrack->SetTPCNCrossedRows(UShort_t(esdV0Pos->GetTPCCrossedRows()));
1081  aodTrack->SetIntegratedLength(esdV0Pos->GetIntegratedLength());
1082  aodTrack->SetTOFLabel(tofLabel);
1083  CopyChi2TPCConstrainedVsGlobal(esdV0Pos, aodTrack);
1084  CopyCaloProps(esdV0Pos,aodTrack);
1085  fAODTrackRefs->AddAt(aodTrack,posFromV0);
1086  if (esdV0Pos->GetSign() > 0) ++fNumberOfPositiveTracks;
1087  aodTrack->ConvertAliPIDtoAODPID();
1088  aodTrack->SetFlags(esdV0Pos->GetStatus());
1089  SetAODPID(esdV0Pos,aodTrack,detpid);
1090  } else {
1091  aodTrack = static_cast<AliAODTrack*>(fAODTrackRefs->At(posFromV0));
1092  }
1093  vV0->AddDaughter(aodTrack);
1094 
1095  // Add the negative tracks from the V0
1096  esdV0Neg->GetPxPyPz(momNeg);
1097  esdV0Neg->GetXYZ(pos);
1098  esdV0Neg->GetCovarianceXYZPxPyPz(covTr);
1099  // esdV0Neg->GetESDpid(pid);
1100  esdV0Neg->GetTOFLabel(tofLabel);
1101 
1102  if (!fUsedTrack[negFromV0]) {
1103  fUsedTrack[negFromV0] = kTRUE;
1104  UInt_t selectInfo = 0;
1105  if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdV0Neg);
1106  if(fMChandler)fMChandler->SelectParticle(esdV0Neg->GetLabel());
1107  aodTrack = new(Tracks()[fNumberOfTracks++]) AliAODTrack(esdV0Neg->GetID(),
1108  esdV0Neg->GetLabel(),
1109  momNeg,
1110  kTRUE,
1111  pos,
1112  kFALSE,
1113  covTr,
1114  (Short_t)esdV0Neg->GetSign(),
1115  esdV0Neg->GetITSClusterMap(),
1116  // pid,
1117  vV0,
1118  kTRUE, // check if this is right
1119  vtx->UsesTrack(esdV0Neg->GetID()),
1121  selectInfo);
1122  aodTrack->SetITSSharedMap(esdV0Neg->GetITSSharedMap());
1123  aodTrack->SetITSchi2(esdV0Neg->GetITSchi2());
1124  aodTrack->SetPIDForTracking(esdV0Neg->GetPIDForTracking());
1125  aodTrack->SetTPCFitMap(esdV0Neg->GetTPCFitMap());
1126  aodTrack->SetTPCClusterMap(esdV0Neg->GetTPCClusterMap());
1127  aodTrack->SetTPCSharedMap (esdV0Neg->GetTPCSharedMap());
1128  aodTrack->SetChi2perNDF(Chi2perNDF(esdV0Neg));
1129  aodTrack->SetTPCPointsF(esdV0Neg->GetTPCNclsF());
1130  aodTrack->SetTPCNCrossedRows(UShort_t(esdV0Neg->GetTPCCrossedRows()));
1131  aodTrack->SetIntegratedLength(esdV0Neg->GetIntegratedLength());
1132  aodTrack->SetTOFLabel(tofLabel);
1133  CopyChi2TPCConstrainedVsGlobal(esdV0Neg, aodTrack);
1134  CopyCaloProps(esdV0Neg,aodTrack);
1135  fAODTrackRefs->AddAt(aodTrack,negFromV0);
1136  if (esdV0Neg->GetSign() > 0) ++fNumberOfPositiveTracks;
1137  aodTrack->ConvertAliPIDtoAODPID();
1138  aodTrack->SetFlags(esdV0Neg->GetStatus());
1139  SetAODPID(esdV0Neg,aodTrack,detpid);
1140  } else {
1141  aodTrack = static_cast<AliAODTrack*>(fAODTrackRefs->At(negFromV0));
1142  }
1143  vV0->AddDaughter(aodTrack);
1144 
1145  // Add the V0 the V0 array as well
1146  Double_t dcaV0Daughters = v0->GetDcaV0Daughters();
1147  Double_t dcaV0ToPrimVertex = v0->GetD(esd.GetPrimaryVertex()->GetX(),
1148  esd.GetPrimaryVertex()->GetY(),
1149  esd.GetPrimaryVertex()->GetZ());
1150 
1151  v0->GetPPxPyPz(momPosAtV0vtx[0],momPosAtV0vtx[1],momPosAtV0vtx[2]);
1152  v0->GetNPxPyPz(momNegAtV0vtx[0],momNegAtV0vtx[1],momNegAtV0vtx[2]);
1153 
1154  Double_t dcaDaughterToPrimVertex[2] = { 999., 999.}; // ..[0] = DCA in (x,y) for Pos and ..[1] = Neg
1155  dcaDaughterToPrimVertex[0] = TMath::Abs(esdV0Pos->GetD( esd.GetPrimaryVertex()->GetX(),
1156  esd.GetPrimaryVertex()->GetY(),
1157  esd.GetMagneticField()) );
1158  dcaDaughterToPrimVertex[1] = TMath::Abs(esdV0Neg->GetD( esd.GetPrimaryVertex()->GetX(),
1159  esd.GetPrimaryVertex()->GetY(),
1160  esd.GetMagneticField()) );
1161 
1162  AliAODv0* aodV0 = new(V0s()[fNumberOfV0s++]) AliAODv0(vV0,
1163  dcaV0Daughters,
1164  dcaV0ToPrimVertex,
1165  momPosAtV0vtx,
1166  momNegAtV0vtx,
1167  dcaDaughterToPrimVertex);
1168 
1169  // set the aod v0 on-the-fly status
1170  aodV0->SetOnFlyStatus(v0->GetOnFlyStatus());
1171  }//End of loop on V0s
1172 
1173  V0s().Expand(fNumberOfV0s);
1174 }
1175 
1176 //______________________________________________________________________________
1178 {
1192 
1193  AliCodeTimerAuto("",0);
1194 
1195  // Loop over the tracks and extract and mask out all aod tracks that pass the selections for AODt racks
1196  for(int it = 0;it < fNumberOfTracks;++it)
1197  {
1198  AliAODTrack *tr = (AliAODTrack*)(Tracks().At(it));
1199  if(!tr)continue;
1200  UInt_t map = tr->GetFilterMap();
1201  if(map&fTPCConstrainedFilterMask){
1202  // we only reset the track select ionfo, no deletion...
1203  tr->SetFilterMap(map&~fTPCConstrainedFilterMask);
1204  }
1205  if(map&fHybridFilterMaskTPCCG){
1206  // this is one part of the hybrid tracks
1207  // the others not passing the selection will be TPC only selected below
1209  }
1210  }
1211 
1212  // Loop over the ESD trcks and pick out the tracks passing TPC only cuts
1213  const AliESDVertex *vtxSPD = esd.GetPrimaryVertexSPD();
1214  const AliESDVertex *vtx = esd.GetPrimaryVertex();
1215 
1216  Double_t pos[3] = { 0. };
1217  Double_t covTr[21]={0.};
1218  // Double_t pid[10]={0.};
1219  Double_t p[3] = { 0. };
1220  Double_t pDCA[3] = { 0. }; // momentum at DCA
1221  Double_t rDCA[3] = { 0. }; // position at DCA
1222  Float_t dDCA[2] = {0.}; // DCA to the vertex d and z
1223  Float_t cDCA[3] = {0.}; // covariance of impact parameters
1224  Int_t tofLabel[3] = {0};
1225 
1226  AliAODTrack* aodTrack(0x0);
1227 
1228  // account for change in pT after the constraint
1229  Float_t ptMax = 1E10;
1230  Float_t ptMin = 0;
1231  for(int i = 0;i<32;i++){
1232  if(fTPCConstrainedFilterMask&(1<<i)){
1234  Float_t tmp1= 0,tmp2 = 0;
1235  cuts->GetPtRange(tmp1,tmp2);
1236  if(tmp1>ptMin)ptMin=tmp1;
1237  if(tmp2<ptMax)ptMax=tmp2;
1238  }
1239  }
1240 
1241  for (Int_t nTrack = 0; nTrack < esd.GetNumberOfTracks(); ++nTrack)
1242  {
1243  AliESDtrack* esdTrack = esd.GetTrack(nTrack); //carefull do not modify it othwise need to work with a copy
1244 
1245  UInt_t selectInfo = 0;
1246  Bool_t isHybridITSTPC = false;
1247  //
1248  // Track selection
1249  if (fTrackFilter) {
1250  selectInfo = fTrackFilter->IsSelected(esdTrack);
1251  }
1252 
1253  if(!(selectInfo&fHybridFilterMaskTPCCG)){
1254  // not already selected tracks, use second part of hybrid tracks
1255  isHybridITSTPC = true;
1256  // too save space one could only store these...
1257  }
1258 
1259  selectInfo &= fTPCConstrainedFilterMask;
1260  if (!selectInfo) continue;
1261  if (fWriteHybridTPCCOnly&&!isHybridITSTPC) continue; // write only complementary tracks
1262  // create a tpc only tracl
1263  AliESDtrack *track = AliESDtrackCuts::GetTPCOnlyTrack(const_cast<AliESDEvent*>(&esd),esdTrack->GetID());
1264  if (!track) continue;
1265 
1266  if (track->Pt()>0.) {
1267  // only constrain tracks above threshold
1268  AliExternalTrackParam exParam;
1269  // take the B-field from the ESD, no 3D fieldMap available at this point
1270  Bool_t relate = false;
1271  relate = track->RelateToVertexTPC(vtxSPD,esd.GetMagneticField(),kVeryBig,&exParam);
1272  if(!relate){
1273  delete track;
1274  continue;
1275  }
1276  // fetch the track parameters at the DCA (unconstraint)
1277  if(track->GetTPCInnerParam()){
1278  track->GetTPCInnerParam()->GetPxPyPz(pDCA);
1279  track->GetTPCInnerParam()->GetXYZ(rDCA);
1280  }
1281  // get the DCA to the vertex:
1282  track->GetImpactParametersTPC(dDCA,cDCA);
1283  // set the constrained parameters to the track
1284  track->Set(exParam.GetX(),exParam.GetAlpha(),exParam.GetParameter(),exParam.GetCovariance());
1285  }
1286 
1287  track->GetPxPyPz(p);
1288 
1289  Float_t pT = track->Pt();
1290  if(pT<ptMin||pT>ptMax){
1291  delete track;
1292  continue;
1293  }
1294 
1295  track->GetXYZ(pos);
1296  track->GetCovarianceXYZPxPyPz(covTr);
1297  // esdTrack->GetESDpid(pid);// original PID
1298  esdTrack->GetTOFLabel(tofLabel);
1299  if(fMChandler)fMChandler->SelectParticle(esdTrack->GetLabel());
1300  fUsedTrackCopy[nTrack] |= selectInfo;
1301  aodTrack = new(Tracks()[fNumberOfTracks++]) AliAODTrack((track->GetID()+1)*-1,
1302  track->GetLabel(),
1303  p,
1304  kTRUE,
1305  pos,
1306  kFALSE,
1307  covTr,
1308  (Short_t)track->GetSign(),
1309  track->GetITSClusterMap(),
1310  // pid,
1312  kTRUE, // check if this is right
1313  vtx->UsesTrack(track->GetID()),
1315  selectInfo);
1316  aodTrack->SetITSSharedMap(track->GetITSSharedMap());
1317  aodTrack->SetITSchi2(track->GetITSchi2());
1318  aodTrack->SetPIDForTracking(track->GetPIDForTracking());
1319  aodTrack->SetIsHybridTPCConstrainedGlobal(isHybridITSTPC);
1320  aodTrack->SetTPCFitMap(track->GetTPCFitMap());
1321  aodTrack->SetTPCClusterMap(track->GetTPCClusterMap());
1322  aodTrack->SetTPCSharedMap (track->GetTPCSharedMap());
1323  aodTrack->SetIsTPCConstrained(kTRUE);
1324  aodTrack->SetChi2perNDF(Chi2perNDF(esdTrack)); // original track
1325  // set the DCA values to the AOD track
1326  aodTrack->SetPxPyPzAtDCA(pDCA[0],pDCA[1],pDCA[2]);
1327  aodTrack->SetXYAtDCA(rDCA[0],rDCA[1]);
1328  aodTrack->SetDCA(dDCA[0],dDCA[1]);
1329  aodTrack->SetFlags(track->GetStatus());
1330  aodTrack->SetTPCPointsF(track->GetTPCNclsF());
1331  aodTrack->SetTPCNCrossedRows(UShort_t(track->GetTPCCrossedRows()));
1332  aodTrack->SetIntegratedLength(track->GetIntegratedLength());
1333  aodTrack->SetTOFLabel(tofLabel);
1334  CopyChi2TPCConstrainedVsGlobal(track, aodTrack);
1335  CopyCaloProps(track,aodTrack);
1336  // do not duplicate PID information
1337  // aodTrack->ConvertAliPIDtoAODPID();
1338  // SetAODPID(esdTrack,aodTrack,detpid);
1339  delete track;
1340  } // end of loop on tracks
1341 }
1342 
1343 //______________________________________________________________________________
1345 {
1350 
1351  AliCodeTimerAuto("",0);
1352 
1353  // Loop over the tracks and extract and mask out all aod tracks that pass the selections for AODt racks
1354  for(int it = 0;it < fNumberOfTracks;++it)
1355  {
1356  AliAODTrack *tr = (AliAODTrack*)(Tracks().At(it));
1357  if(!tr)continue;
1358  UInt_t map = tr->GetFilterMap();
1360  // we only reset the track select info, no deletion...
1361  // mask reset mask in case track is already taken
1362  tr->SetFilterMap(map&~fGlobalConstrainedFilterMask);
1363  }
1364  if(map&fHybridFilterMaskGCG){
1365  // this is one part of the hybrid tracks
1366  // the others not passing the selection will be the ones selected below
1368  }
1369  }
1370  // Loop over the ESD trcks and pick out the tracks passing the GlobalConstraint cuts
1371 
1372  Double_t pos[3] = { 0. };
1373  Double_t covTr[21]={0.};
1374  // Double_t pid[10]={0.};
1375  Double_t p[3] = { 0. };
1376 
1377  Double_t pDCA[3] = { 0. }; // momentum at DCA
1378  Double_t rDCA[3] = { 0. }; // position at DCA
1379  Float_t dDCA[2] = {0.}; // DCA to the vertex d and z
1380  Float_t cDCA[3] = {0.}; // covariance of impact parameters
1381  Int_t tofLabel[3] = {0};
1382 
1383  AliAODTrack* aodTrack(0x0);
1384  AliAODPid* detpid(0x0);
1385  const AliESDVertex *vtx = esd.GetPrimaryVertex();
1386 
1387  // account for change in pT after the constraint
1388  Float_t ptMax = 1E10;
1389  Float_t ptMin = 0;
1390  for(int i = 0;i<32;i++){
1391  if(fGlobalConstrainedFilterMask&(1<<i)){
1393  Float_t tmp1= 0,tmp2 = 0;
1394  cuts->GetPtRange(tmp1,tmp2);
1395  if(tmp1>ptMin)ptMin=tmp1;
1396  if(tmp2<ptMax)ptMax=tmp2;
1397  }
1398  }
1399 
1400  for (Int_t nTrack = 0; nTrack < esd.GetNumberOfTracks(); ++nTrack)
1401  {
1402  AliESDtrack* esdTrack = esd.GetTrack(nTrack); //carefull do not modify it othwise need to work with a copy
1403  const AliExternalTrackParam * exParamGC = esdTrack->GetConstrainedParam();
1404  if(!exParamGC)continue;
1405 
1406  UInt_t selectInfo = 0;
1407  Bool_t isHybridGC = false;
1408 
1409  //
1410  // Track selection
1411  if (fTrackFilter) {
1412  selectInfo = fTrackFilter->IsSelected(esdTrack);
1413  }
1414 
1415  if (!(selectInfo&fHybridFilterMaskGCG)) isHybridGC = true;
1416  if (fWriteHybridGCOnly&&!isHybridGC) continue; // write only complementary tracks
1417 
1418  selectInfo &= fGlobalConstrainedFilterMask;
1419  if (!selectInfo) continue;
1420  // fetch the track parameters at the DCA (unconstrained)
1421  esdTrack->GetPxPyPz(pDCA);
1422  esdTrack->GetXYZ(rDCA);
1423  // get the DCA to the vertex:
1424  esdTrack->GetImpactParameters(dDCA,cDCA);
1425  if (!esdTrack->GetConstrainedPxPyPz(p)) continue;
1426 
1427  Float_t pT = exParamGC->Pt();
1428  if(pT<ptMin||pT>ptMax){
1429  continue;
1430  }
1431 
1432  esdTrack->GetConstrainedXYZ(pos);
1433  exParamGC->GetCovarianceXYZPxPyPz(covTr);
1434  // esdTrack->GetESDpid(pid);
1435  esdTrack->GetTOFLabel(tofLabel);
1436  if(fMChandler)fMChandler->SelectParticle(esdTrack->GetLabel());
1437  fUsedTrackCopy[nTrack] |= selectInfo;
1438  aodTrack = new(Tracks()[fNumberOfTracks++]) AliAODTrack((esdTrack->GetID()+1)*-1,
1439  esdTrack->GetLabel(),
1440  p,
1441  kTRUE,
1442  pos,
1443  kFALSE,
1444  covTr,
1445  (Short_t)esdTrack->GetSign(),
1446  esdTrack->GetITSClusterMap(),
1447  // pid,
1449  kTRUE, // check if this is right
1450  vtx->UsesTrack(esdTrack->GetID()),
1452  selectInfo);
1453  aodTrack->SetITSSharedMap(esdTrack->GetITSSharedMap());
1454  aodTrack->SetITSchi2(esdTrack->GetITSchi2());
1455  aodTrack->SetPIDForTracking(esdTrack->GetPIDForTracking());
1456  aodTrack->SetIsHybridGlobalConstrainedGlobal(isHybridGC);
1457  aodTrack->SetIsGlobalConstrained(kTRUE);
1458  aodTrack->SetTPCFitMap(esdTrack->GetTPCFitMap());
1459  aodTrack->SetTPCClusterMap(esdTrack->GetTPCClusterMap());
1460  aodTrack->SetTPCSharedMap (esdTrack->GetTPCSharedMap());
1461  aodTrack->SetChi2perNDF(Chi2perNDF(esdTrack));
1462 
1463  // set the DCA values to the AOD track
1464  aodTrack->SetPxPyPzAtDCA(pDCA[0],pDCA[1],pDCA[2]);
1465  aodTrack->SetXYAtDCA(rDCA[0],rDCA[1]);
1466  aodTrack->SetDCA(dDCA[0],dDCA[1]);
1467  aodTrack->SetFlags(esdTrack->GetStatus());
1468  aodTrack->SetTPCPointsF(esdTrack->GetTPCNclsF());
1469  aodTrack->SetTPCNCrossedRows(UShort_t(esdTrack->GetTPCCrossedRows()));
1470  aodTrack->SetIntegratedLength(esdTrack->GetIntegratedLength());
1471  aodTrack->SetTOFLabel(tofLabel);
1472  CopyChi2TPCConstrainedVsGlobal(esdTrack, aodTrack);
1473  CopyCaloProps(esdTrack,aodTrack);
1474  if(isHybridGC){
1475  // only copy AOD information for hybrid, no duplicate information
1476  aodTrack->ConvertAliPIDtoAODPID();
1477  SetAODPID(esdTrack,aodTrack,detpid);
1478  }
1479  } // end of loop on tracks
1480 }
1481 
1482 //______________________________________________________________________________
1484 {
1486 
1487  AliCodeTimerAuto("",0);
1488 
1489  AliDebug(1,Form("NUMBER OF ESD TRACKS %5d\n", esd.GetNumberOfTracks()));
1490 
1491  const AliESDVertex *vtx = esd.GetPrimaryVertex();
1492  Double_t p[3] = { 0. };
1493  Double_t pos[3] = { 0. };
1494  Double_t covTr[21] = { 0. };
1495  // Double_t pid[10] = { 0. };
1496  Int_t tofLabel[3] = {0};
1497  AliAODTrack* aodTrack(0x0);
1498  AliAODPid* detpid(0x0);
1499 
1500 
1501  for (Int_t nTrack = 0; nTrack < esd.GetNumberOfTracks(); ++nTrack)
1502  {
1503  if (fUsedTrack[nTrack]) continue;
1504 
1505  AliESDtrack *esdTrack = esd.GetTrack(nTrack);
1506  UInt_t selectInfo = 0;
1507  //
1508  // Track selection
1509  if (fTrackFilter) {
1510  selectInfo = fTrackFilter->IsSelected(esdTrack);
1511  if (!selectInfo && !vtx->UsesTrack(esdTrack->GetID())) continue;
1512  }
1513 
1514  esdTrack->GetPxPyPz(p);
1515  esdTrack->GetXYZ(pos);
1516  esdTrack->GetCovarianceXYZPxPyPz(covTr);
1517  // esdTrack->GetESDpid(pid);
1518  esdTrack->GetTOFLabel(tofLabel);
1519  if(fMChandler)fMChandler->SelectParticle(esdTrack->GetLabel());
1520  fUsedTrack[nTrack] = kTRUE;
1521  aodTrack = new(Tracks()[fNumberOfTracks++]) AliAODTrack(esdTrack->GetID(),
1522  esdTrack->GetLabel(),
1523  p,
1524  kTRUE,
1525  pos,
1526  kFALSE,
1527  covTr,
1528  (Short_t)esdTrack->GetSign(),
1529  esdTrack->GetITSClusterMap(),
1530  // pid,
1532  kTRUE, // check if this is right
1533  vtx->UsesTrack(esdTrack->GetID()),
1535  selectInfo);
1536  aodTrack->SetITSSharedMap(esdTrack->GetITSSharedMap());
1537  aodTrack->SetITSchi2(esdTrack->GetITSchi2());
1538  fPrimaryVertex->AddDaughter(aodTrack);
1539  aodTrack->SetPIDForTracking(esdTrack->GetPIDForTracking());
1540  aodTrack->SetTPCFitMap(esdTrack->GetTPCFitMap());
1541  aodTrack->SetTPCClusterMap(esdTrack->GetTPCClusterMap());
1542  aodTrack->SetTPCSharedMap (esdTrack->GetTPCSharedMap());
1543  aodTrack->SetChi2perNDF(Chi2perNDF(esdTrack));
1544  aodTrack->SetTPCPointsF(esdTrack->GetTPCNclsF());
1545  aodTrack->SetTPCNCrossedRows(UShort_t(esdTrack->GetTPCCrossedRows()));
1546  aodTrack->SetIntegratedLength(esdTrack->GetIntegratedLength());
1547  aodTrack->SetTOFLabel(tofLabel);
1548  CopyChi2TPCConstrainedVsGlobal(esdTrack, aodTrack);
1549  CopyCaloProps(esdTrack,aodTrack);
1550  fAODTrackRefs->AddAt(aodTrack, nTrack);
1551  if (esdTrack->GetSign() > 0) ++fNumberOfPositiveTracks;
1552  aodTrack->SetFlags(esdTrack->GetStatus());
1553  aodTrack->ConvertAliPIDtoAODPID();
1554  SetAODPID(esdTrack,aodTrack,detpid);
1555 
1556  } // end of loop on tracks
1557 }
1558 
1559 //______________________________________________________________________________
1561 {
1563 
1564  AliCodeTimerAuto("",0);
1565  Int_t jPmdClusters=0;
1566  // Access to the AOD container of PMD clusters
1567  TClonesArray &pmdClusters = *(AODEvent()->GetPmdClusters());
1568  for (Int_t iPmd = 0; iPmd < esd.GetNumberOfPmdTracks(); ++iPmd) {
1569  // file pmd clusters, to be revised!
1570  AliESDPmdTrack *pmdTrack = esd.GetPmdTrack(iPmd);
1571  Int_t nLabel = 0;
1572  Int_t *label = 0x0;
1573  Double_t posPmd[3] = { pmdTrack->GetClusterX(), pmdTrack->GetClusterY(), pmdTrack->GetClusterZ()};
1574  Double_t pidPmd[13] = { 0.}; // to be revised!
1575  // type not set!
1576  // assoc cluster not set
1577  new(pmdClusters[jPmdClusters++]) AliAODPmdCluster(iPmd, nLabel, label, pmdTrack->GetClusterADC(), posPmd, pidPmd);
1578  }
1579 }
1580 
1581 //______________________________________________________________________________
1583 {
1585 
1586  AliCodeTimerAuto("",0);
1587 
1588  // Access to the AOD container of clusters
1589  TClonesArray &caloClusters = *(AODEvent()->GetCaloClusters());
1590  Int_t jClusters(0);
1591 
1592  for (Int_t iClust=0; iClust<esd.GetNumberOfCaloClusters(); ++iClust) {
1593  AliESDCaloCluster * cluster = esd.GetCaloCluster(iClust);
1594 
1595  Int_t id = cluster->GetID();
1596  Int_t nLabel = cluster->GetNLabels();
1597  Int_t *labels = cluster->GetLabels();
1598  if(labels){
1599  for(int i = 0;i < nLabel;++i) {
1600  if(fMChandler)fMChandler->SelectParticle(labels[i]);
1601  }
1602  }
1603 
1604  Float_t energy = cluster->E();
1605  Float_t posF[3] = { 0.};
1606  cluster->GetPosition(posF);
1607 
1608  AliAODCaloCluster *caloCluster = new(caloClusters[jClusters++]) AliAODCaloCluster(id,
1609  nLabel,
1610  labels,
1611  energy,
1612  posF,
1613  NULL,
1614  cluster->GetType(),0);
1615 
1616  caloCluster->SetCaloCluster(cluster->GetDistanceToBadChannel(),
1617  cluster->GetDispersion(),
1618  cluster->GetM20(), cluster->GetM02(),
1619  cluster->GetEmcCpvDistance(),
1620  cluster->GetNExMax(),cluster->GetTOF()) ;
1621  caloCluster->SetPIDFromESD(cluster->GetPID());
1622  caloCluster->SetNCells(cluster->GetNCells());
1623  caloCluster->SetCellsAbsId(cluster->GetCellsAbsId());
1624  caloCluster->SetCellsAmplitudeFraction(cluster->GetCellsAmplitudeFraction());
1625  caloCluster->SetTrackDistance(cluster->GetTrackDx(), cluster->GetTrackDz());
1626 
1627  caloCluster->SetCellsMCEdepFractionMap(cluster->GetCellsMCEdepFractionMap());
1628  caloCluster->SetClusterMCEdepFraction (cluster->GetClusterMCEdepFraction ());
1629 
1630  Int_t nMatchCount = 0;
1631  TArrayI* matchedT = cluster->GetTracksMatched();
1632  if (fNumberOfTracks>0 && matchedT && cluster->GetTrackMatchedIndex() >= 0) {
1633  for (Int_t im = 0; im < matchedT->GetSize(); im++) {
1634  Int_t iESDtrack = matchedT->At(im);;
1635  if (fAODTrackRefs->At(iESDtrack) != 0) {
1636  caloCluster->AddTrackMatched((AliAODTrack*)fAODTrackRefs->At(iESDtrack));
1637  nMatchCount++;
1638  }
1639  }
1640  }
1641  if(nMatchCount==0)
1642  caloCluster->SetTrackDistance(-999,-999);
1643 
1644  }
1645  caloClusters.Expand(jClusters); // resize TObjArray to 'remove' slots for pseudo clusters
1646 }
1647 
1648 //______________________________________________________________________________
1650 {
1651  AliCodeTimerAuto("",0);
1652 
1653  if (calo == "PHOS") {
1654  AliAODCaloTrigger &aodTrigger = *(AODEvent()->GetCaloTrigger(calo));
1655  AliESDCaloTrigger &esdTrigger = *(esd.GetCaloTrigger(calo));
1656 
1657  aodTrigger.Allocate(esdTrigger.GetEntries());
1658  esdTrigger.Reset();
1659 
1660  Float_t a;
1661  Int_t tmod,tabsId;
1662  while (esdTrigger.Next()) {
1663  esdTrigger.GetPosition(tmod,tabsId);
1664  esdTrigger.GetAmplitude(a);
1665  aodTrigger.Add(tmod,tabsId,a,0.,(Int_t*)NULL,0,esdTrigger.GetL1TimeSum(),0);
1666  }
1667  return;
1668  }
1669 
1670  static Bool_t saveOnce = kFALSE;
1671  if (!saveOnce) {
1673  if (aodHandler) {
1674  TTree *aodTree = aodHandler->GetTree();
1675  if (aodTree) {
1676  Int_t *type = esd.GetCaloTriggerType();
1677  for (Int_t i = 0; i < 15; i++) {
1678  aodTree->GetUserInfo()->Add(new TParameter<int>(Form("EMCALCaloTrigger%d",i), type[i]));
1679  }
1680  saveOnce = kTRUE;
1681  }
1682  }
1683  }
1684 
1685  AliAODCaloTrigger &aodTrigger = *(AODEvent()->GetCaloTrigger(calo));
1686  AliESDCaloTrigger &esdTrigger = *(esd.GetCaloTrigger(calo));
1687  aodTrigger.Allocate(esdTrigger.GetEntries());
1688 
1689  esdTrigger.Reset();
1690  while (esdTrigger.Next()) {
1691  Int_t px, py, ts, nTimes, times[10], b;
1692  Float_t a, t;
1693  esdTrigger.GetPosition(px, py);
1694  esdTrigger.GetAmplitude(a);
1695  esdTrigger.GetTime(t);
1696  esdTrigger.GetL0Times(times);
1697  esdTrigger.GetNL0Times(nTimes);
1698  esdTrigger.GetL1TimeSum(ts);
1699  esdTrigger.GetTriggerBits(b);
1700  aodTrigger.Add(px, py, a, t, times, nTimes, ts, b);
1701  }
1702 
1703  for (int i = 0; i < 4; i++) aodTrigger.SetL1Threshold(i, esdTrigger.GetL1Threshold(i));
1704  Int_t v0[2] = {
1705  esdTrigger.GetL1V0(0),
1706  esdTrigger.GetL1V0(1)
1707  };
1708  aodTrigger.SetL1V0(v0);
1709  aodTrigger.SetL1FrameMask(esdTrigger.GetL1FrameMask());
1710 }
1711 
1712 //______________________________________________________________________________
1714 {
1716 
1717  AliCodeTimerAuto("",0);
1718 
1719  // fill EMCAL cell info
1720  if (esd.GetEMCALCells()) { // protection against missing ESD information
1721  AliESDCaloCells &esdEMcells = *(esd.GetEMCALCells());
1722  Int_t nEMcell = esdEMcells.GetNumberOfCells() ;
1723  AliAODCaloCells &aodEMcells = *(AODEvent()->GetEMCALCells());
1724  aodEMcells.CreateContainer(nEMcell);
1726  for (Int_t iCell = 0; iCell < nEMcell; iCell++) {
1727  aodEMcells.SetCell(iCell,esdEMcells.GetCellNumber(iCell),esdEMcells.GetAmplitude(iCell),
1728  esdEMcells.GetTime(iCell), esdEMcells.GetMCLabel(iCell), esdEMcells.GetEFraction(iCell),
1729  esdEMcells.GetHighGain(iCell) );
1730  }
1731  aodEMcells.Sort();
1732  }
1733 }
1734 
1735 //______________________________________________________________________________
1737 {
1739 
1740  AliCodeTimerAuto("",0);
1741 
1742  // fill PHOS cell info
1743  if (esd.GetPHOSCells()) { // protection against missing ESD information
1744  AliESDCaloCells &esdPHcells = *(esd.GetPHOSCells());
1745  Int_t nPHcell = esdPHcells.GetNumberOfCells() ;
1746 
1747  AliAODCaloCells &aodPHcells = *(AODEvent()->GetPHOSCells());
1748  aodPHcells.CreateContainer(nPHcell);
1749  aodPHcells.SetType(AliAODCaloCells::kPHOSCell);
1750  for (Int_t iCell = 0; iCell < nPHcell; iCell++) {
1751  aodPHcells.SetCell(iCell,esdPHcells.GetCellNumber(iCell),esdPHcells.GetAmplitude(iCell),
1752  esdPHcells.GetTime(iCell), esdPHcells.GetMCLabel(iCell), esdPHcells.GetEFraction(iCell),
1753  esdPHcells.GetHighGain(iCell) );
1754  }
1755  aodPHcells.Sort();
1756  }
1757 }
1758 
1759 //______________________________________________________________________________
1761 {
1763 
1764  AliCodeTimerAuto("",0);
1765 
1766  AliAODTracklets &SPDTracklets = *(AODEvent()->GetTracklets());
1767  const AliMultiplicity *mult = esd.GetMultiplicity();
1768  if (mult) {
1769  if (mult->GetNumberOfTracklets()>0) {
1770  SPDTracklets.CreateContainer(mult->GetNumberOfTracklets());
1771  SPDTracklets.SetScaleDThetaBySin2T(mult->GetScaleDThetaBySin2T());
1772  for (Int_t n=0; n<mult->GetNumberOfTracklets(); n++) {
1773  if(fMChandler){
1774  fMChandler->SelectParticle(mult->GetLabel(n, 0));
1775  fMChandler->SelectParticle(mult->GetLabel(n, 1));
1776  }
1777  SPDTracklets.SetTracklet(n, mult->GetTheta(n), mult->GetPhi(n), mult->GetDeltaPhi(n), mult->GetLabel(n, 0),mult->GetLabel(n, 1));
1778  }
1779  }
1780  SPDTracklets.SetFiredChipMap(mult->GetFiredChipMap());
1781  SPDTracklets.SetFastOrFiredChipMap(mult->GetFastOrFiredChipMap());
1782  SPDTracklets.SetFiredChips(0,mult->GetNumberOfFiredChips(0));
1783  SPDTracklets.SetFiredChips(1,mult->GetNumberOfFiredChips(1));
1784  //
1785  for (int i=6;i--;) SPDTracklets.SetITSClusters(i,mult->GetNumberOfITSClusters(i));
1786  } else {
1787  //Printf("ERROR: AliMultiplicity could not be retrieved from ESD");
1788  }
1789 }
1790 
1791 //______________________________________________________________________________
1793 {
1794  AliCodeTimerAuto("",0);
1795 
1796  // Kinks: it is a big mess the access to the information in the kinks
1797  // The loop is on the tracks in order to find the mother and daugther of each kink
1798 
1799  Double_t covTr[21]={0.};
1800  // Double_t pid[10]={0.};
1801  AliAODPid* detpid(0x0);
1802  Int_t tofLabel[3] = {0};
1803 
1805 
1806  const AliESDVertex* vtx = esd.GetPrimaryVertex();
1807 
1808  for (Int_t iTrack=0; iTrack<esd.GetNumberOfTracks(); ++iTrack)
1809  {
1810  AliESDtrack * esdTrack = esd.GetTrack(iTrack);
1811 
1812  Int_t ikink = esdTrack->GetKinkIndex(0);
1813 
1814  if (ikink && fNumberOfKinks) {
1815  // Negative kink index: mother, positive: daughter
1816  // Search for the second track of the kink
1817 
1818  for (Int_t jTrack = iTrack+1; jTrack<esd.GetNumberOfTracks(); ++jTrack) {
1819  AliESDtrack * esdTrack1 = esd.GetTrack(jTrack);
1820  Int_t jkink = esdTrack1->GetKinkIndex(0);
1821 
1822  if ( TMath::Abs(ikink)==TMath::Abs(jkink) ) {
1823  // The two tracks are from the same kink
1824  if (fUsedKink[TMath::Abs(ikink)-1]) continue; // skip used kinks
1825 
1826  Int_t imother = -1;
1827  Int_t idaughter = -1;
1828 
1829  if (ikink<0 && jkink>0) {
1830  imother = iTrack;
1831  idaughter = jTrack;
1832  } else if (ikink>0 && jkink<0) {
1833  imother = jTrack;
1834  idaughter = iTrack;
1835  } else {
1836  //cerr << "Error: Wrong combination of kink indexes: "
1837  // << ikink << " " << jkink << endl;
1838  continue;
1839  }
1840 
1841  // Add the mother track if it passed primary track selection cuts
1842  AliAODTrack * mother = NULL;
1843 
1844  UInt_t selectInfo = 0;
1845  if (fTrackFilter) {
1846  selectInfo = fTrackFilter->IsSelected(esd.GetTrack(imother));
1847  if (!selectInfo) continue;
1848  }
1849 
1850  if (!fUsedTrack[imother]) {
1851  fUsedTrack[imother] = kTRUE;
1852  AliESDtrack *esdTrackM = esd.GetTrack(imother);
1853  Double_t p[3] = { 0. };
1854  Double_t pos[3] = { 0. };
1855  esdTrackM->GetPxPyPz(p);
1856  esdTrackM->GetXYZ(pos);
1857  esdTrackM->GetCovarianceXYZPxPyPz(covTr);
1858  // esdTrackM->GetESDpid(pid);
1859  esdTrackM->GetTOFLabel(tofLabel);
1860  if(fMChandler)fMChandler->SelectParticle(esdTrackM->GetLabel());
1861  mother = new(Tracks()[fNumberOfTracks++]) AliAODTrack(esdTrackM->GetID(),
1862  esdTrackM->GetLabel(),
1863  p,
1864  kTRUE,
1865  pos,
1866  kFALSE,
1867  covTr,
1868  (Short_t)esdTrackM->GetSign(),
1869  esdTrackM->GetITSClusterMap(),
1870  // pid,
1872  kTRUE, // check if this is right
1873  vtx->UsesTrack(esdTrack->GetID()),
1875  selectInfo);
1876  mother->SetITSSharedMap(esdTrackM->GetITSSharedMap());
1877  mother->SetITSchi2(esdTrackM->GetITSchi2());
1878  mother->SetPIDForTracking(esdTrackM->GetPIDForTracking());
1879  mother->SetTPCFitMap(esdTrackM->GetTPCFitMap());
1880  mother->SetTPCClusterMap(esdTrackM->GetTPCClusterMap());
1881  mother->SetTPCSharedMap (esdTrackM->GetTPCSharedMap());
1882  mother->SetChi2perNDF(Chi2perNDF(esdTrackM));
1883  mother->SetTPCPointsF(esdTrackM->GetTPCNclsF());
1884  mother->SetTPCNCrossedRows(UShort_t(esdTrackM->GetTPCCrossedRows()));
1885  mother->SetIntegratedLength(esdTrackM->GetIntegratedLength());
1886  mother->SetTOFLabel(tofLabel);
1887  CopyChi2TPCConstrainedVsGlobal(esdTrackM, mother);
1888  CopyCaloProps(esdTrackM,mother);
1889  fAODTrackRefs->AddAt(mother, imother);
1890  if (esdTrackM->GetSign() > 0) ++fNumberOfPositiveTracks;
1891  mother->SetFlags(esdTrackM->GetStatus());
1892  mother->ConvertAliPIDtoAODPID();
1893  fPrimaryVertex->AddDaughter(mother);
1894  mother->ConvertAliPIDtoAODPID();
1895  SetAODPID(esdTrackM,mother,detpid);
1896  }
1897  else {
1898  //cerr << "Error: event " << esd.GetEventNumberInFile() << " kink " << TMath::Abs(ikink)-1
1899  // << " track " << imother << " has already been used!" << endl;
1900  }
1901 
1902  // Add the kink vertex
1903  AliESDkink * kink = esd.GetKink(TMath::Abs(ikink)-1);
1904 
1905  AliAODVertex * vkink = new(Vertices()[fNumberOfVertices++]) AliAODVertex(kink->GetPosition(),
1906  NULL,
1907  0.,
1908  mother,
1909  esdTrack->GetID(), // ID of mother's track!
1911  // Add the daughter track
1912  AliAODTrack * daughter = NULL;
1913  if (!fUsedTrack[idaughter]) {
1914  fUsedTrack[idaughter] = kTRUE;
1915  AliESDtrack *esdTrackD = esd.GetTrack(idaughter);
1916  Double_t p[3] = { 0. };
1917  Double_t pos[3] = { 0. };
1918  esdTrackD->GetPxPyPz(p);
1919  esdTrackD->GetXYZ(pos);
1920  esdTrackD->GetCovarianceXYZPxPyPz(covTr);
1921  // esdTrackD->GetESDpid(pid);
1922  esdTrackD->GetTOFLabel(tofLabel);
1923  selectInfo = 0;
1924  if (fTrackFilter) selectInfo = fTrackFilter->IsSelected(esdTrackD);
1925  if(fMChandler)fMChandler->SelectParticle(esdTrackD->GetLabel());
1926  daughter = new(Tracks()[fNumberOfTracks++]) AliAODTrack(esdTrackD->GetID(),
1927  esdTrackD->GetLabel(),
1928  p,
1929  kTRUE,
1930  pos,
1931  kFALSE,
1932  covTr,
1933  (Short_t)esdTrackD->GetSign(),
1934  esdTrackD->GetITSClusterMap(),
1935  // pid,
1936  vkink,
1937  kTRUE, // check if this is right
1938  vtx->UsesTrack(esdTrack->GetID()),
1940  selectInfo);
1941  daughter->SetITSSharedMap(esdTrackD->GetITSSharedMap());
1942  daughter->SetITSchi2(esdTrackD->GetITSchi2());
1943  daughter->SetPIDForTracking(esdTrackD->GetPIDForTracking());
1944  daughter->SetTPCFitMap(esdTrackD->GetTPCFitMap());
1945  daughter->SetTPCClusterMap(esdTrackD->GetTPCClusterMap());
1946  daughter->SetTPCSharedMap (esdTrackD->GetTPCSharedMap());
1947  daughter->SetTPCPointsF(esdTrackD->GetTPCNclsF());
1948  daughter->SetTPCNCrossedRows(UShort_t(esdTrackD->GetTPCCrossedRows()));
1949  daughter->SetIntegratedLength(esdTrackD->GetIntegratedLength());
1950  daughter->SetTOFLabel(tofLabel);
1951  CopyChi2TPCConstrainedVsGlobal(esdTrackD, daughter);
1952  CopyCaloProps(esdTrackD,daughter);
1953  fAODTrackRefs->AddAt(daughter, idaughter);
1954  if (esdTrackD->GetSign() > 0) ++fNumberOfPositiveTracks;
1955  daughter->SetFlags(esdTrackD->GetStatus());
1956  daughter->ConvertAliPIDtoAODPID();
1957  vkink->AddDaughter(daughter);
1958  daughter->ConvertAliPIDtoAODPID();
1959  SetAODPID(esdTrackD,daughter,detpid);
1960  } else {
1961  //cerr << "Error: event " << esd.GetEventNumberInFile() << " kink " << TMath::Abs(ikink)-1
1962  // << " track " << idaughter << " has already been used!" << endl;
1963  }
1964  }
1965  }
1966  }
1967  }
1968 }
1969 
1970 //______________________________________________________________________________
1972 {
1973  AliCodeTimerAuto("",0);
1974 
1975  // Access to the AOD container of vertices
1976  fNumberOfVertices = 0;
1977 
1978  Double_t pos[3] = { 0. };
1979  Double_t covVtx[6] = { 0. };
1980 
1981  // Add primary vertex. The primary tracks will be defined
1982  // after the loops on the composite objects (V0, cascades, kinks)
1983  const AliESDVertex *vtx = esd.GetPrimaryVertex();
1984  char vType = AliAODVertex::kPrimary;
1985  if (!vtx->GetStatus()) vType = AliAODVertex::kPrimaryInvalid;
1986  else if (vtx == esd.GetPrimaryVertexTPC()) vType = AliAODVertex::kPrimaryTPC;
1987  vtx->GetXYZ(pos); // position
1988  vtx->GetCovMatrix(covVtx); //covariance matrix
1990  AliAODVertex(pos, covVtx, vtx->GetChi2toNDF(), NULL, -1, vType);
1991  fPrimaryVertex->SetName(vtx->GetName());
1992  fPrimaryVertex->SetTitle(vtx->GetTitle());
1993  fPrimaryVertex->SetBC(vtx->GetBC());
1994 
1995  /*
1996  // RS: always transfer original NContributors
1997  TString vtitle = vtx->GetTitle();
1998  if (!vtitle.Contains("VertexerTracks")) fPrimaryVertex->SetNContributors(vtx->GetNContributors());
1999  */
2001 
2002  if (fDebug > 0) fPrimaryVertex->Print();
2003 
2004  // Add SPD "main" vertex
2005  const AliESDVertex *vtxS = esd.GetPrimaryVertexSPD();
2006  vtxS->GetXYZ(pos); // position
2007  vtxS->GetCovMatrix(covVtx); //covariance matrix
2008  AliAODVertex * mVSPD = new(Vertices()[fNumberOfVertices++])
2009  AliAODVertex(pos, covVtx, vtxS->GetChi2toNDF(), NULL, -1, AliAODVertex::kMainSPD);
2010  mVSPD->SetName(vtxS->GetName());
2011  mVSPD->SetTitle(vtxS->GetTitle());
2012  mVSPD->SetNContributors(vtxS->GetNContributors());
2013 
2014  // Add SPD pileup vertices
2015  for(Int_t iV=0; iV<esd.GetNumberOfPileupVerticesSPD(); ++iV) {
2016  const AliESDVertex *vtxP = esd.GetPileupVertexSPD(iV);
2017  vtxP->GetXYZ(pos); // position
2018  vtxP->GetCovMatrix(covVtx); //covariance matrix
2019  AliAODVertex * pVSPD = new(Vertices()[fNumberOfVertices++])
2020  AliAODVertex(pos, covVtx, vtxP->GetChi2toNDF(), NULL, -1, AliAODVertex::kPileupSPD);
2021  pVSPD->SetName(vtxP->GetName());
2022  pVSPD->SetTitle(vtxP->GetTitle());
2023  pVSPD->SetNContributors(vtxP->GetNContributors());
2024  pVSPD->SetBC(vtxP->GetBC());
2025  }
2026 
2027  // Add TRK pileup vertices
2028  for(Int_t iV=0; iV<esd.GetNumberOfPileupVerticesTracks(); ++iV) {
2029  const AliESDVertex *vtxP = esd.GetPileupVertexTracks(iV);
2030  vtxP->GetXYZ(pos); // position
2031  vtxP->GetCovMatrix(covVtx); //covariance matrix
2032  AliAODVertex * pVTRK = new(Vertices()[fNumberOfVertices++])
2033  AliAODVertex(pos, covVtx, vtxP->GetChi2toNDF(), NULL, -1, AliAODVertex::kPileupTracks);
2034  pVTRK->SetName(vtxP->GetName());
2035  pVTRK->SetTitle(vtxP->GetTitle());
2036  pVTRK->SetNContributors(vtxP->GetNContributors());
2037  pVTRK->SetBC(vtxP->GetBC());
2038  }
2039 
2040  // Add TPC "main" vertex
2041  const AliESDVertex *vtxT = esd.GetPrimaryVertexTPC();
2042  vtxT->GetXYZ(pos); // position
2043  vtxT->GetCovMatrix(covVtx); //covariance matrix
2044  AliAODVertex * mVTPC = new(Vertices()[fNumberOfVertices++])
2045  AliAODVertex(pos, covVtx, vtxT->GetChi2toNDF(), NULL, -1, AliAODVertex::kMainTPC);
2046  mVTPC->SetName(vtxT->GetName());
2047  mVTPC->SetTitle(vtxT->GetTitle());
2048  mVTPC->SetNContributors(vtxT->GetNContributors());
2049 }
2050 
2051 //______________________________________________________________________________
2053 {
2055 
2056  AliAODVZERO* vzeroData = AODEvent()->GetVZEROData();
2057  *vzeroData = *(esd.GetVZEROData());
2058 }
2059 
2060 //______________________________________________________________________________
2062 {
2064 
2065  const AliESDTZERO* esdTzero = esd.GetESDTZERO();
2066  AliAODTZERO* aodTzero = AODEvent()->GetTZEROData();
2067 
2068  for (Int_t icase=0; icase<3; icase++){
2069  aodTzero->SetT0TOF( icase, esdTzero->GetT0TOF(icase));
2070  aodTzero->SetT0TOFbest(icase, esdTzero->GetT0TOFbest(icase));
2071  }
2072  aodTzero->SetBackgroundFlag(esdTzero->GetBackgroundFlag());
2073  aodTzero->SetPileupFlag(esdTzero->GetPileupFlag());
2074  aodTzero->SetSatelliteFlag(esdTzero->GetSatellite());
2075 
2076  Float_t rawTime[24];
2077  for(Int_t ipmt=0; ipmt<24; ipmt++)
2078  rawTime[ipmt] = esdTzero->GetTimeFull(ipmt,0);
2079 
2080  Int_t idxOfFirstPmtA = -1, idxOfFirstPmtC = -1;
2081  Float_t timeOfFirstPmtA = 9999, timeOfFirstPmtC = 9999;
2082  for(int ipmt=0; ipmt<12; ipmt++){
2083  if( rawTime[ipmt] > -2 && rawTime[ipmt] < timeOfFirstPmtC && rawTime[ipmt]!=0){
2084  timeOfFirstPmtC = rawTime[ipmt];
2085  idxOfFirstPmtC = ipmt;
2086  }
2087  }
2088  for(int ipmt=12; ipmt<24; ipmt++){
2089  if( rawTime[ipmt] > -2 && rawTime[ipmt] < timeOfFirstPmtA && rawTime[ipmt]!=0 ){
2090  timeOfFirstPmtA = rawTime[ipmt];
2091  idxOfFirstPmtA = ipmt;
2092  }
2093  }
2094 
2095  if(idxOfFirstPmtA != -1 && idxOfFirstPmtC != -1){
2096  //speed of light in cm/ns TMath::C()*1e-7
2097  Float_t vertexraw = TMath::C()*1e-7 * (rawTime[idxOfFirstPmtA] - rawTime[idxOfFirstPmtC])/2;
2098  aodTzero->SetT0VertexRaw( vertexraw );
2099  }else{
2100  aodTzero->SetT0VertexRaw(99999);
2101  }
2102 
2103  aodTzero->SetT0zVertex(esdTzero->GetT0zVertex());
2104  //amplitude
2105  const Double32_t *amp=esdTzero->GetT0amplitude();
2106  for(int ipmt=0; ipmt<24; ipmt++)
2107  aodTzero->SetAmp(ipmt, amp[ipmt]);
2108  aodTzero->SetAmp(24,esdTzero->GetMultC() );
2109  aodTzero->SetAmp(25,esdTzero->GetMultA() );
2110  //pile-up bits
2111  aodTzero->SetPileupBits(esdTzero->GetT0PileupBits() );
2112 
2113 }
2114 
2115 //______________________________________________________________________________
2117 {
2119 
2120  AliESDZDC* esdZDC = esd.GetZDCData();
2121 
2122  const Double_t zem1Energy = esdZDC->GetZEM1Energy();
2123  const Double_t zem2Energy = esdZDC->GetZEM2Energy();
2124 
2125  const Double_t *towZNC = esdZDC->GetZNCTowerEnergy();
2126  const Double_t *towZPC = esdZDC->GetZPCTowerEnergy();
2127  const Double_t *towZNA = esdZDC->GetZNATowerEnergy();
2128  const Double_t *towZPA = esdZDC->GetZPATowerEnergy();
2129  const Double_t *towZNCLG = esdZDC->GetZNCTowerEnergyLR();
2130  const Double_t *towZNALG = esdZDC->GetZNATowerEnergyLR();
2131  const Double_t *towZPCLG = esdZDC->GetZPCTowerEnergyLR();
2132  const Double_t *towZPALG = esdZDC->GetZPATowerEnergyLR();
2133 
2134  AliAODZDC* zdcAOD = AODEvent()->GetZDCData();
2135 
2136  zdcAOD->SetZEM1Energy(zem1Energy);
2137  zdcAOD->SetZEM2Energy(zem2Energy);
2138  zdcAOD->SetZNCTowers(towZNC, towZNCLG);
2139  zdcAOD->SetZNATowers(towZNA, towZNALG);
2140  zdcAOD->SetZPCTowers(towZPC, towZPCLG);
2141  zdcAOD->SetZPATowers(towZPA, towZPALG);
2142 
2143  zdcAOD->SetZDCParticipants(esdZDC->GetZDCParticipants(), esdZDC->GetZDCPartSideA(), esdZDC->GetZDCPartSideC());
2144  zdcAOD->SetZDCImpactParameter(esdZDC->GetImpactParameter(), esdZDC->GetImpactParamSideA(), esdZDC->GetImpactParamSideC());
2145 
2146  // Setters dealing only with the 1st stored TDC hit
2147  zdcAOD->SetZDCTDCSum(esdZDC->GetZNTDCSum(0));
2148  zdcAOD->SetZDCTDCDiff(esdZDC->GetZNTDCDiff(0));
2149 
2150  zdcAOD->ResetZNAfired();
2151  zdcAOD->ResetZNCfired();
2152  zdcAOD->ResetZPAfired();
2153  zdcAOD->ResetZPCfired();
2154  zdcAOD->ResetZEM1fired();
2155  zdcAOD->ResetZEM2fired();
2156 
2157  const Float_t kNoEntry = -999.;
2158  //Taking into account all the 4 hits
2159  if(esdZDC->IsZNChit()){
2160  zdcAOD->SetZNCfired();
2161  int zncch = esdZDC->GetZNCTDCChannel();
2162  if(zncch>0){
2163  zdcAOD->SetZNCTDC(esdZDC->GetZDCTDCCorrected(zncch, 0));
2164  for(int i=0; i<4; i++){
2165  if(TMath::Abs(esdZDC->GetZDCTDCData(zncch, i))>1e-6) zdcAOD->SetZNCTDCm(i, esdZDC->GetZDCTDCCorrected(zncch, i));
2166  }
2167  }
2168  }
2169  else for(int i=0; i<4; i++) zdcAOD->SetZNCTDCm(i, kNoEntry);
2170  if(esdZDC->IsZNAhit()){
2171  zdcAOD->SetZNAfired();
2172  int znach = esdZDC->GetZNATDCChannel();
2173  if(znach>0){
2174  zdcAOD->SetZNATDC(esdZDC->GetZDCTDCCorrected(znach, 0));
2175  for(int i=0; i<4; i++){
2176  if(TMath::Abs(esdZDC->GetZDCTDCData(znach, i))>1e-6) zdcAOD->SetZNATDCm(i, esdZDC->GetZDCTDCCorrected(znach, i));
2177  }
2178  }
2179  }
2180  else for(int i=0; i<4; i++) zdcAOD->SetZNATDCm(i, kNoEntry);
2181  if(esdZDC->IsZPChit()){
2182  zdcAOD->SetZPCfired();
2183  int zpcch = esdZDC->GetZPCTDCChannel();
2184  if(zpcch>0){
2185  zdcAOD->SetZPCTDC(esdZDC->GetZDCTDCCorrected(zpcch, 0));
2186  for(int i=0; i<4; i++){
2187  if(TMath::Abs(esdZDC->GetZDCTDCData(zpcch, i))>1e-6) zdcAOD->SetZPCTDCm(i, esdZDC->GetZDCTDCCorrected(zpcch, i));
2188  }
2189  }
2190  }
2191  else for(int i=0; i<4; i++) zdcAOD->SetZPCTDCm(i, kNoEntry);
2192  if(esdZDC->IsZPAhit()){
2193  zdcAOD->SetZPAfired();
2194  int zpach = esdZDC->GetZPATDCChannel();
2195  if(zpach>0){
2196  zdcAOD->SetZPATDC(esdZDC->GetZDCTDCCorrected(zpach, 0));
2197  for(int i=0; i<4; i++){
2198  if(TMath::Abs(esdZDC->GetZDCTDCData(zpach, i))>1e-6) zdcAOD->SetZPATDCm(i, esdZDC->GetZDCTDCCorrected(zpach, i));
2199  }
2200  }
2201  }
2202  else for(int i=0; i<4; i++) zdcAOD->SetZPATDCm(i, kNoEntry);
2203  if(esdZDC->IsZEM1hit()) zdcAOD->SetZEM1fired();
2204  if(esdZDC->IsZEM2hit()) zdcAOD->SetZEM2fired();
2205 }
2206 //______________________________________________________________________________
2208 {
2210 
2211  AliAODAD* adData = AODEvent()->GetADData();
2212  if (adData && esd.GetADData())
2213  *adData = *(esd.GetADData());
2214 }
2215 //_____________________________________________________________________________
2217 {
2220 
2221  AliCodeTimerAuto("",0);
2222 
2223  Int_t cntHmpidGoodTracks = 0;
2224 
2225  Float_t xMip = 0;
2226  Float_t yMip = 0;
2227  Int_t qMip = 0;
2228  Int_t nphMip = 0;
2229 
2230  Float_t xTrk = 0;
2231  Float_t yTrk = 0;
2232  Float_t thetaTrk = 0;
2233  Float_t phiTrk = 0;
2234 
2235  Double_t hmpPid[5]={0};
2236  Double_t hmpMom[3]={0};
2237 
2238  TClonesArray &hmpidRings = *(AODEvent()->GetHMPIDrings());
2239 
2240  for (Int_t iTrack=0; iTrack<esd.GetNumberOfTracks(); ++iTrack) {
2241  if(! esd.GetTrack(iTrack) ) continue;
2242 
2243  if(esd.GetTrack(iTrack)->GetHMPIDsignal() > -20 ) { //
2244  (esd.GetTrack(iTrack))->GetHMPIDmip(xMip, yMip, qMip, nphMip); // Get MIP properties
2245  (esd.GetTrack(iTrack))->GetHMPIDtrk(xTrk,yTrk,thetaTrk,phiTrk);
2246  (esd.GetTrack(iTrack))->GetHMPIDpid(hmpPid);
2247  if((esd.GetTrack(iTrack))->GetOuterHmpParam()) (esd.GetTrack(iTrack))->GetOuterHmpPxPyPz(hmpMom);
2248 
2249  if(esd.GetTrack(iTrack)->GetHMPIDsignal() == 0 && thetaTrk == 0 && qMip == 0 && nphMip ==0 ) continue; //
2250 
2251  new(hmpidRings[cntHmpidGoodTracks++]) AliAODHMPIDrings((esd.GetTrack(iTrack))->GetID(), // Unique track id to attach the ring to
2252  1000000*nphMip+qMip, // MIP charge and number of photons
2253  (esd.GetTrack(iTrack))->GetHMPIDcluIdx(), // 1000000*chamber id + cluster idx of assigned MIP cluster
2254  thetaTrk, // track inclination angle theta
2255  phiTrk, // track inclination angle phi
2256  (esd.GetTrack(iTrack))->GetHMPIDsignal(), // Cherenkov angle
2257  (esd.GetTrack(iTrack))->GetHMPIDoccupancy(), // Occupancy claculated for the given chamber
2258  (esd.GetTrack(iTrack))->GetHMPIDchi2(), // Ring resolution squared
2259  xTrk, // Track x coordinate (LORS)
2260  yTrk, // Track y coordinate (LORS)
2261  xMip, // MIP x coordinate (LORS)
2262  yMip, // MIP y coordinate (LORS)
2263  hmpPid, // PID probablities from ESD, remove once it is CombinedPid
2264  hmpMom // Track momentum in HMPID at ring reconstruction
2265  );
2266  }
2267  }
2268 
2269  return cntHmpidGoodTracks;
2270 }
2271 
2273 {
2276 
2277  const Int_t nTrdTracks = esd.GetNumberOfTrdTracks();
2278  const Int_t nLayers = 6;
2279 
2280  for (Int_t iTrdTrack = 0; iTrdTrack < nTrdTracks; ++iTrdTrack) {
2281  // copy information from ESD track to AOD track
2282  const AliESDTrdTrack *esdTrdTrk = esd.GetTrdTrack(iTrdTrack);
2283  AliAODTrdTrack &aodTrdTrk = AODEvent()->AddTrdTrack(esdTrdTrk);
2284 
2285  // copy the contributing tracklets
2286  for (Int_t iTracklet = 0; iTracklet < nLayers; ++iTracklet) {
2287  if (const AliESDTrdTracklet *esdTrdTrkl = esdTrdTrk->GetTracklet(iTracklet))
2288  aodTrdTrk.AddTracklet(*esdTrdTrkl, iTracklet);
2289  }
2290 
2291  // add the reference to the matched global track
2292  AliAODTrack *aodTrkMatch = 0x0;
2293  AliAODPid* detpid(0x0);
2294  AliESDtrack *esdTrkMatch = (AliESDtrack*) esdTrdTrk->GetTrackMatch();
2295  if (esdTrkMatch) {
2296  Int_t idx = esdTrkMatch->GetID();
2297 
2298  if (idx < 0)
2299  AliError("track has a matched track that was not found");
2300  else if (esdTrkMatch != esd.GetTrack(idx))
2301  AliError("wrong track found for ESD track index");
2302  else {
2303  UInt_t selectInfo = fTrackFilter ? fTrackFilter->IsSelected(esdTrkMatch) : 0;
2304 
2305  if (fUsedTrack[idx]) {
2306  aodTrkMatch = (AliAODTrack*) (*fAODTrackRefs)[idx];
2307  AliDebug(2, Form("event %lld: existing track (idx %i, pt = %f) matched to TRD track (idx %i, pt = %f), cut flags: 0x%08x",
2308  Entry(), idx, esdTrkMatch->Pt(), iTrdTrack, esdTrdTrk->Pt(),
2309  selectInfo));
2310  } else {
2311  if (selectInfo & fUsedTrackCopy[idx]) {
2312  // mask filter bits already used in track copies
2313  selectInfo &= ~fUsedTrackCopy[idx];
2314  AliWarning(Form("event %lld: copied track (idx %i, pt = %f) matched to TRD track (idx %i, pt = %f), cut flags: 0x%08x -> 0x%08x",
2315  Entry(), idx, esdTrkMatch->Pt(), iTrdTrack, esdTrdTrk->Pt(),
2316  fTrackFilter->IsSelected(esdTrkMatch), selectInfo));
2317  }
2318  AliDebug(2, Form("event %lld: unused track (idx %i, pt = %f) matched to TRD track (idx %i, pt = %f), cut flags: 0x%08x -> 0x%08x",
2319  Entry(), idx, esdTrkMatch->Pt(), iTrdTrack, esdTrdTrk->Pt(),
2320  fTrackFilter->IsSelected(esdTrkMatch), selectInfo));
2321 
2322  Double_t mom[3]={0.};
2323  Double_t pos[3]={0.};
2324  Double_t covTr[21]={0.};
2325  // Double_t pid[10]={0.};
2326 
2327  esdTrkMatch->GetPxPyPz(mom);
2328  esdTrkMatch->GetXYZ(pos);
2329  esdTrkMatch->GetCovarianceXYZPxPyPz(covTr);
2330  // esdTrkMatch->GetESDpid(pid);
2331  const AliESDVertex* vtx = esd.GetPrimaryVertex();
2332 
2333  fUsedTrack[idx] = kTRUE;
2334  if(fMChandler) fMChandler->SelectParticle(esdTrkMatch->GetLabel());
2335 
2336  aodTrkMatch = new(Tracks()[fNumberOfTracks++]) AliAODTrack(esdTrkMatch->GetID(),
2337  esdTrkMatch->GetLabel(),
2338  mom,
2339  kTRUE,
2340  pos,
2341  kFALSE,
2342  covTr,
2343  (Short_t)esdTrkMatch->GetSign(),
2344  esdTrkMatch->GetITSClusterMap(),
2345  // pid,
2347  kTRUE,
2348  vtx->UsesTrack(esdTrkMatch->GetID()),
2350  selectInfo);
2351  aodTrkMatch->SetITSSharedMap(esdTrkMatch->GetITSSharedMap());
2352  aodTrkMatch->SetITSchi2(esdTrkMatch->GetITSchi2());
2353  aodTrkMatch->SetPIDForTracking(esdTrkMatch->GetPIDForTracking());
2354  aodTrkMatch->SetTPCFitMap(esdTrkMatch->GetTPCFitMap());
2355  aodTrkMatch->SetTPCClusterMap(esdTrkMatch->GetTPCClusterMap());
2356  aodTrkMatch->SetTPCSharedMap (esdTrkMatch->GetTPCSharedMap());
2357  aodTrkMatch->SetChi2perNDF(Chi2perNDF(esdTrkMatch));
2358  aodTrkMatch->SetTPCPointsF(esdTrkMatch->GetTPCNclsF());
2359  aodTrkMatch->SetTPCNCrossedRows(UShort_t(esdTrkMatch->GetTPCCrossedRows()));
2360  aodTrkMatch->SetIntegratedLength(esdTrkMatch->GetIntegratedLength());
2361  CopyChi2TPCConstrainedVsGlobal(esdTrkMatch, aodTrkMatch);
2362  CopyCaloProps(esdTrkMatch,aodTrkMatch);
2363  fAODTrackRefs->AddAt(aodTrkMatch,idx);
2364  if (esdTrkMatch->GetSign() > 0) ++fNumberOfPositiveTracks;
2365  aodTrkMatch->ConvertAliPIDtoAODPID();
2366  aodTrkMatch->SetFlags(esdTrkMatch->GetStatus());
2367  SetAODPID(esdTrkMatch,aodTrkMatch,detpid);
2368 
2369 
2370  }
2371  }
2372  }
2373  aodTrdTrk.SetTrackMatchReference(aodTrkMatch);
2374  }
2375 }
2376 
2377 //______________________________________________________________________________
2379 {
2381 
2382  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
2383 
2384  if(!esd)return;
2385 
2386  AliCodeTimerAuto("",0);
2387 
2388  TList modifiedCuts; // cuts modified to adjust them for particular event condition
2389  AdjustCutsForEvent(*esd, modifiedCuts, kFALSE);
2390 
2393 
2394  fOldESDformat = ( esd->GetAliESDOld() != 0x0 );
2395 
2396  // Reconstruct cascades and V0 here
2398  esd->ResetCascades();
2399  esd->ResetV0s();
2400 
2401  AliV0vertexer lV0vtxer;
2402  AliCascadeVertexer lCascVtxer;
2403 
2404  lV0vtxer.SetCuts(fV0Cuts);
2405  lCascVtxer.SetCuts(fCascadeCuts);
2406 
2407 
2408  lV0vtxer.Tracks2V0vertices(esd);
2409  lCascVtxer.V0sTracks2CascadeVertices(esd);
2410  }
2411 
2412  // Perform progagation of tracks if needed
2414  const Int_t ntrack = esd->GetNumberOfTracks();
2415  for (Int_t i=0;i<ntrack;++i) {
2416  AliESDtrack *t = esd->GetTrack(i);
2418  }
2419  }
2420 
2421  fNumberOfTracks = 0;
2423  fNumberOfV0s = 0;
2424  fNumberOfVertices = 0;
2425  fNumberOfCascades = 0;
2426  fNumberOfKinks = 0;
2427 
2428  AliAODHeader* header = ConvertHeader(*esd);
2429 
2430  if ( fIsVZEROEnabled ) ConvertVZERO(*esd);
2431  if ( fIsTZEROEnabled ) ConvertTZERO(*esd);
2432 
2433  // Fetch Stack for debuggging if available
2434  fMChandler=0x0;
2435  if(MCEvent()) {
2436  fMChandler = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
2437  }
2438 
2439  // loop over events and fill them
2440  // Multiplicity information needed by the header (to be revised!)
2441  Int_t nTracks = esd->GetNumberOfTracks();
2442 
2443 // The line below should not be needed anymore (tracks already connected)
2444 // for (Int_t iTrack=0; iTrack<nTracks; ++iTrack) esd->GetTrack(iTrack)->SetESDEvent(esd);
2445 
2446  // Update the header
2447  Int_t nV0s = esd->GetNumberOfV0s();
2448  Int_t nCascades = esd->GetNumberOfCascades();
2449  Int_t nKinks = esd->GetNumberOfKinks();
2450  Int_t nVertices = nV0s + nCascades /*V0 wihtin cascade already counted*/+ nKinks + 1 /* = prim. vtx*/;
2451  Int_t nPileSPDVertices=1+esd->GetNumberOfPileupVerticesSPD(); // also SPD main vertex
2452  Int_t nPileTrkVertices=esd->GetNumberOfPileupVerticesTracks();
2453  nVertices+=nPileSPDVertices;
2454  nVertices+=nPileTrkVertices;
2455  Int_t nJets = 0;
2456  Int_t nCaloClus = esd->GetNumberOfCaloClusters();
2457  Int_t nFmdClus = 0;
2458  Int_t nPmdClus = esd->GetNumberOfPmdTracks();
2459  Int_t nHmpidRings = 0;
2460 
2461  AliDebug(1,Form(" NV0=%d NCASCADES=%d NKINKS=%d", nV0s, nCascades, nKinks));
2462 
2463  AODEvent()->ResetStd(nTracks, nVertices, nV0s, nCascades, nJets, nCaloClus, nFmdClus, nPmdClus, nHmpidRings);
2464 
2465  if (nV0s > 0) {
2466  // RefArray to store a mapping between esd V0 number and newly created AOD-Vertex V0
2467  fAODV0VtxRefs = new TRefArray(nV0s);
2468  // RefArray to store the mapping between esd V0 number and newly created AOD-V0
2469  fAODV0Refs = new TRefArray(nV0s);
2470  // Array to take into account the V0s already added to the AOD (V0 within cascades)
2471  fUsedV0 = new Bool_t[nV0s];
2472  for (Int_t iV0=0; iV0<nV0s; ++iV0) fUsedV0[iV0]=kFALSE;
2473  }
2474 
2475  if (nTracks>0) {
2476  // RefArray to store the mapping between esd track number and newly created AOD-Track
2477 
2478  fAODTrackRefs = new TRefArray(nTracks);
2479 
2480  // Array to take into account the tracks already added to the AOD
2481  fUsedTrack = new Bool_t[nTracks];
2482  fUsedTrackCopy = new UInt_t[nTracks];
2483  for (Int_t iTrack=0; iTrack<nTracks; ++iTrack) {
2484  fUsedTrack[iTrack]=kFALSE;
2485  fUsedTrackCopy[iTrack] = 0;
2486  }
2487  }
2488 
2489  // Array to take into account the kinks already added to the AOD
2490  if (nKinks>0) {
2491  fUsedKink = new Bool_t[nKinks];
2492  for (Int_t iKink=0; iKink<nKinks; ++iKink) fUsedKink[iKink]=kFALSE;
2493  }
2494 
2495  ConvertPrimaryVertices(*esd);
2496 
2497  //setting best TOF PID
2499  if (esdH)
2500  fESDpid = esdH->GetESDpid();
2501 
2502  if (fIsPidOwner && fESDpid) {
2503  delete fESDpid;
2504  fESDpid = 0;
2505  }
2506  if (!fESDpid) { //in case of no Tender attached
2507  fESDpid = new AliESDpid;
2508  fIsPidOwner = kTRUE;
2509  }
2510 
2511  if (!esd->GetTOFHeader()) { //protection in case the pass2 LHC10b,c,d have been processed without tender.
2512  Float_t t0spread[10];
2513  Float_t intrinsicTOFres=100; //ps ok for LHC10b,c,d pass2!!
2514  for (Int_t i=0; i<10; i++) t0spread[i] = (TMath::Sqrt(esd->GetSigma2DiamondZ()))/0.03; //0.03 to convert from cm to ps
2515  fESDpid->GetTOFResponse().SetT0resolution(t0spread);
2516  fESDpid->GetTOFResponse().SetTimeResolution(intrinsicTOFres);
2517  // fESDpid->SetTOFResponse(esd, (AliESDpid::EStartTimeType_t)fTimeZeroType);
2518  AliTOFHeader tmpTOFHeader(0,t0spread[0],0,NULL,NULL,NULL,intrinsicTOFres,t0spread[0]);
2519  AODEvent()->SetTOFHeader(&tmpTOFHeader); // write dummy TOF header in AOD
2520  } else {
2521  AODEvent()->SetTOFHeader(esd->GetTOFHeader()); // write TOF header in AOD
2522  }
2523 
2524  // In case of AOD production strating form LHC10e without Tender.
2525  //if(esd->GetTOFHeader() && fIsPidOwner) fESDpid->SetTOFResponse(esd, (AliESDpid::EStartTimeType_t)fTimeZeroType);
2526 
2528  if (fAreV0sEnabled) ConvertV0s(*esd);
2529  if (fAreKinksEnabled) ConvertKinks(*esd);
2530  if (fAreTracksEnabled) ConvertTracks(*esd);
2531 
2532  // Update number of AOD tracks in header at the end of track loop (M.G.)
2536 
2537 
2544  if (fAreEMCALTriggerEnabled) ConvertCaloTrigger(TString("EMCAL"), *esd);
2545  if (fArePHOSTriggerEnabled) ConvertCaloTrigger(TString("PHOS"), *esd);
2547  if (fIsZDCEnabled) ConvertZDC(*esd);
2548  if (fIsADEnabled) ConvertAD(*esd);
2549  if (fIsHMPIDEnabled) nHmpidRings = ConvertHMPID(*esd);
2550  if (fIsTRDEnabled) ConvertTRD(*esd);
2551 
2552 
2553  delete fAODTrackRefs; fAODTrackRefs=0x0;
2554  delete fAODV0VtxRefs; fAODV0VtxRefs=0x0;
2555  delete fAODV0Refs; fAODV0Refs=0x0;
2556  delete[] fUsedTrack; fUsedTrack=0x0;
2557  delete[] fUsedTrackCopy; fUsedTrackCopy=0x0;
2558  delete[] fUsedV0; fUsedV0=0x0;
2559  delete[] fUsedKink; fUsedKink=0x0;
2560 
2561  if (modifiedCuts.GetEntries()) AdjustCutsForEvent(*esd, modifiedCuts, kTRUE); // revert
2562 
2563  if (fIsPidOwner) {
2564  delete fESDpid;
2565  fESDpid = 0x0;
2566  }
2567  AODEvent()->ConnectTracks();
2568 }
2569 
2570 //______________________________________________________________________________
2572 {
2574 
2575  // Save PID object for candidate electrons
2576  Bool_t pidSave = kFALSE;
2577  if (fTrackFilter) {
2578  Bool_t selectInfo = fTrackFilter->IsSelected((char*) "Electrons");
2579  if (selectInfo) pidSave = kTRUE;
2580  }
2581 
2582  // Tracks passing pt cut
2583  if(esdtrack->Pt()>fHighPthreshold) {
2584  pidSave = kTRUE;
2585  } else {
2586  if(fPtshape){
2587  if(esdtrack->Pt()> fPtshape->GetXmin()){
2588  Double_t y = fPtshape->Eval(esdtrack->Pt())/fPtshape->Eval(fHighPthreshold);
2589  if(gRandom->Rndm(0)<1./y){
2590  pidSave = kTRUE;
2591  }//end rndm
2592  }//end if p < pmin
2593  }//end if p function
2594  }// end else
2595 
2596  if (pidSave) {
2597  if(!aodtrack->GetDetPid()){// prevent memory leak when calling SetAODPID twice for the same track
2598  detpid = new AliAODPid();
2599  SetDetectorRawSignals(detpid,esdtrack);
2600  aodtrack->SetDetPID(detpid);
2601  }
2602  }
2603 }
2604 
2605 //______________________________________________________________________________
2607 {
2609 
2610  if(!track) {
2611  AliInfo("no ESD track found. .....exiting");
2612  return;
2613  }
2614 
2615  // TPC momentum
2616  aodpid->SetTPCmomentum(track->GetTPCmomentum());
2617  aodpid->SetTPCTgl(track->GetTPCTgl());
2618  aodpid->SetITSsignal(track->GetITSsignal());
2619  Double_t itsdedx[4]; // dE/dx samples for individual ITS layers
2620  track->GetITSdEdxSamples(itsdedx);
2621  aodpid->SetITSdEdxSamples(itsdedx);
2622 
2623  aodpid->SetTPCsignal(track->GetTPCsignal());
2624  aodpid->SetTPCsignalN(track->GetTPCsignalN());
2625  if (track->GetTPCdEdxInfo()) aodpid->SetTPCdEdxInfo(track->GetTPCdEdxInfo());
2626 
2627  //n TRD planes = 6
2628  Int_t nslices = track->GetNumberOfTRDslices()*6;
2629  TArrayD trdslices(nslices);
2630  for(Int_t iSl =0; iSl < track->GetNumberOfTRDslices(); iSl++) {
2631  for(Int_t iPl =0; iPl<6; iPl++) trdslices[iPl*track->GetNumberOfTRDslices()+iSl] = track->GetTRDslice(iPl,iSl);
2632  }
2633 
2634  //TRD momentum
2635  for(Int_t iPl=0;iPl<6;iPl++){
2636  Double_t trdmom=track->GetTRDmomentum(iPl);
2637  aodpid->SetTRDmomentum(iPl,trdmom);
2638  }
2639 
2640  aodpid->SetTRDslices(track->GetNumberOfTRDslices()*6,trdslices.GetArray());
2641  aodpid->SetTRDsignal(track->GetTRDsignal());
2642 
2643  //TRD clusters and tracklets
2644  aodpid->SetTRDncls(track->GetTRDncls());
2645  aodpid->SetTRDntrackletsPID(track->GetTRDntrackletsPID());
2646 
2647  aodpid->SetTRDChi2(track->GetTRDchi2());
2648 
2649  //TOF PID
2650  Double_t times[AliPID::kSPECIESC]; track->GetIntegratedTimes(times,AliPID::kSPECIESC);
2651  aodpid->SetIntegratedTimes(times);
2652 
2653  // Float_t tzeroTrack = fESDpid->GetTOFResponse().GetStartTime(track->P());
2654  // aodpid->SetTOFsignal(track->GetTOFsignal()-tzeroTrack);
2655  aodpid->SetTOFsignal(track->GetTOFsignal());
2656 
2657  Double_t tofRes[5];
2658  for (Int_t iMass=0; iMass<5; iMass++){
2659  // tofRes[iMass]=(Double_t)fESDpid->GetTOFResponse().GetExpectedSigma(track->P(), times[iMass], AliPID::ParticleMass(iMass));
2660  tofRes[iMass]=0; //backward compatibility
2661  }
2662  aodpid->SetTOFpidResolution(tofRes);
2663  //aodpid->SetHMPIDsignal(0); // set to zero for compression but it will be removed later
2664 }
2665 
2667 {
2669 
2670  Int_t nClustersTPC = track->GetTPCNcls();
2671  if ( nClustersTPC > 5) {
2672  return (track->GetTPCchi2()/Float_t(nClustersTPC - 5));
2673  } else {
2674  return (-1.);
2675  }
2676 }
2677 
2678 //______________________________________________________________________________
2679 void AliAnalysisTaskESDfilter::Terminate(Option_t */*option*/)
2680 {
2682 
2683  if (fDebug > 1) printf("AnalysisESDfilter: Terminate() \n");
2684 }
2685 
2686 //______________________________________________________________________________
2688 {
2690 
2691  if (!pStack) return;
2692  label = TMath::Abs(label);
2693  TParticle *part = pStack->Particle(label);
2694  Printf("########################");
2695  Printf("%s:%d %d UniqueID %d PDG %d P %3.3f",(char*)__FILE__,__LINE__,label,part->GetUniqueID(),part->GetPdgCode(),part->P());
2696  part->Print();
2697  TParticle* mother = part;
2698  Int_t imo = part->GetFirstMother();
2699  Int_t nprim = pStack->GetNprimary();
2700  // while((imo >= nprim) && (mother->GetUniqueID() == 4)) {
2701  while((imo >= nprim)) {
2702  mother = pStack->Particle(imo);
2703  Printf("Mother %s:%d Label %d UniqueID %d PDG %d P %3.3f",(char*)__FILE__,__LINE__,imo,mother->GetUniqueID(),mother->GetPdgCode(),mother->P());
2704  mother->Print();
2705  imo = mother->GetFirstMother();
2706  }
2707  Printf("########################");
2708 }
2709 
2710 //______________________________________________________________________________
2712 {
2714 
2716  if (tre->IsEMCAL()) tra->SetEMCALcluster(tre->GetEMCALcluster());
2717  if (tre->IsPHOS()) tra->SetPHOScluster(tre->GetPHOScluster());
2718 }
2719 
2720 //______________________________________________________________________________
2722 {
2723 
2724 
2726  //Golden chi2 is from AliESDtrackCuts or no TPC track
2728  }else{ //Golden chi2 is not calculated in AliESDtrackCuts. Do calculate here.
2729  const AliESDEvent* esdEvent = esdt->GetESDEvent();
2730  const AliESDVertex* vertex = esdEvent ? esdEvent->GetPrimaryVertex() : 0;
2731  if ((vertex && vertex->GetStatus())) aodt->SetChi2TPCConstrainedVsGlobal(esdt->GetChi2TPCConstrainedVsGlobal(vertex));
2732  }
2733 
2734 
2735 }
2736 
2737 //______________________________________________________________________________
2738 void AliAnalysisTaskESDfilter::SetRefitVertexTracks(Int_t algo, Double_t* cuts)
2739 {
2743 
2744  fRefitVertexTracks = algo;
2745  if (algo>0 && cuts) {
2747  for (int i=fRefitVertexTracks;i--;) fRefitVertexTracksCuts[i] = cuts[i];
2749  }
2750 }
2751 
2752 //______________________________________________________________________________
2754 {
2757 
2758  fIsMuonCaloPass = kTRUE;
2759 
2760  DisableCascades();
2761  DisableKinks();
2762  DisableV0s();
2764  SetPropagateTrackToEMCal(kFALSE);
2765 }
2766 
2767 //______________________________________________________________________________
2768 void AliAnalysisTaskESDfilter::AdjustCutsForEvent(const AliESDEvent& esd, TList& modifiedCuts, bool revert)
2769 {
2773 
2774  if (!fTrackFilter) return;
2775  if (revert) {
2776  TIter next(&modifiedCuts);
2777  AliESDtrackCuts* cut = 0;
2778  while ( (cut=(AliESDtrackCuts*)next()) ) {
2779  cut->SetRequireITSStandAlone(kTRUE);
2780  cut->SetRequireITSPureStandAlone(kFALSE);
2781  }
2782  static Bool_t printOnce = kTRUE;
2783  if (printOnce) {
2784  AliInfoF("Event w/oTPC, reverted %d cuts asking for ITS_SA tracks, no more such messages will be printed",
2785  modifiedCuts.GetEntries());
2786  printOnce = kFALSE;
2787  }
2788  modifiedCuts.Clear();
2789  return;
2790  }
2791 
2792  // this is relevant only events w/o TPC
2793  if (esd.GetNumberOfTPCClusters()>0) return;
2794  int nPureSA = 0, nCompSA = 0;
2795  // check if this event is affected, i.e. it has no ITScomplementary tracks but has SA tracks
2796  for (int i=esd.GetNumberOfTracks();i--;) {
2797  AliESDtrack* tr = esd.GetTrack(i);
2798  ULong64_t flags = tr->GetStatus();
2799  if ( flags & AliESDtrack::kTPCin ) continue;
2800  if ( flags & AliESDtrack::kITSpureSA ) {
2801  nPureSA++;
2802  continue;
2803  }
2804  if ( flags & AliESDtrack::kITSin ) {
2805  nCompSA++;
2806  break;
2807  };
2808  }
2809  if (nPureSA && !nCompSA) {
2810  // check if there are cuts asking for complementary ITS_SA tracks
2811  TIter next(fTrackFilter->GetCuts());
2812  AliESDtrackCuts* cut = 0;
2813  while ( (cut=(AliESDtrackCuts*)next()) ) {
2814  if (cut->GetRequireITSStandAlone()) {
2815  cut->SetRequireITSStandAlone(kFALSE);
2816  cut->SetRequireITSPureStandAlone(kTRUE);
2817  modifiedCuts.Add(cut);
2818  }
2819  }
2820  modifiedCuts.SetOwner(kFALSE);
2821  static Bool_t printOnce = kTRUE;
2822  if (printOnce) {
2823  AliInfoF("Event w/oTPC, forced %d cuts asking for ITS_SA tracks to accept ITS_pureSA",modifiedCuts.GetEntries());
2824  printOnce = kFALSE;
2825  }
2826  }
2827 
2828 }
Int_t GetTrackMatchedIndex(Int_t i=0) const
void GetPPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const
Definition: AliESDv0.h:207
virtual Double_t GetZEM2Energy() const
Definition: AliESDZDC.h:40
Double_t GetTrackDx(void) const
TBrowser b
Definition: RunAnaESD.C:12
Class for calorimeter cluster, EMCal and PHOS, data handling.
TClonesArray * GetCascades()
Definition: AliAODEvent.h:209
void SetOfflineTrigger(UInt_t trigger)
Definition: AliAODHeader.h:205
Double_t fCascadeCuts[8]
Array to store the values for the different reco selections cascades related.
TBits GetT0PileupBits() const
Definition: AliESDTZERO.h:81
Bool_t fIsTRDEnabled
whether or not to fill on-line tracklets and tracks from TRD (true by default)
AliAODCaloTrigger * GetCaloTrigger(TString calo) const
Definition: AliAODEvent.h:227
Bool_t fAreEMCALTriggerEnabled
whether or not to fill the emcal trigger (true by default)
Double_t GetDispersion() const
Double_t GetTRDslice(Int_t plane, Int_t slice=-1) const
Double_t GetTRDmomentum(Int_t plane, Double_t *sp=0x0) const
const TBits & GetTPCFitMap() const
Definition: AliESDtrack.h:274
Double_t GetSigma2DiamondZ() const
Definition: AliESDEvent.h:155
Double_t GetTPCmomentum() const
Definition: AliESDtrack.h:263
void CopyCaloProps(AliESDtrack *esdt, AliAODTrack *aodt)
Bool_t GetConstrainedPxPyPz(Double_t *p) const
Definition: AliESDtrack.h:107
AliESDCaloCluster * GetCaloCluster(Int_t i) const
Definition: AliESDEvent.h:500
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
UInt_t fHybridFilterMaskTPCCG
Filter Mask used to mark global tracks as hybrid.
void SetIntegratedTimes(Double_t timeint[5])
Definition: AliAODPid.cxx:150
Int_t GetNumberOfV0s() const
Definition: AliESDEvent.h:552
void SetL1FrameMask(Int_t m)
void SetBackgroundFlag(Bool_t back=false)
Definition: AliAODTZERO.h:44
const Double_t * GetZPATowerEnergyLR() const
Definition: AliESDZDC.h:49
void SetTRDslices(Int_t nslices, const Double_t *const trdslices)
Definition: AliAODPid.h:112
void SetTriggerCluster(UChar_t trigClus)
Definition: AliAODHeader.h:149
void SetTPCsignal(Double_t tpc)
Definition: AliAODPid.h:30
Implementation of the Event Handler Interface for AOD.
Definition: AliAODHandler.h:27
Int_t fNumberOfTracks
current number of tracks
Int_t GetPindex() const
Definition: AliESDv0.h:86
void SetZPATDC(Float_t tdc)
Definition: AliAODZDC.h:98
Double_t GetMagneticField() const
Definition: AliESDEvent.h:148
void SetZDCP2Energy(Double_t p2Energy)
Definition: AliAODHeader.h:158
AliESDPmdTrack * GetPmdTrack(Int_t i) const
Definition: AliESDEvent.h:450
void GetAmplitude(Float_t &amp) const
Access to L0-amplitude of the current fastor channel.
AliESDkink * GetKink(Int_t i) const
Definition: AliESDEvent.h:495
Int_t GetNumberOfTrdTracks() const
Definition: AliESDEvent.h:550
Double_t GetDiamondY() const
Definition: AliESDEvent.h:151
AliESDVZERO * GetVZEROData() const
Definition: AliESDEvent.h:281
const Double_t * GetZPCTowerEnergyLR() const
Definition: AliESDZDC.h:48
Double_t GetClusterADC() const
void SetTPCTgl(Double_t tpcTgl)
Definition: AliAODPid.h:33
void SetType(Char_t ttype)
Class for AOD ZDC data.
Definition: AliAODZDC.h:13
void ConvertV0s(const AliESDEvent &esd)
virtual TTree * GetTree() const
Definition: AliAODHandler.h:73
void GetImpactParametersTPC(Float_t &xy, Float_t &z) const
Definition: AliESDtrack.h:437
Int_t GetNumberOfTPCClusters() const
Definition: AliESDEvent.h:370
void ResetZEM2fired()
Definition: AliAODZDC.h:118
UShort_t * GetClusterMCEdepFraction() const
void GetL0Times(Int_t times[]) const
Get level0 times for the current L0 patch.
UInt_t GetL1TriggerInputs() const
Definition: AliESDHeader.h:52
Double_t GetCachedChi2TPCConstrainedVsGlobalVal() const
Definition: AliESDtrack.h:121
void SetZEM2fired()
Definition: AliAODZDC.h:111
AliESDTrdTracklet * GetTracklet(Int_t idx) const
virtual UInt_t IsEventSelected()
Bool_t IsZNAhit()
Definition: AliESDZDC.h:145
AliAnalysisFilter * fTrackFilter
Track Filter.
AliESDAD * GetADData() const
Definition: AliESDEvent.h:293
Bool_t * fUsedKink
! indices of used kinks
void SetZEM1fired()
Definition: AliAODZDC.h:110
TRefArray * fAODV0Refs
array of v0s references
void Set(T x, T alpha, const T param[5], const T covar[15])
void SetNumberOfTPCClusters(int n)
Definition: AliAODHeader.h:74
Int_t GetNumberOfPileupVerticesSPD() const
Definition: AliESDEvent.h:530
virtual Double_t GetY() const
Definition: AliVertex.h:39
Bool_t fOldESDformat
is the ESD in old format ?
Bool_t GetBackgroundFlag() const
Definition: AliESDTZERO.h:73
virtual const Float_t * GetVZEROEqFactors() const
Definition: AliESDEvent.h:166
void SetRefMultiplicity(Int_t refMult)
Definition: AliAODHeader.h:161
Bool_t fAreEMCALCellsEnabled
whether or not to fill the emcal cells (true by default)
void GetNPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const
Definition: AliESDv0.h:202
Bool_t fArePHOSCellsEnabled
whether or not to fill the phos cells (true by default)
virtual void GetXYZ(Double_t position[3]) const
Definition: AliVertex.cxx:119
TRefArray * fAODTrackRefs
array of track references
void GetTriggerBits(Int_t &bits) const
Get the trigger bits for a given fastor position.
void SetDetectorRawSignals(AliAODPid *aodpid, AliESDtrack *track)
Int_t * GetCaloTriggerType() const
Definition: AliESDEvent.h:164
Double_t GetTrackPhiOnEMCal() const
Definition: AliESDtrack.h:412
Bool_t GetXYZ(Double_t *p) const
TArrayI * GetTracksMatched() const
virtual void PrintTask(Option_t *option="all", Int_t indent=0) const
void SetOrbitNumber(UInt_t nOr)
Definition: AliAODHeader.h:144
AliESDcascade * GetCascade(Int_t i) const
Definition: AliESDEvent.h:489
Class for calorimeter cell AOD data handling.
static AliAnalysisManager * GetAnalysisManager()
const TBits & GetTPCClusterMap() const
Definition: AliESDtrack.h:276
TList * fHistov0List
TList containing PCM histos.
AliAODZDC * GetZDCData() const
Definition: AliAODEvent.h:341
Int_t GetZDCTDCData(Int_t i, Int_t j) const
Definition: AliESDZDC.h:76
Double_t GetChi2toNDF() const
Definition: AliESDVertex.h:71
Bool_t GetOnFlyStatus() const
Definition: AliESDv0.h:93
virtual Short_t GetZDCPartSideA() const
Definition: AliESDZDC.h:29
AliAnalysysManager Manager analysis class. Allows creation of several analysis tasks and data contain...
void SetTRDntrackletsPID(UChar_t ntls)
Definition: AliAODPid.h:39
Bool_t SetTracklet(Int_t pos, Double32_t theta, Double32_t phi, Double32_t deltaPhi, Int_t labelL1, Int_t labelL2)
void ResetStd(Int_t trkArrSize=0, Int_t vtxArrSize=0, Int_t v0ArrSize=0, Int_t cascadeArrSize=0, Int_t jetSize=0, Int_t caloClusSize=0, Int_t fmdClusSize=0, Int_t pmdClusSize=0, Int_t hmpidRingsSize=0, Int_t dimuonArrsize=0, Int_t nTrdTracks=0)
UInt_t fGlobalConstrainedFilterMask
Filter Mask used to select and store refitted TPC only tracks.
void SetL2TriggerInputs(UShort_t n)
Definition: AliAODHeader.h:186
const Double_t * GetPosition() const
Definition: AliESDkink.h:39
Int_t GetID() const
Definition: AliESDtrack.h:69
Float_t GetT0spread(Int_t i) const
Definition: AliESDRun.h:112
Container class for AOD AD data.
Definition: AliAODAD.h:10
Int_t GetLabel() const
Definition: AliESDtrack.h:83
void SetITSsignal(Double_t its)
Definition: AliAODPid.h:28
Double_t GetZDCP2Energy() const
Definition: AliESDEvent.h:238
virtual Short_t GetNumberOfFiredChips(Int_t layer) const
void SetPeriodNumber(UInt_t nPer)
Definition: AliAODHeader.h:145
Float_t GetMultC() const
Definition: AliESDTZERO.h:66
virtual const Double_t * GetZNCTowerEnergyLR() const
Definition: AliESDZDC.h:46
Bool_t fIsV0CascadeRecoEnabled
whether or not to reconstruct again V0s and cascades (false by default)
void SetIsTPCConstrained(Bool_t b=kTRUE)
Definition: AliAODTrack.h:392
void SetCentrality(const AliCentrality *cent)
Definition: AliAODHeader.h:302
Int_t GetEMCALcluster() const
Definition: AliESDtrack.h:408
Int_t GetPIDForTracking() const
Definition: AliESDtrack.h:101
void GetPtRange(Float_t &r1, Float_t &r2) const
UShort_t GetL2TriggerInputs() const
Definition: AliESDHeader.h:53
virtual Short_t Charge() const
Definition: AliESDcascade.h:56
Double_t GetZ() const
Definition: AliAODVertex.h:72
Double_t GetM02() const
void SetT0spread(Int_t i, Float_t t)
Definition: AliAODHeader.h:224
Double_t fHighPthreshold
Pt threshold for detector signal setting.
Container with calorimeter trigger information in the AOD event.
TClonesArray * GetHMPIDrings() const
Definition: AliAODEvent.h:253
void SetFiredTriggerClasses(TString trig)
Definition: AliAODHeader.h:148
void SetT0resolution(Float_t *t0resolution)
void SetRefMultiplicityComb05(Int_t refMult)
Definition: AliAODHeader.h:168
void SetCellsAmplitudeFraction(Double32_t *array)
Bool_t fIsPidOwner
whether we own fESDpid
void SetZNATDCm(Int_t i, Float_t tdc)
Definition: AliAODZDC.h:102
Double_t GetTrackEtaOnEMCal() const
Definition: AliESDtrack.h:413
Bool_t PostData(Int_t iout, TObject *data, Option_t *option="")
void ConnectTracks()
Bool_t Add(Int_t col, Int_t row, Float_t amp, Float_t time, Int_t trgtimes[], Int_t ntrgtimes, Int_t trgts, Int_t trgbits)
AliAODTracklets * GetTracklets() const
Definition: AliAODEvent.h:270
virtual Bool_t Next()
Forward to next trigger entry (fastor / L0 patch)
TClonesArray * GetTracks() const
Definition: AliAODEvent.h:165
AliAODVZERO * GetVZEROData() const
Definition: AliAODEvent.h:333
void SetZNCTowers(const Double_t value[5], const Double_t valueLG[5])
Definition: AliAODZDC.cxx:162
AliESDtrackCuts * fTPCaloneTrackCuts
TPC stand-alone track cuts.
virtual void SetFillExtension(Bool_t)
Double32_t GetT0TOFbest(Int_t i) const
Definition: AliESDTZERO.h:39
Int_t GetNumberOfPileupVerticesTracks() const
Definition: AliESDEvent.h:533
Float_t p[]
Definition: kNNTest.C:133
AliESDZDC * GetZDCData() const
Definition: AliESDEvent.h:230
Bool_t fAreTrackletsEnabled
whether or not to fill the tracklets (true by default)
void SetCellsMCEdepFractionMap(UInt_t *array)
void SetChi2perNDF(Double_t chi2perNDF)
Definition: AliAODTrack.h:412
ULong_t GetDetectorStatus() const
Definition: AliESDEvent.h:595
Bool_t GetSatellite() const
Definition: AliESDTZERO.h:75
void DefineInput(Int_t islot, TClass *type)
void SetZNAfired()
Definition: AliAODZDC.h:106
Int_t GetID() const
void SetZEM2Energy(const Double_t zem2)
Definition: AliAODZDC.h:80
void SetTPConlyRefMultiplicity(Int_t mult)
Definition: AliAODHeader.h:209
void GetXYZ(Double_t &x, Double_t &y, Double_t &z) const
Definition: AliESDv0.cxx:541
ULong64_t GetTriggerMaskNext50() const
Definition: AliESDEvent.h:208
void SetCellsAbsId(UShort_t *array)
void SetT0TOFbest(Int_t icase, Double32_t time)
Definition: AliAODTZERO.h:42
Bool_t IsZPChit()
Definition: AliESDZDC.h:146
virtual void UserExec(Option_t *option)
Double_t GetAlpha() const
Double_t GetClusterZ() const
Bool_t fArePHOSTriggerEnabled
whether or not to fill the phos trigger (true by default)
AliVHeader * GetHeader() const
Definition: AliAODEvent.h:92
void SetDAQAttributes(UInt_t v)
Definition: AliAODHeader.h:118
virtual Double_t GetZEM1Energy() const
Definition: AliESDZDC.h:39
virtual Int_t GetLabel(Int_t i, Int_t layer) const
void SetVZEROEqFactors(const Float_t *factors)
Definition: AliAODHeader.h:217
void ConvertEMCALCells(const AliESDEvent &esd)
void SetRequireITSStandAlone(Bool_t b=kFALSE)
void ConvertPHOSCells(const AliESDEvent &esd)
virtual Double_t GetImpactParamSideC() const
Definition: AliESDZDC.h:33
AliTPCfastTrack * track
void SetClusterMCEdepFraction(UShort_t *array)
void SetTPCClusterMap(const TBits amap)
Definition: AliAODTrack.h:291
void SetRefMultiplicityComb08(Int_t refMult)
Definition: AliAODHeader.h:169
void SetDCA(Double_t d, Double_t z)
Implementation of the Analysis Oriented Data (AOD) Xi vertex class.
Definition: AliAODcascade.h:20
Double_t * fRefitVertexTracksCuts
optional cuts for vertex refit
#define AliInfoF(message,...)
Definition: AliLog.h:499
Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const
const AliExternalTrackParam * GetTPCInnerParam() const
Definition: AliESDtrack.h:133
AliESDpid * GetESDpid() const
virtual AliMCEvent * MCEvent() const
Float_t GetMultA() const
Definition: AliESDTZERO.h:67
void SetT0TOF(Int_t icase, Double32_t time)
Definition: AliAODTZERO.h:41
Double_t GetDiamondX() const
Definition: AliESDEvent.h:150
void SetOnFlyStatus(Bool_t status)
Definition: AliAODv0.h:32
void SetTPCFitMap(const TBits amap)
Definition: AliAODTrack.h:293
TTree * GetTree() const
Bool_t IsPHOS() const
Definition: AliESDtrack.h:420
void AdjustCutsForEvent(const AliESDEvent &esd, TList &modifiedCuts, bool revert)
virtual Short_t GetZDCPartSideC() const
Definition: AliESDZDC.h:30
void ConvertAD(const AliESDEvent &esd)
virtual void SetFillAOD(Bool_t)
Int_t GetL1Threshold(Int_t i) const
UInt_t fHybridFilterMaskGCG
Filter Mask used to mark global tracks as hybrid.
UInt_t GetTimeStamp() const
Definition: AliESDEvent.h:218
const Double_t * GetParameter() const
Double_t GetZDCN1Energy() const
Definition: AliESDEvent.h:235
virtual AliVEvent * InputEvent() const
Double_t GetDistanceToBadChannel() const
Float_t GetZNTDCSum(Int_t ihit) const
Definition: AliESDZDC.cxx:369
void SetTPCNCrossedRows(UInt_t n)
Definition: AliAODTrack.h:295
Bool_t IsZEM2hit()
Definition: AliESDZDC.h:149
void PrintXi(const Double_t &rPrimVtxX, const Double_t &rPrimVtxY, const Double_t &rPrimVtxZ) const
Bool_t fIsHMPIDEnabled
whether or not to fill the hmpid branch (true by default)
#define AliWarning(message)
Definition: AliLog.h:541
void SetDiamond(Float_t xy[2], Float_t cov[3])
Definition: AliAODHeader.h:177
void SetNCells(Int_t n)
void AddTrackMatched(TObject *trk)
void SetTOFsignal(Double_t tof)
Definition: AliAODPid.h:41
void GetPosition(Int_t &col, Int_t &row) const
Access to position of the current fastor channel.
void SetTRDmomentum(Int_t nplane, Float_t trdMom)
Definition: AliAODPid.h:37
void SetL0TriggerInputs(UInt_t n)
Definition: AliAODHeader.h:184
Int_t fNumberOfVertices
current number of vertices
void SetPIDFromESD(const T *pid)
Int_t GetKinkIndex(Int_t i) const
Definition: AliESDtrack.h:271
void SetTimeResolution(Float_t res)
void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid=kTRUE)
Definition: AliAODTrack.h:396
const AliESDVertex * GetPrimaryVertexTracks() const
Definition: AliESDEvent.h:314
void SetTPCmomentum(Double_t tpcMom)
Definition: AliAODPid.h:32
Int_t V0sTracks2CascadeVertices(AliESDEvent *event)
void GetITSdEdxSamples(Double_t s[4]) const
void SetPileupFlag(Bool_t back=false)
Definition: AliAODTZERO.h:45
void ConvertVZERO(const AliESDEvent &esd)
Bool_t fDoPropagateTrackToEMCal
whether or not to propagate the tracks to the EMCal surface – true by default
void SetNContributors(Int_t nc)
Definition: AliAODVertex.h:115
void SetFlags(ULong64_t flags)
Definition: AliAODTrack.h:377
AOD class to store tracklets.
Int_t fDebug
Debug flag.
AOD Pid object for additional pid information.
Definition: AliAODPid.h:17
UShort_t * GetCellsAbsId()
void SetTPCdEdxInfo(AliTPCdEdxInfo *dEdxInfo)
Definition: AliAODPid.cxx:183
AliVEventHandler * GetInputEventHandler() const
void ConvertAliPIDtoAODPID()
TObject * GetInputData(Int_t islot) const
virtual Double_t GetImpactParamSideA() const
Definition: AliESDZDC.h:32
void ConvertPmdClusters(const AliESDEvent &esd)
AliTPCdEdxInfo * GetTPCdEdxInfo() const
Definition: AliESDtrack.h:253
AliAnalysisFilter * fV0Filter
V0 Filter.
Double32_t GetT0TOF(Int_t i) const
Definition: AliESDTZERO.h:35
void SetEventplane(AliEventplane *eventplane)
Definition: AliAODHeader.h:313
Bool_t fIsADEnabled
whether or not to fill the ad branch (true by default)
Bool_t IsZEM1hit()
Definition: AliESDZDC.h:148
void SetBunchCrossNumber(UShort_t nBx)
Definition: AliAODHeader.h:143
Double_t GetTPCTgl() const
Definition: AliESDtrack.h:264
void SetMuonMagFieldScale(Double_t magFldScl)
Definition: AliAODHeader.h:152
void SetCaloCluster(Double_t dist=-999., Double_t disp=-1., Double_t m20=0., Double_t m02=0., Double_t emcCpvDist=-999., UShort_t nExMax=0, Double_t tof=0.)
Int_t GetNprimary() const
Definition: AliStack.h:137
AliESDv0 * GetV0(Int_t i) const
Definition: AliESDEvent.h:478
UInt_t GetDAQAttributes() const
Definition: AliESDEvent.h:601
Bool_t fAreTracksEnabled
whether or not to fill the (central) tracks branch (true by default)
TClonesArray * GetV0s() const
Definition: AliAODEvent.h:201
void SetZDCEMEnergy(Double_t emEnergy1, Double_t emEnergy2)
Definition: AliAODHeader.h:159
Class for handling of ESD track cuts.
Bool_t fAreV0sEnabled
whether or not to fill the v0 branch (true by default)
Bool_t IsZPAhit()
Definition: AliESDZDC.h:147
Double_t GetHMPIDsignal() const
Definition: AliESDtrack.h:383
Double_t GetY() const
Definition: AliAODVertex.h:71
void SetL1V0(const Int_t *v)
Int_t GetEventNumberInFile() const
Definition: AliESDHeader.h:82
const AliESDVertex * GetPrimaryVertexTPC() const
Definition: AliESDEvent.h:304
TTree * tree
void SetCuts(const Double_t *cuts)
Definition: AliV0vertexer.h:80
Bool_t GetScaleDThetaBySin2T() const
Double_t GetZDCEMEnergy(Int_t i=0) const
Definition: AliESDEvent.h:239
UInt_t fTPCConstrainedFilterMask
Filter Mask used to select and store refitted TPC only tracks.
Bool_t fIsTZEROEnabled
whether or not to fill the tzero branch (true by default)
Double_t chi2
Definition: AnalyzeLaser.C:7
Bool_t IsOn(ULong64_t mask) const
Definition: AliESDtrack.h:81
ULong64_t GetTriggerMask() const
Definition: AliESDEvent.h:207
void SetTRDChi2(Double_t chi2)
Definition: AliAODPid.h:40
virtual const Double_t * GetZPATowerEnergy() const
Definition: AliESDZDC.h:45
virtual TTree * GetTree() const
void SetFilterMap(UInt_t i)
Definition: AliAODTrack.h:280
void SetTOFLabel(const Int_t *p)
Bool_t * fUsedV0
! indices of used V0s
Double_t GetTPCsignal() const
Definition: AliESDtrack.h:259
Int_t GetEntries() const
Get the number of entries in the trigger data.
void GetBPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const
Definition: AliESDcascade.h:81
virtual void Terminate(Option_t *option)
AOD event base class.
Definition: AliAODHeader.h:27
void SetRunNumber(Int_t nRun)
Definition: AliAODHeader.h:140
UInt_t GetEventType() const
Definition: AliESDEvent.h:222
void SetL1Threshold(Int_t i, Int_t thr)
void SetZNCTDC(Float_t tdc)
Definition: AliAODZDC.h:95
virtual void SetAODPID(AliESDtrack *esdtrack, AliAODTrack *aodtrack, AliAODPid *detpid)
const AliESDVertex * GetPileupVertexTracks(Int_t i) const
Definition: AliESDEvent.h:387
void SetZPCfired()
Definition: AliAODZDC.h:109
AliESDCaloTrigger * GetCaloTrigger(TString calo) const
Definition: AliESDEvent.h:509
void SetTrackPhiEtaPtOnEMCal(Double_t phi, Double_t eta, Double_t pt)
Definition: AliAODTrack.h:318
void SetITSdEdxSamples(const Double_t s[4])
Definition: AliAODPid.cxx:169
const AliESDVertex * GetPileupVertexSPD(Int_t i) const
Definition: AliESDEvent.h:383
Double_t GetITSchi2() const
Definition: AliESDtrack.h:193
void CreateContainer(Short_t nCells)
Float_t GetTPCCrossedRows() const
Double_t GetTRDchi2() const
Definition: AliESDtrack.h:322
Double_t GetChi2TPCConstrainedVsGlobal(const AliESDVertex *vtx) const
#define AliInfo(message)
Definition: AliLog.h:484
void SetEMCALcluster(Int_t index)
Definition: AliAODTrack.h:311
const Double32_t * GetT0amplitude() const
Definition: AliESDTZERO.h:50
Int_t GetRunNumber() const
Definition: AliESDEvent.h:141
AliESDCaloCells * GetPHOSCells() const
Definition: AliESDEvent.h:507
UInt_t GetL0TriggerInputs() const
Definition: AliESDHeader.h:51
AliESDCaloCells * GetEMCALCells() const
Definition: AliESDEvent.h:506
static Int_t GetReferenceMultiplicity(const AliESDEvent *esd, Bool_t tpcOnly)
Container with calorimeter trigger information in the ESD event.
TString GetFiredTriggerClasses() const
Definition: AliESDEvent.h:210
virtual Double_t GetTheta(Int_t i) const
Float_t GetZNTDCDiff(Int_t ihit) const
Definition: AliESDZDC.cxx:393
void SetTriggerMaskNext50(ULong64_t trigMsk)
Definition: AliAODHeader.h:147
Int_t GetBC() const
Definition: AliESDVertex.h:85
void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ)
Definition: AliAODTrack.h:407
Double_t GetTrackPtOnEMCal() const
Definition: AliESDtrack.h:414
void SetZNATDC(Float_t tdc)
Definition: AliAODZDC.h:96
TBits * fbitfieldPCMv0sB
Bitfield with PCM v0s from offline v0 finder.
void SetZDCTDCDiff(Float_t tdc)
Definition: AliAODZDC.h:93
Double_t Pt() const
AliAODCaloCells * GetPHOSCells() const
Definition: AliAODEvent.h:274
#define AliCodeTimerAuto(message, counter)
Definition: AliCodeTimer.h:137
void SetDiamondZ(Float_t z, Float_t sig2z)
Definition: AliAODHeader.h:181
void ConvertTPCOnlyTracks(const AliESDEvent &esd)
void SetNumberOfTPCTracks(int n)
Definition: AliAODHeader.h:75
void SetZNCTDCm(Int_t i, Float_t tdc)
Definition: AliAODZDC.h:101
void SetZPAfired()
Definition: AliAODZDC.h:108
virtual void SetITSClusters(Int_t layer, UInt_t clusters)
virtual Short_t GetZDCParticipants() const
Definition: AliESDZDC.h:28
virtual Double_t GetZ() const
Definition: AliVertex.h:40
void SetTrackMatchReference(AliVTrack *trk)
void SetDetPID(AliAODPid *aodpid)
Definition: AliAODTrack.h:175
Double_t GetTrackDz(void) const
Double_t GetX() const
Definition: AliAODVertex.h:70
AliMultiplicity * GetMultiplicity() const
Definition: AliESDEvent.h:361
Bool_t fAreKinksEnabled
whether or not to fill the kinks (true by default)
const Double_t * GetCovariance() const
void ResetV0s()
Definition: AliESDEvent.h:564
Double_t GetTPCchi2() const
Definition: AliESDtrack.h:265
Bool_t fEnableFillAOD
value that decides if this task activates AOD filling
ULong64_t GetStatus() const
Definition: AliESDtrack.h:82
Float_t GetZDCTDCCorrected(Int_t i, Int_t j) const
Definition: AliESDZDC.h:77
const Double_t kVeryBig
Bool_t GetPxPyPz(Double_t *p) const
UInt_t GetNLabels() const
void SetZPCTowers(const Double_t value[5], const Double_t valueLG[5])
Definition: AliAODZDC.cxx:184
Int_t * GetLabels() const
UShort_t GetTPCsignalN() const
Definition: AliESDtrack.h:262
AliAODTrdTrack & AddTrdTrack(const AliVTrdTrack *track)
UShort_t GetTPCNcls() const
Definition: AliESDtrack.h:230
void ConvertZDC(const AliESDEvent &esd)
void SetDetectorStatusMask(UInt_t detStatus)
Definition: AliAODHeader.h:110
Int_t Tracks2V0vertices(AliESDEvent *event)
Int_t fNumberOfPositiveTracks
current number of positive tracks
Bool_t fAreCaloClustersEnabled
whether or not to fill the calo clusters (true by default)
void SetZEM1Energy(const Double_t zem1)
Definition: AliAODZDC.h:79
void ConvertTracklets(const AliESDEvent &esd)
Int_t GetZPCTDCChannel()
Definition: AliESDZDC.h:88
void SetParent(TObject *parent)
Definition: AliAODVertex.h:68
Bool_t IsEMCAL() const
Definition: AliESDtrack.h:410
Float_t GetTimeFull(Int_t ch, Int_t hit) const
Definition: AliESDTZERO.h:54
void SetIsGlobalConstrained(Bool_t b=kTRUE)
Definition: AliAODTrack.h:395
void ConvertKinks(const AliESDEvent &esd)
virtual Double_t GetImpactParameter() const
Definition: AliESDZDC.h:31
Int_t GetNindex() const
Definition: AliESDv0.h:85
void ConvertCascades(const AliESDEvent &esd)
Bool_t fAreCascadesEnabled
whether or not to fill the cascades branch (true by default)
UChar_t GetNExMax() const
Int_t GetL1V0(Int_t i) const
AliVEventHandler * GetOutputEventHandler() const
Char_t GetType() const
Double_t GetTOF() const
Bool_t GetConstrainedXYZ(Double_t *r) const
Definition: AliESDtrack.h:111
void SetIntegratedLength(Double_t l)
Definition: AliAODTrack.h:338
Short_t GetCellNumber(Short_t pos) const
static AliESDtrackCuts * GetStandardTPCOnlyTrackCuts()
void SetRefMultiplicityPos(Int_t refMultPos)
Definition: AliAODHeader.h:162
AliESDTrdTrack * GetTrdTrack(Int_t i) const
Definition: AliESDEvent.h:457
virtual AliAODEvent * AODEvent() const
UInt_t GetNumberOfITSClusters(Int_t layer) const
void SetTRDncls(UChar_t ncls, Int_t layer=-1)
Definition: AliAODPid.h:124
AliTPCcalibV0 v0
Bool_t fArePmdClustersEnabled
whether or not to fill the pmd clusters (true by default)
void SelectParticle(Int_t i)
void SetZPCTDC(Float_t tdc)
Definition: AliAODZDC.h:97
Double_t GetTRDsignal() const
Definition: AliESDtrack.h:318
void SetZDCImpactParameter(Float_t b, Float_t bA, Float_t bC)
Definition: AliAODZDC.h:88
Calorimeter cluster data container.
#define AliFatal(message)
Definition: AliLog.h:640
virtual Double_t GetX() const
Definition: AliVertex.h:38
void ResetZNAfired()
Definition: AliAODZDC.h:113
Bool_t fIsMuonCaloPass
whether or not this filtering is used on a muon_calo ESD
void SetZPATDCm(Int_t i, Float_t tdc)
Definition: AliAODZDC.h:104
virtual TTree * OutputTree() const
UInt_t GetOrbitNumber() const
Definition: AliESDEvent.h:217
AliAODHeader * ConvertHeader(const AliESDEvent &esd)
TClonesArray * GetPmdClusters() const
Definition: AliAODEvent.h:246
const AliESDTZERO * GetESDTZERO() const
Definition: AliESDEvent.h:260
void SetITSClusters(Int_t ilay, UInt_t nclus)
Definition: AliAODHeader.h:342
virtual void SetFastOrFiredChipMap(const TBits &fochips)
Double_t GetChi2Xi() const
Definition: AliESDcascade.h:75
virtual const Double_t * GetZNCTowerEnergy() const
Definition: AliESDZDC.h:42
void SetZNCfired()
Definition: AliAODZDC.h:107
void ResetZPCfired()
Definition: AliAODZDC.h:116
void SetPropagateTrackToEMCal(Bool_t propagate)
TObjArray * RefitESDVertexTracks(AliESDEvent *esdEv, Int_t algo=6, const Double_t *cuts=0)
TList * GetCuts() const
Bool_t SetCell(Short_t pos, Short_t cellNumber, Double_t amplitude, Double_t time, Int_t mclabel=-1, Double_t efrac=0., Bool_t isHG=kFALSE)
Int_t ConvertHMPID(const AliESDEvent &esd)
mgr
Definition: runKineProof.C:24
void CreateContainer(Int_t nTracks)
void SetITSSharedMap(UChar_t map)
Definition: AliAODTrack.h:416
Double_t GetEFraction(Short_t pos) const
Bool_t GetPileupFlag() const
Definition: AliESDTZERO.h:74
void ConvertTZERO(const AliESDEvent &esd)
AliTOFPIDResponse & GetTOFResponse()
void SetT0zVertex(Double32_t z)
Definition: AliAODTZERO.h:49
void SetTOFHeader(const AliTOFHeader *tofEventTime)
void ConvertCaloClusters(const AliESDEvent &esd)
Double_t GetClusterY() const
UChar_t GetTRDntrackletsPID() const
Definition: AliESDtrack.h:295
virtual Double_t GetDeltaPhi(Int_t i) const
Double_t Chi2perNDF(AliESDtrack *track)
void SetTOFpidResolution(Double_t tofPIDres[5])
Definition: AliAODPid.cxx:157
void PrintTask(Option_t *option="all", Int_t indent=0) const
void SetTPCPointsF(UShort_t findable)
Definition: AliAODTrack.h:294
Double_t fV0Cuts[7]
Array to store the values for the different reco selections V0 related.
Int_t GetZPATDCChannel()
Definition: AliESDZDC.h:84
TParticle * Particle(Int_t id, Bool_t useInEmbedding=kFALSE)
Definition: AliStack.cxx:689
#define AliDebug(logLevel, message)
Definition: AliLog.h:300
Bool_t fAddPCMv0s
Add pcm v0s when v0filter is switched on.
Double_t GetITSsignal() const
Definition: AliESDtrack.h:183
Bool_t fIsVZEROEnabled
whether or not to fill the vzero branch (true by default)
Double_t GetIntegratedLength() const
Double_t E() const
void GetPosCov(Double_t cov[6]) const
Definition: AliESDv0.cxx:604
void SetRefMultiplicityComb10(Int_t refMult)
Definition: AliAODHeader.h:170
virtual const Double_t * GetZNATowerEnergy() const
Definition: AliESDZDC.h:43
Bool_t fWriteHybridTPCCOnly
write only the complent tracks not all global constrained
void Print(Option_t *option="") const
void AddDaughter(TObject *daughter)
virtual void Reset()
Int_t GetNCells() const
virtual const Double_t * GetZPCTowerEnergy() const
Definition: AliESDZDC.h:44
void GetDiamondCovXY(Float_t cov[3]) const
Definition: AliESDEvent.h:156
TClonesArray * GetCaloClusters() const
Definition: AliAODEvent.h:222
void PrintMCInfo(AliStack *pStack, Int_t label)
void ResetZEM1fired()
Definition: AliAODZDC.h:117
void SetCuts(const Double_t cuts[8])
Int_t GetNumberOfTRDslices() const
UShort_t GetTPCNclsF() const
Definition: AliESDtrack.h:231
virtual Int_t GetNContributors() const
Definition: AliVertex.h:42
virtual UInt_t IsSelected(TObject *obj)
void SetTPCsignalN(UShort_t tpcN)
Definition: AliAODPid.h:31
void ResetCascades()
Definition: AliESDEvent.h:565
AOD PMD cluster class.
void ConvertTRD(const AliESDEvent &esd)
UChar_t GetTRDncls() const
Definition: AliESDtrack.h:324
AliAODPid * GetDetPid() const
Definition: AliAODTrack.h:370
UChar_t GetTriggerCluster() const
Definition: AliESDEvent.h:226
Int_t GetZNCTDCChannel()
Definition: AliESDZDC.h:87
const AliESDVertex * GetPrimaryVertexSPD() const
Definition: AliESDEvent.h:307
Int_t GetNumberOfCascades() const
Definition: AliESDEvent.h:553
void SetTPCSharedMap(const TBits amap)
Definition: AliAODTrack.h:292
Double_t GetEmcCpvDistance() const
Analysis Oriented Data (AOD) V0 vertex class.
Definition: AliAODv0.h:15
void SetXYAtDCA(Double_t x, Double_t y)
Definition: AliAODTrack.h:406
virtual void GetImpactParameters(Float_t &xy, Float_t &z) const
Definition: AliESDtrack.h:448
void SetZDCP1Energy(Double_t p1Energy)
Definition: AliAODHeader.h:156
const AliESDVertex * GetPrimaryVertex() const
Short_t GetNumberOfCells() const
Double_t GetDcaXiDaughters() const
Definition: AliESDcascade.h:89
Int_t GetMCLabel(Short_t pos) const
AliAODCaloCells * GetEMCALCells() const
Definition: AliAODEvent.h:273
void GetTOFLabel(Int_t *p) const
Int_t GetBindex() const
Definition: AliESDcascade.h:85
TObject * GetParent() const
Definition: AliAODVertex.h:102
Int_t GetZNATDCChannel()
Definition: AliESDZDC.h:83
void ConvertGlobalConstrainedTracks(const AliESDEvent &esd)
Int_t GetNumberOfTracks() const
Definition: AliESDEvent.h:536
UInt_t GetPeriodNumber() const
Definition: AliESDEvent.h:146
AliESDtrack * GetTrack(Int_t i) const
Definition: AliESDEvent.h:405
const AliESDRun * GetESDRun() const
Definition: AliESDEvent.h:135
Container class for AOD TZERO data.
Definition: AliAODTZERO.h:14
void SetTriggerMask(ULong64_t trigMsk)
Definition: AliAODHeader.h:146
Bool_t IsZNChit()
Definition: AliESDZDC.h:144
AliVTrack * GetTrackMatch() const
Container class for AOD VZERO data.
Definition: AliAODVZERO.h:13
void SetIRInt1InteractionMap(TBits bits)
Definition: AliAODHeader.h:229
Int_t fNumberOfKinks
current number of kinks
static Bool_t ExtrapolateTrackToEMCalSurface(AliVTrack *track, Double_t emcalR=440, Double_t mass=0.1396, Double_t step=20, Double_t minpT=0.35, Bool_t useMassForTracking=kFALSE, Bool_t useDCA=kFALSE)
void GetPosCovXi(Double_t cov[6]) const
Float_t GetCurrentDip() const
Definition: AliESDEvent.h:180
Double_t GetTime(Short_t pos) const
void SetZDCN1Energy(Double_t n1Energy)
Definition: AliAODHeader.h:155
void SetNumberOfESDTracks(Int_t n)
Definition: AliAODHeader.h:142
void SetTrackDistance(Double_t dx, Double_t dz)
virtual Double_t GetPhi(Int_t i) const
virtual void SetFiredChipMap(const TBits &firedChips)
void ResetZPAfired()
Definition: AliAODZDC.h:115
Bool_t RelateToVertexTPC(const AliESDVertex *vtx, Double_t b, Double_t maxd, AliExternalTrackParam *cParam=0)
void SetESDFileName(TString name)
Definition: AliAODHeader.h:187
Int_t GetNumberOfCaloClusters() const
Definition: AliESDEvent.h:559
Double_t GetZDCN2Energy() const
Definition: AliESDEvent.h:237
AliESDHeader * GetHeader() const
Definition: AliESDEvent.h:193
virtual Bool_t GetStatus() const
Definition: AliVertex.h:44
void SetRequireITSPureStandAlone(Bool_t b=kFALSE)
virtual const Double_t * GetZNATowerEnergyLR() const
Definition: AliESDZDC.h:47
#define AliError(message)
Definition: AliLog.h:591
void SetZDCTDCSum(Float_t tdc)
Definition: AliAODZDC.h:92
void GetCovMatrix(Double_t covmatrix[6]) const
void DefineOutput(Int_t islot, TClass *type)
void SetZNATowers(const Double_t value[5], const Double_t valueLG[5])
Definition: AliAODZDC.cxx:173
TF1 * fPtshape
Pt spectrum distribution.
void GetIntegratedTimes(Double_t *times, Int_t nspec=AliPID::kSPECIES) const
TCut cut
Definition: MakeGlobalFit.C:75
virtual Bool_t UsesTrack(Int_t index) const
Definition: AliVertex.cxx:151
void SetChi2TPCConstrainedVsGlobal(Double_t chi2)
Definition: AliAODTrack.h:307
void SetTimeStamp(UInt_t timeStamp)
Definition: AliAODHeader.h:79
UInt_t * fUsedTrackCopy
! filterbits of tracks for which a copy was added to the AODs
Class for calorimeter cell ESD data handling.
TBits GetIRInt2InteractionMap() const
Definition: AliESDHeader.h:68
Bool_t GetHighGain(Short_t pos) const
format for the TRD tracks calculated in the
void SetPileupBits(TBits pileup)
Definition: AliAODTZERO.h:52
Int_t GetNumberOfPmdTracks() const
Definition: AliESDEvent.h:549
void GetTime(Float_t &time) const
Int_t GetPHOScluster() const
Definition: AliESDtrack.h:418
AliAODTZERO * GetTZEROData() const
Definition: AliAODEvent.h:328
void ConvertTracks(const AliESDEvent &esd)
virtual void SetFiredChips(Int_t layer, Short_t firedChips)
void GetXYZcascade(Double_t &x, Double_t &y, Double_t &z) const
Double_t GetDiamondZ() const
Definition: AliESDEvent.h:152
void SetZDCParticipants(Int_t npart, Int_t npartA, Int_t npartC)
Definition: AliAODZDC.h:86
UChar_t GetITSClusterMap() const
Definition: AliESDtrack.h:197
void SetIRInt2InteractionMap(TBits bits)
Definition: AliAODHeader.h:228
void SetRefitVertexTracks(Int_t algo=6, Double_t *cuts=0)
UInt_t * GetCellsMCEdepFractionMap() const
Int_t GetNumberOfKinks() const
Definition: AliESDEvent.h:554
UChar_t GetITSSharedMap() const
Definition: AliESDtrack.h:201
AliVEventHandler * fInputHandler
! Input Handler
void SetEventType(UInt_t evttype)
Definition: AliAODHeader.h:150
virtual const TBits & GetFiredChipMap() const
Float_t GetD(Double_t x0, Double_t y0) const
Definition: AliESDv0.cxx:550
void SetZDCN2Energy(Double_t n2Energy)
Definition: AliAODHeader.h:157
Class to handle the AOD tracks with good HMPID rings.
const TBits & GetTPCSharedMap() const
Definition: AliESDtrack.h:278
void GetL1TimeSum(Int_t &timesum) const
Get the L1 time sums (L1 ADC values) for the current fastor.
Double32_t * GetCellsAmplitudeFraction()
void SetBC(Int_t bc)
Definition: AliAODVertex.h:148
void SetPIDForTracking(Int_t pid)
Definition: AliAODTrack.h:177
Double_t GetChi2V0() const
Definition: AliESDv0.h:78
Double_t GetClusterX() const
AOD vertex base class.
Definition: AliAODVertex.h:23
TClonesArray * GetVertices() const
Definition: AliAODEvent.h:176
Double_t GetZDCP1Energy() const
Definition: AliESDEvent.h:236
Int_t fRefitVertexTracks
request to refit the vertex if >=0 (algoID if cuts not supplied, otherwise ncuts) ...
void GetPosition(Float_t *x) const
TH1D * fv0Histos
v0 histos for PCM consistency checks
void SetMagneticField(Double_t magFld)
Definition: AliAODHeader.h:151
Bool_t fIsZDCEnabled
whether or not to fill the zdc branch (true by default)
const AliESDEvent * GetESDEvent() const
Definition: AliESDtrack.h:468
Int_t fNumberOfCascades
current number of cascades
virtual Long64_t Entry() const
void SetZPATowers(const Double_t value[5], const Double_t valueLG[5])
Definition: AliAODZDC.cxx:195
void SetSatelliteFlag(Bool_t sat=false)
Definition: AliAODTZERO.h:46
void Allocate(Int_t size)
void SetEventNumberESDFile(Int_t n)
Definition: AliAODHeader.h:141
AOD track implementation of AliVTrack.
Definition: AliAODTrack.h:29
void SetZPCTDCm(Int_t i, Float_t tdc)
Definition: AliAODZDC.h:103
Double_t GetAmplitude(Short_t pos) const
void SetAmp(Int_t pmt, Float_t amp)
Definition: AliAODTZERO.h:50
AliTOFHeader * GetTOFHeader() const
Definition: AliESDEvent.h:346
Double_t GetM20() const
void CopyChi2TPCConstrainedVsGlobal(AliESDtrack *esdt, AliAODTrack *aodt)
Double_t fEMCalSurfaceDistance
EMCal surface distance from the center of the detector (r = 440 by default)
void GetNL0Times(Int_t &ntimes) const
Get the number of L0 times for the current patch.
void SetRefMultiplicityNeg(Int_t refMultNeg)
Definition: AliAODHeader.h:163
AliESD * GetAliESDOld()
Definition: AliESDEvent.h:573
void SetScaleDThetaBySin2T(Bool_t v)
Double32_t GetT0zVertex() const
Definition: AliESDTZERO.h:28
AliAODAD * GetADData() const
Definition: AliAODEvent.h:344
void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid=kTRUE)
Definition: AliAODTrack.h:393
Bool_t fWriteHybridGCOnly
write only the complent tracks not all global constrained
void SetPHOScluster(Int_t index)
Definition: AliAODTrack.h:321
const AliExternalTrackParam * GetConstrainedParam() const
Definition: AliESDtrack.h:115
Double_t GetD(Double_t xv, Double_t yv, Double_t b) const
AliAODHandler * aodHandler
Definition: runKineProof.C:54
AliMCEventHandler * fMChandler
pointer to MC handler (if any)
UInt_t GetFilterMap() const
Definition: AliAODTrack.h:281
static AliESDtrack * GetTPCOnlyTrack(const AliESDEvent *esd, Int_t iTrack)
virtual const TBits & GetFastOrFiredChipMap() const
Int_t GetL1FrameMask() const
void ConvertPrimaryVertices(const AliESDEvent &esd)
AliAODVertex * fPrimaryVertex
pointer to primary vertex of the event
Int_t GetNumberOfTPCTracks() const
void ConvertCaloTrigger(TString calo, const AliESDEvent &esd)
const Double_t * GetPID() const
Double_t GetTOFsignal() const
void SetT0VertexRaw(Float_t vtx)
Definition: AliAODTZERO.h:48
TRefArray * fAODV0VtxRefs
array of v0 vertices references
void SetITSchi2(Double_t ITSchi2)
Definition: AliAODTrack.h:414
TBits GetIRInt1InteractionMap() const
Definition: AliESDHeader.h:69
void ResetZNCfired()
Definition: AliAODZDC.h:114
void SetL1TriggerInputs(UInt_t n)
Definition: AliAODHeader.h:185
virtual Int_t GetNumberOfTracklets() const
Double_t GetDcaV0Daughters() const
Definition: AliESDv0.h:88
Int_t fNumberOfV0s
current number of v0s
UShort_t GetBunchCrossNumber() const
Definition: AliESDEvent.h:225
Bool_t * fUsedTrack
! indices of used tracks
void SetTRDsignal(Double_t sig)
Definition: AliAODPid.h:36
TBits * fbitfieldPCMv0sA
Bitfield with PCM v0s from on-fly v0 finder.
void AddTracklet(const AliVTrdTracklet &trkl, Int_t layer)