CMS 3D CMS Logo

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

#include <LayerMeasurements.h>

Public Types

using SimpleHitContainer = std::vector< BaseTrackerRecHit * >
 

Public Member Functions

void addInvalidMeas (std::vector< TrajectoryMeasurement > &measVec, const DetGroup &group, const DetLayer &layer) const
 
std::vector< TrajectoryMeasurementGroupgroupedMeasurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
MeasurementDetWithData idToDet (const DetId &id) const
 
 LayerMeasurements ()
 
 LayerMeasurements (const MeasurementDetSystem &detSystem, const MeasurementTrackerEvent &data)
 
std::vector< TrajectoryMeasurementmeasurements (const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
bool recHits (SimpleHitContainer &result, const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 

Private Attributes

const MeasurementTrackerEventtheData
 
const MeasurementDetSystemtheDetSystem
 

Detailed Description

Definition at line 21 of file LayerMeasurements.h.

Member Typedef Documentation

Definition at line 24 of file LayerMeasurements.h.

Constructor & Destructor Documentation

LayerMeasurements::LayerMeasurements ( )
inline

Definition at line 28 of file LayerMeasurements.h.

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

Definition at line 31 of file LayerMeasurements.h.

References addInvalidMeas(), edmIntegrityCheck::group, groupedMeasurements(), measurements(), recHits(), and mps_fire::result.

31  :
32  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 183 of file LayerMeasurements.cc.

References TrackingRecHit::missing.

Referenced by LayerMeasurements().

186 {
187  if (!measVec.empty()) {
188  // invalidMeas on Det of most compatible hit
189  auto const & ts = measVec.front().predictedState();
190  auto toll = measVec.front().recHitR().det()->surface().bounds().significanceInside(ts.localPosition(),ts.localError().positionError());
191  measVec.emplace_back(measVec.front().predictedState(),
192  std::make_shared<InvalidTrackingRecHit>(*measVec.front().recHitR().det(), TrackingRecHit::missing),
193  toll,&layer);
194  }
195  else if (!group.empty()) {
196  // invalid state on first compatible Det
197  auto const & ts = group.front().trajectoryState();
198  auto toll = group.front().det()->surface().bounds().significanceInside(ts.localPosition(),ts.localError().positionError());
199  measVec.emplace_back(group.front().trajectoryState(),
200  std::make_shared<InvalidTrackingRecHit>(*group.front().det(), TrackingRecHit::missing), toll,&layer);
201  }
202 }
vector< TrajectoryMeasurementGroup > LayerMeasurements::groupedMeasurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 138 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(), LogDebug, MeasurementDetWithData::measurements(), eostools::move(), mps_fire::result, tracking::TempMeasurements::size(), and GeometricSearchDet::surface().

Referenced by LayerMeasurements().

141  {
142  vector<TrajectoryMeasurementGroup> result;
143 
144  vector<DetGroup> && groups = layer.groupedCompatibleDets( startingState, prop, est);
145  result.reserve(groups.size());
146 
148  for (auto& grp : groups) {
149  if ( grp.empty() ) continue;
150 
151  vector<TrajectoryMeasurement> tmpVec;
152  for (auto const & det : grp) {
153  MeasurementDetWithData mdet = theDetSystem->idToDet(det.det()->geographicalId(), *theData);
154  if (mdet.isNull()) {
155  throw MeasurementDetException( "MeasurementDet not found");
156  }
157  if (mdet.measurements( det.trajectoryState(), est,tmps))
158  for (std::size_t i=0; i!=tmps.size(); ++i)
159  tmpVec.emplace_back(det.trajectoryState(),std::move(tmps.hits[i]),tmps.distances[i],&layer);
160  tmps.clear();
161  }
162 
163  // sort the final result
164  LogDebug("LayerMeasurements")<<"Sorting " << tmpVec.size() << " measurements in this grp.";
165  sort( tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
166  addInvalidMeas( tmpVec, grp,layer);
167  result.emplace_back(std::move(tmpVec), std::move(grp));
168  }
169 
170 
171  // if the result is empty check if the layer is compatible (for invalid measurement)
172  if (result.empty()) {
173  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
174  if ( compat.first) {
175  vector<TrajectoryMeasurement> tmVec;
176  tmVec.emplace_back(compat.second, std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive), 0.F,&layer);
177  result.emplace_back(std::move(tmVec), DetGroup());
178  }
179  }
180  return result;
181 }
#define LogDebug(id)
std::size_t size() const
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
const MeasurementTrackerEvent * theData
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
void addInvalidMeas(std::vector< TrajectoryMeasurement > &measVec, const DetGroup &group, const DetLayer &layer) const
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
const MeasurementDetSystem * theDetSystem
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
def move(src, dest)
Definition: eostools.py:510
MeasurementDetWithData LayerMeasurements::idToDet ( const DetId id) const
inline

Definition at line 59 of file LayerMeasurements.h.

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

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

Definition at line 110 of file LayerMeasurements.cc.

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

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

113  {
114 
116 
117  vector<DetWithState> const & compatDets = layer.compatibleDets( startingState, prop, est);
118 
119  if (!compatDets.empty()) return get(theDetSystem, theData, layer, compatDets, startingState, prop, est);
120 
121  vector<TrajectoryMeasurement> result;
122  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
123 
124  if ( compat.first) {
125  result.push_back( TrajectoryMeasurement( compat.second,
126  std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive), 0.F,
127  &layer));
128  LogDebug("LayerMeasurements")<<"adding a missing hit.";
129  }else LogDebug("LayerMeasurements")<<"adding not measurement.";
130 
131 
132  return result;
133 
134 }
#define LogDebug(id)
const MeasurementTrackerEvent * theData
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
const MeasurementDetSystem * theDetSystem
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
bool LayerMeasurements::recHits ( SimpleHitContainer result,
const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Definition at line 92 of file LayerMeasurements.cc.

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

Referenced by LayerMeasurements().

96  {
97 
98  auto const & compatDets = layer.compatibleDets( startingState, prop, est);
99  if (compatDets.empty()) return false;
100  bool ret=false;
101  for ( auto const & ds : compatDets) {
102  auto mdet = theDetSystem->idToDet(ds.first->geographicalId(), *theData);
103  ret |=mdet.recHits(result,ds.second,est);
104  }
105  return ret;
106 }
const MeasurementTrackerEvent * theData
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
RecHitContainer recHits(const TrajectoryStateOnSurface &tsos) const
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
const MeasurementDetSystem * theDetSystem

Member Data Documentation

const MeasurementTrackerEvent* LayerMeasurements::theData
private

Definition at line 66 of file LayerMeasurements.h.

Referenced by idToDet().

const MeasurementDetSystem* LayerMeasurements::theDetSystem
private

Definition at line 65 of file LayerMeasurements.h.

Referenced by idToDet().