1 #ifndef ALIFMDMCHITENERGYFITTERTASK_H
2 #define ALIFMDMCHITENERGYFITTERTASK_H
3 #include <AliBaseESDTask.h>
4 #include <AliFMDMCHitEnergyFitter.h>
5 #include <AliFMDEventInspector.h>
9 * This task is designed to read in MC truth information about the
10 * energy loss in each strip, and then fit the distributions from
11 * secondaries and primaries separately.
13 * Then (this is not implemented yet) it tries to deconvolve the
14 * contributions from secondaries and primaries separately from the
15 * total sum energy loss distribution, and in that way estimate the
16 * secondary to primary charge particle ratios per @f$\eta@f$ bin. If
17 * the same procedure is applied to real data, then we can have an
18 * estimate - from data - of the ratio of secondaries to primaries and
19 * thus perhaps get a clearer picture of the secondary particle
22 * The the function fitted to the (scaled) energy loss
23 * (@f$\Delta/\Delta_{mip}@f$ distributions is
26 * F(\Delta;\Delta_p,\xi,\sigma,\mathbf{a}) =
27 * \sum_{i=1}^{N}a_i f(\Delta;\Delta_i,\xi_i,\sigma_i)
29 * where @f$ a@f$ is of length @f$ N@f$ and
31 * f(\Delta;\Delta,\xi,\sigma) =
32 * \int_{-\infty}^{+\infty}d\Delta' L(\Delta,\Delta',\xi)
33 * \frac{1}{\sqrt{2\pi\sigma^2}}
34 * e^{-\frac{(\Delta'-\Delta_mp^2}{2\sigma^2}}
38 * \Delta_i = i(\Delta_1+\xi\log(i))\\
40 * \sigma_i = \sqrt{i}\sigma_1\\
42 * \Delta_p = \Delta_1\\
47 * See also AliForwardUtil::ELossFitter
49 class AliFMDMCHitEnergyFitterTask : public AliBaseESDTask
53 * Default CTOR - do not use
55 AliFMDMCHitEnergyFitterTask()
64 * @param name Name - not used
65 * @param useTuple Whether to use store an NTuple
67 AliFMDMCHitEnergyFitterTask(const char* name,
68 Bool_t useTuple=false);
72 ~AliFMDMCHitEnergyFitterTask() {}
75 * Called when setting up the train on the client - i.e., called
76 * once before the job hits the worker nodes
82 * Called at start-up on the clients - i.e., called once per worker
83 * node before the event processing.
89 * Called after the first event was seen - i.e., called once per
90 * worker node just after the first event was seen, but before event
93 * @param ipz Interaction point Z--coordinate axis to use
94 * @param eta @f$\eta=-\log[\tan^{-1}(\theta/2)]@f$ axis to use
98 Bool_t PreData(const TAxis& ipz, const TAxis& eta);
100 * Process a single event
102 * @param esd ESD input event
104 * @return true on success
106 Bool_t Event(AliESDEvent& esd);
108 * Finalize the task. This is called once after all event
109 * processing and after all outputs have been merged. This is
110 * called on the master/client once.
112 * @return true on success
114 Bool_t Finalize() { fEnergyFitter.Fit(fResults); return true; }
116 * Print information to standard out
118 * @param option Passed to sub objects as-is
120 void Print(Option_t* option="") const;
122 * Get the event inspector
124 * @return Reference to the event inspector
126 AliFMDEventInspector& GetEventInspector() { return fEventInspector; }
128 * Get the event inspector
130 * @return Constant reference to the event inspector
132 const AliFMDEventInspector& GetEventInspector() const
134 return fEventInspector;
137 * Get the energy fitter
139 * @return Reference to the energy fitter
141 AliFMDMCHitEnergyFitter& GetEnergyFitter() { return fEnergyFitter; }
143 * Get the energy fitter
145 * @return Constant reference to the energy fitter
147 const AliFMDMCHitEnergyFitter& GetEnergyFitter() const
149 return fEnergyFitter;
151 void SetDebug(Int_t dbg) {
152 AliBaseESDTask::SetDebug(dbg); GetEnergyFitter().SetDebug(dbg); }
155 * Copy CTOR - not Implemented
157 * @param o Object to copy from
159 AliFMDMCHitEnergyFitterTask(const AliFMDMCHitEnergyFitterTask& o);
161 * Assignment operator - not implemented
163 * @param o Object to assign from
165 * @return Reference to this
167 AliFMDMCHitEnergyFitterTask& operator=(const AliFMDMCHitEnergyFitterTask&o);
169 * Get the default @f$\eta=-\log[\tan^{-1}(\theta/2)]@f$ axis to use
171 * @return Pointer to static object
173 TAxis* DefaultEtaAxis() const;
175 * Get the default interaction point Z--coordinate axis to use
177 * @return Pointer to static object
179 TAxis* DefaultVertexAxis() const;
181 AliFMDEventInspector fEventInspector; // The event inspector
182 AliFMDMCHitEnergyFitter fEnergyFitter; // The energy loss fitter
183 AliMCAuxHandler* fHitHandler; // Handler for reading hits in
185 ClassDef(AliFMDMCHitEnergyFitterTask,1); // Task to fit Delta from MC hits