1 #ifndef ALIFMDMCTRACKDENSITY_MC
2 #define ALIFMDMCTRACKDENSITY_MC
3 #include "AliForwardUtil.h"
4 #include "AliBaseMCTrackDensity.h"
9 * A class to calculate the particle density from track references.
10 * This code is used both in AliForwardMCCorrectionsTask and
11 * AliFMDMCDensity calculator.
14 * - AliESDFMD object - from reconstruction
19 * - AliESDFMD object - content is # of track references/strip
21 * @par Corrections used:
25 * - Incident angle vs number of track references
26 * - Incident angle vs number of strips/cluster
28 * @ingroup pwglf_forward_algo
29 * @ingroup pwglf_forward_mc
30 * @ingroup pwglf_forward_aod
32 class AliFMDMCTrackDensity : public AliBaseMCTrackDensity
36 * Default constructor. Do not use - for ROOT I/O system use only
38 AliFMDMCTrackDensity();
42 * @param name Not used
44 AliFMDMCTrackDensity(const char* name);
48 * @param o Object to copy from
50 AliFMDMCTrackDensity(const AliFMDMCTrackDensity& o);
54 * @param o Object to assign from
56 * @return Reference to this
58 AliFMDMCTrackDensity& operator=(const AliFMDMCTrackDensity& o);
62 virtual ~AliFMDMCTrackDensity() {}
65 * Set maximum number of strips per 'cluster'
67 * @param n Maximum number of strips per 'cluster'
69 void SetMaxConsequtiveStrips(UShort_t n) { fMaxConsequtiveStrips = n; }
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
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.
89 Bool_t Calculate(const AliESDFMD& esd,
90 const AliMCEvent& event,
97 * @param list List to add outputs to
99 void DefineOutput(TList* list);
101 void Print(Option_t* option="") const;
104 * Must be defined to return the track-reference ID for this detector
106 * @return Detector id set on track references
108 Int_t GetDetectorId() const;
110 * Process a track reference
112 * @param particle Particle
113 * @param mother Ultimate mother (if not primary)
114 * @param ref Reference
116 * @return 0 if no output should be generated for this reference, or
117 * pointer to track-reference to produce output for.
119 AliTrackReference* ProcessRef(AliMCParticle* particle,
120 const AliMCParticle* mother,
121 AliTrackReference* ref);
123 * Called at before loop over track references
126 void BeginTrackRefs();
128 * Called at before loop over track references
130 * @param nRefs Number of references
132 void EndTrackRefs(Int_t nRefs);
134 * Store a particle hit in Base<i>dr</i>[<i>s,t</i>] in @a output
137 * @param particle Particle to store
138 * @param mother Ultimate mother of particle
139 * @param ref Longest track reference
143 Double_t StoreParticle(AliMCParticle* particle,
144 const AliMCParticle* mother,
145 AliTrackReference* ref) const;
147 * Structure holding the state of the `tracker'
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
165 * @param alsoCount If true, also clear count
167 void Clear(Bool_t alsoCount=false);
169 * Assignment operator
171 * @param o Object to assign from
173 * @return Reference to this object
175 State& operator=(const State& o);
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
186 ClassDef(AliFMDMCTrackDensity,3); // Calculate track-ref density