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 
11  bool computeCoarseLocalPosition) :
12 TransientTrackingRecHit(geom), theCPE(cpe)
13 {
14  if (rh->hasPositionAndError() || !computeCoarseLocalPosition)
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()){
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{
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.";
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 
54 {
55  return static_cast<const GeomDetUnit*>(det());
56 }
#define LogDebug(id)
ClusterRef cluster() const
bool hasPositionAndError() const
to be redefined by daughter class
ClusterRegionalRef cluster_regional() const
const SiStripRecHit1D * specificHit() const
std::pair< LocalPoint, LocalError > LocalValues
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const StripClusterParameterEstimator * theCPE
const T & max(const T &a, const T &b)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
SiStripCluster const & stripCluster() const
SiStripRecHit1D theHitData
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
TSiStripRecHit1D(const GeomDet *geom, const SiStripRecHit1D *rh, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition)
static RecHitPointer build(const GeomDet *geom, const SiStripRecHit1D *rh, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition=false)
virtual const GeomDetUnit * detUnit() const
virtual TSiStripRecHit1D * clone() const
unsigned long long le
Definition: VDTMath.h:202