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  PxMeasurementConditionSet & conditions ) :
19  MeasurementDet (gdet),
20  theDetConditions(&conditions)
21  {
22  if ( dynamic_cast<const PixelGeomDetUnit*>(gdet) == 0) {
23  throw MeasurementDetException( "TkPixelMeasurementDet constructed with a GeomDet which is not a PixelGeomDetUnit");
24  }
25  }
26 
29  TempMeasurements & result) const {
30 
31  if (!isActive(data)) {
32  result.add(theInactiveHit, 0.F);
33  return true;
34  }
35 
36  auto oldSize = result.size();
37  MeasurementDet::RecHitContainer && allHits = recHits(stateOnThisDet, data);
38  for (auto && hit : allHits) {
39  std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, *hit);
40  if ( diffEst.first)
41  result.add(std::move(hit), diffEst.second);
42  }
43 
44  if (result.size()>oldSize) return true;
45 
46  // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
47  bool inac = hasBadComponents(stateOnThisDet, data);
48  result.add(inac ? theInactiveHit : theMissingHit, 0.F);
49  return inac;
50 
51 }
52 
53 
56  const LocalTrajectoryParameters & ltp) const
57 {
58  const GeomDetUnit& gdu( specificGeomDet());
59 
60  auto && params = cpe()->getParameters( * cluster, gdu, ltp );
61  return std::make_shared<SiPixelRecHit>( std::get<0>(params), std::get<1>(params), std::get<2>(params), fastGeomDet(), cluster);
62 }
63 
66 {
68  if (isEmpty(data.pixelData())== true ) return result;
69  if (isActive(data) == false) return result;
70  const SiPixelCluster* begin=0;
71  if (0 != data.pixelData().handle()->data().size()) {
72  begin = &(data.pixelData().handle()->data().front());
73  }
74  const detset & detSet = data.pixelData().detSet(index());
75  result.reserve(detSet.size());
76  for ( const_iterator ci = detSet.begin(); ci != detSet.end(); ++ ci ) {
77 
78  if (ci < begin){
79  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch.";
80  return result;
81  }
82  unsigned int index = ci-begin;
83  if (!data.pixelClustersToSkip().empty() && index>=data.pixelClustersToSkip().size()){
84  edm::LogError("IndexMisMatch")<<"TkPixelMeasurementDet cannot create hit because of index mismatch. i.e "<<index<<" >= "<<data.pixelClustersToSkip().size();
85  return result;
86  }
87  if(data.pixelClustersToSkip().empty() or (not data.pixelClustersToSkip()[index]) ) {
88  SiPixelClusterRef cluster = edmNew::makeRefTo( data.pixelData().handle(), ci );
89  result.push_back( buildRecHit( cluster, ts.localParameters() ) );
90  }else{
91  LogDebug("TkPixelMeasurementDet")<<"skipping this cluster from last iteration on "<<fastGeomDet().geographicalId().rawId()<<" key: "<<index;
92  }
93  }
94  return result;
95 }
96 
97 bool
99  if (badRocPositions_.empty()) return false;
100  LocalPoint lp = tsos.localPosition();
102  double dx = 3*std::sqrt(le.xx()) + theRocWidth, dy = 3*std::sqrt(le.yy()) + theRocHeight;
103  for (std::vector<LocalPoint>::const_iterator it = badRocPositions_.begin(), ed = badRocPositions_.end(); it != ed; ++it) {
104  if ( (std::abs(it->x() - lp.x()) < dx) &&
105  (std::abs(it->y() - lp.y()) < dy) ) return true;
106  }
107  return false;
108 }
#define LogDebug(id)
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
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, const MeasurementTrackerEvent &dat, TempMeasurements &result) const
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_
const PixelClusterParameterEstimator * cpe() const
T y() const
Definition: PV3DBase.h:63
bool hasBadComponents(const TrajectoryStateOnSurface &tsos, const MeasurementTrackerEvent &dat) const
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > & handle() const
TrackingRecHit::RecHitPointer buildRecHit(const SiPixelClusterRef &cluster, const LocalTrajectoryParameters &ltp) const
const std::vector< bool > & pixelClustersToSkip() const
LocalError positionError() const
TrackingRecHit::ConstRecHitPointer theMissingHit
virtual ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
const GeomDet & fastGeomDet() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
float yy() const
Definition: LocalError.h:26
const PxMeasurementDetSet & pixelData() const
T sqrt(T t)
Definition: SSEVec.h:48
void add(ConstRecHitPointer const &h, float d)
tuple result
Definition: query.py:137
def move
Definition: eostools.py:508
TkPixelMeasurementDet(const GeomDet *gdet, PxMeasurementConditionSet &conditionSet)
data_type const * data(size_t cell) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
const LocalTrajectoryError & localError() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
bool isActive(const MeasurementTrackerEvent &data) const
Is this module active in reconstruction? It must be both &#39;setActiveThisEvent&#39; and &#39;setActive&#39;...
std::shared_ptr< TrackingRecHit const > RecHitPointer
detset::const_iterator const_iterator
virtual RecHitContainer recHits(const TrajectoryStateOnSurface &, const MeasurementTrackerEvent &dat) const
TrackingRecHit::ConstRecHitPointer theInactiveHit
TrackingRecHit::ConstRecHitContainer RecHitContainer
Pixel cluster – collection of neighboring pixels above threshold.
#define begin
Definition: vmac.h:30
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const PixelGeomDetUnit & specificGeomDet() const
iterator end()
Definition: DetSetNew.h:70
const PixelDetSet & detSet(int i) const
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
size_type size() const
Definition: DetSetNew.h:86
T x() const
Definition: PV3DBase.h:62
bool isEmpty(const PxMeasurementDetSet &data) const
int size() const
iterator begin()
Definition: DetSetNew.h:67