]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliFMDMCTrackDensity.h
Documentation fixes for Doxygen
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDMCTrackDensity.h
1 #ifndef ALIFMDMCTRACKDENSITY_MC
2 #define ALIFMDMCTRACKDENSITY_MC
3 #include "AliForwardUtil.h"
4 #include <TNamed.h>
5 class TList;
6 class TH1D;
7 class TH2D;
8 class AliMCEvent;
9 class AliESDFMD;
10 class AliMCParticle;
11 class AliTrackReference;
12 class AliStack;
13
14 /**
15  * A class to calculate the particle density from track references.
16  * This code is used both in AliForwardMCCorrectionsTask and
17  * AliFMDMCDensity calculator. 
18  * 
19  * @par Input: 
20  *    - AliESDFMD object  - from reconstruction
21  *    - Kinematics
22  *    - Track-References
23  *
24  * @par Output: 
25  *    - AliESDFMD object  - content is # of track references/strip
26  *
27  * @par Corrections used: 
28  *    - None
29  *
30  * @par Histograms: 
31  *    - Incident angle vs number of track references
32  *    - Incident angle vs number of strips/cluster
33  *
34  * @ingroup pwg2_forward_algo
35  * @ingroup pwg2_forward_mc
36  * @ingroup pwg2_forward_aod
37  */
38 class AliFMDMCTrackDensity : public TNamed
39 {
40 public:
41   /** 
42    * Default constructor.  Do not use - for ROOT I/O system use only 
43    */
44   AliFMDMCTrackDensity();
45   /** 
46    * Normal constructor 
47    * 
48    * @param name Not used
49    */
50   AliFMDMCTrackDensity(const char* name);
51   /** 
52    * Copy constructor 
53    * 
54    * @param o Object to copy from 
55    */
56   AliFMDMCTrackDensity(const AliFMDMCTrackDensity& o);
57   /** 
58    * Assignment operator
59    * 
60    * @param o Object to assign from 
61    * 
62    * @return Reference to this 
63    */
64   AliFMDMCTrackDensity& operator=(const AliFMDMCTrackDensity& o);
65   /** 
66    * Destructor. 
67    */
68   virtual ~AliFMDMCTrackDensity() {}
69
70   /** 
71    * Set maximum number of strips per 'cluster' 
72    * 
73    * @param n  Maximum number of strips per 'cluster' 
74    */
75   void SetMaxConsequtiveStrips(UShort_t n) { fMaxConsequtiveStrips = n; }
76   /** 
77    * Set whether to only consider primaries 
78    * 
79    * @param use If true, consider only primaries
80    */
81   void SetUseOnlyPrimary(Bool_t use) { fUseOnlyPrimary = use; }
82   
83   /** 
84    * Set whether to print debug messages.  Please note this will
85    * produce a lot of output. 
86    * 
87    * @param debug Whether to enable debug messages or not 
88    */
89   void SetDebug(Bool_t debug=true) { fDebug = debug; }
90   /** 
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
99    * hits structure.
100    * 
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. 
106    * 
107    * @return true 
108    */
109   Bool_t Calculate(const AliESDFMD&    esd, 
110                    const AliMCEvent&   event, 
111                    Double_t            vz,
112                    AliESDFMD&          output,
113                    TH2D*               primary);
114   /** 
115    * Define ouputs 
116    * 
117    * @param list List to add outputs to
118    */
119   void DefineOutput(TList* list);
120   
121   void Print(Option_t* option="") const;
122 protected:
123   /** 
124    * Store a particle hit in FMD<i>dr</i>[<i>s,t</i>] in @a output
125    * 
126    * 
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 
134    */  
135   void StoreParticle(AliMCParticle* particle, 
136                      const AliMCParticle* mother,
137                      Int_t          longest,
138                      Double_t       vz,
139                      UShort_t       nC, 
140                      UShort_t       nT,
141                      AliESDFMD&     output) const;
142   /** 
143    * Get incident angle of this track reference
144    * 
145    * @param ref Track reference
146    * @param vz  Z coordinate of the IP
147    * 
148    * @return incident angle (in radians)
149    */
150   Double_t GetTrackRefTheta(const AliTrackReference* ref,
151                             Double_t vz) const;
152   /** 
153    * Get ultimate mother of a track 
154    * 
155    * @param iTr   Track number 
156    * @param event Event
157    * 
158    * @return Pointer to mother or null 
159    */
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
169
170   ClassDef(AliFMDMCTrackDensity,1); // Calculate track-ref density
171 };
172
173 #endif
174 // Local Variables:
175 //  mode: C++ 
176 // End: