]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliCentralCorrAcceptance.h
Fixes for pA indenfication of events
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliCentralCorrAcceptance.h
CommitLineData
6f791cc3 1//
2// This class contains the acceptance correction due to dead channels
3//
4//
5#ifndef ALICENTRALCORRACCEPTANCE_H
6#define ALICENTRALCORRACCEPTANCE_H
ffca499d 7/**
8 * @file AliCentralCorrAcceptance.h
9 * @author Hans Hjersing Dalsgaard
10 * @date Wed Mar 23 13:58:33 2011
11 *
12 * @brief
13 *
14 *
bd6f5206 15 * @ingroup pwglf_forward_corr
ffca499d 16 */
6f791cc3 17#include <TObject.h>
18#include <TObjArray.h>
19#include <TAxis.h>
20class TH1D;
21
22/**
23 * This class contains the acceptance correction due to dead channels
24 *
25 * These are generated from the on-line dead channel calculations
26 *
bd6f5206 27 * @ingroup pwglf_forward_corr
6f791cc3 28 */
29class AliCentralCorrAcceptance : public TObject
30{
31public:
32 /**
33 * Default constructor
34 */
35 AliCentralCorrAcceptance();
36 /**
37 * Copy constructor
38 *
39 * @param o Object to copy from
40 */
41 AliCentralCorrAcceptance(const AliCentralCorrAcceptance& o);
42 /**
43 * Destructor
44 *
45 */
46 virtual ~AliCentralCorrAcceptance();
47 /**
48 * @{
49 * @name Get corrections and parameters
50 */
51 /**
52 * Assignment operator
53 *
54 * @param o Object to assign from
55 *
56 * @return Reference to this object
57 */
58 AliCentralCorrAcceptance& operator=(const AliCentralCorrAcceptance& o);
59 /**
60 * Get the acceptance correction @f$ a_{r,v}@f$
61 *
6f791cc3 62 * @param v Primary interaction point @f$z@f$ coordinate
63 *
64 * @return The correction @f$ a_{r,v}@f$
65 */
66 TH1D* GetCorrection(Double_t v) const;
67 /**
68 * Get the acceptance correction @f$ a_{r,v}@f$
69 *
6f791cc3 70 * @param b Bin corresponding to the primary interaction point
71 * @f$z@f$ coordinate (1 based)
72 *
73 * @return The correction @f$ a_{r,v}@f$
74 */
75 TH1D* GetCorrection(UShort_t b) const;
76 /**
77 * Get the vertex axis used
78 *
79 * @return vertex axis
80 */
81 const TAxis& GetVertexAxis() const { return fVertexAxis; }
82 /* @} */
83
84 /**
85 * @{
86 * @name Set corrections and parameters
87 */
88 /**
89 * Set the acceptance correction @f$ a_{r,v}(\eta)@f$.
90 * Note, that the object takes ownership of the passed pointer.
91 *
6f791cc3 92 * @param v Primary interaction point @f$z@f$ coordinate
93 * @param h @f$ a_{r,v}(\eta)@f$
94 *
95 * @return true if operation succeeded
96 */
97 Bool_t SetCorrection(Double_t v, TH1D* h);
98 /**
99 * Set the acceptance correction @f$ a_{r,v}(\eta)@f$
100 * Note, that the object takes ownership of the passed pointer.
101 *
6f791cc3 102 * @param b Bin corresponding to the primary interaction point
103 * @f$z@f$ coordinate (1 based)
104 * @param h @f$ a_{r,v}(\eta)@f$
105 *
106 * @return true if operation succeeded
107 */
108 Bool_t SetCorrection(UShort_t b, TH1D* h);
109 /**
110 * Set the vertex axis to use
111 *
112 * @param axis Vertex axis
113 */
114 void SetVertexAxis(const TAxis& axis);
115 /**
116 * Set the vertex axis to use
117 *
118 * @param nBins Number of bins
119 * @param min Minimum
120 * @param max Maximum
121 */
122 void SetVertexAxis(Int_t nBins, Double_t min, Double_t max);
123 /* @} */
124
125 /**
126 * @{
127 * @name Auxiliary member functions
128 */
129 /**
130 * Declare this as a folder
131 *
132 * @return Always true
133 */
134 Bool_t IsFolder() const { return true; }
135 /**
136 * Browse this object in the browser
137 *
138 * @param b
139 */
140 void Browse(TBrowser* b);
141 /**
142 * Print this object
143 *
144 * @param option
145 */
146 void Print(Option_t* option="R") const; //*MENU*
147 /* @} */
148protected:
149 /**
150 * Find the vertex bin that corresponds to the passed vertex
151 *
152 * @param vertex The interaction points @f$z@f$-coordinate
153 *
154 * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if
155 * out of range
156 */
157 Int_t FindVertexBin(Double_t vertex) const;
158
159 TObjArray fArray; // Array of per-vertex acceptance corr
160 TAxis fVertexAxis; // The vertex axis
161 ClassDef(AliCentralCorrAcceptance,1); // Acceptance correction due to dead areas
162};
163
164//____________________________________________________________________
165inline void
166AliCentralCorrAcceptance::SetVertexAxis(Int_t nBins, Double_t min,
167 Double_t max)
168{
169 fVertexAxis.Set(nBins, min, max);
170}
171//____________________________________________________________________
172inline void
173AliCentralCorrAcceptance::SetVertexAxis(const TAxis& e)
174{
175 fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
176}
177#endif
178// Local Variables:
179// mode: C++
180// End: