CMS 3D CMS Logo

Public Member Functions | Private Attributes

LayerMeasurements Class Reference

#include <LayerMeasurements.h>

List of all members.

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.

                                                             :
    theDetSystem (detSysytem) {}

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 combine::missing.

{
  if (!measVec.empty()) {
    // invalidMeas on Det of most compatible hit
    measVec.emplace_back(measVec.front().predictedState(), 
                         InvalidTransientRecHit::build(measVec.front().recHit()->det(), TrackingRecHit::missing),
                         0.,&layer);
  }
  else if (!group.empty()) {
    // invalid state on first compatible Det
    measVec.emplace_back(group.front().trajectoryState(), 
                         InvalidTransientRecHit::build(group.front().det(), TrackingRecHit::missing), 0.,&layer);
  }
}
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().

                                                                               {
  vector<TrajectoryMeasurementGroup> result;
  
  vector<DetGroup> && groups = layer.groupedCompatibleDets( startingState, prop, est);
  result.reserve(groups.size());

  tracking::TempMeasurements tmps;
  for (auto&  grp : groups) {
    if ( grp.empty() )  continue;
    
    vector<TrajectoryMeasurement> tmpVec;
    for (auto const & det : grp) {
      const MeasurementDet* mdet = theDetSystem->idToDet(det.det()->geographicalId());
      if (mdet == 0) {
        throw MeasurementDetException( "MeasurementDet not found");
      }      
      if (mdet->measurements( det.trajectoryState(), est,tmps))
        for (std::size_t i=0; i!=tmps.size(); ++i)
          tmpVec.emplace_back(det.trajectoryState(),std::move(tmps.hits[i]),tmps.distances[i],&layer);
      tmps.clear();
    }
    
    // sort the final result
    sort( tmpVec.begin(), tmpVec.end(), TrajMeasLessEstim());
    addInvalidMeas( tmpVec, grp,layer); 
    result.emplace_back(std::move(tmpVec), std::move(grp));
  }


  // if the result is empty check if the layer is compatible (for invalid measurement)
  if (result.empty()) {
    pair<bool, TrajectoryStateOnSurface> compat = layer.compatible( startingState, prop, est);
    if ( compat.first) {
      TrajectoryMeasurement inval( compat.second, InvalidTransientRecHit::build(0, TrackingRecHit::inactive,&layer), 0.F,&layer);
      vector<TrajectoryMeasurement> tmVec(1,inval);
      result.push_back( TrajectoryMeasurementGroup( tmVec, DetGroup()));
    }
  }
  return result;
}
vector< TrajectoryMeasurement > LayerMeasurements::measurements ( const DetLayer layer,
const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const

Member Data Documentation

Definition at line 41 of file LayerMeasurements.h.