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
 
MeasurementDetWithData idToDet (const DetId &id) const
 
 LayerMeasurements ()
 dummy default constructor (obviously you can't use any object created this way), but it can be needed in some cases More...
 
 LayerMeasurements (const MeasurementDetSystem &detSystem, const MeasurementTrackerEvent &data)
 the constructor that most of the people should be using More...
 
std::vector
< TrajectoryMeasurement
measurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 

Private Attributes

const MeasurementTrackerEventtheData
 
const MeasurementDetSystemtheDetSystem
 

Detailed Description

Definition at line 17 of file LayerMeasurements.h.

Constructor & Destructor Documentation

LayerMeasurements::LayerMeasurements ( )
inline

dummy default constructor (obviously you can't use any object created this way), but it can be needed in some cases

Definition at line 21 of file LayerMeasurements.h.

21 : theDetSystem(0), theData(0) {}
const MeasurementTrackerEvent * theData
const MeasurementDetSystem * theDetSystem
LayerMeasurements::LayerMeasurements ( const MeasurementDetSystem detSystem,
const MeasurementTrackerEvent data 
)
inline

the constructor that most of the people should be using

Definition at line 24 of file LayerMeasurements.h.

24  :
25  theDetSystem(&detSystem), theData(&data) {}
const MeasurementTrackerEvent * theData
const MeasurementDetSystem * theDetSystem

Member Function Documentation

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

Definition at line 163 of file LayerMeasurements.cc.

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

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

Definition at line 119 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, MeasurementDetWithData::isNull(), MeasurementDetWithData::measurements(), query::result, tracking::TempMeasurements::size(), and python.multivaluedict::sort().

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

Definition at line 44 of file LayerMeasurements.h.

References MeasurementDetSystem::idToDet(), theData, and theDetSystem.

44  {
45  return theDetSystem->idToDet(id, *theData);
46  }
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
const MeasurementTrackerEvent * theData
const MeasurementDetSystem * theDetSystem
vector< TrajectoryMeasurement > LayerMeasurements::measurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 91 of file LayerMeasurements.cc.

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

Referenced by HitEff::analyze(), OutInConversionSeedFinder::completeSeed(), InOutConversionSeedFinder::completeSeed(), TSGFromPropagation::findMeasurements(), FastTSGFromPropagation::findMeasurements(), NuclearInteractionFinder::findMeasurementsFromTSOS(), SiStripElectronSeedGenerator::findSeedsFromCluster(), CosmicTrackingRegion::hits_(), PixelMatchNextLayers::PixelMatchNextLayers(), and OutInConversionSeedFinder::startSeed().

94  {
95 
97 
98  vector<DetWithState> const & compatDets = layer.compatibleDets( startingState, prop, est);
99 
100  if (!compatDets.empty()) return get(theDetSystem, theData, layer, compatDets, startingState, prop, est);
101 
102  vector<TrajectoryMeasurement> result;
103  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
104 
105  if ( compat.first) {
106  result.push_back( TrajectoryMeasurement( compat.second,
108  &layer));
109  LogDebug("LayerMeasurements")<<"adding a missing hit.";
110  }else LogDebug("LayerMeasurements")<<"adding not measurement.";
111 
112 
113  return result;
114 
115 }
#define LogDebug(id)
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
const MeasurementTrackerEvent * theData
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 MeasurementTrackerEvent* LayerMeasurements::theData
private

Definition at line 51 of file LayerMeasurements.h.

Referenced by idToDet().

const MeasurementDetSystem* LayerMeasurements::theDetSystem
private

Definition at line 50 of file LayerMeasurements.h.

Referenced by idToDet().