1 #ifndef ALIROOT_PWG2_FORWARD_ALIFMDSHARINGFILTER_H
2 #define ALIROOT_PWG2_FORWARD_ALIFMDSHARINGFILTER_H
6 #include "AliForwardUtil.h"
13 * Class to do the sharing correction. That is, a filter that merges
14 * adjacent strip signals presumably originating from a single particle
15 * that impinges on the detector in such a way that it deposite energy
16 * into two or more strips.
19 * - AliESDFMD object - from reconstruction
22 * - AliESDFMD object - copy of input, but with signals merged
24 * @par Corrections used:
25 * - AliFMDAnaCalibEnergyDistribution objects
28 * - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
29 * signals before and after the filter.
30 * - For each ring (see above), an array of distributions of number of
31 * hit strips for each vertex bin (if enabled - see Init method)
34 * @ingroup pwg2_forward
36 class AliFMDSharingFilter : public TNamed
42 virtual ~AliFMDSharingFilter();
44 * Default Constructor - do not use
46 AliFMDSharingFilter();
50 * @param title Title of object - not significant
52 AliFMDSharingFilter(const char* title);
56 * @param o Object to copy from
58 AliFMDSharingFilter(const AliFMDSharingFilter& o);
62 * @param o Object to assign from
64 * @return Reference to this
66 AliFMDSharingFilter& operator=(const AliFMDSharingFilter& o);
69 * Set the low cut used for sharing
71 * @param lowCut Low cut
73 void SetLowCut(Double_t lowCut=0) { fLowCut = lowCut; }
75 * Reset the low cut for sharing to use the fit range lower cut
78 void UnsetLowCut() { fLowCut = 0; }
80 * Set the debug level. The higher the value the more output
82 * @param dbg Debug level
84 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
87 * Enable use of angle corrected signals in the algorithm
89 * @param use If true, use angle corrected signals,
90 * otherwise use de-corrected signals. In the final output, the
91 * signals are always angle corrected.
93 void UseAngleCorrectedSignals(Bool_t use) { fCorrectAngles = use; }
95 * Set the number of landau width to subtract from the most probably
96 * value to get the high cut for the merging algorithm.
98 * @param n Number of @f$ \xi@f$
100 void SetNXi(Short_t n) { fNXi = n; }
102 * Filter the input AliESDFMD object
105 * @param lowFlux If this is a low-flux event
106 * @param output Output AliESDFMD object
108 * @return True on success, false otherwise
110 Bool_t Filter(const AliESDFMD& input,
114 * Scale the histograms to the total number of events
116 * @param dir Where the output is
117 * @param nEvents Number of events
119 void ScaleHistograms(TList* dir, Int_t nEvents);
122 * Define the output histograms. These are put in a sub list of the
123 * passed list. The histograms are merged before the parent task calls
124 * AliAnalysisTaskSE::Terminate
126 * @param dir Directory to add to
128 void DefineOutput(TList* dir);
132 * @param option Not used
134 void Print(Option_t* option="") const;
137 * Internal data structure to keep track of the histograms
139 struct RingHistos : public AliForwardUtil::RingHistos
151 RingHistos(UShort_t d, Char_t r);
155 * @param o Object to copy from
157 RingHistos(const RingHistos& o);
159 * Assignment operator
161 * @param o Object to assign from
163 * @return Reference to this
165 RingHistos& operator=(const RingHistos& o);
173 void Clear(const Option_t* ="") { fNHits = 0; }
175 * Increase number of hits
178 void Incr() { fNHits++; }
187 * @param dir where to store
189 void Output(TList* dir);
191 * Scale the histograms to the total number of events
193 * @param nEvents Number of events
194 * @param dir Where the output is
196 void ScaleHistograms(TList* dir, Int_t nEvents);
197 TH1D* fBefore; // Distribution of signals before filter
198 TH1D* fAfter; // Distribution of signals after filter
199 TH1D* fHits; // Distribution of hit strips.
200 Int_t fNHits; // Number of hit strips per event
201 ClassDef(RingHistos,1);
204 * Get the ring histogram container
209 * @return Ring histogram container
211 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
213 * Get the signal in a strip
215 * @param fmd ESD object
221 * @return The energy signal
223 Double_t SignalInStrip(const AliESDFMD& fmd,
229 * The actual algorithm
231 * @param mult The unfiltered signal in the strip
232 * @param eta Psuedo rapidity
233 * @param prevE Previous strip signal (or 0)
234 * @param nextE Next strip signal (or 0)
235 * @param lowFlux Whether this is a low flux event
240 * @param usedPrev Whether the previous strip was used in sharing or not
241 * @param usedThis Wether this strip was used in sharing or not.
243 * @return The filtered signal in the strip
245 Double_t MultiplicityOfStrip(Double_t mult,
257 * Angle correct the signal
259 * @param mult Angle Un-corrected Signal
260 * @param eta Pseudo-rapidity
262 * @return Angle corrected signal
264 Double_t AngleCorrect(Double_t mult, Double_t eta) const;
266 * Angle de-correct the signal
268 * @param mult Angle corrected Signal
269 * @param eta Pseudo-rapidity
271 * @return Angle un-corrected signal
273 Double_t DeAngleCorrect(Double_t mult, Double_t eta) const;
275 * Get the high cut. The high cut is defined as the
276 * most-probably-value peak found from the energy distributions, minus
277 * 2 times the width of the corresponding Landau.
279 virtual Double_t GetHighCut(UShort_t d, Char_t r, Double_t eta) const;
281 * Get the low cut. Normally, the low cut is taken to be the lower
282 * value of the fit range used when generating the energy loss fits.
283 * However, if fLowCut is set (using SetLowCit) to a value greater
284 * than 0, then that value is used.
286 virtual Double_t GetLowCut() const;
288 TList fRingHistos; // List of histogram containers
289 Double_t fLowCut; // Low cut on sharing
290 Bool_t fCorrectAngles; // Whether to work on angle corrected signals
291 Short_t fNXi; // Number of xi's from Delta to stop merging
292 Int_t fDebug; // Debug level
294 ClassDef(AliFMDSharingFilter,1); //