1 #include "AliSPDMCTrackDensity.h"
2 #include "AliMCEvent.h"
3 #include "AliTrackReference.h"
4 #include "AliForwardUtil.h"
11 //____________________________________________________________________
12 AliSPDMCTrackDensity::AliSPDMCTrackDensity()
13 : AliBaseMCTrackDensity(),
16 fMinZ(-15), // -14.1),
21 // Default constructor
24 //____________________________________________________________________
25 AliSPDMCTrackDensity::AliSPDMCTrackDensity(const char*)
26 : AliBaseMCTrackDensity("spdMCTrackDensity"),
34 // Normal constructor constructor
37 //____________________________________________________________________
38 AliSPDMCTrackDensity::AliSPDMCTrackDensity(const AliSPDMCTrackDensity& o)
39 : AliBaseMCTrackDensity(o),
47 // Normal constructor constructor
50 //____________________________________________________________________
52 AliSPDMCTrackDensity::operator=(const AliSPDMCTrackDensity& o)
54 // Assignment operator
55 if (&o == this) return *this;
56 AliBaseMCTrackDensity::operator=(o);
67 //____________________________________________________________________
69 AliSPDMCTrackDensity::GetDetectorId() const
71 return AliTrackReference::kITS;
75 //____________________________________________________________________
77 AliSPDMCTrackDensity::BeginTrackRefs()
82 //____________________________________________________________________
84 AliSPDMCTrackDensity::CheckTrackRef(AliTrackReference* ref) const
86 // Get radius and z where the track reference was made
87 Double_t r = ref->R();
88 Double_t z = ref->Z();
89 if (r > fMaxR || r < fMinR) return false;
90 if (z > fMaxZ || z < fMinZ) return false;
94 //____________________________________________________________________
96 AliSPDMCTrackDensity::ProcessRef(AliMCParticle* /*particle*/,
97 const AliMCParticle* /*mother*/,
98 AliTrackReference* ref)
100 if (fStored) return 0;
102 return fStored = ref;
105 //____________________________________________________________________
107 AliSPDMCTrackDensity::StoreParticle(AliMCParticle* particle,
108 const AliMCParticle* mother,
109 AliTrackReference* ref) const
111 Double_t w = AliBaseMCTrackDensity::StoreParticle(particle, mother, ref);
112 Double_t r = ref->R();
113 Double_t x = ref->X();
114 Double_t y = ref->Y();
115 Double_t z = ref->Z();
118 Double_t th = TMath::ATan2(r,zr);
119 if (th < 0) th += 2*TMath::Pi();
120 Double_t et = -TMath::Log(TMath::Tan(th/2));
121 Double_t ph = TMath::ATan2(y,x);
122 if (ph < 0) ph += 2*TMath::Pi();
123 fOutput->Fill(et,ph,w);
129 //____________________________________________________________________
131 AliSPDMCTrackDensity::Calculate(const AliMCEvent& event,
137 // Filter the input kinematics and track references, using
138 // some of the ESD information
141 // input Input ESD event
142 // event Input MC event
143 // vz Vertex position
144 // output Output ESD-like object
145 // primary Per-event histogram of primaries
148 // True on succes, false otherwise
152 return ProcessTracks(event, vz, primary);
154 #define PF(N,V,...) \
155 AliForwardUtil::PrintField(N,V, ## __VA_ARGS__)
157 #define PFV(N,VALUE) \
159 AliForwardUtil::PrintName(N); \
160 std::cout << (VALUE) << std::endl; } while(false)
161 //____________________________________________________________________
163 AliSPDMCTrackDensity::Print(Option_t* option) const
165 AliBaseMCTrackDensity::Print(option);
166 gROOT->IncreaseDirLevel();
167 PF("R range", "[%f,%f]", fMinR, fMaxR);
168 PF("Z range", "[%f,%f]", fMinZ, fMaxZ);
169 gROOT->DecreaseDirLevel();
172 //____________________________________________________________________