]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDSharingFilter.h
CommitLineData
7984e5f7 1//
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.
6//
7#ifndef ALIFMDSHARINGFILTER_H
8#define ALIFMDSHARINGFILTER_H
ffca499d 9/**
10 * @file AliFMDSharingFilter.h
11 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
12 * @date Wed Mar 23 14:03:57 2011
13 *
14 * @brief
15 *
16 *
bd6f5206 17 * @ingroup pwglf_forward_aod
ffca499d 18 */
7e4038b5 19#include <TNamed.h>
20#include <TH2.h>
21#include <TList.h>
9d99b0dd 22#include "AliForwardUtil.h"
d2638bb7 23#include "AliFMDMultCuts.h"
7e4038b5 24class AliESDFMD;
25class TAxis;
26class TList;
27class TH2;
5bb5d1f6 28class AliFMDFloatMap;
7e4038b5 29
30/**
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.
35 *
671df6c9 36 * @image html alice-int-2012-040-share_fraction.png "Energy loss sharing"
37 *
7e4038b5 38 * @par Input:
39 * - AliESDFMD object - from reconstruction
40 *
41 * @par Output:
42 * - AliESDFMD object - copy of input, but with signals merged
43 *
44 * @par Corrections used:
e8bf1690 45 * - AliFMDCorrELossFit
7e4038b5 46 *
47 * @par Histograms:
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
5934a3e3 51 * hit strips for each vertex bin (if enabled - see SetupForData method)
7e4038b5 52 *
53 *
bd6f5206 54 * @ingroup pwglf_forward_algo
55 * @ingroup pwglf_forward_aod
7e4038b5 56 */
57class AliFMDSharingFilter : public TNamed
58{
59public:
8449e3e0 60 /**
61 * Status of a strip
62 * @deprecated Not used
63 */
5bb5d1f6 64 enum Status {
290052e7 65 /** Nothing yet */
5bb5d1f6 66 kNone = 1,
290052e7 67 /** Candidate for merging */
5bb5d1f6 68 kCandidate = 2,
290052e7 69 /** This was merged into other strip */
5bb5d1f6 70 kMergedWithOther = 3,
290052e7 71 /** Other strips was merged into this */
5bb5d1f6 72 kMergedInto = 4
73 };
7e4038b5 74 /**
75 * Destructor
76 */
77 virtual ~AliFMDSharingFilter();
78 /**
79 * Default Constructor - do not use
80 */
81 AliFMDSharingFilter();
82 /**
83 * Constructor
84 *
85 * @param title Title of object - not significant
86 */
87 AliFMDSharingFilter(const char* title);
428cd802 88
7e4038b5 89 /**
428cd802 90 * @{
91 * @name Parameters etc.
7e4038b5 92 */
7e4038b5 93 /**
428cd802 94 * If called with a true argument, then merging is wholy disabled
7e4038b5 95 *
428cd802 96 * @param disable If true, disable merging altogether
7e4038b5 97 */
428cd802 98 virtual void SetMergingDisabled(Bool_t disable) {fMergingDisabled = disable; }
ea3e5d95 99 /**
100 * Set the debug level. The higher the value the more output
101 *
102 * @param dbg Debug level
103 */
4bcdcbc1 104 virtual void SetDebug(Int_t dbg=1) { fDebug = dbg; }
7e4038b5 105 /**
106 * Enable use of angle corrected signals in the algorithm
107 *
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.
111 */
5bb5d1f6 112 void SetUseAngleCorrectedSignals(Bool_t use) { fCorrectAngles = use; }
40196108 113 /**
114 * Enable zeroing of signals if below high cut
115 *
116 * @param use zero the signals if below sharing cut
117 *
118 */
119 void SetZeroSharedHitsBelowThreshold(Bool_t use) { fZeroSharedHitsBelowThreshold = use; }
7b212e49 120 /**
121 * Enable a simpler merging algorithm
122 *
123 * @param use use the simpler algorithm
124 *
125 */
126 void SetUseSimpleSharing(Bool_t use) { fUseSimpleMerging = use; }
d1013ccf 127 /**
128 * In case of a simpler merging algorithm allow 3 strips to be
129 * merged
130 *
131 * @param use allow three strips
132 *
133 */
428cd802 134 void SetAllow3Strips(Bool_t use) { fThreeStripSharing = use; }
bdd49110 135 /**
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
138 *
139 * @param use ignore the ESD info
140 */
141 void SetIgnoreESDWhenAngleCorrecting(Bool_t use) { fIgnoreESDForAngleCorrection = use; }
428cd802 142 /* @} */
143
144 /**
145 * @{
146 * @name Processing
147 */
148 /**
149 * Initialize
150 *
151 * @param axis Default eta axis from parent task
152 */
153 void SetupForData(const TAxis& axis);
7e4038b5 154 /**
155 * Filter the input AliESDFMD object
156 *
157 * @param input Input
158 * @param lowFlux If this is a low-flux event
159 * @param output Output AliESDFMD object
290052e7 160 * @param zvtx Vertex position
7e4038b5 161 *
162 * @return True on success, false otherwise
163 */
164 Bool_t Filter(const AliESDFMD& input,
165 Bool_t lowFlux,
6f4a5c0d 166 AliESDFMD& output,
167 Double_t zvtx);
7e4038b5 168 /**
169 * Scale the histograms to the total number of events
170 *
c389303e 171 * @param dir Where the output is
33438b4c 172 * @param output Output list
7e4038b5 173 * @param nEvents Number of events
174 */
428cd802 175 virtual void Terminate(const TList* dir, TList* output, Int_t nEvents);
9d99b0dd 176 /**
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
180 *
181 * @param dir Directory to add to
182 */
5934a3e3 183 virtual void CreateOutputObjects(TList* dir);
428cd802 184 /* @} */
0bd4b00f 185 /**
186 * Print information
187 *
188 * @param option Not used
189 */
e8bf1690 190 virtual void Print(Option_t* option="") const;
d2638bb7 191
428cd802 192 /**
193 * @{
194 * @name Cuts
195 */
290052e7 196 /**
197 * Get the low cuts
198 *
199 * @return Reference to low cuts
200 */
d2638bb7 201 AliFMDMultCuts& GetLCuts() { return fLCuts; }
290052e7 202 /**
203 * Get the high cuts
204 *
205 * @return Reference to high cuts
206 */
d2638bb7 207 AliFMDMultCuts& GetHCuts() { return fHCuts; }
290052e7 208 /**
209 * Get the low cuts
210 *
211 * @return Reference to low cuts
212 */
d2638bb7 213 const AliFMDMultCuts& GetLCuts() const { return fLCuts; }
290052e7 214 /**
215 * Get the high cuts
216 *
217 * @return Reference to high cuts
218 */
d2638bb7 219 const AliFMDMultCuts& GetHCuts() const { return fHCuts; }
290052e7 220 /**
221 * Set the low cuts
222 *
223 * @param c Cuts object
224 */
d2638bb7 225 void SetLCuts(const AliFMDMultCuts& c) { fLCuts = c; }
290052e7 226 /**
227 * Set the high cuts
228 *
229 * @param c Cuts object
230 */
d2638bb7 231 void SetHCuts(const AliFMDMultCuts& c) { fHCuts = c; }
428cd802 232 /* @} */
7e4038b5 233protected:
428cd802 234 /**
235 * Copy constructor - not implemented
236 */
ee83b849 237 AliFMDSharingFilter(const AliFMDSharingFilter& o){;}
428cd802 238 /**
239 * Assignment operator - not implemented
240 *
241 * @return Reference to this
242 */
ee83b849 243 AliFMDSharingFilter& operator=(const AliFMDSharingFilter& o){return *this;}
7e4038b5 244 /**
245 * Internal data structure to keep track of the histograms
246 */
9d99b0dd 247 struct RingHistos : public AliForwardUtil::RingHistos
7e4038b5 248 {
249 /**
250 * Default CTOR
251 */
252 RingHistos();
253 /**
254 * Constructor
255 *
256 * @param d detector
257 * @param r ring
258 */
259 RingHistos(UShort_t d, Char_t r);
260 /**
261 * Copy constructor
262 *
263 * @param o Object to copy from
264 */
265 RingHistos(const RingHistos& o);
266 /**
267 * Assignment operator
268 *
269 * @param o Object to assign from
270 *
271 * @return Reference to this
272 */
273 RingHistos& operator=(const RingHistos& o);
274 /**
275 * Destructor
276 */
277 ~RingHistos();
278 /**
c389303e 279 * Clear this object
7e4038b5 280 */
8449e3e0 281 // void Clear(const Option_t* ="") { fNHits = 0; }
c389303e 282 /**
283 * Increase number of hits
284 *
285 */
8449e3e0 286 // void Incr() { fNHits++; }
c389303e 287 /**
288 * Finish off
289 *
290 */
8449e3e0 291 // void Finish();
c389303e 292 /**
293 * Make output
294 *
295 * @param dir where to store
296 */
5934a3e3 297 void CreateOutputObjects(TList* dir);
9d99b0dd 298 /**
299 * Scale the histograms to the total number of events
300 *
301 * @param nEvents Number of events
c389303e 302 * @param dir Where the output is
9d99b0dd 303 */
5934a3e3 304 void Terminate(const TList* dir, Int_t nEvents);
428cd802 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
5bb5d1f6 312 TH2D* fNeighborsBefore; // Correlation of neighbors
428cd802 313 TH2D* fNeighborsAfter; // Correlation of neighbors
77f97e3f
CHC
314 TH2D* fSumESD; // Summed ESD signal
315 TH2D* fSum; // Summed cluster signal
f71c22f5
CHC
316 TH1D* fNConsecutive; // # consecutive strips with signal > low cut
317 ClassDef(RingHistos,4);
7e4038b5 318 };
319 /**
320 * Get the ring histogram container
321 *
322 * @param d Detector
323 * @param r Ring
324 *
325 * @return Ring histogram container
326 */
327 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
328 /**
329 * Get the signal in a strip
330 *
331 * @param fmd ESD object
332 * @param d Detector
333 * @param r Ring
334 * @param s Sector
335 * @param t Strip
336 *
337 * @return The energy signal
338 */
339 Double_t SignalInStrip(const AliESDFMD& fmd,
340 UShort_t d,
341 Char_t r,
342 UShort_t s,
343 UShort_t t) const;
7e4038b5 344 /**
345 * Angle correct the signal
346 *
347 * @param mult Angle Un-corrected Signal
348 * @param eta Pseudo-rapidity
349 *
350 * @return Angle corrected signal
351 */
352 Double_t AngleCorrect(Double_t mult, Double_t eta) const;
353 /**
354 * Angle de-correct the signal
355 *
356 * @param mult Angle corrected Signal
357 * @param eta Pseudo-rapidity
358 *
359 * @return Angle un-corrected signal
360 */
361 Double_t DeAngleCorrect(Double_t mult, Double_t eta) const;
5bb5d1f6 362 /**
7e4038b5 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.
5bb5d1f6 366 *
367 * @param d Detector
368 * @param r Ring
369 * @param eta Eta value
370 * @param errors If false, do not show errors
371 *
372 * @return 0 or less on failure, otherwise @f$\Delta_{mp}-n\xi@f$
7e4038b5 373 */
5bb5d1f6 374 virtual Double_t GetHighCut(UShort_t d, Char_t r, Double_t eta,
375 Bool_t errors=true) const;
0bd4b00f 376 /**
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.
5bb5d1f6 381 *
382 * @param d Detector
383 * @param r Ring
384 * @param eta Eta value
385 *
386 * @return
0bd4b00f 387 */
5bb5d1f6 388 virtual Double_t GetLowCut(UShort_t d, Char_t r, Double_t eta) const;
428cd802 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
d1013ccf 398 Bool_t fThreeStripSharing; //In case of simple sharing allow 3 strips
bdd49110 399 Bool_t fMergingDisabled; // If true, do not merge
400 Bool_t fIgnoreESDForAngleCorrection; // Ignore ESD information when angle correcting
0ccdab7b 401 ClassDef(AliFMDSharingFilter,11); //
7e4038b5 402};
403
404#endif
405// Local Variables:
406// mode: C++
407// End: