MarlinTPC  1.2.0
PhotoelectricFittingProcessor.h
1 #ifdef USE_LCCD
2 
3 #ifndef PHOTOELECTRICFITTINGPROCESSOR_H
4 #define PHOTOELECTRICFITTINGPROCESSOR_H 1
5 
6 // Marlin
7 #include <marlin/Processor.h>
8 
9 // GEAR
10 #include <gear/TPCParameters.h>
11 #include <gearimpl/GlobalPadIndex.h>
12 
13 // LCIO
14 #include <EVENT/TrackerHit.h>
15 
16 /* NOTE this uses the C++ version of Minuit - not the Fortran version */
17 #include <Minuit2/FCNBase.h>
18 
19 // CLHEP
20 #include <CLHEP/Vector/TwoVector.h>
21 
22 // stl
23 #include <string>
24 #include <set>
25 #include <list>
26 
27 namespace EVENT
28 {
29 
30 class TrackerPulse;
31 }
32 
33 namespace AIDA
34 {
35 
36 class ITuple;
37 }
38 
39 namespace marlintpc
40 {
41 
45 class PhotoelectricFittingProcessor : public marlin::Processor
46 {
47 
48  public:
49 
50  PhotoelectricFittingProcessor() ;
51 
52  virtual void init() ;
53 
54  virtual Processor* newProcessor()
55  {
56  return new PhotoelectricFittingProcessor();
57  }
58 
59  virtual void processRunHeader(lcio::LCRunHeader* run);
60 
61  virtual void processEvent(lcio::LCEvent * evt);
62 
63  virtual void check(lcio::LCEvent * evt);
64 
65  virtual void end();
66 
67  private:
68 
71  std::string _input_photoelectric_tracker_pulses_collection_name;
72 
75  std::string _output_photodot_collection_name;
76 
79  std::string _output_photoline_collection_name;
80 
83  bool _output_is_transient;
84 
87  std::string _projected_photogeometry_file_name;
88 
91  double _sigma;
92 
95  AIDA::ITuple *_photodot_fit_results_tuple;
96 
99  std::map< gear::GlobalPadIndex, std::list< std::set< EVENT::TrackerPulse* > >::iterator > _photodot_pulse_set_by_global_index;
100 
103  std::list< std::set< EVENT::TrackerPulse* > > _photodot_pulse_sets;
104 
107  std::list< CLHEP::Hep2Vector > _photodot_centroids;
108 
111  std::map< gear::GlobalPadIndex, std::list< std::set< EVENT::TrackerPulse* > >::iterator > _photoline_pulse_set_by_global_index;
112 
115  std::list< std::set< EVENT::TrackerPulse* > > _photoline_pulse_sets;
116 
119  class PhotodotLikelihood : public ROOT::Minuit2::FCNBase
120  {
121 
122  public:
123 
124  PhotodotLikelihood(const std::set< EVENT::TrackerPulse* > &photodot_data);
125 
126  virtual double operator()(const std::vector<double>& x) const;
127 
128  virtual double Up() const;
129 
130  private:
131 
132  const std::set< EVENT::TrackerPulse* > &_photodot_data;
133  };
134 
135 };
136 
137 }
138 
139 #endif // PHOTOELECTRICFITTINGPROCESSOR_H
140 #endif // USE_LCCD