AliPhysics  64f4410 (64f4410)
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()
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
Base task in the EMCAL framework.
Container for particles within the EMCAL framework.
void ExecOnce()
Perform steps needed to initialize the analysis.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
bool Bool_t
Definition: External.C:53