CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSiPixelRecHit.cc
Go to the documentation of this file.
5 #include<typeinfo>
6 
7 TSiPixelRecHit::RecHitPointer TSiPixelRecHit::clone (const TrajectoryStateOnSurface& ts) const
8 {
9  if (theCPE == 0){
10  return new TSiPixelRecHit( det(), &theHitData, 0,false);
11  }else{
12  const SiPixelCluster& clust = *specificHit()->cluster();
14  theCPE->localParameters( clust, *detUnit(), ts);
15  return TSiPixelRecHit::build( lv.first, lv.second, det(), specificHit()->cluster(), theCPE);
16  }
17 }
18 
19 const GeomDetUnit* TSiPixelRecHit::detUnit() const
20 {
21  return static_cast<const GeomDetUnit*>(det());
22 }
23 
24 
25 
26 // This private constructor copies the TrackingRecHit. It should be used when the
27 // TrackingRecHit exist already in some collection.
28 TSiPixelRecHit::TSiPixelRecHit(const GeomDet * geom, const SiPixelRecHit* rh,
30  bool computeCoarseLocalPosition) :
31  TValidTrackingRecHit(geom, *rh), theCPE(cpe), theHitData(*rh)
32 {
33  if (! (rh->hasPositionAndError() || !computeCoarseLocalPosition)) {
34  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(geom);
35  if (gdu){
36  PixelClusterParameterEstimator::LocalValues lval= theCPE->localParameters(*rh->cluster(), *gdu);
37  LogDebug("TSiPixelRecHit")<<"calculating coarse position/error.";
38  theHitData = SiPixelRecHit(lval.first, lval.second,geom->geographicalId(),rh->cluster());
39  }else{
40  edm::LogError("TSiPixelRecHit") << " geomdet does not cast into geomdet unit. cannot create pixel local parameters.";
41  }
42  }
43 
44  // Additionally, fill the SiPixeRecHitQuality from the PixelCPE.
45  theHitData.setRawQualityWord( cpe->rawQualityWord() );
46  theClusterProbComputationFlag = cpe->clusterProbComputationFlag();
47 
48 }
49 
50 
51 
52 // Another private constructor. It creates the TrackingRecHit internally,
53 // avoiding redundent cloning.
54 TSiPixelRecHit::TSiPixelRecHit( const LocalPoint& pos, const LocalError& err,
55  const GeomDet* det,
56  clusterRef const & clust,
57  const PixelClusterParameterEstimator* cpe) :
58  TValidTrackingRecHit(det), theCPE(cpe),
59  theHitData( pos, err, det->geographicalId(), clust)
60 {
61  // Additionally, fill the SiPixeRecHitQuality from the PixelCPE.
62  theHitData.setRawQualityWord( cpe->rawQualityWord() );
63  theClusterProbComputationFlag = cpe->clusterProbComputationFlag();
64 }
65 
#define LogDebug(id)
virtual SiPixelRecHitQuality::QualWordType rawQualityWord() const
std::pair< LocalPoint, LocalError > LocalValues
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
Pixel cluster – collection of neighboring pixels above threshold.
Pixel Reconstructed Hit.