MarlinTPC  1.2.0
TrackFitterLikelihoodProcessor.h
1 #ifndef TRACKFITTERLIKELIHOODPROCESSOR_H
2 #define TRACKFITTERLIKELIHOODPROCESSOR_H 1
3 
4 #include "marlin/Processor.h"
5 
6 #include "TrackFitterBase.h"
7 
8 #include "TPCConditionsListener.h"
9 
10 // LCIO
11 #include "lcio.h"
12 
13 /* NOTE this uses the C++ version of Minuit - not the Fortran version */
14 #include "Minuit2/FCNBase.h"
15 
16 // stl
17 #include <string>
18 #include <vector>
19 
20 // some forward declarations
21 
22 namespace AIDA
23 {
24 
25 class ITuple;
26 }
27 
28 namespace EVENT
29 {
30 class LCEvent;
31 class LCRunHeader;
32 class Track;
33 }
34 
35 namespace IMPL
36 {
37 
38 class TrackImpl;
39 class TrackerHitImpl;
40 }
41 
42 namespace marlintpc
43 {
44 
49 class TrackFitterLikelihoodProcessor : public marlin::Processor, public ROOT::Minuit2::FCNBase
50 {
51 
52  public:
53 
57 
58 
62 
63 
66  marlin::Processor * newProcessor();
67 
68 
71  void init();
72 
73 
76  void processRunHeader(lcio::LCRunHeader *run);
77 
78 
81  virtual void processEvent(lcio::LCEvent *evt);
82 
83 
84  // From FCNBase
104  virtual double operator()(const std::vector<double>& x) const;
105 
114  virtual double Up() const;
115 
116 
119  virtual void check(lcio::LCEvent *evt);
120 
121 
124  virtual void end();
125 
126 
127  private:
128 
131  void calculate_expected_charge_distribution(TrackImpl &expected_track, double sigma0) const;
132 
135  void calculate_expected_charge_distribution_homogeneous_polar(IMPL::TrackImpl&, const double) const;
136 
139  void calculate_expected_charge_distribution_homogeneous_cartesian(IMPL::TrackImpl&, const double) const;
140 
143  void calculate_expected_charge_distribution_non_homogeneous_polar(IMPL::TrackImpl&, const double) const;
144 
147  void calculate_expected_charge_distribution_non_homogeneous_cartesian(IMPL::TrackImpl&, const double) const;
148 
151  void calculate_expected_charge_distribution_polar_row(IMPL::TrackerHitImpl&, const EVENT::TrackerHit &data_hit, const double, const double, const double) const;
152 
155  void calculate_expected_charge_distribution_cartesian_row(IMPL::TrackerHitImpl&, const EVENT::TrackerHit &data_hit, const double, const double, const double) const;
156 
159  const double calculate_charge_distribution_log_likelihood(const EVENT::Track&) const;
160 
161 
164  const double calculate_primary_ionization_location_log_likelihood(const Track&) const;
165 
166 
169  IMPL::TrackImpl find_most_likely_fit(EVENT::Track* seed_track);
170 
171 
179  double calculate_expected_distribution(double b, double phi, double sigma,
180  double height, double width) const;
181 
184  std::string _seed_track_collection_name;
185 
188  std::string _fitted_track_collection_name;
189 
192  std::string _tpc_conditions_collection_name;
193 
196  double _sigma0;
197 
202  bool _fit_sigma0;
203 
206  double _gas_trans_diffusion_constant;
207 
210  double _gas_trans_defocussing_constant;
211 
214  double _p_noise;
215 
218  EVENT::Track* _current_seed_track;
219 
222  double _readout_electronics_inner_z;
223 
226  double _sigma_z;
227 
230  bool _produce_tuples;
231 
234  AIDA::ITuple *_track_result_tuples;
235 
238  double _omega_tau;
239 
242  double _drift_velocity;
243 
247  double _path_integral_step_size;
248 
251  double _tpc_outer_radius;
252 
255  bool _fit_nonhomogeneous_fields;
256 
259  int _omega_order_of_magnitude;
260  int _tanLambda_order_of_magnitude;
261 
264  TPCConditionsListener* _tpcConditionsListener;
265 
268  /*class PolarPDF {
269 
270  public:
271  PolarPDF (const Track &estimated_track);
272 
273  double evaluate_pdf_integral( const double r, const double phi );
274 
275  private:
276  const double _estimated_omega;
277  const double _estimated_phi0;
278  const double _estimated_d0;
279  }*/
280 };
281 
282 } // namespace marlintpc
283 
284 #endif // TRACKFITTERLIKELIHOODPROCESSOR_H
void processRunHeader(lcio::LCRunHeader *run)
Called once per run to process the event's header.
Definition: TrackFitterLikelihoodProcessor.cc:209
virtual void check(lcio::LCEvent *evt)
Called for every event - right after processEvent() has been called for all processors.
Definition: TrackFitterLikelihoodProcessor.cc:1995
virtual double Up() const
Error definition of the function.
Definition: TrackFitterLikelihoodProcessor.cc:583
virtual void end()
Called after data processing for clean up in the inverse order of the init() method so that resources...
Definition: TrackFitterLikelihoodProcessor.cc:2002
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Definition: TrackFitterLikelihoodProcessor.cc:425
void init()
Called at the begin of the job before anything is read.
Definition: TrackFitterLikelihoodProcessor.cc:187
marlin::Processor * newProcessor()
Return a new instance of this processor.
Definition: TrackFitterLikelihoodProcessor.cc:1988
TrackFitterLikelihoodProcessor()
Default constructor.
Definition: TrackFitterLikelihoodProcessor.cc:76
Helper Class which provides access to the TPC conditions for every event.
Definition: TPCConditionsListener.h:37
~TrackFitterLikelihoodProcessor()
Destructor.
Definition: TrackFitterLikelihoodProcessor.cc:181
virtual double operator()(const std::vector< double > &x) const
The meaning of the vector of parameters is of course defined by the user, who uses the values of thos...
Definition: TrackFitterLikelihoodProcessor.cc:509
TrackFitterLikelihoodProcessor : This class takes post-amplified data from a readout pad and reconstr...
Definition: TrackFitterLikelihoodProcessor.h:49