MarlinTPC  1.2.0
PhotoelectricProjectionFinder.h
1 #ifdef USE_LCCD
2 
3 #ifndef PHOTOELECTRICPROJECTIONFINDER_H
4 #define PHOTOELECTRICPROJECTIONFINDER_H 1
5 
6 // Marlin
7 #include <marlin/Processor.h>
8 
9 // LCIO
10 #include <lcio.h>
11 
12 // gear
13 #include <gearimpl/GlobalPadIndex.h>
14 
15 // stl
16 #include <map>
17 #include <set>
18 #include <string>
19 #include <vector>
20 
21 namespace CLHEP
22 {
23 
24 class Hep2Vector;
25 }
26 
27 namespace EVENT
28 {
29 
30 class TrackerPulse;
31 }
32 
33 namespace marlintpc
34 {
35 
39 class PhotoelectricProjectionFinder : public marlin::Processor
40 {
41 
42  public:
43 
44  PhotoelectricProjectionFinder() ;
45 
46  virtual void init() ;
47 
48  virtual Processor* newProcessor()
49  {
50  return new PhotoelectricProjectionFinder();
51  }
52 
53  virtual void processRunHeader(lcio::LCRunHeader* run);
54 
55  virtual void processEvent(lcio::LCEvent * evt);
56 
57  virtual void check(lcio::LCEvent * evt);
58 
59  virtual void end();
60 
61  private:
62 
65  std::string _input_tracker_pulses_collection_name;
66 
69  float _max_separation;
70 
73  float _density_threshold;
74 
77  std::string _projected_photogeometry_file_name;
78 
81  std::string _photogeometry_file_name;
82 
85  std::map< gear::GlobalPadIndex, int > _counts_by_pad;
86 
89  int _total_event_count;
90 
93  float _photopulse_interval_start;
94 
97  float _photopulse_interval_end;
98 
101  float _event_fraction_threshold;
102 
105  float _maximum_dot_displacement;
106 
109  std::string _distortion_file_name;
110 
111  int _runNumber;
112 
113  std::string _detectorName;
114 
117  void create_points(std::vector<CLHEP::Hep2Vector*> &points, std::map< CLHEP::Hep2Vector*, gear::GlobalPadIndex> &pad_by_point);
118 
121  void find_neighbours(const std::vector<CLHEP::Hep2Vector*> &points, const float max_seperation, std::map< CLHEP::Hep2Vector*, std::set<CLHEP::Hep2Vector*> > &neighbours_by_point);
122 
125  void calculate_point_clusters(const std::vector< CLHEP::Hep2Vector* > &points, const std::map< CLHEP::Hep2Vector*, std::set< CLHEP::Hep2Vector* > > &neighbours_by_point, std::set< std::set< CLHEP::Hep2Vector* > > &point_clusters);
126 
129  void classify_point_clusters(const std::set< std::set< CLHEP::Hep2Vector* > > &point_clusters, const std::map< CLHEP::Hep2Vector*, gear::GlobalPadIndex > pad_by_point, std::set< const std::set< CLHEP::Hep2Vector*>* > &photodots, std::set< const std::set< CLHEP::Hep2Vector* >* > &photolines);
130 
133  void store_results(const std::set< const std::set< CLHEP::Hep2Vector* >* > &photodots, const std::set< const std::set< CLHEP::Hep2Vector* >* > &photolines, std::map< CLHEP::Hep2Vector*, gear::GlobalPadIndex > pad_by_point, bool storeLCIO);
134 
137  void produce_tuples(const std::set< const std::set< CLHEP::Hep2Vector* >* > &photodots, const std::set< const std::set< CLHEP::Hep2Vector* >* > &photolines);
138 };
139 
140 }
141 
142 #endif // PHOTOELECTRICPROJECTIONFINDER_H
143 #endif // USE_LCCD