MarlinTrkProcessors  2.4.1
DDSpacePointBuilder.h
1 #ifndef DDSpacePointBuilder_h
2 #define DDSpacePointBuilder_h 1
3 
4 #include "marlin/Processor.h"
5 #include "lcio.h"
6 #include <string>
7 #include <map>
8 #include <EVENT/TrackerHit.h>
9 #include <EVENT/TrackerHitPlane.h>
10 #include <IMPL/TrackerHitImpl.h>
11 
12 #include "CLHEP/Vector/ThreeVector.h"
13 #include "CLHEP/Vector/Rotation.h"
14 
15 // DD4HEP classes
16 #include "DDSurfaces/Vector2D.h"
17 #include "DDSurfaces/Vector3D.h"
18 #include "DDSurfaces/ISurface.h"
19 #include "DD4hep/LCDD.h"
20 #include "DDRec/SurfaceManager.h"
21 #include "DDRec/SurfaceHelper.h"
22 #include "DD4hep/DD4hepUnits.h"
23 
24 using namespace lcio ;
25 using namespace marlin ;
26 
27 
28 
29 
30 
66 class DDSpacePointBuilder : public Processor {
67 
68  public:
69 
70  virtual Processor* newProcessor() { return new DDSpacePointBuilder ; }
71 
72 
74 
78  virtual void init() ;
79 
82  virtual void processRunHeader( LCRunHeader* run ) ;
83 
86  virtual void processEvent( LCEvent * evt ) ;
87 
88 
89  virtual void check( LCEvent * evt ) ;
90 
91 
94  virtual void end() ;
95 
96 
97 
98 
99  protected:
100 
101 
102 
106 
110 
114 
117  std::string _relColName;
118 
124  static int calculateXingPoint( double x1, double y1, float ex1, float ey1, double x2, double y2, float ex2, float ey2, double& x, double& y );
125 
148  static int calculatePointBetweenTwoLines(
149  const CLHEP::Hep3Vector& P1,
150  const CLHEP::Hep3Vector& V1,
151  const CLHEP::Hep3Vector& P2,
152  const CLHEP::Hep3Vector& V2,
153  CLHEP::Hep3Vector& point );
154 
155 
156 
168  static int calculatePointBetweenTwoLines_UsingVertex(
169  const CLHEP::Hep3Vector& PA,
170  const CLHEP::Hep3Vector& PB,
171  const CLHEP::Hep3Vector& PC,
172  const CLHEP::Hep3Vector& PD,
173  const CLHEP::Hep3Vector& Vertex,
174  CLHEP::Hep3Vector& point);
175 
176 
178  //TrackerHitImpl* createSpacePoint( TrackerHitPlane* a , TrackerHitPlane* b, double stripLength, const DD4hep::DDRec::SurfaceMap* surfMap );
179  TrackerHitImpl* createSpacePoint( TrackerHitPlane* a , TrackerHitPlane* b, double stripLength );
180 // TrackerHitImpl* createSpacePointOld( TrackerHitPlane* a , TrackerHitPlane* b );
181 
187  std::vector< int > getCellID0sAtBack( int cellID0 );
188 
189  std::vector< int > getCellID0sAtBackOfFTD( int cellID0 );
190 
191  std::vector< int > getCellID0sAtBackOfSET( int cellID0 );
192 
193  std::vector< int > getCellID0sAtBackOfSIT( int cellID0 );
194 
195 
197  std::string getCellID0Info( int cellID0 );
198 
199 
200  int _nRun ;
201  int _nEvt ;
202 
203  unsigned _nOutOfBoundary;
204  unsigned _nStripsTooParallel;
205  unsigned _nPlanesNotParallel;
206 
207  float _nominal_vertex_x;
208  float _nominal_vertex_y;
209  float _nominal_vertex_z;
210 
211  CLHEP::Hep3Vector _nominal_vertex;
212 
213  float _striplength_tolerance;
214 
215  double _striplength ;
216  std::string _subDetName ;
217 
218  //DD4hep::Geometry::LCDD& lcdd;
219  const DD4hep::DDRec::SurfaceMap* surfMap ;
220 
221 } ;
222 
223 #endif
224 
225 
226 
std::string _TrackerHitCollection
Input collection name.
Definition: DDSpacePointBuilder.h:105
std::string _relColName
Output relations collection name.
Definition: DDSpacePointBuilder.h:117
================= FTD Space Point Builder =================
Definition: DDSpacePointBuilder.h:66
std::string _SpacePointsCollection
Output collection name.
Definition: DDSpacePointBuilder.h:113
std::string _TrackerHitSimHitRelCollection
Input relation collection name.
Definition: DDSpacePointBuilder.h:109