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 
12 namespace {
13  const float theRocWidth = 8.1;
14  const float theRocHeight = 8.1;
15 }
16 
18  const PixelClusterParameterEstimator* cpe) :
19  MeasurementDet (gdet),
20  theCPE(cpe),
21  skipClusters_(0),
22  empty(true),
23  activeThisEvent_(true), activeThisPeriod_(true)
24  {
25  if ( dynamic_cast<const PixelGeomDetUnit*>(gdet) == 0) {
26  throw MeasurementDetException( "TkPixelMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
27  }
28  }
29 
30 std::vector<TrajectoryMeasurement>
32  const TrajectoryStateOnSurface& startingState,
33  const Propagator&,
34  const MeasurementEstimator& est) const
35 {
36  std::vector<TrajectoryMeasurement> result;
37 
38  if (isActive() == false) {
39  result.push_back( TrajectoryMeasurement( stateOnThisDet,
41  0.F));
42  return result;
43  }
44 
45  MeasurementDet::RecHitContainer allHits = recHits( stateOnThisDet);
46  for (RecHitContainer::const_iterator ihit=allHits.begin();
47  ihit != allHits.end(); ihit++) {
48  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, **ihit);
49  if ( diffEst.first) {
50  result.push_back( TrajectoryMeasurement( stateOnThisDet, *ihit,
51  diffEst.second));
52  }
53  //RC else delete *ihit; // we own allHits and have to delete the ones we don't return
54  }
55  if ( result.empty()) {
56  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
58  result.push_back( TrajectoryMeasurement( stateOnThisDet,
60  }
61  else {
62  // sort results according to estimator value
63  if ( result.size() > 1) {
64  sort( result.begin(), result.end(), TrajMeasLessEstim());
65  }
66  }
67  return result;
68 }
69 
72  const LocalTrajectoryParameters & ltp) const
73 {
74  const GeomDetUnit& gdu( specificGeomDet());
75  LocalValues lv = theCPE->localParameters( * cluster, gdu, ltp );
76  return TSiPixelRecHit::build( lv.first, lv.second, &fastGeomDet(), cluster, theCPE);
77 }
78 
81 {
83  if (empty == true ) return result;
84  if (isActive() == false) return result;
85  const SiPixelCluster* begin=0;
86  if(0!=handle_->data().size()) {
87  begin = &(handle_->data().front());
88  }
89  result.reserve(detSet_.size());
90  for ( const_iterator ci = detSet_.begin(); ci != detSet_.end(); ++ ci ) {
91 
92  if (ci < begin){
93  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch.";
94  return result;
95  }
96  unsigned int index = ci-begin;
97  if (skipClusters_!=0 && skipClusters_->size()!=0 && index>=skipClusters_->size()){
98  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<skipClusters_->size();
99  return result;
100  }
101  if(0==skipClusters_ or skipClusters_->empty() or (not (*skipClusters_)[index]) ) {
103  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
104  }else{
105  LogDebug("TkPixelMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
106  }
107  }
108  return result;
109 }
110 
111 bool
113  if (badRocPositions_.empty()) return false;
114  LocalPoint lp = tsos.localPosition();
116  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
117  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
118  if ( (std::abs(it->x() - lp.x()) < dx) &&
119  (std::abs(it->y() - lp.y()) < dy) ) return true;
120  }
121  return false;
122 }
#define LogDebug(id)
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)
float xx() const
Definition: LocalError.h:24
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)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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
const std::vector< bool > * skipClusters_
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
TkPixelMeasurementDet(const GeomDet *gdet, const PixelClusterParameterEstimator *cpe)
LocalError positionError() const
const GeomDet & fastGeomDet() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:46
tuple result
Definition: query.py:137
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
const LocalTrajectoryError & localError() const
static RecHitPointer build(const GeomDet *geom, const SiPixelRecHit *rh, const PixelClusterParameterEstimator *cpe, bool computeCoarseLocalPosition=false)
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
Pixel cluster – collection of neighboring pixels above threshold.
#define begin
Definition: vmac.h:31
const PixelGeomDetUnit & specificGeomDet() const
iterator end()
Definition: DetSetNew.h:59
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
size_type size() const
Definition: DetSetNew.h:75
const PixelClusterParameterEstimator * theCPE
T x() const
Definition: PV3DBase.h:61
unsigned long long le
Definition: VDTMath.h:202
iterator begin()
Definition: DetSetNew.h:56