]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliCentralMultiplicityTask.h
Mega commit of many changes to PWGLFforward
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliCentralMultiplicityTask.h
1 // 
2 // Base class for classes that calculate the multiplicity in the
3 // SPD clusters event-by-event
4 // 
5 #ifndef ALICENTRALMULTIPLICITYTASK_H
6 #define ALICENTRALMULTIPLICITYTASK_H
7 /**
8  * @file   AliCentralMultiplicityTask.h
9  * @author Hans Hjersing Dalsgaard
10  * @date   Wed Mar 23 14:00:03 2011
11  * 
12  * @brief  
13  * 
14  * @ingroup pwglf_forward_aod
15  * 
16  */
17 #include <AliAnalysisTaskSE.h>
18 #include "AliFMDEventInspector.h"
19 #include "AliAODCentralMult.h"
20 class AliCentralCorrectionManager;
21 class AliESDEvent;
22 class AliMultiplicity;
23 class TH2D;
24 class TList;
25 class TTree;
26 class TObjArray;
27
28 /** 
29  * Class that calculates the multiplicity in the
30  * central region event-by-event
31  * 
32  * @par Inputs: 
33  *   - AliESDEvent 
34  *
35  * @par Outputs: 
36  *   - AliAODCentralMult 
37  * 
38  * @par Histograms 
39  *   
40  * @par Corrections used 
41  * 
42  * @ingroup pwglf_forward_tasks
43  * @ingroup pwglf_forward_aod
44  * 
45  */
46 class AliCentralMultiplicityTask : public AliAnalysisTaskSE
47 {
48 public:
49   /** 
50    * @{ 
51    * @name Interface methods 
52    */
53    /** 
54    * Constructor 
55    * 
56    * @param name Name of task 
57    */
58   AliCentralMultiplicityTask(const char* name); 
59   /** 
60    * Constructor 
61    *
62    * Reserved for ROOT's I/O system - do not use
63    */
64   AliCentralMultiplicityTask();
65   /** 
66    * Copy constructor 
67    * 
68    * @param o Object to copy from 
69    */
70   AliCentralMultiplicityTask(const AliCentralMultiplicityTask& o);
71   /** 
72    * Assignment operator 
73    * 
74    * @param o Object to assign from 
75    * 
76    * @return Reference to this object 
77    */
78   AliCentralMultiplicityTask& operator=(const AliCentralMultiplicityTask& o);
79   /** 
80    * Configure this task via a macro 
81    * 
82    * @param macro Macro to configure va 
83    * 
84    * @return true on success, false otherwise
85    */
86   virtual Bool_t Configure(const char* macro="CentralAODConfig.C");
87   /** 
88    * Create output objects 
89    * 
90    */
91   virtual void UserCreateOutputObjects();
92   /** 
93    * Process each event 
94    *
95    * @param option Not used
96    */  
97   virtual void UserExec(Option_t* option);
98   /** 
99    * End of job
100    * 
101    * @param option Not used 
102    */
103   virtual void Terminate(Option_t* option);
104   /** 
105    * Print information 
106    * 
107    * @param option Not used
108    */
109   virtual void Print(Option_t* option="") const;
110   /** 
111    * Set whether to use the secondary corrections 
112    * 
113    * @param use Whether to use secondary corrections 
114    */
115   virtual void SetUseSecondary(Bool_t use) { fUseSecondary = use; }
116   /** 
117    * Set whether to use the acceptance corrections 
118    * 
119    * @param use Whether to use acceptance corrections 
120    */
121   virtual void SetUseAcceptance(Bool_t use) { fUseAcceptance = use; }
122   /** 
123    * Set whether to make diagnostics or not
124    * 
125    * @param use If true, store some extra diagnostic histograms
126    */
127   virtual void SetMakeDiagnostics(Bool_t use=true) { fStore = use; }
128   /** 
129    * Get the event inspector
130    * 
131    * @return Reference to used event inspector
132    */
133   AliFMDEventInspector& GetInspector() { return fInspector; }
134   /** 
135    * Get the event inspector
136    * 
137    * @return Reference to used event inspector
138    */
139   const AliFMDEventInspector& GetInspector() const { return fInspector; }
140
141 protected:
142   /** 
143    * Get the ESD event and initialise manager on first event if not
144    * done already
145    * 
146    * @return Pointer to valid ESD event object 
147    */
148   virtual AliESDEvent* GetESDEvent();
149   /** 
150    * Mark this event for storage in AOD output
151    * 
152    */
153   virtual void MarkEventForStore() const;
154   /** 
155    * Process the ESD SPD information 
156    * 
157    * @param hist    Histogram to fill
158    * @param spdmult SPD multiplicity object
159    */
160   virtual void ProcessESD(TH2D& hist, const AliMultiplicity* spdmult) const;
161   /** 
162    * Find our eta limits
163    * 
164    */
165   virtual void FindEtaLimits();
166
167   struct VtxBin : public TObject
168   {
169     VtxBin(Int_t iVz=0, Double_t minIpZ=0, Double_t maxIpZ=0);
170     VtxBin(const VtxBin& o);
171     VtxBin& operator=(const VtxBin& o);
172     
173     const char* GetName() const;
174     void SetupForData(TList* l, TH2* coverage, Bool_t store=true);
175     void Correct(TH2D&  aodHist,
176                  Bool_t useSecondary,
177                  Bool_t useAcceptance,
178                  Bool_t sum=true) const;
179     void Print(Option_t* option="") const;
180
181     Int_t        fId;     // Vertex bin number 
182     Double_t     fMinIpZ; // Least value of ipZ 
183     Double_t     fMaxIpZ; // Largest value of ipZ 
184     Int_t        fEtaMin; // Smallest eta bin to use 
185     Int_t        fEtaMax; // Largest eta bin to use 
186     TH2*         fSec;    // Our secondary correction
187     TH1*         fAcc;    // Our acceptance correction 
188     mutable TH2* fHits;   // Diagnostics sum 
189
190     ClassDef(VtxBin,1);
191   };
192     
193 protected: 
194   AliFMDEventInspector   fInspector;        // Inspect events 
195   TList*                 fList;             // Output list
196   AliAODCentralMult      fAODCentral;       // Output object
197   Bool_t                 fUseSecondary;     // Whether to secondary map
198   Bool_t                 fUseAcceptance;    // Whether to use acceptance corr.
199   Bool_t                 fFirstEventSeen;   // Have we seen first event     
200   Int_t                  fIvz;              // Event's vertex bin 
201   TH2D*                  fNClusterTracklet; // # of clusters vs tracklets 
202   TH2D*                  fClusterPerTracklet; // Clusters per tracklet. 
203   TH1D*                  fNCluster;         //! Number of clusters 
204   TH1D*                  fNTracklet;        //! number of tracklets 
205   TObjArray*             fVtxList;          //! Array of vertex bins
206   Bool_t                 fStore;            // Store diagnostics
207 private:
208   AliCentralCorrectionManager* fCorrManager; 
209   ClassDef(AliCentralMultiplicityTask,5)    // Forward multiplicity class
210 };
211
212 #endif
213 // Local Variables:
214 //  mode: C++
215 // End:
216