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 
31  const MeasurementEstimator& est,
32  TempMeasurements & result) const {
33 
34  if (!isActive()) {
36  return true;
37  }
38 
39  auto oldSize = result.size();
40  MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet);
41  for (auto && hit : allHits) {
42  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit);
43  if ( diffEst.first)
44  result.add(std::move(hit), diffEst.second);
45  }
46 
47  if (result.size()>oldSize) return true;
48 
49  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
50  bool inac = hasBadComponents(stateOnThisDet);
52  result.add(InvalidTransientRecHit::build(&fastGeomDet(), type), 0.F);
53  return inac;
54 
55 }
56 
57 
60  const LocalTrajectoryParameters & ltp) const
61 {
62  const GeomDetUnit& gdu( specificGeomDet());
63  LocalValues lv = theCPE->localParameters( * cluster, gdu, ltp );
64  return TSiPixelRecHit::build( lv.first, lv.second, &fastGeomDet(), cluster, theCPE);
65 }
66 
69 {
71  if (empty == true ) return result;
72  if (isActive() == false) return result;
73  const SiPixelCluster* begin=0;
74  if(0!=handle_->data().size()) {
75  begin = &(handle_->data().front());
76  }
77  result.reserve(detSet_.size());
78  for ( const_iterator ci = detSet_.begin(); ci != detSet_.end(); ++ ci ) {
79 
80  if (ci < begin){
81  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch.";
82  return result;
83  }
84  unsigned int index = ci-begin;
85  if (skipClusters_!=0 && skipClusters_->size()!=0 && index>=skipClusters_->size()){
86  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<skipClusters_->size();
87  return result;
88  }
89  if(0==skipClusters_ or skipClusters_->empty() or (not (*skipClusters_)[index]) ) {
91  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
92  }else{
93  LogDebug("TkPixelMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
94  }
95  }
96  return result;
97 }
98 
99 bool
101  if (badRocPositions_.empty()) return false;
102  LocalPoint lp = tsos.localPosition();
104  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
105  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
106  if ( (std::abs(it->x() - lp.x()) < dx) &&
107  (std::abs(it->y() - lp.y()) < dy) ) return true;
108  }
109  return false;
110 }
#define LogDebug(id)
type
Definition: HCALResponse.h:21
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;...
std::size_t size() const
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
std::vector< LocalPoint > badRocPositions_
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TransientTrackingRecHit &hit) const =0
TransientTrackingRecHit::ConstRecHitContainer RecHitContainer
virtual const GeomDet & geomDet() const
const std::vector< bool > * skipClusters_
T y() const
Definition: PV3DBase.h:63
#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
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
T sqrt(T t)
Definition: SSEVec.h:48
void add(ConstRecHitPointer const &h, float d)
tuple result
Definition: query.py:137
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
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
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:62
iterator begin()
Definition: DetSetNew.h:56