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.
36 * @image html alice-int-2012-040-share_fraction.png "Energy loss sharing"
39 * - AliESDFMD object - from reconstruction
42 * - AliESDFMD object - copy of input, but with signals merged
44 * @par Corrections used:
45 * - AliFMDCorrELossFit
48 * - For each ring (FMD1i, FMD2i, FMD2o, FMD3i, FMD3o) the distribution of
49 * signals before and after the filter.
50 * - For each ring (see above), an array of distributions of number of
51 * hit strips for each vertex bin (if enabled - see SetupForData method)
54 * @ingroup pwglf_forward_algo
55 * @ingroup pwglf_forward_aod
57 class AliFMDSharingFilter : public TNamed
62 * @deprecated Not used
67 /** Candidate for merging */
69 /** This was merged into other strip */
71 /** Other strips was merged into this */
77 virtual ~AliFMDSharingFilter();
79 * Default Constructor - do not use
81 AliFMDSharingFilter();
85 * @param title Title of object - not significant
87 AliFMDSharingFilter(const char* title);
91 * @name Parameters etc.
94 * If called with a true argument, then merging is wholy disabled
96 * @param disable If true, disable merging altogether
98 virtual void SetMergingDisabled(Bool_t disable) {fMergingDisabled = disable; }
100 * Set the debug level. The higher the value the more output
102 * @param dbg Debug level
104 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; }
136 * Set whether to ignore the ESD info when angle correcting, this
137 * is to counter a known issue where the info in the ESD is incorrect
139 * @param use ignore the ESD info
141 void SetIgnoreESDWhenAngleCorrecting(Bool_t use) { fIgnoreESDForAngleCorrection = use; }
151 * @param axis Default eta axis from parent task
153 void SetupForData(const TAxis& axis);
155 * Filter the input AliESDFMD object
158 * @param lowFlux If this is a low-flux event
159 * @param output Output AliESDFMD object
160 * @param zvtx Vertex position
162 * @return True on success, false otherwise
164 Bool_t Filter(const AliESDFMD& input,
169 * Scale the histograms to the total number of events
171 * @param dir Where the output is
172 * @param output Output list
173 * @param nEvents Number of events
175 virtual void Terminate(const TList* dir, TList* output, Int_t nEvents);
177 * Define the output histograms. These are put in a sub list of the
178 * passed list. The histograms are merged before the parent task calls
179 * AliAnalysisTaskSE::Terminate
181 * @param dir Directory to add to
183 virtual void CreateOutputObjects(TList* dir);
188 * @param option Not used
190 virtual void Print(Option_t* option="") const;
199 * @return Reference to low cuts
201 AliFMDMultCuts& GetLCuts() { return fLCuts; }
205 * @return Reference to high cuts
207 AliFMDMultCuts& GetHCuts() { return fHCuts; }
211 * @return Reference to low cuts
213 const AliFMDMultCuts& GetLCuts() const { return fLCuts; }
217 * @return Reference to high cuts
219 const AliFMDMultCuts& GetHCuts() const { return fHCuts; }
223 * @param c Cuts object
225 void SetLCuts(const AliFMDMultCuts& c) { fLCuts = c; }
229 * @param c Cuts object
231 void SetHCuts(const AliFMDMultCuts& c) { fHCuts = c; }
235 * Copy constructor - not implemented
237 AliFMDSharingFilter(const AliFMDSharingFilter& o){;}
239 * Assignment operator - not implemented
241 * @return Reference to this
243 AliFMDSharingFilter& operator=(const AliFMDSharingFilter& o){return *this;}
245 * Internal data structure to keep track of the histograms
247 struct RingHistos : public AliForwardUtil::RingHistos
259 RingHistos(UShort_t d, Char_t r);
263 * @param o Object to copy from
265 RingHistos(const RingHistos& o);
267 * Assignment operator
269 * @param o Object to assign from
271 * @return Reference to this
273 RingHistos& operator=(const RingHistos& o);
281 // void Clear(const Option_t* ="") { fNHits = 0; }
283 * Increase number of hits
286 // void Incr() { fNHits++; }
295 * @param dir where to store
297 void CreateOutputObjects(TList* dir);
299 * Scale the histograms to the total number of events
301 * @param nEvents Number of events
302 * @param dir Where the output is
304 void Terminate(const TList* dir, Int_t nEvents);
305 TH1D* fBefore; // Distribution of signals before filter
306 TH1D* fAfter; // Distribution of signals after filter
307 TH1D* fSingle; // Distribution of 1 signal after filter
308 TH1D* fDouble; // Distribution of 2 signals after filter
309 TH1D* fTriple; // Distribution of 3 signals after filter
310 TH2D* fSinglePerStrip; // Distribution of 1 signal per strip
311 TH2D* fBeforeAfter; // Correlation of before and after
312 TH2D* fNeighborsBefore; // Correlation of neighbors
313 TH2D* fNeighborsAfter; // Correlation of neighbors
314 TH2D* fSumESD; // Summed ESD signal
315 TH2D* fSum; // Summed cluster signal
316 TH1D* fNConsecutive; // # consecutive strips with signal > low cut
317 ClassDef(RingHistos,4);
320 * Get the ring histogram container
325 * @return Ring histogram container
327 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
329 * Get the signal in a strip
331 * @param fmd ESD object
337 * @return The energy signal
339 Double_t SignalInStrip(const AliESDFMD& fmd,
345 * Angle correct the signal
347 * @param mult Angle Un-corrected Signal
348 * @param eta Pseudo-rapidity
350 * @return Angle corrected signal
352 Double_t AngleCorrect(Double_t mult, Double_t eta) const;
354 * Angle de-correct the signal
356 * @param mult Angle corrected Signal
357 * @param eta Pseudo-rapidity
359 * @return Angle un-corrected signal
361 Double_t DeAngleCorrect(Double_t mult, Double_t eta) const;
363 * Get the high cut. The high cut is defined as the
364 * most-probably-value peak found from the energy distributions, minus
365 * 2 times the width of the corresponding Landau.
369 * @param eta Eta value
370 * @param errors If false, do not show errors
372 * @return 0 or less on failure, otherwise @f$\Delta_{mp}-n\xi@f$
374 virtual Double_t GetHighCut(UShort_t d, Char_t r, Double_t eta,
375 Bool_t errors=true) const;
377 * Get the low cut. Normally, the low cut is taken to be the lower
378 * value of the fit range used when generating the energy loss fits.
379 * However, if fLowCut is set (using SetLowCit) to a value greater
380 * than 0, then that value is used.
384 * @param eta Eta value
388 virtual Double_t GetLowCut(UShort_t d, Char_t r, Double_t eta) const;
389 TList fRingHistos; // List of histogram containers
390 Bool_t fCorrectAngles; // Whether to work on angle corrected signals
391 TH2* fHighCuts; // High cuts used
392 TH2* fLowCuts; // High cuts used
393 Int_t fDebug; // Debug level
394 Bool_t fZeroSharedHitsBelowThreshold; // Zero shared strip below cut?
395 AliFMDMultCuts fLCuts; // Cuts object for low cuts
396 AliFMDMultCuts fHCuts; // Cuts object for high cuts
397 Bool_t fUseSimpleMerging;// enable simple sharing by HHD
398 Bool_t fThreeStripSharing; //In case of simple sharing allow 3 strips
399 Bool_t fMergingDisabled; // If true, do not merge
400 Bool_t fIgnoreESDForAngleCorrection; // Ignore ESD information when angle correcting
401 ClassDef(AliFMDSharingFilter,11); //