CMS 3D CMS Logo

Functions
fastTrackingUtilities Namespace Reference

Functions

template<class T >
int32_t getRecHitCombinationIndex (const T &object)
 
bool hitIsMasked (const FastTrackerRecHit *hit, const std::vector< bool > &hitMasks)
 
double hitLocalError (const TrackingRecHit *hit)
 
template<class T >
void setRecHitCombinationIndex (edm::OwnVector< T > &recHits, int32_t icomb)
 

Function Documentation

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

Definition at line 20 of file FastTrackingUtilities.h.

References Exception, plotBeamSpotDB::first, trackerHitRTTI::isFast(), rpcPointValidation_cfi::recHit, and edm::second().

Referenced by TrackCandidateProducer::produce().

21  {
22  // seed must have at least one hit
23  if(object.recHits().first == object.recHits().second){
24  throw cms::Exception("fastTrackingHelpers::getRecHitCombinationIndex") << " given object has 0 hits" << std::endl;
25  }
26 
27  const TrackingRecHit & recHit = *object.recHits().first;
28  if(!trackerHitRTTI::isFast(recHit)){
29  throw cms::Exception("fastTrackingHelpers::setRecHitCombinationIndex") << " one of hits in OwnVector is non-fastsim" << std::endl;
30  }
31  // cast and return combination index
32  return static_cast<const FastTrackerRecHit &>(recHit).recHitCombinationIndex();
33  // return combination index of first hit
34  }
U second(std::pair< T, U > const &p)
bool isFast(TrackingRecHit const &hit)
bool fastTrackingUtilities::hitIsMasked ( const FastTrackerRecHit hit,
const std::vector< bool > &  hitMasks 
)
inline

Definition at line 37 of file FastTrackingUtilities.h.

References mps_fire::i, FastTrackerRecHit::id(), and FastTrackerRecHit::nIds().

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

38  {
39  for(unsigned int i = 0;i<hit->nIds();i++)
40  {
41  if(!(hitMasks)[hit->id(i)])
42  {
43  return false;
44  }
45  }
46  return true;
47  }
virtual size_t nIds() const
virtual int32_t id(size_t i=0) const
double fastTrackingUtilities::hitLocalError ( const TrackingRecHit hit)
inline

Definition at line 49 of file FastTrackingUtilities.h.

References delta, TrackingRecHit::localPositionError(), mathSSE::sqrt(), geometryCSVtoXML::xx, LocalError::xx(), geometryCSVtoXML::xy, LocalError::xy(), geometryCSVtoXML::yy, and LocalError::yy().

Referenced by TrackCandidateProducer::produce().

50  {
51  double xx = hit->localPositionError().xx();
52  double yy = hit->localPositionError().yy();
53  double xy = hit->localPositionError().xy();
54  double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
55  return 0.5 * (xx+yy-delta);
56  }
dbl * delta
Definition: mlp_gen.cc:36
float xx() const
Definition: LocalError.h:24
float xy() const
Definition: LocalError.h:25
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
virtual LocalError localPositionError() const =0
template<class T >
void fastTrackingUtilities::setRecHitCombinationIndex ( edm::OwnVector< T > &  recHits,
int32_t  icomb 
)
inline

Definition at line 10 of file FastTrackingUtilities.h.

References Exception, trackerHitRTTI::isFast(), and rpcPointValidation_cfi::recHit.

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

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