test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 class NavigationSchool;
54 
55 namespace std{
56  template<>
57  struct hash<std::pair<const GeomDet*,GlobalPoint> > {
58  std::size_t operator()(const std::pair<const GeomDet*,GlobalPoint>& g) const {
59  std::size_t hsh = 5381;
60  hsh = ((hsh << 5) + hsh) + (unsigned long)g.first;
61  hsh = ((hsh << 5) + hsh) + 10000*g.second.x();
62  hsh = ((hsh << 5) + hsh) + 10000*g.second.y();
63  hsh = ((hsh << 5) + hsh) + 10000*g.second.z();
64  return hsh;
65  }
66  };
67  template<>
68  struct equal_to<std::pair<const GeomDet*,GlobalPoint> > : public std::binary_function<std::pair<const GeomDet*,GlobalPoint>,std::pair<const GeomDet*,GlobalPoint>,bool> {
69  bool operator()(const std::pair<const GeomDet*,GlobalPoint>& a,
70  const std::pair<const GeomDet*,GlobalPoint>& b) const {
71  return ( a.first == b.first &&
72  a.second.x() == b.second.x() &&
73  a.second.y() == b.second.y() &&
74  a.second.z() == b.second.z() );
75  }
76  };
77 }
78 
80  {
81  public :
82 
86 
87 
88  RecHitWithDist( ConstRecHitPointer rh, float & dphi )
89  : rh_(rh), dphi_(dphi)
90  {}
91 
92  ConstRecHitPointer recHit() const { return rh_ ; }
93  float dPhi() const { return dphi_ ; }
94 
95  void invert() { dphi_*=-1. ; }
96 
97  private :
98 
100  float dphi_ ;
101 
102  } ;
103 
104 
106  {
107  public :
108 
112 
116  : rh_(rh), subDet_(subDet), dRz_(dRz), dPhi_(dPhi)
117  {}
118 
119  ConstRecHitPointer recHit() const { return rh_; }
120  int subDet() const { return subDet_ ; }
121  float dRz() const { return dRz_ ; }
122  float dPhi() const { return dPhi_ ; }
123 
124  void invert() { dPhi_*=-1. ; }
125 
126  private:
127 
129  int subDet_ ;
130  float dRz_ ;
131  float dPhi_ ;
132 
133  } ;
134 
136  {
137  public :
138 
139  SeedWithInfo( TrajectorySeed seed, unsigned char hitsMask, int subDet2, float dRz2, float dPhi2 , int subDet1, float dRz1, float dPhi1)
140  : seed_(seed), hitsMask_(hitsMask),
141  subDet2_(subDet2), dRz2_(dRz2), dPhi2_(dPhi2),
142  subDet1_(subDet1), dRz1_(dRz1), dPhi1_(dPhi1)
143  {}
144 
145  const TrajectorySeed & seed() const { return seed_ ; }
146  unsigned char hitsMask() const { return hitsMask_ ; }
147 
148  int subDet2() const { return subDet2_ ; }
149  float dRz2() const { return dRz2_ ; }
150  float dPhi2() const { return dPhi2_ ; }
151 
152  int subDet1() const { return subDet1_ ; }
153  float dRz1() const { return dRz1_ ; }
154  float dPhi1() const { return dPhi1_ ; }
155 
156  private :
157 
159  unsigned char hitsMask_ ;
160  int subDet2_ ;
161  float dRz2_ ;
162  float dPhi2_ ;
163  int subDet1_ ;
164  float dRz1_ ;
165  float dPhi1_ ;
166  } ;
167 
169  {
170  public :
171 
175  typedef ROOT::Math::PositionVector3D<ROOT::Math::CylindricalEta3D<Double32_t> > REPPoint;
176 
178  ( float phi1min, float phi1max,
179  //float phi2min, float phi2max,
180  float phi2minB, float phi2maxB, float phi2minF, float phi2maxF,
181  float z2minB, float z2maxB, float r2minF, float r2maxF,
182  float rMinI, float rMaxI, bool searchInTIDTEC ) ;
183 
184  virtual ~PixelHitMatcher() ;
185  void setES( const MagneticField *, const MeasurementTracker * theMeasurementTracker, const TrackerGeometry * trackerGeometry ) ;
186 
187  void setEvent( const MeasurementTrackerEvent & event ) ;
188 
189  std::vector<std::pair<RecHitWithDist,ConstRecHitPointer> >
190  compatibleHits(const GlobalPoint& xmeas, const GlobalPoint& vprim,
191  float energy, float charge,
192  const TrackerTopology *tTopo,
193  const NavigationSchool& navigationSchool) ;
194 
195  // compatibleSeeds(edm::Handle<TrajectorySeedCollection> &seeds, const GlobalPoint& xmeas,
196  std::vector<SeedWithInfo>
198  ( TrajectorySeedCollection * seeds, const GlobalPoint & xmeas,
199  const GlobalPoint & vprim, float energy, float charge ) ;
200 
201  std::vector<CLHEP::Hep3Vector> predicted1Hits() ;
202  std::vector<CLHEP::Hep3Vector> predicted2Hits();
203 
204  void set1stLayer( float dummyphi1min, float dummyphi1max ) ;
205  void set1stLayerZRange( float zmin1, float zmax1 ) ;
206  //void set2ndLayer( float dummyphi2min, float dummyphi2max ) ;
207  void set2ndLayer( float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF ) ;
208 
209  float getVertex() ;
210  void setUseRecoVertex( bool val ) ;
211 
212  private :
213 
215 
216  std::vector<CLHEP::Hep3Vector> pred1Meas ;
217  std::vector<CLHEP::Hep3Vector> pred2Meas ;
231 
232  float vertex_;
233 
236  std::unordered_map<const GeomDet*, TrajectoryStateOnSurface> mapTsos_fast_;
237  std::unordered_map<std::pair<const GeomDet*,GlobalPoint>, TrajectoryStateOnSurface> mapTsos2_fast_;
238  std::vector<GlobalPoint> hit_gp_map_;
239 } ;
240 
241 #endif
242 
243 
244 
245 
246 
247 
248 
249 
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
BarrelMeasurementEstimator meas1stBLayer
TrajectorySeed seed_
float dPhi() const
void setEvent(const MeasurementTrackerEvent &event)
PropagatorWithMaterial * prop1stLayer
void setES(const MagneticField *, const MeasurementTracker *theMeasurementTracker, const TrackerGeometry *trackerGeometry)
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)
double charge(const std::vector< uint8_t > &Ampls)
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
void set2ndLayer(float dummyphi2minB, float dummyphi2maxB, float dummyphi2minF, float dummyphi2maxF)
std::vector< GlobalPoint > hit_gp_map_
void set1stLayerZRange(float zmin1, float zmax1)
PixelHitMatcher(float phi1min, float phi1max, float phi2minB, float phi2maxB, float phi2minF, float phi2maxF, float z2minB, float z2maxB, float r2minF, float r2maxF, float rMinI, float rMaxI, bool searchInTIDTEC)
std::vector< TrajectorySeed > TrajectorySeedCollection
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
ConstRecHitPointer recHit() const
LayerMeasurements theLayerMeasurements
TransientTrackingRecHit::RecHitContainer RecHitContainer
const double infinity
const MagneticField * theMagField
const MeasurementTrackerEvent * theTrackerEvent
std::vector< CLHEP::Hep3Vector > predicted1Hits()
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::shared_ptr< TrackingRecHit const > RecHitPointer
float dPhi1() const
float dPhi2() const
unsigned char hitsMask_
void set1stLayer(float dummyphi1min, float dummyphi1max)
PixelMatchStartLayers startLayers
std::size_t operator()(const std::pair< const GeomDet *, GlobalPoint > &g) const
double b
Definition: hdecay.h:120
const GeometricSearchTracker * theGeometricSearchTracker
float dPhi() const
std::vector< CLHEP::Hep3Vector > pred2Meas
virtual ~PixelHitMatcher()
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
ForwardMeasurementEstimator meas2ndFLayer
bool operator()(const std::pair< const GeomDet *, GlobalPoint > &a, const std::pair< const GeomDet *, GlobalPoint > &b) const
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< Double32_t > > REPPoint
PropagatorWithMaterial * prop2ndLayer
std::unordered_map< const GeomDet *, TrajectoryStateOnSurface > mapTsos_fast_
ForwardMeasurementEstimator meas1stFLayer
double a
Definition: hdecay.h:121
ConstRecHitPointer rh_
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
int subDet1() const
TransientTrackingRecHit::RecHitPointer RecHitPointer
int subDet2() const
std::vector< SeedWithInfo > compatibleSeeds(TrajectorySeedCollection *seeds, const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, float charge)
const TrajectorySeed & seed() const
std::vector< CLHEP::Hep3Vector > predicted2Hits()
RecHitContainer hitsInTrack
std::vector< std::pair< RecHitWithDist, ConstRecHitPointer > > compatibleHits(const GlobalPoint &xmeas, const GlobalPoint &vprim, float energy, float charge, const TrackerTopology *tTopo, const NavigationSchool &navigationSchool)
void setUseRecoVertex(bool val)
ConstRecHitPointer recHit() const
std::unordered_map< std::pair< const GeomDet *, GlobalPoint >, TrajectoryStateOnSurface > mapTsos2_fast_
const TrackerGeometry * theTrackerGeometry
RecHitWithDist(ConstRecHitPointer rh, float &dphi)
const MeasurementTracker * theTracker