AliPhysics  75b74d3 (75b74d3)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AliEmcalTrackPropagatorTask.cxx
Go to the documentation of this file.
1 //
2 // Task to propagate tracks to EMCAL surface.
3 //
4 // Author: C.Loizides, S.Aiola
5 
7 
8 #include "AliParticleContainer.h"
9 
10 #include <TClonesArray.h>
11 
12 #include <AliVTrack.h>
13 #include <AliEMCALRecoUtils.h>
14 
16 
17 //________________________________________________________________________
20  fDist(440),
21  fOnlyIfNotSet(kTRUE),
22  fOnlyIfEmcal(kTRUE)
23 {
24  // Constructor.
25 }
26 
27 //________________________________________________________________________
29  AliAnalysisTaskEmcal(name, kFALSE),
30  fDist(440),
31  fOnlyIfNotSet(kTRUE),
32  fOnlyIfEmcal(kTRUE)
33 {
34  // Constructor.
35 }
36 
37 //________________________________________________________________________
39 {
40  // Destructor.
41 }
42 
43 //________________________________________________________________________
45 {
46  // Executed only once at the beginning of the analysis.
47 
49  if (tracks) {
50  tracks->SetClassName("AliVTrack");
51  }
52 
54 }
55 
56 //________________________________________________________________________
58 {
59  // Main loop, called for each event.
60 
62 
63  if (!tracks) return 0;
64 
65  tracks->ResetCurrentID();
66  AliVTrack* track = 0;
67  while ((track = static_cast<AliVTrack*>(tracks->GetNextAcceptParticle()))) {
68  if (fOnlyIfNotSet && track->IsExtrapolatedToEMCAL()) continue;
69  if (fOnlyIfEmcal && !track->IsEMCAL()) continue;
70 
71  AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(track, fDist);
72  }
73 
74  return kTRUE;
75 }
virtual AliVParticle * GetNextAcceptParticle()
Base task in the EMCAL framework.
void SetClassName(const char *clname)
Container for particles within the EMCAL framework.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
ClassImp(AliEmcalTrackPropagatorTask) AliEmcalTrackPropagatorTask
void ResetCurrentID(Int_t i=-1)