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
58 /** Status of a strip */
62 /** Candidate for merging */
64 /** This was merged into other strip */
66 /** Other strips was merged into this */
72 virtual ~AliFMDSharingFilter();
74 * Default Constructor - do not use
76 AliFMDSharingFilter();
80 * @param title Title of object - not significant
82 AliFMDSharingFilter(const char* title);
86 * @param o Object to copy from
88 AliFMDSharingFilter(const AliFMDSharingFilter& o);
92 * @param o Object to assign from
94 * @return Reference to this
96 AliFMDSharingFilter& operator=(const AliFMDSharingFilter& o);
101 * @param axis Default eta axis from parent task
103 void Init(const TAxis& axis);
105 * Set the debug level. The higher the value the more output
107 * @param dbg Debug level
109 virtual void SetDebug(Int_t dbg=1) { fDebug = dbg; }
112 * Enable use of angle corrected signals in the algorithm
114 * @param use If true, use angle corrected signals,
115 * otherwise use de-corrected signals. In the final output, the
116 * signals are always angle corrected.
118 void SetUseAngleCorrectedSignals(Bool_t use) { fCorrectAngles = use; }
120 * Enable zeroing of signals if below high cut
122 * @param use zero the signals if below sharing cut
125 void SetZeroSharedHitsBelowThreshold(Bool_t use) { fZeroSharedHitsBelowThreshold = use; }
127 * Enable a simpler merging algorithm
129 * @param use use the simpler algorithm
132 void SetUseSimpleSharing(Bool_t use) { fUseSimpleMerging = use; }
134 * In case of a simpler merging algorithm allow 3 strips to be
137 * @param use allow three strips
140 void SetAllow3Strips(Bool_t use) { fThreeStripSharing = use; }
143 * In case of a displaced vertices recalculate eta and angle correction
145 * @param use recalculate or not
148 void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
151 * Filter the input AliESDFMD object
154 * @param lowFlux If this is a low-flux event
155 * @param output Output AliESDFMD object
156 * @param zvtx Vertex position
158 * @return True on success, false otherwise
160 Bool_t Filter(const AliESDFMD& input,
165 * Scale the histograms to the total number of events
167 * @param dir Where the output is
168 * @param nEvents Number of events
170 virtual void ScaleHistograms(const TList* dir, Int_t nEvents);
173 * Define the output histograms. These are put in a sub list of the
174 * passed list. The histograms are merged before the parent task calls
175 * AliAnalysisTaskSE::Terminate
177 * @param dir Directory to add to
179 virtual void DefineOutput(TList* dir);
183 * @param option Not used
185 virtual void Print(Option_t* option="") const;
190 * @return Reference to low cuts
192 AliFMDMultCuts& GetLCuts() { return fLCuts; }
196 * @return Reference to high cuts
198 AliFMDMultCuts& GetHCuts() { return fHCuts; }
202 * @return Reference to low cuts
204 const AliFMDMultCuts& GetLCuts() const { return fLCuts; }
208 * @return Reference to high cuts
210 const AliFMDMultCuts& GetHCuts() const { return fHCuts; }
214 * @param c Cuts object
216 void SetLCuts(const AliFMDMultCuts& c) { fLCuts = c; }
220 * @param c Cuts object
222 void SetHCuts(const AliFMDMultCuts& c) { fHCuts = c; }
224 void AddDead(UShort_t d, Char_t r, UShort_t s, UShort_t t);
225 void AddDeadRegion(UShort_t d, Char_t r, UShort_t s1, UShort_t s2,
226 UShort_t t1, UShort_t t2);
229 * Internal data structure to keep track of the histograms
231 struct RingHistos : public AliForwardUtil::RingHistos
243 RingHistos(UShort_t d, Char_t r);
247 * @param o Object to copy from
249 RingHistos(const RingHistos& o);
251 * Assignment operator
253 * @param o Object to assign from
255 * @return Reference to this
257 RingHistos& operator=(const RingHistos& o);
265 void Clear(const Option_t* ="") { fNHits = 0; }
267 * Increase number of hits
270 void Incr() { fNHits++; }
279 * @param dir where to store
281 void Output(TList* dir);
283 * Scale the histograms to the total number of events
285 * @param nEvents Number of events
286 * @param dir Where the output is
288 void ScaleHistograms(const TList* dir, Int_t nEvents);
289 TH1D* fBefore; // Distribution of signals before filter
290 TH1D* fAfter; // Distribution of signals after filter
291 TH1D* fSingle; // Distribution of 1 signal after filter
292 TH1D* fDouble; // Distribution of 2 signals after filter
293 TH1D* fTriple; // Distribution of 3 signals after filter
294 TH2D* fSinglePerStrip; // Distribution of 1 signal per strip
295 TH1D* fDistanceBefore; //Distance between signals before sharing
296 TH1D* fDistanceAfter; //Distance between signals after sharing
297 TH2D* fBeforeAfter; // Correlation of before and after
298 TH2D* fNeighborsBefore; // Correlation of neighbors
299 TH2D* fNeighborsAfter; // Correlation of neighbors
300 TH2D* fSum; // Summed signal
301 TH1D* fHits; // Distribution of hit strips.
302 Int_t fNHits; // Number of hit strips per event
303 ClassDef(RingHistos,1);
306 * Get the ring histogram container
311 * @return Ring histogram container
313 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
315 * Get the signal in a strip
317 * @param fmd ESD object
323 * @return The energy signal
325 Double_t SignalInStrip(const AliESDFMD& fmd,
331 * The actual algorithm
333 * @param mult The unfiltered signal in the strip
334 * @param eta Psuedo rapidity
335 * @param prevE Previous strip signal (or 0)
336 * @param nextE Next strip signal (or 0)
337 * @param lowFlux Whether this is a low flux event
342 * @param usedPrev Whether the previous strip was used in sharing or not
343 * @param usedThis Wether this strip was used in sharing or not.
345 * @return The filtered signal in the strip
347 Double_t MultiplicityOfStrip(Double_t mult,
357 Bool_t& usedThis) const;
359 * The actual algorithm
361 * @param thisE This strips energy
362 * @param prevE Previous strip enery
363 * @param nextE Next strip energy
364 * @param eta Psuedo-rapidity
365 * @param lowFlux Whether to use low flux settings
370 * @param prevStatus Previous status
371 * @param thisStatus This status
372 * @param nextStatus Next status
374 * @return The filtered signal in the strip
376 Double_t MultiplicityOfStrip(Double_t thisE,
387 Status& nextStatus) const;
389 * Angle correct the signal
391 * @param mult Angle Un-corrected Signal
392 * @param eta Pseudo-rapidity
394 * @return Angle corrected signal
396 Double_t AngleCorrect(Double_t mult, Double_t eta) const;
398 * Angle de-correct the signal
400 * @param mult Angle corrected Signal
401 * @param eta Pseudo-rapidity
403 * @return Angle un-corrected signal
405 Double_t DeAngleCorrect(Double_t mult, Double_t eta) const;
407 * Get the high cut. The high cut is defined as the
408 * most-probably-value peak found from the energy distributions, minus
409 * 2 times the width of the corresponding Landau.
413 * @param eta Eta value
414 * @param errors If false, do not show errors
416 * @return 0 or less on failure, otherwise @f$\Delta_{mp}-n\xi@f$
418 virtual Double_t GetHighCut(UShort_t d, Char_t r, Double_t eta,
419 Bool_t errors=true) const;
421 * Get the low cut. Normally, the low cut is taken to be the lower
422 * value of the fit range used when generating the energy loss fits.
423 * However, if fLowCut is set (using SetLowCit) to a value greater
424 * than 0, then that value is used.
428 * @param eta Eta value
432 virtual Double_t GetLowCut(UShort_t d, Char_t r, Double_t eta) const;
434 virtual Bool_t IsDead(UShort_t d, Char_t r, UShort_t s, UShort_t t) const;
435 TList fRingHistos; // List of histogram containers
436 // Double_t fLowCut; // Low cut on sharing
437 Bool_t fCorrectAngles; // Whether to work on angle corrected signals
438 TH2* fSummed; // Operations histogram
439 TH2* fHighCuts; // High cuts used
440 TH2* fLowCuts; // High cuts used
441 AliFMDFloatMap* fOper; // Operation done per strip
442 Int_t fDebug; // Debug level
443 Bool_t fZeroSharedHitsBelowThreshold; //Whether to zero shared strip below cut
444 AliFMDMultCuts fLCuts; //Cuts object for low cuts
445 AliFMDMultCuts fHCuts; //Cuts object for high cuts
446 Bool_t fUseSimpleMerging; //enable simple sharing by HHD
447 Bool_t fThreeStripSharing; //In case of simple sharing allow 3 strips
448 Bool_t fRecalculateEta; //Whether to recalculate eta and angle correction (disp vtx)
449 TArrayI fExtraDead; // List of extra dead channels
450 ClassDef(AliFMDSharingFilter,5); //