CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProjectedRecHit2D.cc
Go to the documentation of this file.
5 
6 
8  const GeomDet* det, const GeomDet* originalDet,
9  const TransientTrackingRecHit& originalTransientHit) :
10  GenericTransientTrackingRecHit( det, new ProjectedSiStripRecHit2D( pos, err, det->geographicalId(),
11  static_cast<const SiStripRecHit2D*>(originalTransientHit.hit()) ) )
12 {
13  const TSiStripRecHit2DLocalPos* specificOriginalTransientHit = static_cast<const TSiStripRecHit2DLocalPos*>(&originalTransientHit);
14  theCPE = specificOriginalTransientHit->cpe();
16 }
17 
20 {
21  if (theCPE != 0) {
23  if(!originalHit().cluster().isNull()){
24  const SiStripCluster& clust = *(originalHit().cluster());
25 
26  const GeomDetUnit * gdu = reinterpret_cast<const GeomDetUnit *>(theOriginalDet);
27  //if (!gdu) std::cout<<"no luck dude"<<std::endl;
29  theCPE->localParameters( clust, *gdu, ts);
30 
31  RecHitPointer updatedOriginalHit =
32  TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet,
33  originalHit().cluster(), theCPE);
34 
35  RecHitPointer hit = proj.project( *updatedOriginalHit, *det(), ts);
36 
37  return hit;
38  }else{
39  const SiStripCluster& clust = *(originalHit().cluster_regional());
40 
41  const GeomDetUnit * gdu = reinterpret_cast<const GeomDetUnit *>(theOriginalDet);
43  theCPE->localParameters( clust, *gdu, ts);
44 
45  RecHitPointer updatedOriginalHit =
46  TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet,
47  originalHit().cluster_regional(), theCPE);
48 
49  RecHitPointer hit = proj.project( *updatedOriginalHit, *det(), ts);
50 
51  return hit;
52 
53  }
54  }
56  else return clone();
57 }
58 
63 
64  return result;
65 }
66 
68  const ProjectedSiStripRecHit2D* rh,
70  bool computeCoarseLocalPosition) :
71  GenericTransientTrackingRecHit( geom, *rh), theCPE(cpe), theOriginalDet(originaldet) {
72  if (computeCoarseLocalPosition){
73  if (theCPE != 0) {
75  if(!originalHit().cluster().isNull()){
76  const SiStripCluster& clust = *(originalHit().cluster());
77 
79  theCPE->localParameters( clust, *detUnit());
80 
81  RecHitPointer updatedOriginalHit =
82  TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet,
83  originalHit().cluster(), theCPE);
84 
85  RecHitPointer hit = proj.project( *updatedOriginalHit, *det());
86  trackingRecHit_ = hit->hit()->clone();
87  }else{
88  const SiStripCluster& clust = *(originalHit().cluster_regional());
89 
91  theCPE->localParameters( clust, *detUnit());
92 
93  RecHitPointer updatedOriginalHit =
94  TSiStripRecHit2DLocalPos::build( lv.first, lv.second, theOriginalDet,
95  originalHit().cluster_regional(), theCPE);
96 
97  RecHitPointer hit = proj.project( *updatedOriginalHit, *det());
98  trackingRecHit_ = hit->hit()->clone();
99  }
100  }
101  }
102 }
static RecHitPointer build(const GeomDet *geom, const SiStripRecHit2D *rh, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition=false)
const StripClusterParameterEstimator * theCPE
ClusterRegionalRef cluster_regional() const
virtual const TrackingRecHit * hit() const
const SiStripRecHit2D & originalHit() const
std::pair< LocalPoint, LocalError > LocalValues
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
virtual ProjectedRecHit2D * clone() const
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.
const StripClusterParameterEstimator * cpe() const
const GeomDet * originalDet() const
tuple result
Definition: query.py:137
const GeomDetUnit * detUnit() const
ClusterRef cluster() const
std::vector< ConstRecHitPointer > ConstRecHitContainer
ProjectedRecHit2D(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const GeomDet *originaldet, const TransientTrackingRecHit &originalHit)
string const
Definition: compareJSON.py:14
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
const GeomDet * theOriginalDet