]>
Commit | Line | Data |
---|---|---|
f68d9069 | 1 | #ifndef ALIFMDMCTRACKDENSITY_MC |
2 | #define ALIFMDMCTRACKDENSITY_MC | |
3 | #include "AliForwardUtil.h" | |
4bcdcbc1 | 4 | #include "AliBaseMCTrackDensity.h" |
f68d9069 | 5 | class TH1D; |
f68d9069 | 6 | class AliESDFMD; |
f68d9069 | 7 | |
8 | /** | |
9 | * A class to calculate the particle density from track references. | |
10 | * This code is used both in AliForwardMCCorrectionsTask and | |
11 | * AliFMDMCDensity calculator. | |
12 | * | |
13 | * @par Input: | |
14 | * - AliESDFMD object - from reconstruction | |
15 | * - Kinematics | |
16 | * - Track-References | |
17 | * | |
18 | * @par Output: | |
19 | * - AliESDFMD object - content is # of track references/strip | |
20 | * | |
21 | * @par Corrections used: | |
22 | * - None | |
23 | * | |
24 | * @par Histograms: | |
25 | * - Incident angle vs number of track references | |
26 | * - Incident angle vs number of strips/cluster | |
27 | * | |
bd6f5206 | 28 | * @ingroup pwglf_forward_algo |
29 | * @ingroup pwglf_forward_mc | |
30 | * @ingroup pwglf_forward_aod | |
f68d9069 | 31 | */ |
4bcdcbc1 | 32 | class AliFMDMCTrackDensity : public AliBaseMCTrackDensity |
f68d9069 | 33 | { |
34 | public: | |
35 | /** | |
36 | * Default constructor. Do not use - for ROOT I/O system use only | |
37 | */ | |
38 | AliFMDMCTrackDensity(); | |
39 | /** | |
40 | * Normal constructor | |
41 | * | |
42 | * @param name Not used | |
43 | */ | |
44 | AliFMDMCTrackDensity(const char* name); | |
45 | /** | |
46 | * Copy constructor | |
47 | * | |
48 | * @param o Object to copy from | |
49 | */ | |
50 | AliFMDMCTrackDensity(const AliFMDMCTrackDensity& o); | |
51 | /** | |
52 | * Assignment operator | |
53 | * | |
54 | * @param o Object to assign from | |
55 | * | |
56 | * @return Reference to this | |
57 | */ | |
58 | AliFMDMCTrackDensity& operator=(const AliFMDMCTrackDensity& o); | |
59 | /** | |
60 | * Destructor. | |
61 | */ | |
62 | virtual ~AliFMDMCTrackDensity() {} | |
63 | ||
64 | /** | |
65 | * Set maximum number of strips per 'cluster' | |
66 | * | |
67 | * @param n Maximum number of strips per 'cluster' | |
68 | */ | |
69 | void SetMaxConsequtiveStrips(UShort_t n) { fMaxConsequtiveStrips = n; } | |
f68d9069 | 70 | /** |
71 | * Loops over all the particles in the passed event. If @a primary | |
72 | * is not null, then that histogram is filled with the primary | |
73 | * particle information - irrespective of whether the particle | |
74 | * actually hits the FMD or not. For each track (primary or | |
75 | * secondary, unless only primary information is requested - see | |
76 | * SetUseOnlyPrimary) loop over all track references to that | |
77 | * particle and check if they come from the FMD. In that case, | |
78 | * figure out which strip(s) to assign the track to, and fill the @a | |
79 | * hits structure. | |
80 | * | |
81 | * @param esd FMD ESD structure | |
82 | * @param event MC event | |
83 | * @param vz IP z-coordinate | |
84 | * @param output Output of FMD hits | |
85 | * @param primary Primary information, if available. | |
86 | * | |
87 | * @return true | |
88 | */ | |
89 | Bool_t Calculate(const AliESDFMD& esd, | |
90 | const AliMCEvent& event, | |
91 | Double_t vz, | |
92 | AliESDFMD& output, | |
93 | TH2D* primary); | |
94 | /** | |
95 | * Define ouputs | |
96 | * | |
97 | * @param list List to add outputs to | |
98 | */ | |
5934a3e3 | 99 | void CreateOutputObjects(TList* list); |
f68d9069 | 100 | |
101 | void Print(Option_t* option="") const; | |
102 | protected: | |
103 | /** | |
4bcdcbc1 | 104 | * Must be defined to return the track-reference ID for this detector |
f68d9069 | 105 | * |
4bcdcbc1 | 106 | * @return Detector id set on track references |
107 | */ | |
108 | Int_t GetDetectorId() const; | |
f68d9069 | 109 | /** |
4bcdcbc1 | 110 | * Process a track reference |
f68d9069 | 111 | * |
4bcdcbc1 | 112 | * @param particle Particle |
113 | * @param mother Ultimate mother (if not primary) | |
114 | * @param ref Reference | |
f68d9069 | 115 | * |
4bcdcbc1 | 116 | * @return 0 if no output should be generated for this reference, or |
117 | * pointer to track-reference to produce output for. | |
f68d9069 | 118 | */ |
4bcdcbc1 | 119 | AliTrackReference* ProcessRef(AliMCParticle* particle, |
120 | const AliMCParticle* mother, | |
121 | AliTrackReference* ref); | |
f68d9069 | 122 | /** |
4bcdcbc1 | 123 | * Called at before loop over track references |
f68d9069 | 124 | * |
f68d9069 | 125 | */ |
4bcdcbc1 | 126 | void BeginTrackRefs(); |
2b556440 | 127 | /** |
4bcdcbc1 | 128 | * Called at before loop over track references |
129 | * | |
290052e7 | 130 | * @param nRefs Number of references |
2b556440 | 131 | */ |
4bcdcbc1 | 132 | void EndTrackRefs(Int_t nRefs); |
133 | /** | |
134 | * Store a particle hit in Base<i>dr</i>[<i>s,t</i>] in @a output | |
135 | * | |
136 | * | |
137 | * @param particle Particle to store | |
138 | * @param mother Ultimate mother of particle | |
290052e7 | 139 | * @param ref Longest track reference |
140 | * | |
141 | * @return weight | |
4bcdcbc1 | 142 | */ |
143 | Double_t StoreParticle(AliMCParticle* particle, | |
144 | const AliMCParticle* mother, | |
145 | AliTrackReference* ref) const; | |
290052e7 | 146 | /** |
147 | * Structure holding the state of the `tracker' | |
148 | * | |
149 | */ | |
4bcdcbc1 | 150 | mutable struct State |
151 | { | |
290052e7 | 152 | Double_t angle; // Angle |
153 | UShort_t oldDetector; // Last detector | |
154 | Char_t oldRing; // Last ring | |
155 | UShort_t oldSector; // Last sector | |
156 | UShort_t oldStrip; // Last strip | |
157 | UShort_t startStrip; // First strip | |
158 | UShort_t nRefs; // Number of references | |
159 | UShort_t nStrips; // Number of strips | |
160 | UShort_t count; // Count of hit strips | |
161 | AliTrackReference* longest; //! Longest track through | |
162 | /** | |
163 | * Clear this state | |
164 | * | |
165 | * @param alsoCount If true, also clear count | |
166 | */ | |
4bcdcbc1 | 167 | void Clear(Bool_t alsoCount=false); |
290052e7 | 168 | /** |
169 | * Assignment operator | |
170 | * | |
171 | * @param o Object to assign from | |
172 | * | |
173 | * @return Reference to this object | |
174 | */ | |
4bcdcbc1 | 175 | State& operator=(const State& o); |
5ca83fee | 176 | } fState; //! State |
4bcdcbc1 | 177 | |
178 | ||
179 | UShort_t fMaxConsequtiveStrips; // Max 'cluster' size | |
180 | TH1D* fNr; // Number of track-refs per cluster | |
181 | TH1D* fNt; // Size of cluster in strips | |
182 | TH1D* fNc; // Number of clusters per track | |
183 | TH2D* fNcr; // Number of clusters per track | |
184 | AliESDFMD* fOutput; //! Output ESD object | |
f68d9069 | 185 | |
5934a3e3 | 186 | ClassDef(AliFMDMCTrackDensity,5); // Calculate track-ref density |
f68d9069 | 187 | }; |
188 | ||
189 | #endif | |
190 | // Local Variables: | |
191 | // mode: C++ | |
192 | // End: |