CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
LayerMeasurements Class Reference

#include <LayerMeasurements.h>

Public Member Functions

std::vector
< TrajectoryMeasurementGroup
groupedMeasurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
MeasurementDetWithData idToDet (const DetId &id) const
 
 LayerMeasurements (const MeasurementDetSystem &detSystem, const MeasurementTrackerEvent &data)
 
std::vector
< TrajectoryMeasurement
measurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
std::vector< BaseTrackerRecHit * > recHits (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 

Private Attributes

MeasurementTrackerEvent const & data_
 
MeasurementDetSystem const & detSystem_
 

Detailed Description

Definition at line 18 of file LayerMeasurements.h.

Constructor & Destructor Documentation

LayerMeasurements::LayerMeasurements ( const MeasurementDetSystem detSystem,
const MeasurementTrackerEvent data 
)
inline

Definition at line 20 of file LayerMeasurements.h.

21  : detSystem_(detSystem), data_(data) {}
MeasurementTrackerEvent const & data_
MeasurementDetSystem const & detSystem_

Member Function Documentation

vector< TrajectoryMeasurementGroup > LayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 150 of file LayerMeasurements.cc.

References tracking::TempMeasurements::clear(), GeometricSearchDet::compatible(), tracking::TempMeasurements::distances, F(), GeomDet::geographicalId(), GeometricSearchDet::groupedCompatibleDets(), tracking::TempMeasurements::hits, mps_fire::i, TrackingRecHit::inactive, MeasurementDetWithData::isNull(), phase1PixelTopology::layer, LogDebug, MeasurementDetWithData::measurements(), eostools::move(), mps_fire::result, tracking::TempMeasurements::size(), and GeometricSearchDet::surface().

153  {
154  vector<TrajectoryMeasurementGroup> result;
155 
156  vector<DetGroup>&& groups = layer.groupedCompatibleDets(startingState, prop, est);
157  result.reserve(groups.size());
158 
160  for (auto& grp : groups) {
161  if (grp.empty())
162  continue;
163 
164  vector<TrajectoryMeasurement> tmpVec;
165  for (auto const& det : grp) {
166  MeasurementDetWithData mdet = detSystem_.idToDet(det.det()->geographicalId(), data_);
167  if (mdet.isNull()) {
168  throw MeasurementDetException("MeasurementDet not found");
169  }
170  if (mdet.measurements(det.trajectoryState(), est, tmps))
171  for (std::size_t i = 0; i != tmps.size(); ++i)
172  tmpVec.emplace_back(det.trajectoryState(), std::move(tmps.hits[i]), tmps.distances[i], &layer);
173  tmps.clear();
174  }
175 
176  // sort the final result
177  LogDebug("LayerMeasurements") << "Sorting " << tmpVec.size() << " measurements in this grp.";
178  sort(tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
179  addInvalidMeas(tmpVec, grp, layer);
180  result.emplace_back(std::move(tmpVec), std::move(grp));
181  }
182 
183  // if the result is empty check if the layer is compatible (for invalid measurement)
184  if (result.empty()) {
185  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible(startingState, prop, est);
186  if (compat.first) {
187  vector<TrajectoryMeasurement> tmVec;
188  tmVec.emplace_back(compat.second,
189  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive),
190  0.F,
191  &layer);
192  result.emplace_back(std::move(tmVec), DetGroup());
193  }
194  }
195  return result;
196 }
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
std::size_t size() const
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
MeasurementTrackerEvent const & data_
constexpr std::array< uint8_t, layerIndexSize > layer
tuple result
Definition: mps_fire.py:311
def move
Definition: eostools.py:511
MeasurementDetSystem const & detSystem_
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
#define LogDebug(id)
MeasurementDetWithData LayerMeasurements::idToDet ( const DetId id) const
inline

Definition at line 39 of file LayerMeasurements.h.

References data_, detSystem_, and MeasurementDetSystem::idToDet().

39 { return detSystem_.idToDet(id, data_); }
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
MeasurementTrackerEvent const & data_
MeasurementDetSystem const & detSystem_
vector< TrajectoryMeasurement > LayerMeasurements::measurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 123 of file LayerMeasurements.cc.

References GeometricSearchDet::compatible(), GeometricSearchDet::compatibleDets(), F(), TrackingRecHit::inactive, LogDebug, mps_fire::result, and GeometricSearchDet::surface().

Referenced by SiPixelHitEfficiencySource::analyze(), OutInConversionSeedFinder::completeSeed(), InOutConversionSeedFinder::completeSeed(), NuclearInteractionFinder::findMeasurementsFromTSOS(), CosmicTrackingRegion::hits_(), and OutInConversionSeedFinder::startSeed().

126  {
128 
129  vector<DetWithState> const& compatDets = layer.compatibleDets(startingState, prop, est);
130 
131  if (!compatDets.empty())
132  return get(detSystem_, data_, layer, compatDets, startingState, prop, est);
133 
134  vector<TrajectoryMeasurement> result;
135  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible(startingState, prop, est);
136 
137  if (compat.first) {
138  result.push_back(
139  TrajectoryMeasurement(compat.second,
140  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive),
141  0.F,
142  &layer));
143  LogDebug("LayerMeasurements") << "adding a missing hit.";
144  } else
145  LogDebug("LayerMeasurements") << "adding not measurement.";
146 
147  return result;
148 }
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
MeasurementTrackerEvent const & data_
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: mps_fire.py:311
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
MeasurementDetSystem const & detSystem_
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
#define LogDebug(id)
std::vector< BaseTrackerRecHit * > LayerMeasurements::recHits ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 108 of file LayerMeasurements.cc.

References GeometricSearchDet::compatibleDets(), MeasurementDetWithData::recHits(), and mps_fire::result.

Referenced by RectangularEtaPhiTrackingRegion::hits().

111  {
112  std::vector<BaseTrackerRecHit*> result;
113  auto const& compatDets = layer.compatibleDets(startingState, prop, est);
114  if (compatDets.empty())
115  return result;
116  for (auto const& ds : compatDets) {
117  auto mdet = detSystem_.idToDet(ds.first->geographicalId(), data_);
118  mdet.recHits(result, ds.second, est);
119  }
120  return result;
121 }
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
MeasurementTrackerEvent const & data_
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: mps_fire.py:311
RecHitContainer recHits(const TrajectoryStateOnSurface &tsos) const
MeasurementDetSystem const & detSystem_

Member Data Documentation

MeasurementTrackerEvent const& LayerMeasurements::data_
private

Definition at line 43 of file LayerMeasurements.h.

Referenced by idToDet().

MeasurementDetSystem const& LayerMeasurements::detSystem_
private

Definition at line 42 of file LayerMeasurements.h.

Referenced by idToDet().