MarlinTPC  1.2.0
HitSplitter.h
1 #ifndef MARLINTPC_HIT_SPLITTER_H
2 #define MARLINTPC_HIT_SPLITTER_H
3 
4 //stl
5 #include <set>
6 
7 // lcio
8 #include <IMPL/LCCollectionVec.h>
9 #include <EVENT/TrackerHit.h>
10 #include <EVENT/TrackerPulse.h>
11 #include <EVENT/LCIO.h>
12 
13 namespace marlintpc
14 {
26 {
27  public:
33  HitSplitter(IMPL::LCCollectionVec * SplitHitsCollection,
34  IMPL::LCCollectionVec * PulsesInSplitHitsCollection,
35  float vDrift);
36 
49  EVENT::TrackerHitVec splitHit(EVENT::TrackerHit const * const);
50 
51  protected:
52 
53  IMPL::LCCollectionVec * _splitHitsCollection;
54  IMPL::LCCollectionVec * _pulsesInSplitHitsCollection;
55  float _vDrift;
56 
63  {
64  public:
65  bool operator<(const SortablePulse & p) const;
66  int operator-(const SortablePulse & p) const;
67 
68  SortablePulse(EVENT::TrackerPulse * pulse);
69  EVENT::TrackerPulse * getTrackerPulse() const;
70  protected:
71  EVENT::TrackerPulse * _pulse;
72  };
73 
74  typedef std::pair < std::multiset<SortablePulse>::iterator,
75  std::multiset<SortablePulse>::iterator > IteratorPair;
76 
80  struct Distance
81  {
82  float distance;
83  std::multiset<SortablePulse>::iterator firstPulse;
84  std::multiset<SortablePulse>::iterator secondPulse;
85 
86  Distance(float d, std::multiset<SortablePulse>::iterator first,
87  std::multiset<SortablePulse>::iterator second);
88 
89  bool operator<(Distance const &right) const
90  {
91  return distance < right.distance;
92  }
93  };
94 
95 };
96 }// namespace marlintpc
97 
98 #endif // MARLINTPC_HIT_SPLITTER_H
EVENT::TrackerHitVec splitHit(EVENT::TrackerHit const *const)
The split hits function returns a vector with the split hits.
Definition: HitSplitter.cc:41
The hit splitter separates hits that are merged.
Definition: HitSplitter.h:25
A nested helper struct to contain two pulses and the distance between them, and sort according to the...
Definition: HitSplitter.h:80
float _vDrift
The drift velocity.
Definition: HitSplitter.h:55
HitSplitter(IMPL::LCCollectionVec *SplitHitsCollection, IMPL::LCCollectionVec *PulsesInSplitHitsCollection, float vDrift)
The constructor needs two collection it can write to: One for the split hits and one for the pulses t...
Definition: HitSplitter.cc:32
A helper class to sort pulses according to their pad index.
Definition: HitSplitter.h:62