MarlinTrkProcessors  2.4.1
ExtrToSIT.h
1 #ifndef ExtrToSIT_h
2 #define ExtrToSIT_h 1
3 
4 #include <marlin/Processor.h>
5 #include <string>
6 #include <iostream>
7 #include <algorithm>
8 #include <vector>
9 #include <cmath>
10 #include <time.h>
11 #include <math.h>
12 #include <sstream>
13 #include <assert.h>
14 
15 #include <UTIL/LCRelationNavigator.h>
16 #include <UTIL/BitField64.h>
17 #include <UTIL/ILDConf.h>
18 #include <UTIL/BitSet32.h>
19 
20 #include <EVENT/TrackerHit.h>
21 #include <EVENT/SimTrackerHit.h>
22 #include <EVENT/TrackerHitPlane.h>
23 #include <IMPL/TrackerHitImpl.h>
24 #include <EVENT/LCCollection.h>
25 #include <EVENT/LCRelation.h>
26 #include <IMPL/LCCollectionVec.h>
27 #include <IMPL/LCFlagImpl.h>
28 #include <IMPL/LCRelationImpl.h>
29 #include <EVENT/Track.h>
30 #include <IMPL/TrackStateImpl.h>
31 #include <IMPL/TrackImpl.h>
32 
33 #include "KiTrack/SubsetHopfieldNN.h"
34 #include "KiTrack/SubsetSimple.h"
35 
36 //---- GEAR ----
37 #include "marlin/Global.h"
38 #include "gear/GEAR.h"
39 #include <gear/ZPlanarParameters.h>
40 #include <gear/ZPlanarLayerLayout.h>
41 #include "gear/BField.h"
42 
43 // ----- include for verbosity dependend logging ---------
44 #include "marlin/VerbosityLevels.h"
45 
46 #include "MarlinTrk/Factory.h"
47 #include "MarlinTrk/IMarlinTrack.h"
48 #include "MarlinTrk/MarlinTrkUtils.h"
49 #include "MarlinTrk/HelixTrack.h"
50 
51 
52 
53 using namespace KiTrack;
54 namespace MarlinTrk{
55  class IMarlinTrkSystem ;
56 }
57 
58 
59 class ExtrToSIT : public marlin::Processor {
60 
61 public:
62 
63 
64  virtual marlin::Processor* newProcessor() { return new ExtrToSIT ; }
65 
66  ExtrToSIT() ;
67 
71  virtual void init() ;
72 
75  virtual void processRunHeader( lcio::LCRunHeader* run ) ;
76 
79  virtual void processEvent( lcio::LCEvent * evt ) ;
80 
81 
82  virtual void check( lcio::LCEvent * evt ) ;
83 
84 
87  virtual void end() ;
88 
89  void SelectBestCandidate(EVENT::TrackerHitVec &HitsInLayer, const float* &pivot, EVENT::TrackerHit* &BestHit, bool &BestHitFound, int &pointer) ;
90 
91  void SelectBestCandidateLimited(EVENT::TrackerHitVec &HitsInLayer, const float* &pivot, EVENT::TrackerHit* &BestHit, const FloatVec& covLCIO, double& radius, bool &BestHitFound, double &sigma, int &pointer, int &PossibleHits, float &dU, float &dV, double &DimDist, TrackerHitVec &usedSiHits) ;
92 
93  int FitInit( std::vector < TrackerHit* > trackerHits , MarlinTrk::IMarlinTrack* _marlinTrk ) ;
94  int FitInit2( Track* track , MarlinTrk::IMarlinTrack* _marlinTrk ) ;
95 
96  struct compare_r {
97  bool operator()( EVENT::TrackerHit* a, EVENT::TrackerHit* b) const {
98  double r_a_sqd = a->getPosition()[0] * a->getPosition()[0] + a->getPosition()[1] * a->getPosition()[1] ;
99  double r_b_sqd = b->getPosition()[0] * b->getPosition()[0] + b->getPosition()[1] * b->getPosition()[1] ;
100  return ( r_a_sqd < r_b_sqd ) ;
101  }
102  } ;
103 
104 
105 
106 protected:
107 
108  /* helper function to get collection using try catch block */
109  lcio::LCCollection* GetCollection( lcio::LCEvent * evt, std::string colName ) ;
110 
111  /* helper function to get relations using try catch block */
112  lcio::LCRelationNavigator* GetRelations(lcio::LCEvent * evt, std::string RelName ) ;
113 
116  std::string _input_track_col_name ;
117 
120  std::string _input_track_rel_name ;
121 
124  std::string _sitColName ;
125 
128  std::string _vxdColName ;
129 
133 
137 
140  std::string _siTrkColName ;
141 
144  MarlinTrk::IMarlinTrkSystem* _trksystem ;
145 
146  std::string _mcParticleCollectionName ;
147 
148  bool _MSOn ;
149  bool _ElossOn ;
150  bool _SmoothOn ;
151  bool _dirInsideOut ;
152 
153  double _Max_Chi2_Incr ;
154  int _tpcHitsCut ;
155  float _chi2NDoFCut ;
156  float _DoCut ;
157  float _ZoCut ;
158  double _searchSigma ;
159  bool _isSpacePoints ;
160  int _propToLayer ;
161 
162  int _n_run ;
163  int _n_evt ;
164  int SITHitsFitted ;
165  int SITHitsNonFitted ;
166  int TotalSITHits ;
167  int _nHitsChi2 ;
168 
169  float _maxChi2PerHit;
170  float _bField;
171 
172  StringVec _colNamesTrackerHitRelations ;
173 
174 
175 
176 } ;
177 
178 
179 
180 
181 
182 #endif
183 
184 
185 
std::string _output_track_rel_name
Output track relations name for refitting.
Definition: ExtrToSIT.h:136
Definition: ExtrToSIT.h:96
Definition: ExtrToSIT.h:59
std::string _input_track_rel_name
Input track relations name for refitting.
Definition: ExtrToSIT.h:120
std::string _siTrkColName
Output silicon track collection.
Definition: ExtrToSIT.h:140
std::string _vxdColName
Input VXD tracker summer hit collection.
Definition: ExtrToSIT.h:128
std::string _output_track_col_name
refitted track collection name.
Definition: ExtrToSIT.h:132
std::string _sitColName
Input SIT tracker summer hit collection.
Definition: ExtrToSIT.h:124
MarlinTrk::IMarlinTrkSystem * _trksystem
pointer to the IMarlinTrkSystem instance
Definition: ExtrToSIT.h:144
std::string _input_track_col_name
Input track collection name for refitting.
Definition: ExtrToSIT.h:116