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) {}
MeasurementTrackerEvent const & data_
MeasurementDetSystem const & detSystem_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

Member Function Documentation

◆ groupedMeasurements()

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

Definition at line 177 of file LayerMeasurements.cc.

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

180  {
181  vector<TrajectoryMeasurementGroup> result;
182 
183  vector<DetGroup>&& groups = layer.groupedCompatibleDets(startingState, prop, est);
184  result.reserve(groups.size());
185 
187  for (auto& grp : groups) {
188  if (grp.empty())
189  continue;
190 
191  vector<TrajectoryMeasurement> tmpVec;
192  for (auto const& det : grp) {
193  auto const& detTS = det.trajectoryState();
194 
195  if (not layerIsCompatibleWithTSOS(layer, detTS))
196  continue;
197 
198  MeasurementDetWithData mdet = detSystem_.idToDet(det.det()->geographicalId(), data_);
199  if (mdet.isNull()) {
200  throw MeasurementDetException("MeasurementDet not found");
201  }
202  if (mdet.measurements(detTS, est, tmps))
203  for (std::size_t i = 0; i != tmps.size(); ++i)
204  tmpVec.emplace_back(detTS, std::move(tmps.hits[i]), tmps.distances[i], &layer);
205  tmps.clear();
206  }
207 
208  // sort the final result
209  LogDebug("LayerMeasurements") << "Sorting " << tmpVec.size() << " measurements in this grp.";
210  sort(tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
211  addInvalidMeas(tmpVec, grp, layer);
212  result.emplace_back(std::move(tmpVec), std::move(grp));
213  }
214 
215  // if the result is empty check if the layer is compatible (for invalid measurement)
216  if (result.empty()) {
217  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible(startingState, prop, est);
218  if (compat.first and layerIsCompatibleWithTSOS(layer, compat.second)) {
219  vector<TrajectoryMeasurement> tmVec;
220  tmVec.emplace_back(compat.second,
221  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive),
222  0.F,
223  &layer);
224  result.emplace_back(std::move(tmVec), DetGroup());
225  }
226  }
227  return result;
228 }
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
MeasurementTrackerEvent const & data_
MeasurementDetSystem const & detSystem_
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
std::size_t size() const
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ idToDet()

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_

◆ measurements()

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

Definition at line 150 of file LayerMeasurements.cc.

References F(), TrackingRecHit::inactive, LogDebug, and mps_fire::result.

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

153  {
155 
156  vector<DetWithState> const& compatDets = layer.compatibleDets(startingState, prop, est);
157 
158  if (!compatDets.empty())
159  return get(detSystem_, data_, layer, compatDets, startingState, prop, est);
160 
161  vector<TrajectoryMeasurement> result;
162  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible(startingState, prop, est);
163 
164  if (compat.first and layerIsCompatibleWithTSOS(layer, compat.second)) {
165  result.push_back(
166  TrajectoryMeasurement(compat.second,
167  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive),
168  0.F,
169  &layer));
170  LogDebug("LayerMeasurements") << "adding a missing hit.";
171  } else
172  LogDebug("LayerMeasurements") << "adding not measurement.";
173 
174  return result;
175 }
MeasurementTrackerEvent const & data_
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)

◆ recHits()

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

Definition at line 132 of file LayerMeasurements.cc.

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

135  {
136  std::vector<BaseTrackerRecHit*> result;
137  auto const& compatDets = layer.compatibleDets(startingState, prop, est);
138  if (compatDets.empty())
139  return result;
140  for (auto const& ds : compatDets) {
141  if (not layerIsCompatibleWithTSOS(layer, ds.second))
142  continue;
143 
144  auto mdet = detSystem_.idToDet(ds.first->geographicalId(), data_);
145  mdet.recHits(result, ds.second, est);
146  }
147  return result;
148 }
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
MeasurementTrackerEvent const & data_
MeasurementDetSystem const & detSystem_
RecHitContainer recHits(const TrajectoryStateOnSurface &tsos) const

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().