CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSiStripRecHit1D.cc
Go to the documentation of this file.
6 
7 #include<limits>
8 
9 TSiStripRecHit1D::TSiStripRecHit1D (const GeomDet * geom, const SiStripRecHit1D* rh,
11  bool computeCoarseLocalPosition) :
12 TValidTrackingRecHit(geom), theCPE(cpe)
13 {
14  if (rh->hasPositionAndError() || !computeCoarseLocalPosition)
15  theHitData = SiStripRecHit1D(*rh);
16  else{
17  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(geom);
18  LogDebug("TSiStripRecHit2DLocalPos")<<"calculating coarse position/error.";
19  if (gdu){
20  if (rh->cluster().isNonnull()){
21  StripClusterParameterEstimator::LocalValues lval= theCPE->localParameters(*rh->cluster(), *gdu);
22  LocalError le(lval.second.xx(),0.,std::numeric_limits<float>::max()); //Correct??
23  theHitData = SiStripRecHit1D(lval.first, le, geom->geographicalId(),rh->cluster());
24  }else{
25  StripClusterParameterEstimator::LocalValues lval= theCPE->localParameters(*rh->cluster_regional(), *gdu);
26  LocalError le(lval.second.xx(),0.,std::numeric_limits<float>::max()); //Correct??
27  theHitData = SiStripRecHit1D(lval.first, le, geom->geographicalId(),rh->cluster_regional());
28  }
29  }else{
30  edm::LogError("TSiStripRecHit2DLocalPos")<<" geomdet does not cast into geomdet unit. cannot create strip local parameters.";
31  theHitData = SiStripRecHit1D(*rh);
32  }
33  }
34 }
35 
38 {
39  if (theCPE != 0) {
41  const SiStripCluster& clust = specificHit()->stripCluster();
43  theCPE->localParameters( clust, *detUnit(), ts);
44  LocalError le(lv.second.xx(),0.,std::numeric_limits<float>::max()); //Correct??
45  return TSiStripRecHit1D::build( lv.first, le, det(), specificHit()->omniClusterRef(), theCPE);
46  }
47  else {
48  //FIXME. It should report the problem with a LogWarning;
49  return clone();
50  }
51 }
52 
53 const GeomDetUnit* TSiStripRecHit1D::detUnit() const
54 {
55  return static_cast<const GeomDetUnit*>(det());
56 }
#define LogDebug(id)
std::pair< LocalPoint, LocalError > LocalValues
const T & max(const T &a, const T &b)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135