CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
fastTrackingHelper Namespace Reference

Functions

template<class T >
int32_t getRecHitCombinationIndex (const T &object)
 
template<class T >
void setRecHitCombinationIndex (edm::OwnVector< T > &recHits, int32_t icomb)
 

Function Documentation

template<class T >
int32_t fastTrackingHelper::getRecHitCombinationIndex ( const T object)

Definition at line 19 of file FastTrackingHelper.h.

References Exception, plotBeamSpotDB::first, trackerHitRTTI::isFast(), TrackingRecHit::recHits(), HLT_25ns14e33_v3_cff::recHits, and edm::second().

Referenced by TrackCandidateProducer::produce().

19  {
20  // seed must have at least one hit
21  if(object.recHits().first == object.recHits().second){
22  throw cms::Exception("fastTrackingHelpers::getRecHitCombinationIndex") << " given object has 0 hits" << std::endl;
23  }
24 
25  const TrackingRecHit & recHit = *object.recHits().first;
26  if(!trackerHitRTTI::isFast(recHit)){
27  throw cms::Exception("fastTrackingHelpers::setRecHitCombinationIndex") << " one of hits in OwnVector is non-fastsim" << std::endl;
28  }
29  // cast and return combination index
30  return static_cast<const FastTrackerRecHit &>(recHit).recHitCombinationIndex();
31  // return combination index of first hit
32  }
U second(std::pair< T, U > const &p)
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
bool isFast(TrackingRecHit const &hit)
template<class T >
void fastTrackingHelper::setRecHitCombinationIndex ( edm::OwnVector< T > &  recHits,
int32_t  icomb 
)
inline

Definition at line 9 of file FastTrackingHelper.h.

References Exception, and trackerHitRTTI::isFast().

Referenced by TrackCandidateProducer::produce(), TrajectorySeedProducer::produce(), and FastTSGFromPropagation::trackerSeeds().

9  {
10  for(auto & recHit : recHits){
11  if(!trackerHitRTTI::isFast(recHit)){
12  throw cms::Exception("fastTrackingHelpers::setRecHitCombinationIndex: one of hits in OwnVector is non-fastsim");
13  }
14  static_cast<FastTrackerRecHit &>(recHit).setRecHitCombinationIndex(icomb);
15  }
16  }
bool isFast(TrackingRecHit const &hit)
void setRecHitCombinationIndex(edm::OwnVector< T > &recHits, int32_t icomb)