ForwardTracking  1.10.0
ForwardTracking.h
1 #ifndef ForwardTracking_h
2 #define ForwardTracking_h 1
3 
4 #include <string>
5 
6 #include "marlin/Processor.h"
7 #include "lcio.h"
8 #include "EVENT/TrackerHit.h"
9 #include "EVENT/Track.h"
10 #include "IMPL/TrackImpl.h"
11 #include "MarlinTrk/IMarlinTrkSystem.h"
12 #include "gear/BField.h"
13 
14 #include "KiTrack/Segment.h"
15 #include "KiTrack/ITrack.h"
16 #include "Criteria/Criteria.h"
17 #include "ILDImpl/SectorSystemFTD.h"
18 
19 using namespace lcio ;
20 using namespace marlin ;
21 using namespace KiTrack;
22 using namespace KiTrackMarlin;
23 
26 typedef std::vector< IHit* > RawTrack;
27 
28 
107 class ForwardTracking : public Processor {
108 
109  public:
110 
111  virtual Processor* newProcessor() { return new ForwardTracking ; }
112 
113 
114  ForwardTracking() ;
115 
119  virtual void init() ;
120 
123  virtual void processRunHeader( LCRunHeader* run ) ;
124 
178  virtual void processEvent( LCEvent * evt ) ;
179 
180 
181  virtual void check( LCEvent * evt ) ;
182 
183 
186  virtual void end() ;
187 
188 
189 
190 
191  protected:
192 
203  std::map< IHit* , std::vector< IHit* > > getOverlapConnectionMap( const std::map< int , std::vector< IHit* > > & map_sector_hits,
204  const SectorSystemFTD* secSysFTD,
205  float distMax);
206 
216  std::vector < RawTrack > getRawTracksPlusOverlappingHits( RawTrack rawTrack , std::map< IHit* , std::vector< IHit* > >& map_hitFront_hitsBack );
217 
222  void finaliseTrack( TrackImpl* trackImpl );
223 
241  bool setCriteria( unsigned round );
242 
243 
245  std::string getInfo_map_sector_hits();
246 
247 
249  std::vector<std::string> _FTDHitCollections;
250 
253 
254 
255  int _nRun ;
256  int _nEvt ;
257 
259  double _Bz;
260 
262  double _chi2ProbCut;
263 
265  double _helixFitMax;
266 
267  // Properties of the Kalman Fit
268  bool _MSOn ;
269  bool _ElossOn ;
270  bool _SmoothOn ;
271 
275 
276 
277  // Properties for the Hopfield Neural Network
278  double _HNN_Omega;
279  double _HNN_ActivationThreshold;
280  double _HNN_TInf;
281 
283  std::map< int , std::vector< IHit* > > _map_sector_hits;
284 
286  std::vector< std::string > _criteriaNames;
287 
289  std::map< std::string , std::vector<float> > _critMinima;
290 
292  std::map< std::string , std::vector<float> > _critMaxima;
293 
296 
298  std::vector <ICriterion*> _crit2Vec;
299 
301  std::vector <ICriterion*> _crit3Vec;
302 
304  std::vector <ICriterion*> _crit4Vec;
305 
306 
307  const SectorSystemFTD* _sectorSystemFTD;
308 
309 
310  bool _useCED;
311 
314 
319 
323 
325  std::string _bestSubsetFinder;
326 
327  unsigned _nTrackCandidates;
328  unsigned _nTrackCandidatesPlus;
329 
330 
331 
332  MarlinTrk::IMarlinTrkSystem* _trkSystem;
333 
334  std::string _trkSystemName ;
335 
336  bool _getTrackStateAtCaloFace ;
337 
340 
341  static const int _output_track_col_quality_GOOD;
342  static const int _output_track_col_quality_FAIR;
343  static const int _output_track_col_quality_POOR;
344 
345 
346 } ;
347 
348 
351 
352 public:
353 
354  inline bool operator()( ITrack* trackA, ITrack* trackB ){
355 
356 
357  std::vector< IHit* > hitsA = trackA->getHits();
358  std::vector< IHit* > hitsB = trackB->getHits();
359 
360 
361  for( unsigned i=0; i < hitsA.size(); i++){
362 
363  for( unsigned j=0; j < hitsB.size(); j++){
364 
365  if ( hitsA[i] == hitsB[j] ) return false; // a hit is shared -> incompatible
366 
367  }
368 
369  }
370 
371  return true;
372 
373  }
374 
375 };
376 
377 
379 class TrackQIChi2Prob{
380 
381 public:
382 
383  inline double operator()( ITrack* track ){ return track->getChi2Prob(); }
384 
385 
386 };
387 
395 
396 public:
397 
398  inline double operator()( ITrack* track ){
399 
400  if( track->getHits().size() > 3 ){
401 
402  return track->getChi2Prob()/2. +0.5;
403 
404  }
405  else{
406 
407  return track->getChi2Prob()/2.;
408 
409  }
410 
411  }
412 
413 
414 };
415 
416 
417 #endif
418 
419 
420 
std::vector< std::string > _criteriaNames
Names of the used criteria.
Definition: ForwardTracking.h:286
double _overlappingHitsDistMax
the maximum distance of two hits from overlapping petals to be considered as possible part of one tra...
Definition: ForwardTracking.h:313
std::string _bestSubsetFinder
The method used to find the best subset of tracks.
Definition: ForwardTracking.h:325
std::map< std::string, std::vector< float > > _critMaxima
Map containing the name of a criterion and a vector of the maximum cut offs for it.
Definition: ForwardTracking.h:292
int _output_track_col_quality
The quality of the output track collection.
Definition: ForwardTracking.h:339
double _helixFitMax
Cut for the Helix fit ( chi squared / degrees of freedom )
Definition: ForwardTracking.h:265
int _maxHitsPerSector
If this number of hits in a sector is surpassed for any sector, the hits in the sector will be droppe...
Definition: ForwardTracking.h:274
std::vector< ICriterion * > _crit3Vec
A vector of criteria for 3 hits (2 2-hit segments)
Definition: ForwardTracking.h:301
double _chi2ProbCut
Cut for the Kalman Fit (the chi squared probability)
Definition: ForwardTracking.h:262
std::map< int, std::vector< IHit * > > _map_sector_hits
A map to store the hits according to their sectors.
Definition: ForwardTracking.h:283
int _hitsPerTrackMin
Minimum number of hits a track has to have in order to be stored.
Definition: ForwardTracking.h:295
std::map< std::string, std::vector< float > > _critMinima
Map containing the name of a criterion and a vector of the minimum cut offs for it.
Definition: ForwardTracking.h:289
Standallone Forward Tracking Processor for Marlin.
Definition: ForwardTracking.h:107
std::vector< std::string > _FTDHitCollections
Input collection names.
Definition: ForwardTracking.h:249
bool _takeBestVersionOfTrack
true = when adding hits from overlapping petals, store only the best track; false = store all track...
Definition: ForwardTracking.h:318
double _Bz
B field in z direction.
Definition: ForwardTracking.h:259
A functor to return whether two tracks are compatible: The criterion is if they share a Hit or more...
Definition: DDForwardTracking.h:372
std::vector< ICriterion * > _crit4Vec
A vector of criteria for 4 hits (2 3-hit segments)
Definition: ForwardTracking.h:304
A functor to return the quality of a track, which is currently the chi2 probability.
Definition: DDForwardTracking.h:401
int _maxConnectionsAutomaton
the maximum number of connections that are allowed in the automaton, if this value is surpassed...
Definition: ForwardTracking.h:322
std::vector< ICriterion * > _crit2Vec
A vector of criteria for 2 hits (2 1-hit segments)
Definition: ForwardTracking.h:298
std::string _ForwardTrackCollection
Output collection name.
Definition: ForwardTracking.h:252
A functor to return the quality of a track.
Definition: DDForwardTracking.h:416