CMS 3D CMS Logo

trackerHitRTTI.h
Go to the documentation of this file.
1 #ifndef DataFormats_TrackerRecHit2D_trackerHitRTTI_H
2 #define DataFormats_TrackerRecHit2D_trackerHitRTTI_H
3 
5 
6 namespace trackerHitRTTI {
7  // tracking hit can be : single (si1D, si2D, pix), projected, matched or multi
8  enum RTTI {
9  undef = 0,
10  single = 1,
12  projMono = 3,
13  match = 4,
14  multi = 5,
18  fastMatch = 9,
20  mipTiming = 11
21  };
22  inline RTTI rtti(TrackingRecHit const& hit) { return RTTI(hit.getRTTI()); }
23  inline bool isUndef(TrackingRecHit const& hit) { return rtti(hit) == undef; }
24  inline bool isNotFromCluster(TrackingRecHit const& hit) { return rtti(hit) == notFromCluster; }
25  inline bool isSingle(TrackingRecHit const& hit) { return rtti(hit) == single || rtti(hit) == fastSingle; }
26  inline bool isProjMono(TrackingRecHit const& hit) { return rtti(hit) == projMono || rtti(hit) == fastProjMono; }
27  inline bool isProjStereo(TrackingRecHit const& hit) { return rtti(hit) == projStereo || rtti(hit) == fastProjStereo; }
28  inline bool isProjected(TrackingRecHit const& hit) {
29  return ((rtti(hit) == projMono) | (rtti(hit) == projStereo)) ||
30  (rtti(hit) == fastProjMono) | (rtti(hit) == fastProjStereo);
31  }
32  inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; }
33  inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; }
34  inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 4); }
35  inline bool isFromDet(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 6); }
36  inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) & (rtti(hit) <= 9); }
37  inline bool isFromDetOrFast(TrackingRecHit const& hit) { return (rtti(hit) > 0) & (rtti(hit) < 10); }
38  inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; }
39  inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; }
40 } // namespace trackerHitRTTI
41 
42 #endif
RTTI rtti(TrackingRecHit const &hit)
bool isSingleType(TrackingRecHit const &hit)
bool isFromDet(TrackingRecHit const &hit)
bool isNotFromCluster(TrackingRecHit const &hit)
bool isProjMono(TrackingRecHit const &hit)
unsigned int projId(TrackingRecHit const &hit)
bool isProjStereo(TrackingRecHit const &hit)
bool isTiming(TrackingRecHit const &hit)
bool isMatched(TrackingRecHit const &hit)
bool isFast(TrackingRecHit const &hit)
unsigned int getRTTI() const
bool isSingle(TrackingRecHit const &hit)
bool isMulti(TrackingRecHit const &hit)
bool isUndef(TrackingRecHit const &hit)
bool isFromDetOrFast(TrackingRecHit const &hit)
bool isProjected(TrackingRecHit const &hit)
id_type rawId() const