1 #ifndef ALIFMDMCTRACKDENSITY_MC
2 #define ALIFMDMCTRACKDENSITY_MC
3 #include "AliForwardUtil.h"
11 class AliTrackReference;
15 * A class to calculate the particle density from track references.
16 * This code is used both in AliForwardMCCorrectionsTask and
17 * AliFMDMCDensity calculator.
20 * - AliESDFMD object - from reconstruction
25 * - AliESDFMD object - content is # of track references/strip
27 * @par Corrections used:
31 * - Incident angle vs number of track references
32 * - Incident angle vs number of strips/cluster
34 * @ingroup pwglf_forward_algo
35 * @ingroup pwglf_forward_mc
36 * @ingroup pwglf_forward_aod
38 class AliFMDMCTrackDensity : public TNamed
42 * Default constructor. Do not use - for ROOT I/O system use only
44 AliFMDMCTrackDensity();
48 * @param name Not used
50 AliFMDMCTrackDensity(const char* name);
54 * @param o Object to copy from
56 AliFMDMCTrackDensity(const AliFMDMCTrackDensity& o);
60 * @param o Object to assign from
62 * @return Reference to this
64 AliFMDMCTrackDensity& operator=(const AliFMDMCTrackDensity& o);
68 virtual ~AliFMDMCTrackDensity() {}
71 * Set maximum number of strips per 'cluster'
73 * @param n Maximum number of strips per 'cluster'
75 void SetMaxConsequtiveStrips(UShort_t n) { fMaxConsequtiveStrips = n; }
77 * Set whether to only consider primaries
79 * @param use If true, consider only primaries
81 void SetUseOnlyPrimary(Bool_t use) { fUseOnlyPrimary = use; }
84 * Set whether to print debug messages. Please note this will
85 * produce a lot of output.
87 * @param debug Whether to enable debug messages or not
89 void SetDebug(Bool_t debug=true) { fDebug = debug; }
91 * Loops over all the particles in the passed event. If @a primary
92 * is not null, then that histogram is filled with the primary
93 * particle information - irrespective of whether the particle
94 * actually hits the FMD or not. For each track (primary or
95 * secondary, unless only primary information is requested - see
96 * SetUseOnlyPrimary) loop over all track references to that
97 * particle and check if they come from the FMD. In that case,
98 * figure out which strip(s) to assign the track to, and fill the @a
101 * @param esd FMD ESD structure
102 * @param event MC event
103 * @param vz IP z-coordinate
104 * @param output Output of FMD hits
105 * @param primary Primary information, if available.
109 Bool_t Calculate(const AliESDFMD& esd,
110 const AliMCEvent& event,
117 * @param list List to add outputs to
119 void DefineOutput(TList* list);
121 void Print(Option_t* option="") const;
124 * Store a particle hit in FMD<i>dr</i>[<i>s,t</i>] in @a output
127 * @param particle Particle to store
128 * @param mother Ultimate mother of particle
129 * @param longest Longest track reference
130 * @param vz Z coordinate of IP
131 * @param nC Total number of track-references in this sector
132 * @param nT Number of distint strips hit in this sector
133 * @param output Output structure
135 void StoreParticle(AliMCParticle* particle,
136 const AliMCParticle* mother,
141 AliESDFMD& output) const;
143 * Get incident angle of this track reference
145 * @param ref Track reference
146 * @param vz Z coordinate of the IP
148 * @return incident angle (in radians)
150 Double_t GetTrackRefTheta(const AliTrackReference* ref,
153 * Get ultimate mother of a track
155 * @param iTr Track number
158 * @return Pointer to mother or null
160 const AliMCParticle* GetMother(Int_t iTr, const AliMCEvent& event) const;
161 Bool_t fUseOnlyPrimary; // Only use primaries
162 UShort_t fMaxConsequtiveStrips; // Max 'cluster' size
163 TH1D* fNr; // Number of track-refs per cluster
164 TH1D* fNt; // Size of cluster in strips
165 TH2D* fBinFlow; // eta,phi bin flow
166 TH2D* fEtaBinFlow; // dEta vs eta of strip
167 TH2D* fPhiBinFlow; // dPhi vs phi of strip
168 Bool_t fDebug; // Debug flag
170 ClassDef(AliFMDMCTrackDensity,1); // Calculate track-ref density