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 
30 
33 
37 
38 #include "CLHEP/Vector/ThreeVector.h"
39 #include <vector>
40 #include <unordered_map>
41 #include <limits>
42 
47 class MeasurementTracker;
49 class MagneticField;
51 class TrackerGeometry;
52 class TrackerTopology;
53 
54 namespace std{
55  template<>
56  struct hash<std::pair<const GeomDet*,GlobalPoint> > {
57  std::size_t operator()(const std::pair<const GeomDet*,GlobalPoint>& g) const {
58  auto h1 = std::hash<unsigned long long>()((unsigned long long)g.first);
59  unsigned long long k; memcpy(&k, &g.second,sizeof(k));
60  auto h2 = std::hash<unsigned long long>()(k);
61  return h1 ^ (h2 << 1);
62  }
63  };
64 }
65 
67  {
68  public :
69 
73 
74 
75  RecHitWithDist( ConstRecHitPointer rh, float & dphi )
76  : rh_(rh), dphi_(dphi)
77  {}
78 
79  ConstRecHitPointer recHit() const { return rh_ ; }
80  float dPhi() const { return dphi_ ; }
81 
82  void invert() { dphi_*=-1. ; }
83 
84  private :
85 
86  ConstRecHitPointer rh_ ;
87  float dphi_ ;
88 
89  } ;
90 
91 
93  {
94  public :
95 
99 
100  RecHitWithInfo( ConstRecHitPointer rh, int subDet =0,
103  : rh_(rh), subDet_(subDet), dRz_(dRz), dPhi_(dPhi)
104  {}
105 
106  ConstRecHitPointer recHit() const { return rh_; }
107  int subDet() const { return subDet_ ; }
108  float dRz() const { return dRz_ ; }
109  float dPhi() const { return dPhi_ ; }
110 
111  void invert() { dPhi_*=-1. ; }
112 
113  private:
114 
115  ConstRecHitPointer rh_;
116  int subDet_ ;
117  float dRz_ ;
118  float dPhi_ ;
119 
120  } ;
121 
123  {
124  public :
125 
126  SeedWithInfo( TrajectorySeed seed, unsigned char hitsMask, int subDet2, float dRz2, float dPhi2 , int subDet1, float dRz1, float dPhi1)
127  : seed_(seed), hitsMask_(hitsMask),
128  subDet2_(subDet2), dRz2_(dRz2), dPhi2_(dPhi2),
129  subDet1_(subDet1), dRz1_(dRz1), dPhi1_(dPhi1)
130  {}
131 
132  const TrajectorySeed & seed() const { return seed_ ; }
133  unsigned char hitsMask() const { return hitsMask_ ; }
134 
135  int subDet2() const { return subDet2_ ; }
136  float dRz2() const { return dRz2_ ; }
137  float dPhi2() const { return dPhi2_ ; }
138 
139  int subDet1() const { return subDet1_ ; }
140  float dRz1() const { return dRz1_ ; }
141  float dPhi1() const { return dPhi1_ ; }
142 
143  private :
144 
146  unsigned char hitsMask_ ;
147  int subDet2_ ;
148  float dRz2_ ;
149  float dPhi2_ ;
150  int subDet1_ ;
151  float dRz1_ ;
152  float dPhi1_ ;
153  } ;
154 
156  {
157  public :
158 
162  // Next typedef uses double in ROOT 6 rather than Double32_t due to a bug in ROOT 5,
163  // which otherwise would make ROOT5 files unreadable in ROOT6. This does not increase
164  // the size on disk, because due to the bug, double was actually stored on disk in ROOT 5.
165  typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<double> > REPPoint;
166 
168  ( float phi1min, float phi1max,
169  //float phi2min, float phi2max,
170  float phi2minB, float phi2maxB, float phi2minF, float phi2maxF,
171  float z2minB, float z2maxB, float r2minF, float r2maxF,
172  float rMinI, float rMaxI, bool searchInTIDTEC ) ;
173 
174  virtual ~PixelHitMatcher() ;
175  void setES( const MagneticField *, const MeasurementTracker * theMeasurementTracker, const TrackerGeometry * trackerGeometry ) ;
176 
177  void setEvent( const MeasurementTrackerEvent & event ) ;
178 
179  std::vector<SeedWithInfo>
180  compatibleSeeds
181  ( const std::vector<const TrajectorySeedCollection *>& seedsV, const GlobalPoint & xmeas,
182  const GlobalPoint & vprim, float energy, float charge ) ;
183 
184 
185  std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> >
186  compatibleHits(const GlobalPoint& xmeas, const GlobalPoint& vprim,
187  float energy, float charge,
188  const TrackerTopology *tTopo,
189  const NavigationSchool& navigationSchool) ;
190 
191 
192  std::vector<CLHEP::Hep3Vector> predicted1Hits() ;
193  std::vector<CLHEP::Hep3Vector> predicted2Hits();
194 
195  void set1stLayer( float dummyphi1min, float dummyphi1max ) ;
196  void set1stLayerZRange( float zmin1, float zmax1 ) ;
197  //void set2ndLayer( float dummyphi2min, float dummyphi2max ) ;
198  void set2ndLayer( float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF ) ;
199 
200  float getVertex() ;
201  void setUseRecoVertex( bool val ) ;
202 
203  private :
204 
205  RecHitContainer hitsInTrack ;
206 
207  std::vector<CLHEP::Hep3Vector> pred1Meas ;
208  std::vector<CLHEP::Hep3Vector> pred2Meas ;
222 
223  float vertex_;
224 
227  std::unordered_map<std::pair<const GeomDet*,GlobalPoint>, TrajectoryStateOnSurface> mapTsos2_fast_;
228  std::vector<GlobalPoint> hit_gp_map_;
229 } ;
230 
231 #endif
232 
233 
234 
235 
236 
237 
238 
239 
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_
PixelMatchStartLayers startLayers
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