2 // Class to do the sharing correction. That is, a filter that merges
3 // adjacent strip signals presumably originating from a single particle
4 // that impinges on the detector in such a way that it deposite energy
5 // into two or more strips.
7 #ifndef ALIFMDSHARINGFILTER_H
8 #define ALIFMDSHARINGFILTER_H
12 #include "AliForwardUtil.h"
19 * Class to do the sharing correction. That is, a filter that merges
20 * adjacent strip signals presumably originating from a single particle
21 * that impinges on the detector in such a way that it deposite energy
22 * into two or more strips.
25 * - AliESDFMD object - from reconstruction
28 * - AliESDFMD object - copy of input, but with signals merged
30 * @par Corrections used:
31 * - AliFMDCorrELossFit
34 * - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
35 * signals before and after the filter.
36 * - For each ring (see above), an array of distributions of number of
37 * hit strips for each vertex bin (if enabled - see Init method)
40 * @ingroup pwg2_forward_algo
42 class AliFMDSharingFilter : public TNamed
48 virtual ~AliFMDSharingFilter();
50 * Default Constructor - do not use
52 AliFMDSharingFilter();
56 * @param title Title of object - not significant
58 AliFMDSharingFilter(const char* title);
62 * @param o Object to copy from
64 AliFMDSharingFilter(const AliFMDSharingFilter& o);
68 * @param o Object to assign from
70 * @return Reference to this
72 AliFMDSharingFilter& operator=(const AliFMDSharingFilter& o);
75 * Set the low cut used for sharing
77 * @param lowCut Low cut
79 void SetLowCut(Double_t lowCut=0) { fLowCut = lowCut; }
81 * Reset the low cut for sharing to use the fit range lower cut
84 void UnsetLowCut() { fLowCut = 0; }
86 * Set the debug level. The higher the value the more output
88 * @param dbg Debug level
90 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
93 * Enable use of angle corrected signals in the algorithm
95 * @param use If true, use angle corrected signals,
96 * otherwise use de-corrected signals. In the final output, the
97 * signals are always angle corrected.
99 void UseAngleCorrectedSignals(Bool_t use) { fCorrectAngles = use; }
101 * Set the number of landau width to subtract from the most probably
102 * value to get the high cut for the merging algorithm.
104 * @param n Number of @f$ \xi@f$
106 void SetNXi(Short_t n) { fNXi = n; }
108 * Filter the input AliESDFMD object
111 * @param lowFlux If this is a low-flux event
112 * @param output Output AliESDFMD object
114 * @return True on success, false otherwise
116 Bool_t Filter(const AliESDFMD& input,
120 * Scale the histograms to the total number of events
122 * @param dir Where the output is
123 * @param nEvents Number of events
125 virtual void ScaleHistograms(TList* dir, Int_t nEvents);
128 * Define the output histograms. These are put in a sub list of the
129 * passed list. The histograms are merged before the parent task calls
130 * AliAnalysisTaskSE::Terminate
132 * @param dir Directory to add to
134 virtual void DefineOutput(TList* dir);
138 * @param option Not used
140 virtual void Print(Option_t* option="") const;
143 * Internal data structure to keep track of the histograms
145 struct RingHistos : public AliForwardUtil::RingHistos
157 RingHistos(UShort_t d, Char_t r);
161 * @param o Object to copy from
163 RingHistos(const RingHistos& o);
165 * Assignment operator
167 * @param o Object to assign from
169 * @return Reference to this
171 RingHistos& operator=(const RingHistos& o);
179 void Clear(const Option_t* ="") { fNHits = 0; }
181 * Increase number of hits
184 void Incr() { fNHits++; }
193 * @param dir where to store
195 void Output(TList* dir);
197 * Scale the histograms to the total number of events
199 * @param nEvents Number of events
200 * @param dir Where the output is
202 void ScaleHistograms(TList* dir, Int_t nEvents);
203 TH1D* fBefore; // Distribution of signals before filter
204 TH1D* fAfter; // Distribution of signals after filter
205 TH1D* fHits; // Distribution of hit strips.
206 Int_t fNHits; // Number of hit strips per event
207 ClassDef(RingHistos,1);
210 * Get the ring histogram container
215 * @return Ring histogram container
217 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
219 * Get the signal in a strip
221 * @param fmd ESD object
227 * @return The energy signal
229 Double_t SignalInStrip(const AliESDFMD& fmd,
235 * The actual algorithm
237 * @param mult The unfiltered signal in the strip
238 * @param eta Psuedo rapidity
239 * @param prevE Previous strip signal (or 0)
240 * @param nextE Next strip signal (or 0)
241 * @param lowFlux Whether this is a low flux event
246 * @param usedPrev Whether the previous strip was used in sharing or not
247 * @param usedThis Wether this strip was used in sharing or not.
249 * @return The filtered signal in the strip
251 Double_t MultiplicityOfStrip(Double_t mult,
263 * Angle correct the signal
265 * @param mult Angle Un-corrected Signal
266 * @param eta Pseudo-rapidity
268 * @return Angle corrected signal
270 Double_t AngleCorrect(Double_t mult, Double_t eta) const;
272 * Angle de-correct the signal
274 * @param mult Angle corrected Signal
275 * @param eta Pseudo-rapidity
277 * @return Angle un-corrected signal
279 Double_t DeAngleCorrect(Double_t mult, Double_t eta) const;
281 * Get the high cut. The high cut is defined as the
282 * most-probably-value peak found from the energy distributions, minus
283 * 2 times the width of the corresponding Landau.
285 virtual Double_t GetHighCut(UShort_t d, Char_t r, Double_t eta) const;
287 * Get the low cut. Normally, the low cut is taken to be the lower
288 * value of the fit range used when generating the energy loss fits.
289 * However, if fLowCut is set (using SetLowCit) to a value greater
290 * than 0, then that value is used.
292 virtual Double_t GetLowCut() const;
294 TList fRingHistos; // List of histogram containers
295 Double_t fLowCut; // Low cut on sharing
296 Bool_t fCorrectAngles; // Whether to work on angle corrected signals
297 Short_t fNXi; // Number of xi's from Delta to stop merging
298 Int_t fDebug; // Debug level
300 ClassDef(AliFMDSharingFilter,1); //