]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliSPDMCTrackDensity.h
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliSPDMCTrackDensity.h
1 #ifndef ALISPDMCTRACKDENSITY_MC
2 #define ALISPDMCTRACKDENSITY_MC
3 #include <TNamed.h>
4 class TList;
5 class AliMCEvent;
6 class AliMultiplicity;
7 class AliMCParticle;
8 class AliTrackReference;
9 class TH3D;
10 class TH2D;
11 class TH1D;
12
13 /**
14  * A class to calculate the particle density from track references.
15  * This code is used both in AliForwardMCCorrectionsTask and
16  * AliSPDMCDensity calculator. 
17  * 
18  * @par Input: 
19  *    - AliMultiplicity object  - from reconstruction
20  *    - Kinematics
21  *    - Track-References
22  *
23  * @par Output: 
24  *    - AliESDSPD object  - content is # of track references/strip
25  *
26  * @par Corrections used: 
27  *    - None
28  *
29  * @par Histograms: 
30  *    - Incident angle vs number of track references
31  *    - Incident angle vs number of strips/cluster
32  *
33  * @ingroup pwglf_forward_algo
34  * @ingroup pwglf_forward_mc
35  * @ingroup pwglf_forward_aod
36  */
37 class AliSPDMCTrackDensity : public TNamed
38 {
39 public:
40   /** 
41    * Default constructor.  Do not use - for ROOT I/O system use only 
42    */
43   AliSPDMCTrackDensity();
44   /** 
45    * Normal constructor 
46    * 
47    * @param name Not used
48    */
49   AliSPDMCTrackDensity(const char* name);
50   /** 
51    * Copy constructor 
52    * 
53    * @param o Object to copy from 
54    */
55   AliSPDMCTrackDensity(const AliSPDMCTrackDensity& o);
56   /** 
57    * Assignment operator
58    * 
59    * @param o Object to assign from 
60    * 
61    * @return Reference to this 
62    */
63   AliSPDMCTrackDensity& operator=(const AliSPDMCTrackDensity& o);
64   /** 
65    * Destructor. 
66    */
67   virtual ~AliSPDMCTrackDensity() {}
68
69   /** 
70    * Set whether to only consider primaries 
71    * 
72    * @param use If true, consider only primaries
73    */
74   void SetUseOnlyPrimary(Bool_t use) { fUseOnlyPrimary = use; }
75   /** 
76    * Loops over all the particles in the passed event.  If @a primary
77    * is not null, then that histogram is filled with the primary
78    * particle information - irrespective of whether the particle
79    * actually hits the SPD or not.  For each track (primary or
80    * secondary, unless only primary information is requested - see
81    * SetUseOnlyPrimary) loop over all track references to that
82    * particle and check if they come from the SPD.  In that case,
83    * figure out which @f$(\eta,\varphi)@f$-bin to assign the track to,
84    * and fill the @a output histogram
85    * 
86    * @param event    MC event 
87    * @param vz       IP z--coordinate
88    * @param output   Output of SPD hits
89    * @param primary  Primary information, if available. 
90    * 
91    * @return true 
92    */
93   Bool_t Calculate(const AliMCEvent&   event, 
94                    Double_t            vz,
95                    TH2D&               output,
96                    TH2D*               primary);
97   /** 
98    * Define ouputs 
99    * 
100    * @param list List to add outputs to
101    */
102   void DefineOutput(TList* list);
103   
104   void Print(Option_t* option="") const;
105 protected:
106   /** 
107    * Store a particle hit in FMD<i>dr</i>[<i>s,t</i>] in @a output
108    * 
109    * 
110    * @param particle  Particle to store
111    * @param mother    Ultimate mother 
112    * @param refNo     Reference number
113    * @param vz        Vertex z coordinate 
114    * @param output    Output structure 
115    */  
116   void StoreParticle(AliMCParticle*       particle, 
117                      const AliMCParticle* mother,
118                      Int_t                refNo,
119                      Double_t             vz, 
120                      TH2D&                output) const;
121   /** 
122    * Get ultimate mother of a track 
123    * 
124    * @param iTr   Track number 
125    * @param event Event
126    * 
127    * @return Pointer to mother or null 
128    */
129   const AliMCParticle* GetMother(Int_t iTr, const AliMCEvent& event) const;
130   /** 
131    * Get incident angle of this track reference
132    * 
133    * @param ref Track reference
134    * @param vz  Z coordinate of the IP
135    * 
136    * @return incident angle (in radians)
137    */
138   Double_t GetTrackRefTheta(const AliTrackReference* ref,
139                             Double_t vz) const;
140   Bool_t   fUseOnlyPrimary;       // Only use primaries 
141   Double_t fMinR;             // Min radius 
142   Double_t fMaxR;             // Max radius 
143   Double_t fMinZ;             // Min z
144   Double_t fMaxZ;             // Max z
145   TH2D*    fRZ;               // Location in (r,z)
146   TH3D*    fXYZ;              // Location in (x,y,z)
147   TH1D*    fNRefs;            // Refs per track 
148   TH2D*    fBinFlow;          // eta,phi bin flow 
149
150   ClassDef(AliSPDMCTrackDensity,1); // Calculate track-ref density
151 };
152
153 #endif
154 // Local Variables:
155 //  mode: C++ 
156 // End: