CMS 3D CMS Logo

PixelHitMatcher.h
Go to the documentation of this file.
1 #ifndef PIXELHITMATCHER_H
2 #define PIXELHITMATCHER_H
3 
4 // -*- C++ -*-
5 //
6 // Package: EgammaElectronAlgos
7 // Class: PixelHitMatcher
8 //
17 //
18 // Original Author: Ursula Berthon, Claude Charlot
19 // Created: Mon Mar 27 13:22:06 CEST 2006
20 //
21 //
22 
25 
29 
32 
36 
37 #include "CLHEP/Vector/ThreeVector.h"
38 #include <vector>
39 #include <unordered_map>
40 #include <limits>
41 
46 class MeasurementTracker;
48 class MagneticField;
50 class TrackerGeometry;
51 class TrackerTopology;
52 
53 namespace std{
54  template<>
55  struct hash<std::pair<const GeomDet*,GlobalPoint> > {
56  std::size_t operator()(const std::pair<const GeomDet*,GlobalPoint>& g) const {
57  auto h1 = std::hash<unsigned long long>()((unsigned long long)g.first);
58  unsigned long long k; memcpy(&k, &g.second,sizeof(k));
59  auto h2 = std::hash<unsigned long long>()(k);
60  return h1 ^ (h2 << 1);
61  }
62  };
63 }
64 
66  {
67  public :
68 
72 
73 
74  RecHitWithDist( ConstRecHitPointer rh, float & dphi )
75  : rh_(rh), dphi_(dphi)
76  {}
77 
78  ConstRecHitPointer recHit() const { return rh_ ; }
79  float dPhi() const { return dphi_ ; }
80 
81  void invert() { dphi_*=-1. ; }
82 
83  private :
84 
85  ConstRecHitPointer rh_ ;
86  float dphi_ ;
87 
88  } ;
89 
90 
92  {
93  public :
94 
98 
99  RecHitWithInfo( ConstRecHitPointer rh, int subDet =0,
102  : rh_(rh), subDet_(subDet), dRz_(dRz), dPhi_(dPhi)
103  {}
104 
105  ConstRecHitPointer recHit() const { return rh_; }
106  int subDet() const { return subDet_ ; }
107  float dRz() const { return dRz_ ; }
108  float dPhi() const { return dPhi_ ; }
109 
110  void invert() { dPhi_*=-1. ; }
111 
112  private:
113 
114  ConstRecHitPointer rh_;
115  int subDet_ ;
116  float dRz_ ;
117  float dPhi_ ;
118 
119  } ;
120 
122  {
123  public :
124 
125  SeedWithInfo( TrajectorySeed seed, unsigned char hitsMask, int subDet2, float dRz2, float dPhi2 , int subDet1, float dRz1, float dPhi1)
126  : seed_(seed), hitsMask_(hitsMask),
127  subDet2_(subDet2), dRz2_(dRz2), dPhi2_(dPhi2),
128  subDet1_(subDet1), dRz1_(dRz1), dPhi1_(dPhi1)
129  {}
130 
131  const TrajectorySeed & seed() const { return seed_ ; }
132  unsigned char hitsMask() const { return hitsMask_ ; }
133 
134  int subDet2() const { return subDet2_ ; }
135  float dRz2() const { return dRz2_ ; }
136  float dPhi2() const { return dPhi2_ ; }
137 
138  int subDet1() const { return subDet1_ ; }
139  float dRz1() const { return dRz1_ ; }
140  float dPhi1() const { return dPhi1_ ; }
141 
142  private :
143 
145  unsigned char hitsMask_ ;
146  int subDet2_ ;
147  float dRz2_ ;
148  float dPhi2_ ;
149  int subDet1_ ;
150  float dRz1_ ;
151  float dPhi1_ ;
152  } ;
153 
155  {
156  public :
157 
161  // Next typedef uses double in ROOT 6 rather than Double32_t due to a bug in ROOT 5,
162  // which otherwise would make ROOT5 files unreadable in ROOT6. This does not increase
163  // the size on disk, because due to the bug, double was actually stored on disk in ROOT 5.
164  typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<double> > REPPoint;
165 
167  ( float phi1min, float phi1max,
168  //float phi2min, float phi2max,
169  float phi2minB, float phi2maxB, float phi2minF, float phi2maxF,
170  float z2minB, float z2maxB, float r2minF, float r2maxF,
171  float rMinI, float rMaxI, bool searchInTIDTEC ) ;
172 
173  virtual ~PixelHitMatcher() ;
174  void setES( const MagneticField *, const MeasurementTracker * theMeasurementTracker, const TrackerGeometry * trackerGeometry ) ;
175 
176  void setEvent( const MeasurementTrackerEvent & event ) ;
177 
178  std::vector<SeedWithInfo>
179  compatibleSeeds
180  ( const std::vector<const TrajectorySeedCollection *>& seedsV, const GlobalPoint & xmeas,
181  const GlobalPoint & vprim, float energy, float charge ) ;
182 
183 
184  std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> >
185  compatibleHits(const GlobalPoint& xmeas, const GlobalPoint& vprim,
186  float energy, float charge,
187  const TrackerTopology *tTopo,
188  const NavigationSchool& navigationSchool) ;
189 
190 
191  std::vector<CLHEP::Hep3Vector> predicted1Hits() ;
192  std::vector<CLHEP::Hep3Vector> predicted2Hits();
193 
194  void set1stLayer( float dummyphi1min, float dummyphi1max ) ;
195  void set1stLayerZRange( float zmin1, float zmax1 ) ;
196  //void set2ndLayer( float dummyphi2min, float dummyphi2max ) ;
197  void set2ndLayer( float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF ) ;
198 
199  float getVertex() ;
200  void setUseRecoVertex( bool val ) ;
201 
202  private :
203 
204  RecHitContainer hitsInTrack ;
205 
206  std::vector<CLHEP::Hep3Vector> pred1Meas ;
207  std::vector<CLHEP::Hep3Vector> pred2Meas ;
220 
221  float vertex_;
222 
225  std::unordered_map<std::pair<const GeomDet*,GlobalPoint>, TrajectoryStateOnSurface> mapTsos2_fast_;
226  std::vector<GlobalPoint> hit_gp_map_;
227 } ;
228 
229 #endif
230 
231 
232 
233 
234 
235 
236 
237 
TransientTrackingRecHit::RecHitPointer RecHitPointer
TransientTrackingRecHit::RecHitPointer RecHitPointer
int subDet() const
BarrelMeasurementEstimator meas2ndBLayer
RecHitWithInfo(ConstRecHitPointer rh, int subDet=0, float dRz=std::numeric_limits< float >::infinity(), float dPhi=std::numeric_limits< float >::infinity())
TransientTrackingRecHit::RecHitContainer RecHitContainer
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
BarrelMeasurementEstimator meas1stBLayer
TrajectorySeed seed_
float dPhi() const
PropagatorWithMaterial * prop1stLayer
float dRz1() const
std::vector< CLHEP::Hep3Vector > pred1Meas
unsigned char hitsMask() const
float dRz2() const
std::vector< ConstRecHitPointer > RecHitContainer
TransientTrackingRecHit::RecHitContainer RecHitContainer
float dRz() const
SeedWithInfo(TrajectorySeed seed, unsigned char hitsMask, int subDet2, float dRz2, float dPhi2, int subDet1, float dRz1, float dPhi1)
ConstRecHitPointer rh_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::vector< GlobalPoint > hit_gp_map_
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
rMaxI
intermediate region SC in EB and 2nd hits in PXF
ConstRecHitPointer recHit() const
LayerMeasurements theLayerMeasurements
TransientTrackingRecHit::RecHitContainer RecHitContainer
const double infinity
const MagneticField * theMagField
const MeasurementTrackerEvent * theTrackerEvent
std::shared_ptr< TrackingRecHit const > RecHitPointer
int k[5][pyjets_maxn]
float dPhi1() const
float dPhi2() const
unsigned char hitsMask_
std::size_t operator()(const std::pair< const GeomDet *, GlobalPoint > &g) const
const GeometricSearchTracker * theGeometricSearchTracker
float dPhi() const
std::vector< CLHEP::Hep3Vector > pred2Meas
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
ForwardMeasurementEstimator meas2ndFLayer
PropagatorWithMaterial * prop2ndLayer
ForwardMeasurementEstimator meas1stFLayer
ConstRecHitPointer rh_
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
int subDet1() const
TransientTrackingRecHit::RecHitPointer RecHitPointer
int subDet2() const
const TrajectorySeed & seed() const
RecHitContainer hitsInTrack
ConstRecHitPointer recHit() const
std::unordered_map< std::pair< const GeomDet *, GlobalPoint >, TrajectoryStateOnSurface > mapTsos2_fast_
const TrackerGeometry * theTrackerGeometry
Definition: event.py:1
RecHitWithDist(ConstRecHitPointer rh, float &dphi)
const MeasurementTracker * theTracker