CMS 3D CMS Logo

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

#include <LayerMeasurements.h>

Public Member Functions

void addInvalidMeas (std::vector< TrajectoryMeasurement > &measVec, const DetGroup &group, const DetLayer &layer) const
 
std::vector
< TrajectoryMeasurementGroup
groupedMeasurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
 LayerMeasurements (const MeasurementDetSystem *detSysytem)
 
std::vector
< TrajectoryMeasurement
measurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 

Private Attributes

const MeasurementDetSystemtheDetSystem
 

Detailed Description

Definition at line 16 of file LayerMeasurements.h.

Constructor & Destructor Documentation

LayerMeasurements::LayerMeasurements ( const MeasurementDetSystem detSysytem)
inline

Definition at line 19 of file LayerMeasurements.h.

19  :
20  theDetSystem (detSysytem) {}
const MeasurementDetSystem * theDetSystem

Member Function Documentation

void LayerMeasurements::addInvalidMeas ( std::vector< TrajectoryMeasurement > &  measVec,
const DetGroup group,
const DetLayer layer 
) const

Definition at line 162 of file LayerMeasurements.cc.

References newFWLiteAna::build, and TrackingRecHit::missing.

165 {
166  if (!measVec.empty()) {
167  // invalidMeas on Det of most compatible hit
168  measVec.emplace_back(measVec.front().predictedState(),
169  InvalidTransientRecHit::build(measVec.front().recHit()->det(), TrackingRecHit::missing),
170  0.,&layer);
171  }
172  else if (!group.empty()) {
173  // invalid state on first compatible Det
174  measVec.emplace_back(group.front().trajectoryState(),
175  InvalidTransientRecHit::build(group.front().det(), TrackingRecHit::missing), 0.,&layer);
176  }
177 }
vector< TrajectoryMeasurementGroup > LayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 118 of file LayerMeasurements.cc.

References newFWLiteAna::build, tracking::TempMeasurements::clear(), GeometricSearchDet::compatible(), tracking::TempMeasurements::distances, GeomDet::geographicalId(), GeometricSearchDet::groupedCompatibleDets(), tracking::TempMeasurements::hits, i, TrackingRecHit::inactive, MeasurementDet::measurements(), query::result, tracking::TempMeasurements::size(), and python.multivaluedict::sort().

121  {
122  vector<TrajectoryMeasurementGroup> result;
123 
124  vector<DetGroup> && groups = layer.groupedCompatibleDets( startingState, prop, est);
125  result.reserve(groups.size());
126 
128  for (auto& grp : groups) {
129  if ( grp.empty() ) continue;
130 
131  vector<TrajectoryMeasurement> tmpVec;
132  for (auto const & det : grp) {
133  const MeasurementDet* mdet = theDetSystem->idToDet(det.det()->geographicalId());
134  if (mdet == 0) {
135  throw MeasurementDetException( "MeasurementDet not found");
136  }
137  if (mdet->measurements( det.trajectoryState(), est,tmps))
138  for (std::size_t i=0; i!=tmps.size(); ++i)
139  tmpVec.emplace_back(det.trajectoryState(),std::move(tmps.hits[i]),tmps.distances[i],&layer);
140  tmps.clear();
141  }
142 
143  // sort the final result
144  sort( tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
145  addInvalidMeas( tmpVec, grp,layer);
146  result.emplace_back(std::move(tmpVec), std::move(grp));
147  }
148 
149 
150  // if the result is empty check if the layer is compatible (for invalid measurement)
151  if (result.empty()) {
152  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
153  if ( compat.first) {
154  vector<TrajectoryMeasurement> tmVec;
155  tmVec.emplace_back(compat.second, InvalidTransientRecHit::build(nullptr, TrackingRecHit::inactive,&layer), 0.F,&layer);
156  result.emplace_back(std::move(tmVec), DetGroup());
157  }
158  }
159  return result;
160 }
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
int i
Definition: DBlmapReader.cc:9
std::size_t size() const
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
void addInvalidMeas(std::vector< TrajectoryMeasurement > &measVec, const DetGroup &group, const DetLayer &layer) const
const MeasurementDetSystem * theDetSystem
virtual const MeasurementDet * idToDet(const DetId &id) const =0
Return the pointer to the MeasurementDet corresponding to a given DetId.
virtual bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const =0
vector< TrajectoryMeasurement > LayerMeasurements::measurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 90 of file LayerMeasurements.cc.

References newFWLiteAna::build, GeometricSearchDet::compatible(), GeometricSearchDet::compatibleDets(), TrackingRecHit::inactive, LogDebug, and query::result.

Referenced by HitEff::analyze(), MuonCkfTrajectoryBuilder::collectMeasurement(), OutInConversionSeedFinder::completeSeed(), InOutConversionSeedFinder::completeSeed(), CkfTrajectoryBuilder::findCompatibleMeasurements(), TSGFromPropagation::findMeasurements(), FastTSGFromPropagation::findMeasurements(), NuclearInteractionFinder::findMeasurementsFromTSOS(), SiStripElectronSeedGenerator::findSeedsFromCluster(), CosmicTrackingRegion::hits(), PixelMatchNextLayers::PixelMatchNextLayers(), and OutInConversionSeedFinder::startSeed().

93  {
94 
96 
97  vector<DetWithState> const & compatDets = layer.compatibleDets( startingState, prop, est);
98 
99  if (!compatDets.empty()) return get(theDetSystem, layer, compatDets, startingState, prop, est);
100 
101  vector<TrajectoryMeasurement> result;
102  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
103 
104  if ( compat.first) {
105  result.push_back( TrajectoryMeasurement( compat.second,
107  &layer));
108  LogDebug("LayerMeasurements")<<"adding a missing hit.";
109  }else LogDebug("LayerMeasurements")<<"adding not measurement.";
110 
111 
112  return result;
113 
114 }
#define LogDebug(id)
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const MeasurementDetSystem * theDetSystem
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState

Member Data Documentation

const MeasurementDetSystem* LayerMeasurements::theDetSystem
private

Definition at line 41 of file LayerMeasurements.h.