CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< TrajectoryMeasurementGroup
groupedMeasurements (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
< TrajectoryMeasurement
measurements (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(0), theData(0) {}
const MeasurementTrackerEvent * theData
const MeasurementDetSystem * theDetSystem
LayerMeasurements::LayerMeasurements ( const MeasurementDetSystem detSystem,
const MeasurementTrackerEvent data 
)
inline

Definition at line 31 of file LayerMeasurements.h.

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 182 of file LayerMeasurements.cc.

References TrackingRecHit::missing.

185 {
186  if (!measVec.empty()) {
187  // invalidMeas on Det of most compatible hit
188  measVec.emplace_back(measVec.front().predictedState(),
189  std::make_shared<InvalidTrackingRecHit>(*measVec.front().recHit()->det(), TrackingRecHit::missing),
190  0.,&layer);
191  }
192  else if (!group.empty()) {
193  // invalid state on first compatible Det
194  measVec.emplace_back(group.front().trajectoryState(),
195  std::make_shared<InvalidTrackingRecHit>(*group.front().det(), TrackingRecHit::missing), 0.,&layer);
196  }
197 }
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, i, TrackingRecHit::inactive, MeasurementDetWithData::isNull(), MeasurementDetWithData::measurements(), query::result, tracking::TempMeasurements::size(), python.multivaluedict::sort(), and GeometricSearchDet::surface().

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  sort( tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
165  addInvalidMeas( tmpVec, grp,layer);
166  result.emplace_back(std::move(tmpVec), std::move(grp));
167  }
168 
169 
170  // if the result is empty check if the layer is compatible (for invalid measurement)
171  if (result.empty()) {
172  pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
173  if ( compat.first) {
174  vector<TrajectoryMeasurement> tmVec;
175  tmVec.emplace_back(compat.second, std::make_shared<InvalidTrackingRecHitNoDet>(layer.surface(), TrackingRecHit::inactive), 0.F,&layer);
176  result.emplace_back(std::move(tmVec), DetGroup());
177  }
178  }
179  return result;
180 }
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
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
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
bool measurements(const TrajectoryStateOnSurface &stateOnThisDet, const MeasurementEstimator &est, TempMeasurements &result) const
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  }
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 110 of file LayerMeasurements.cc.

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

Referenced by SiPixelHitEfficiencySource::analyze(), HitEff::analyze(), OutInConversionSeedFinder::completeSeed(), InOutConversionSeedFinder::completeSeed(), TSGFromPropagation::findMeasurements(), FastTSGFromPropagation::findMeasurements(), NuclearInteractionFinder::findMeasurementsFromTSOS(), SiStripElectronSeedGenerator::findSeedsFromCluster(), CosmicTrackingRegion::hits_(), 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)
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const =0
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
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
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(), MeasurementDetWithData::recHits(), and run_regression::ret.

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 }
virtual MeasurementDetWithData idToDet(const DetId &id, const MeasurementTrackerEvent &data) const =0
const MeasurementTrackerEvent * theData
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
RecHitContainer recHits(const TrajectoryStateOnSurface &tsos) const
tuple result
Definition: query.py:137
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().