MarlinTrkProcessors  2.4.1
TrackSubsetProcessor.h
1 #ifndef TrackSubsetProcessor_h
2 #define TrackSubsetProcessor_h 1
3 
4 
5 #include "marlin/Processor.h"
6 #include "lcio.h"
7 #include "EVENT/Track.h"
8 #include "MarlinTrk/IMarlinTrkSystem.h"
9 
10 #include "Math/ProbFunc.h"
11 
12 
13 
14 
15 using namespace lcio ;
16 using namespace marlin ;
17 
18 
52 class TrackSubsetProcessor : public Processor {
53 
54  public:
55 
56  virtual Processor* newProcessor() { return new TrackSubsetProcessor ; }
57 
58 
60 
64  virtual void init() ;
65 
68  virtual void processRunHeader( LCRunHeader* run ) ;
69 
72  virtual void processEvent( LCEvent * evt ) ;
73 
74 
75  virtual void check( LCEvent * evt ) ;
76 
77 
80  virtual void end() ;
81 
82 
83  protected:
84 
88  void removeShortTracks( std::vector< EVENT::Track*>& tracks ) ;
89 
90 
92  std::vector< std::string > _trackInputColNames;
93 
95  std::string _trackOutputColName;
96 
97  MarlinTrk::IMarlinTrkSystem* _trkSystem;
98  std::string _trkSystemName ;
99 
100  bool _MSOn ;
101  bool _ElossOn ;
102  bool _SmoothOn ;
103  bool _removeShortTracks ;
104 
105 
106  float _initialTrackError_d0;
107  float _initialTrackError_phi0;
108  float _initialTrackError_omega;
109  float _initialTrackError_z0;
110  float _initialTrackError_tanL;
111 
112  double _maxChi2PerHit;
113 
114  float _bField;
115 
116  int _nRun ;
117  int _nEvt ;
118 
119  double _omega;
120 
121 } ;
122 
123 
126 
127 
128 public:
129 
130 
131  inline bool operator()( Track* trackA, Track* trackB ){
132 
133 
134  std::vector< TrackerHit* > hitsA = trackA->getTrackerHits();
135  std::vector< TrackerHit* > hitsB = trackB->getTrackerHits();
136 
137 
138  for( unsigned i=0; i < hitsA.size(); i++){
139 
140  for( unsigned j=0; j < hitsB.size(); j++){
141 
142  if ( hitsA[i] == hitsB[j] ) return false; // a hit is shared -> incompatible
143 
144  }
145 
146  }
147 
148  return true;
149 
150 
151  }
152 
153 
154 };
155 
156 
158 class TrackQI{
159 
160 public:
161 
163  TrackQI( MarlinTrk::IMarlinTrkSystem* trkSystem ): _trkSystem(trkSystem){}
164 
165  inline double operator()( Track* track ){
166 
167  return ROOT::Math::chisquared_cdf_c( track->getChi2() , track->getNdf() );
168 
169 
170  }
171 
172 protected:
173 
174  MarlinTrk::IMarlinTrkSystem* _trkSystem;
175 
176 };
177 
178 
179 
180 
181 #endif
182 
183 
184 
Processor that takes tracks from multiple sources and outputs them (or modified versions, or a subset of them) as one track collection.
Definition: TrackSubsetProcessor.h:52
TrackQI(MarlinTrk::IMarlinTrkSystem *trkSystem)
Definition: TrackSubsetProcessor.h:163
std::string _trackOutputColName
Output collection name.
Definition: TrackSubsetProcessor.h:95
A functor to return the quality of a track, which is the ratio chi2 over degrees of freedom...
Definition: CellsAutomatonMV.h:335
std::vector< std::string > _trackInputColNames
Input collection names.
Definition: TrackSubsetProcessor.h:92
A functor to return whether two tracks are compatible: The criterion is if the share a TrackerHit or ...
Definition: TrackSubsetProcessor.h:125