CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkPixelMeasurementDet.cc
Go to the documentation of this file.
10 
11 const float TkPixelMeasurementDet::theRocWidth = 8.1;
12 const float TkPixelMeasurementDet::theRocHeight = 8.1;
13 
15  const PixelClusterParameterEstimator* cpe) :
16  MeasurementDet (gdet),
17  theCPE(cpe),
18  empty(true),
19  activeThisEvent_(true), activeThisPeriod_(true)
20  {
21  thePixelGDU = dynamic_cast<const PixelGeomDetUnit*>(gdet);
22  if (thePixelGDU == 0) {
23  throw MeasurementDetException( "TkPixelMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
24  }
25  }
26 
27 std::vector<TrajectoryMeasurement>
29  const TrajectoryStateOnSurface& startingState,
30  const Propagator&,
31  const MeasurementEstimator& est) const
32 {
33  std::vector<TrajectoryMeasurement> result;
34 
35  if (isActive() == false) {
36  result.push_back( TrajectoryMeasurement( stateOnThisDet,
38  0.F));
39  return result;
40  }
41 
42  MeasurementDet::RecHitContainer allHits = recHits( stateOnThisDet);
43  for (RecHitContainer::const_iterator ihit=allHits.begin();
44  ihit != allHits.end(); ihit++) {
45  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, **ihit);
46  if ( diffEst.first) {
47  result.push_back( TrajectoryMeasurement( stateOnThisDet, *ihit,
48  diffEst.second));
49  }
50  //RC else delete *ihit; // we own allHits and have to delete the ones we don't return
51  }
52  if ( result.empty()) {
53  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
55  result.push_back( TrajectoryMeasurement( stateOnThisDet,
56  InvalidTransientRecHit::build(&geomDet(), type), 0.F));
57  }
58  else {
59  // sort results according to estimator value
60  if ( result.size() > 1) {
61  sort( result.begin(), result.end(), TrajMeasLessEstim());
62  }
63  }
64  return result;
65 }
66 
69  const LocalTrajectoryParameters & ltp) const
70 {
71  const GeomDetUnit& gdu( specificGeomDet());
72  LocalValues lv = theCPE->localParameters( * cluster, gdu, ltp );
73  return TSiPixelRecHit::build( lv.first, lv.second, &geomDet(), cluster, theCPE);
74 }
75 
78 {
80  if (empty == true ) return result;
81  if (isActive() == false) return result;
82  for ( const_iterator ci = detSet_.begin(); ci != detSet_.end(); ++ ci ) {
84  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
85  }
86  return result;
87 }
88 
89 bool
91  if (badRocPositions_.empty()) return false;
92  LocalPoint lp = tsos.localPosition();
94  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
95  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
96  if ( (std::abs(it->x() - lp.x()) < dx) &&
97  (std::abs(it->y() - lp.y()) < dy) ) return true;
98  }
99  return false;
100 }
type
Definition: HCALResponse.h:22
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
static RecHitPointer build(const GeomDet *geom, const SiPixelRecHit *rh, const PixelClusterParameterEstimator *cpe, float weight=1., float annealing=1., bool computeCoarseLocalPosition=false)
float xx() const
Definition: LocalError.h:19
const PixelGeomDetUnit * thePixelGDU
bool isActive() const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
static RecHitPointer build(const GeomDet *geom, Type type=TrackingRecHit::missing, const DetLayer *layer=0)
const LocalTrajectoryParameters & localParameters() const
virtual std::vector< TrajectoryMeasurement > fastMeasurements(const TrajectoryStateOnSurface &stateOnThisDet, const TrajectoryStateOnSurface &startingState, const Propagator &, const MeasurementEstimator &) const
std::vector< LocalPoint > badRocPositions_
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
virtual const GeomDet & geomDet() const
T y() const
Definition: PV3DBase.h:57
#define abs(x)
Definition: mlp_lapack.h:159
static const float theRocHeight
TkPixelMeasurementDet(const GeomDet *gdet, const PixelClusterParameterEstimator *cpe)
static const float theRocWidth
LocalError positionError() const
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
float yy() const
Definition: LocalError.h:21
T sqrt(T t)
Definition: SSEVec.h:28
tuple result
Definition: query.py:137
const LocalTrajectoryError & localError() const
PixelClusterParameterEstimator::LocalValues LocalValues
detset::const_iterator const_iterator
edm::Handle< edmNew::DetSetVector< SiPixelCluster > > handle_
bool hasBadComponents(const TrajectoryStateOnSurface &tsos) const
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &) const
TransientTrackingRecHit::RecHitPointer buildRecHit(const SiPixelClusterRef &cluster, const LocalTrajectoryParameters &ltp) const
const PixelGeomDetUnit & specificGeomDet() const
iterator end()
Definition: DetSetNew.h:59
const PixelClusterParameterEstimator * theCPE
T x() const
Definition: PV3DBase.h:56
iterator begin()
Definition: DetSetNew.h:56