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
10 * @file AliFMDSharingFilter.h
11 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
12 * @date Wed Mar 23 14:03:57 2011
17 * @ingroup pwglf_forward_aod
22 #include "AliForwardUtil.h"
23 #include "AliFMDMultCuts.h"
31 * Class to do the sharing correction. That is, a filter that merges
32 * adjacent strip signals presumably originating from a single particle
33 * that impinges on the detector in such a way that it deposite energy
34 * into two or more strips.
37 * - AliESDFMD object - from reconstruction
40 * - AliESDFMD object - copy of input, but with signals merged
42 * @par Corrections used:
43 * - AliFMDCorrELossFit
46 * - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
47 * signals before and after the filter.
48 * - For each ring (see above), an array of distributions of number of
49 * hit strips for each vertex bin (if enabled - see Init method)
52 * @ingroup pwglf_forward_algo
53 * @ingroup pwglf_forward_aod
55 class AliFMDSharingFilter : public TNamed
67 virtual ~AliFMDSharingFilter();
69 * Default Constructor - do not use
71 AliFMDSharingFilter();
75 * @param title Title of object - not significant
77 AliFMDSharingFilter(const char* title);
81 * @param o Object to copy from
83 AliFMDSharingFilter(const AliFMDSharingFilter& o);
87 * @param o Object to assign from
89 * @return Reference to this
91 AliFMDSharingFilter& operator=(const AliFMDSharingFilter& o);
99 * Set the debug level. The higher the value the more output
101 * @param dbg Debug level
103 virtual void SetDebug(Int_t dbg=1) { fDebug = dbg; }
106 * Enable use of angle corrected signals in the algorithm
108 * @param use If true, use angle corrected signals,
109 * otherwise use de-corrected signals. In the final output, the
110 * signals are always angle corrected.
112 void SetUseAngleCorrectedSignals(Bool_t use) { fCorrectAngles = use; }
114 * Enable zeroing of signals if below high cut
116 * @param use zero the signals if below sharing cut
119 void SetZeroSharedHitsBelowThreshold(Bool_t use) { fZeroSharedHitsBelowThreshold = use; }
121 * Enable a simpler merging algorithm
123 * @param use use the simpler algorithm
126 void SetUseSimpleSharing(Bool_t use) { fUseSimpleMerging = use; }
128 * In case of a simpler merging algorithm allow 3 strips to be
131 * @param use allow three strips
134 void SetAllow3Strips(Bool_t use) { fThreeStripSharing = use; }
137 * In case of a displaced vertices recalculate eta and angle correction
139 * @param use recalculate or not
142 void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
145 * Filter the input AliESDFMD object
148 * @param lowFlux If this is a low-flux event
149 * @param output Output AliESDFMD object
151 * @return True on success, false otherwise
153 Bool_t Filter(const AliESDFMD& input,
158 * Scale the histograms to the total number of events
160 * @param dir Where the output is
161 * @param nEvents Number of events
163 virtual void ScaleHistograms(const TList* dir, Int_t nEvents);
166 * Define the output histograms. These are put in a sub list of the
167 * passed list. The histograms are merged before the parent task calls
168 * AliAnalysisTaskSE::Terminate
170 * @param dir Directory to add to
172 virtual void DefineOutput(TList* dir);
176 * @param option Not used
178 virtual void Print(Option_t* option="") const;
180 AliFMDMultCuts& GetLCuts() { return fLCuts; }
181 AliFMDMultCuts& GetHCuts() { return fHCuts; }
182 const AliFMDMultCuts& GetLCuts() const { return fLCuts; }
183 const AliFMDMultCuts& GetHCuts() const { return fHCuts; }
184 void SetLCuts(const AliFMDMultCuts& c) { fLCuts = c; }
185 void SetHCuts(const AliFMDMultCuts& c) { fHCuts = c; }
188 * Internal data structure to keep track of the histograms
190 struct RingHistos : public AliForwardUtil::RingHistos
202 RingHistos(UShort_t d, Char_t r);
206 * @param o Object to copy from
208 RingHistos(const RingHistos& o);
210 * Assignment operator
212 * @param o Object to assign from
214 * @return Reference to this
216 RingHistos& operator=(const RingHistos& o);
224 void Clear(const Option_t* ="") { fNHits = 0; }
226 * Increase number of hits
229 void Incr() { fNHits++; }
238 * @param dir where to store
240 void Output(TList* dir);
242 * Scale the histograms to the total number of events
244 * @param nEvents Number of events
245 * @param dir Where the output is
247 void ScaleHistograms(const TList* dir, Int_t nEvents);
248 TH1D* fBefore; // Distribution of signals before filter
249 TH1D* fAfter; // Distribution of signals after filter
250 TH1D* fSingle; // Distribution of 1 signal after filter
251 TH1D* fDouble; // Distribution of 2 signals after filter
252 TH1D* fTriple; // Distribution of 3 signals after filter
253 TH2D* fSinglePerStrip; // Distribution of 1 signal per strip
254 TH1D* fDistanceBefore; //Distance between signals before sharing
255 TH1D* fDistanceAfter; //Distance between signals after sharing
256 TH2D* fBeforeAfter; // Correlation of before and after
257 TH2D* fNeighborsBefore; // Correlation of neighbors
258 TH2D* fNeighborsAfter; // Correlation of neighbors
259 TH2D* fSum; // Summed signal
260 TH1D* fHits; // Distribution of hit strips.
261 Int_t fNHits; // Number of hit strips per event
262 ClassDef(RingHistos,1);
265 * Get the ring histogram container
270 * @return Ring histogram container
272 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
274 * Get the signal in a strip
276 * @param fmd ESD object
282 * @return The energy signal
284 Double_t SignalInStrip(const AliESDFMD& fmd,
290 * The actual algorithm
292 * @param mult The unfiltered signal in the strip
293 * @param eta Psuedo rapidity
294 * @param prevE Previous strip signal (or 0)
295 * @param nextE Next strip signal (or 0)
296 * @param lowFlux Whether this is a low flux event
301 * @param usedPrev Whether the previous strip was used in sharing or not
302 * @param usedThis Wether this strip was used in sharing or not.
304 * @return The filtered signal in the strip
306 Double_t MultiplicityOfStrip(Double_t mult,
316 Bool_t& usedThis) const;
317 Double_t MultiplicityOfStrip(Double_t thisE,
328 Status& nextStatus) const;
330 * Angle correct the signal
332 * @param mult Angle Un-corrected Signal
333 * @param eta Pseudo-rapidity
335 * @return Angle corrected signal
337 Double_t AngleCorrect(Double_t mult, Double_t eta) const;
339 * Angle de-correct the signal
341 * @param mult Angle corrected Signal
342 * @param eta Pseudo-rapidity
344 * @return Angle un-corrected signal
346 Double_t DeAngleCorrect(Double_t mult, Double_t eta) const;
348 * Get the high cut. The high cut is defined as the
349 * most-probably-value peak found from the energy distributions, minus
350 * 2 times the width of the corresponding Landau.
354 * @param eta Eta value
355 * @param errors If false, do not show errors
357 * @return 0 or less on failure, otherwise @f$\Delta_{mp}-n\xi@f$
359 virtual Double_t GetHighCut(UShort_t d, Char_t r, Double_t eta,
360 Bool_t errors=true) const;
362 * Get the low cut. Normally, the low cut is taken to be the lower
363 * value of the fit range used when generating the energy loss fits.
364 * However, if fLowCut is set (using SetLowCit) to a value greater
365 * than 0, then that value is used.
369 * @param eta Eta value
373 virtual Double_t GetLowCut(UShort_t d, Char_t r, Double_t eta) const;
375 TList fRingHistos; // List of histogram containers
376 // Double_t fLowCut; // Low cut on sharing
377 Bool_t fCorrectAngles; // Whether to work on angle corrected signals
378 TH2* fSummed; // Operations histogram
379 TH2* fHighCuts; // High cuts used
380 TH2* fLowCuts; // High cuts used
381 AliFMDFloatMap* fOper; // Operation done per strip
382 Int_t fDebug; // Debug level
383 Bool_t fZeroSharedHitsBelowThreshold; //Whether to zero shared strip below cut
384 AliFMDMultCuts fLCuts; //Cuts object for low cuts
385 AliFMDMultCuts fHCuts; //Cuts object for high cuts
386 Bool_t fUseSimpleMerging; //enable simple sharing by HHD
387 Bool_t fThreeStripSharing; //In case of simple sharing allow 3 strips
388 Bool_t fRecalculateEta; //Whether to recalculate eta and angle correction (disp vtx)
389 ClassDef(AliFMDSharingFilter,4); //