1 #ifndef ALIFMDESDFIXER_H
2 #define ALIFMDESDFIXER_H
10 * Class to fix up an ESD object for various small issues.
13 * - AliESDFMD object - from reconstruction
14 * - Ip z coordinate - from reconstruction
15 * - Reco noise factor - Assumed noise factor used in reconstruction
18 * - The same AliESDFMD object but modified
20 * @par Corrections used
21 * - AliFMDCorrNoiseGain if the noise correction is enabled
24 * - Change in @f$\Delta@f$ due to noise correction
25 * - Number of channels declared dead
26 * - Change in @f$\eta@f$
28 * @ingroup pwglf_forward_algo
29 * @ingroup pwglf_forward_aod
31 class AliFMDESDFixer : public TObject
35 * Default CTOR - for ROOT I/O - do not use
42 * @param name Dummy argument
44 AliFMDESDFixer(const char* name);
48 * @return Always the same
50 const char* GetName() const { return "fmdESDFixer"; }
52 * Create output objects
54 void CreateOutputObjects(TList* l);
58 * @param esd ESD object
59 * @param ipZ IP Z--coordinate
61 void Fix(AliESDFMD& esd, Double_t ipZ);
65 * @name Noise suppression fix
68 * Set the factor assumed to be used in the reconstruction. If this
69 * is set way high (>=4) then this corrector will effectively be
74 void SetRecoNoiseFactor(Int_t f) { fRecoFactor = f; }
75 void SetMaxNoiseCorrection(Double_t x) { fMaxNoiseCorr = x; }
77 * Get the factor assumed in reconstruction pass
79 * @return factor assumed in reconstruction pass
81 Int_t GetRecoNoiseFactor() const { return fRecoFactor; }
83 * Check if we're using the noise correction.
85 * @return true if fRecoFactor < 4
87 Bool_t IsUseNoiseCorrection() const { return fRecoFactor < 4; }
89 * Find the target noise factor
91 * @param esd ESD object.
92 * @param check If true, also check for correction object
94 * @return Needed noise factor, or 0 or less if no correction is needed
96 Int_t FindTargetNoiseFactor(const AliESDFMD& esd, Bool_t check=true) const;
101 * @name Recalculations
104 * In case of a displaced vertices recalculate @f$\eta@f$ and angle
107 * @param use recalculate or not
110 void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
115 * @name Special treatmeant of invalid signals
118 * Set whether to consider invalid multiplicities as null (or empty)
121 * @param flag If true, count invalids as empty
123 void SetInvalidIsEmpty(Bool_t flag) { fInvalidIsEmpty = flag; }
128 * @name Dead strip handling
138 void AddDead(UShort_t d, Char_t r, UShort_t s, UShort_t t);
140 * Add a dead region in a detector ring
144 * @param s1 First sector (inclusive)
145 * @param s2 Last sector (inclusive)
146 * @param t1 First strip (inclusive)
147 * @param t2 Last strip (inclusive)
149 void AddDeadRegion(UShort_t d, Char_t r, UShort_t s1, UShort_t s2,
150 UShort_t t1, UShort_t t2);
152 * Add dead strips from a script. The script is supposed to accept
153 * a pointer to this object (AliFMDSharingFilter) and then call
154 * AddDead or AddDeadRegion as needed.
157 * void deadstrips(AliFMDSharingFilter* filter)
159 * filter->AddDead(...);
164 * @param script The script to read dead strips from.
166 void AddDead(const Char_t* script);
169 void Print(Option_t* option="") const;
171 AliFMDESDFixer(const AliFMDESDFixer&);
172 AliFMDESDFixer& operator=(const AliFMDESDFixer&);
176 * @name Worker functions
179 * Check if a strip is marked as dead
186 * @return true if dead
188 virtual Bool_t IsDead(UShort_t d, Char_t r, UShort_t s, UShort_t t) const;
190 * Possibly raise a strip from the dead or kill it
196 * @param m Multiplicity
198 * @return true if this was killed
200 Bool_t CheckDead(UShort_t d, Char_t r, UShort_t s, UShort_t t, Double_t& m);
202 * Re-calculate eta and correct the multiplicity accordingly
208 * @param vz Ip Z-coordinate
209 * @param mult In/out multiplicity
210 * @param eta In/out eta
211 * @param cosTheta On return, the cosine of theta or null
213 void RecalculateEta(UShort_t d, Char_t r, UShort_t s, UShort_t t,
214 Double_t vz, Double_t& mult, Double_t& eta,
217 * Correct for noise suppression
219 * @param f Factor to apply
220 * @param c Correction
221 * @param cosTheta Cosine to theta
222 * @param mult In/Out multiplity
224 * @return true if signal is good, otherwise false
226 Bool_t NoiseCorrect(Int_t f, Double_t c, Double_t cosTheta, Double_t& mult);
228 Int_t fRecoFactor; // Noise factor used in Reco
229 Double_t fMaxNoiseCorr; // If noise corr above this, flag as dead
230 Bool_t fRecalculateEta; // Whether to recalc eta and angle cor (disp vtx)
231 TBits fXtraDead; // List of extra dead channels
232 Bool_t fHasXtraDead; // Whether we have xtra dead channels
233 Bool_t fInvalidIsEmpty; // Consider kInvalidMult as zero
234 TH1* fNoiseChange; // Diagnostics
235 TH1* fEtaChange; // Diagnostics
236 TH1* fDeadChange; // Diagnostics
238 ClassDef(AliFMDESDFixer,1); // Fix FMD ESD object for issues