CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LayerMeasurements Class Reference

#include <LayerMeasurements.h>

Public Member Functions

std::vector< TrajectoryMeasurementGroupgroupedMeasurements (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< TrajectoryMeasurementmeasurements (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::LayerMeasurements ( const MeasurementDetSystem detSystem,
const MeasurementTrackerEvent data 
)
inline

Definition at line 20 of file LayerMeasurements.h.

21  : detSystem_(detSystem), data_(data) {}

Member Function Documentation

◆ groupedMeasurements()

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

Definition at line 149 of file LayerMeasurements.cc.

152  {
153  vector<TrajectoryMeasurementGroup> result;
154 
155  vector<DetGroup>&& groups = layer.groupedCompatibleDets(startingState, prop, est);
156  result.reserve(groups.size());
157 
159  for (auto& grp : groups) {
160  if (grp.empty())
161  continue;
162 
163  vector<TrajectoryMeasurement> tmpVec;
164  for (auto const& det : grp) {
165  MeasurementDetWithData mdet = detSystem_.idToDet(det.det()->geographicalId(), data_);
166  if (mdet.isNull()) {
167  throw MeasurementDetException("MeasurementDet not found");
168  }
169  if (mdet.measurements(det.trajectoryState(), est, tmps))
170  for (std::size_t i = 0; i != tmps.size(); ++i)
171  tmpVec.emplace_back(det.trajectoryState(), std::move(tmps.hits[i]), tmps.distances[i], &layer);
172  tmps.clear();
173  }
174 
175  // sort the final result
176  LogDebug("LayerMeasurements") << "Sorting " << tmpVec.size() << " measurements in this grp.";
177  sort(tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
178  addInvalidMeas(tmpVec, grp, layer);
179  result.emplace_back(std::move(tmpVec), std::move(grp));
180  }
181 
182  // if the result is empty check if the layer is compatible (for invalid measurement)
183  if (result.empty()) {
184  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible(startingState, prop, est);
185  if (compat.first) {
186  vector<TrajectoryMeasurement> tmVec;
187  tmVec.emplace_back(compat.second,
188  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive),
189  0.F,
190  &layer);
191  result.emplace_back(std::move(tmVec), DetGroup());
192  }
193  }
194  return result;
195 }

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

◆ idToDet()

MeasurementDetWithData LayerMeasurements::idToDet ( const DetId id) const
inline

Definition at line 39 of file LayerMeasurements.h.

39 { return detSystem_.idToDet(id, data_); }

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

◆ measurements()

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

Definition at line 122 of file LayerMeasurements.cc.

125  {
127 
128  vector<DetWithState> const& compatDets = layer.compatibleDets(startingState, prop, est);
129 
130  if (!compatDets.empty())
131  return get(detSystem_, data_, layer, compatDets, startingState, prop, est);
132 
133  vector<TrajectoryMeasurement> result;
134  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible(startingState, prop, est);
135 
136  if (compat.first) {
137  result.push_back(
138  TrajectoryMeasurement(compat.second,
139  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive),
140  0.F,
141  &layer));
142  LogDebug("LayerMeasurements") << "adding a missing hit.";
143  } else
144  LogDebug("LayerMeasurements") << "adding not measurement.";
145 
146  return result;
147 }

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

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

◆ recHits()

std::vector< BaseTrackerRecHit * > LayerMeasurements::recHits ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 107 of file LayerMeasurements.cc.

110  {
111  std::vector<BaseTrackerRecHit*> result;
112  auto const& compatDets = layer.compatibleDets(startingState, prop, est);
113  if (compatDets.empty())
114  return result;
115  for (auto const& ds : compatDets) {
116  auto mdet = detSystem_.idToDet(ds.first->geographicalId(), data_);
117  mdet.recHits(result, ds.second, est);
118  }
119  return result;
120 }

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

Member Data Documentation

◆ data_

MeasurementTrackerEvent const& LayerMeasurements::data_
private

Definition at line 43 of file LayerMeasurements.h.

Referenced by idToDet().

◆ detSystem_

MeasurementDetSystem const& LayerMeasurements::detSystem_
private

Definition at line 42 of file LayerMeasurements.h.

Referenced by idToDet().

mps_fire.i
i
Definition: mps_fire.py:428
tracking::TempMeasurements::size
std::size_t size() const
Definition: TempMeasurements.h:20
LayerMeasurements::data_
MeasurementTrackerEvent const & data_
Definition: LayerMeasurements.h:43
TrajMeasLessEstim
Definition: TrajMeasLessEstim.h:10
GeometricSearchDet::compatible
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
GeometricSearchDet::compatibleDets
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: GeometricSearchDet.cc:35
tracking::TempMeasurements
Definition: TempMeasurements.h:10
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
GeometricSearchDet::groupedCompatibleDets
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: GeometricSearchDet.cc:42
MeasurementDetException
Common base class.
Definition: MeasurementDetException.h:12
tracking::TempMeasurements::clear
void clear()
Definition: TempMeasurements.h:15
MeasurementDetWithData::isNull
bool isNull() const
Definition: MeasurementDetWithData.h:13
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
MeasurementDetWithData::recHits
RecHitContainer recHits(const TrajectoryStateOnSurface &tsos) const
Definition: MeasurementDetWithData.h:23
DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: RPCRecHitFilter.h:58
GeometricSearchDet::DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: GeometricSearchDet.h:19
get
#define get
eostools.move
def move(src, dest)
Definition: eostools.py:511
MeasurementDetWithData
Definition: MeasurementDetWithData.h:6
LayerMeasurements::detSystem_
MeasurementDetSystem const & detSystem_
Definition: LayerMeasurements.h:42
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DetGroup
Definition: DetGroup.h:41
TrackingRecHit::inactive
Definition: TrackingRecHit.h:48
mps_fire.result
result
Definition: mps_fire.py:311
MeasurementDetSystem::idToDet
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
tracking::TempMeasurements::distances
Distances distances
Definition: TempMeasurements.h:41
TrajectoryMeasurement
Definition: TrajectoryMeasurement.h:25
MeasurementDetWithData::measurements
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
Definition: MeasurementDetWithData.h:54
tracking::TempMeasurements::hits
RecHitContainer hits
Definition: TempMeasurements.h:40