ForwardTracking  1.10.0
DDForwardTracking.h
1 #ifndef DDForwardTracking_h
2 #define DDForwardTracking_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 #include "ILDImpl/SectorSystemVXD.h"
19 #include "SectorSystemEndcap.h"
20 #include "EndcapHitSimple.h"
21 
22 using namespace lcio ;
23 using namespace marlin ;
24 using namespace KiTrack;
25 using namespace KiTrackMarlin;
26 
29 typedef std::vector< IHit* > RawTrack;
30 
31 
110 class DDForwardTracking : public Processor {
111 
112  public:
113 
114  virtual Processor* newProcessor() { return new DDForwardTracking ; }
115 
116 
118 
122  virtual void init() ;
123 
126  virtual void processRunHeader( LCRunHeader* run ) ;
127 
181  virtual void processEvent( LCEvent * evt ) ;
182 
183 
184  virtual void check( LCEvent * evt ) ;
185 
186 
189  virtual void end() ;
190 
191 
192 
193  protected:
194 
205  /* std::map< IHit* , std::vector< IHit* > > getOverlapConnectionMap( const std::map< int , std::vector< IHit* > > & map_sector_hits, */
206  /* const SectorSystemFTD* secSysFTD, */
207  /* float distMax); */
208 
209  std::map< IHit* , std::vector< IHit* > > getOverlapConnectionMap( const std::map< int , std::vector< IHit* > > & map_sector_hits,
210  const SectorSystemEndcap* secSysEndcap,
211  float distMax);
212 
222  std::vector < RawTrack > getRawTracksPlusOverlappingHits( RawTrack rawTrack , std::map< IHit* , std::vector< IHit* > >& map_hitFront_hitsBack );
223 
228  void finaliseTrack( TrackImpl* trackImpl );
229 
247  bool setCriteria( unsigned round );
248 
249  // void getCellID0Info(TrackerHit*& trackerHit );
250  void getCellID0Info(LCCollection*& col );
251 
252  void getCellID0AndPositionInfo(LCCollection*& col );
253  /* void getCellID0AndPositionInfo(TrackerHit*& trackerHit ); */
254 
255 
256  EndcapHitSimple* createVirtualIPHit( const SectorSystemEndcap* sectorSystemEndcap );
257 
258 
260  std::string getInfo_map_sector_hits();
261 
262 
264  std::vector<std::string> _FTDHitCollections;
265 
268 
269 
270  int _nDivisionsInPhi;
271  int _nDivisionsInTheta;
272  /* double _dPhi; */
273  /* double _dTheta; */
274 
275 
276  int _nRun ;
277  int _nEvt ;
278 
280  double _Bz;
281 
283  double _chi2ProbCut;
284 
286  double _helixFitMax;
287 
288  // Properties of the Kalman Fit
289  bool _MSOn ;
290  bool _ElossOn ;
291  bool _SmoothOn ;
292 
296 
297 
298  // Properties for the Hopfield Neural Network
299  double _HNN_Omega;
300  double _HNN_ActivationThreshold;
301  double _HNN_TInf;
302 
304  std::map< int , std::vector< IHit* > > _map_sector_hits;
305 
307  std::vector< std::string > _criteriaNames;
308 
310  std::map< std::string , std::vector<float> > _critMinima;
311 
313  std::map< std::string , std::vector<float> > _critMaxima;
314 
317 
319  std::vector <ICriterion*> _crit2Vec;
320 
322  std::vector <ICriterion*> _crit3Vec;
323 
325  std::vector <ICriterion*> _crit4Vec;
326 
327 
328  // const SectorSystemFTD* _sectorSystemFTD;
329  const SectorSystemEndcap* _sectorSystemEndcap;
330 
331 
332  bool _useCED;
333 
336 
341 
345 
347  std::string _bestSubsetFinder;
348 
349  unsigned _nTrackCandidates;
350  unsigned _nTrackCandidatesPlus;
351 
352 
353 
354  MarlinTrk::IMarlinTrkSystem* _trkSystem;
355 
356  std::string _trkSystemName ;
357 
358  bool _getTrackStateAtCaloFace ;
359 
362 
363  static const int _output_track_col_quality_GOOD;
364  static const int _output_track_col_quality_FAIR;
365  static const int _output_track_col_quality_POOR;
366 
367 
368 } ;
369 
370 
373 
374 public:
375 
376  inline bool operator()( ITrack* trackA, ITrack* trackB ){
377 
378 
379  std::vector< IHit* > hitsA = trackA->getHits();
380  std::vector< IHit* > hitsB = trackB->getHits();
381 
382 
383  for( unsigned i=0; i < hitsA.size(); i++){
384 
385  for( unsigned j=0; j < hitsB.size(); j++){
386 
387  if ( hitsA[i] == hitsB[j] ) return false; // a hit is shared -> incompatible
388 
389  }
390 
391  }
392 
393  return true;
394 
395  }
396 
397 };
398 
399 
402 
403 public:
404 
405  inline double operator()( ITrack* track ){ return track->getChi2Prob(); }
406 
407 
408 };
409 
417 
418 public:
419 
420  inline double operator()( ITrack* track ){
421 
422  if( track->getHits().size() > 3 ){
423 
424  return track->getChi2Prob()/2. +0.5;
425 
426  }
427  else{
428 
429  return track->getChi2Prob()/2.;
430 
431  }
432 
433  }
434 
435 
436 };
437 
438 
439 
440 
442 
443 public:
444 
445  inline double operator()( ITrack* track ){ return track->getHits().size(); }
446 
447 };
448 
449 
450 #endif
451 
452 
453 
Standallone Forward Tracking Processor for Marlin.
Definition: DDForwardTracking.h:110
int _maxHitsPerSector
If this number of hits in a sector is surpassed for any sector, the hits in the sector will be droppe...
Definition: DDForwardTracking.h:295
int _output_track_col_quality
The quality of the output track collection.
Definition: DDForwardTracking.h:361
std::vector< ICriterion * > _crit3Vec
A vector of criteria for 3 hits (2 2-hit segments)
Definition: DDForwardTracking.h:322
std::vector< ICriterion * > _crit4Vec
A vector of criteria for 4 hits (2 3-hit segments)
Definition: DDForwardTracking.h:325
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: DDForwardTracking.h:310
bool _takeBestVersionOfTrack
true = when adding hits from overlapping petals, store only the best track; false = store all track...
Definition: DDForwardTracking.h:340
A hit.
Definition: EndcapHitSimple.h:15
double _chi2ProbCut
Cut for the Kalman Fit (the chi squared probability)
Definition: DDForwardTracking.h:283
std::string _bestSubsetFinder
The method used to find the best subset of tracks.
Definition: DDForwardTracking.h:347
int _maxConnectionsAutomaton
the maximum number of connections that are allowed in the automaton, if this value is surpassed...
Definition: DDForwardTracking.h:344
double _helixFitMax
Cut for the Helix fit ( chi squared / degrees of freedom )
Definition: DDForwardTracking.h:286
double _Bz
B field in z direction.
Definition: DDForwardTracking.h:280
int _hitsPerTrackMin
Minimum number of hits a track has to have in order to be stored.
Definition: DDForwardTracking.h:316
std::string _ForwardTrackCollection
Output collection name.
Definition: DDForwardTracking.h:267
Definition: DDForwardTracking.h:441
A Sector System class for the Forward Tracking Disks FTD in the ILD.
Definition: SectorSystemEndcap.h:29
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: DDForwardTracking.h:313
std::vector< ICriterion * > _crit2Vec
A vector of criteria for 2 hits (2 1-hit segments)
Definition: DDForwardTracking.h:319
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< std::string > _FTDHitCollections
Input collection names.
Definition: DDForwardTracking.h:264
double _overlappingHitsDistMax
the maximum distance of two hits from overlapping petals to be considered as possible part of one tra...
Definition: DDForwardTracking.h:335
A functor to return the quality of a track, which is currently the chi2 probability.
Definition: DDForwardTracking.h:401
std::vector< std::string > _criteriaNames
Names of the used criteria.
Definition: DDForwardTracking.h:307
std::map< int, std::vector< IHit * > > _map_sector_hits
A map to store the hits according to their sectors.
Definition: DDForwardTracking.h:304
A functor to return the quality of a track.
Definition: DDForwardTracking.h:416