1 #include "AliSPDMCTrackDensity.h"
2 #include "AliMCEvent.h"
3 #include "AliTrackReference.h"
10 //____________________________________________________________________
11 AliSPDMCTrackDensity::AliSPDMCTrackDensity()
12 : AliBaseMCTrackDensity(),
15 fMinZ(-15), // -14.1),
20 // Default constructor
23 //____________________________________________________________________
24 AliSPDMCTrackDensity::AliSPDMCTrackDensity(const char*)
25 : AliBaseMCTrackDensity("spdMCTrackDensity"),
33 // Normal constructor constructor
36 //____________________________________________________________________
37 AliSPDMCTrackDensity::AliSPDMCTrackDensity(const AliSPDMCTrackDensity& o)
38 : AliBaseMCTrackDensity(o),
46 // Normal constructor constructor
49 //____________________________________________________________________
51 AliSPDMCTrackDensity::operator=(const AliSPDMCTrackDensity& o)
53 // Assignment operator
54 if (&o == this) return *this;
55 AliBaseMCTrackDensity::operator=(o);
66 //____________________________________________________________________
68 AliSPDMCTrackDensity::GetDetectorId() const
70 return AliTrackReference::kITS;
74 //____________________________________________________________________
76 AliSPDMCTrackDensity::BeginTrackRefs()
81 //____________________________________________________________________
83 AliSPDMCTrackDensity::CheckTrackRef(AliTrackReference* ref) const
85 // Get radius and z where the track reference was made
86 Double_t r = ref->R();
87 Double_t z = ref->Z();
88 if (r > fMaxR || r < fMinR) return false;
89 if (z > fMaxZ || z < fMinZ) return false;
93 //____________________________________________________________________
95 AliSPDMCTrackDensity::ProcessRef(AliMCParticle* /*particle*/,
96 const AliMCParticle* /*mother*/,
97 AliTrackReference* ref)
99 if (fStored) return 0;
101 return fStored = ref;
104 //____________________________________________________________________
106 AliSPDMCTrackDensity::StoreParticle(AliMCParticle* particle,
107 const AliMCParticle* mother,
108 AliTrackReference* ref) const
110 Double_t w = AliBaseMCTrackDensity::StoreParticle(particle, mother, ref);
111 Double_t r = ref->R();
112 Double_t x = ref->X();
113 Double_t y = ref->Y();
114 Double_t z = ref->Z();
117 Double_t th = TMath::ATan2(r,zr);
118 if (th < 0) th += 2*TMath::Pi();
119 Double_t et = -TMath::Log(TMath::Tan(th/2));
120 Double_t ph = TMath::ATan2(y,x);
121 if (ph < 0) ph += 2*TMath::Pi();
122 fOutput->Fill(et,ph,w);
128 //____________________________________________________________________
130 AliSPDMCTrackDensity::Calculate(const AliMCEvent& event,
136 // Filter the input kinematics and track references, using
137 // some of the ESD information
140 // input Input ESD event
141 // event Input MC event
142 // vz Vertex position
143 // output Output ESD-like object
144 // primary Per-event histogram of primaries
147 // True on succes, false otherwise
151 return ProcessTracks(event, vz, primary);
154 //____________________________________________________________________
156 AliSPDMCTrackDensity::Print(Option_t* option) const
158 AliBaseMCTrackDensity::Print(option);
159 char ind[gROOT->GetDirLevel()+1];
160 for (Int_t i = 0; i < gROOT->GetDirLevel(); i++) ind[i] = ' ';
161 ind[gROOT->GetDirLevel()] = '\0';
162 std::cout << ind << " R range: [" << fMinR << ',' << fMaxR
164 << ind << " Z range: [" << fMinZ << ',' << fMaxZ
169 //____________________________________________________________________