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  vector = 12
22  };
23  inline RTTI rtti(TrackingRecHit const& hit) { return RTTI(hit.getRTTI()); }
24  inline bool isUndef(TrackingRecHit const& hit) { return rtti(hit) == undef; }
25  inline bool isNotFromCluster(TrackingRecHit const& hit) { return rtti(hit) == notFromCluster; }
26  inline bool isSingle(TrackingRecHit const& hit) { return rtti(hit) == single || rtti(hit) == fastSingle; }
27  inline bool isProjMono(TrackingRecHit const& hit) { return rtti(hit) == projMono || rtti(hit) == fastProjMono; }
28  inline bool isProjStereo(TrackingRecHit const& hit) { return rtti(hit) == projStereo || rtti(hit) == fastProjStereo; }
29  inline bool isProjected(TrackingRecHit const& hit) {
30  return ((rtti(hit) == projMono) || (rtti(hit) == projStereo)) || (rtti(hit) == fastProjMono) ||
31  (rtti(hit) == fastProjStereo);
32  }
33  inline bool isMatched(TrackingRecHit const& hit) { return rtti(hit) == match || rtti(hit) == fastMatch; }
34  inline bool isMulti(TrackingRecHit const& hit) { return rtti(hit) == multi; }
35  inline bool isSingleType(TrackingRecHit const& hit) { return (rtti(hit) > 0) && (rtti(hit) < 4); }
36  inline bool isFromDet(TrackingRecHit const& hit) {
37  return (((rtti(hit) > 0) && (rtti(hit) < 6)) || (rtti(hit) == 12));
38  }
39  inline bool isFast(TrackingRecHit const& hit) { return (rtti(hit) > 5) && (rtti(hit) <= 9); }
40  inline bool isFromDetOrFast(TrackingRecHit const& hit) {
41  return (((rtti(hit) > 0) && (rtti(hit) < 10)) || (rtti(hit) == 12));
42  }
43  inline bool isTiming(TrackingRecHit const& hit) { return rtti(hit) == mipTiming; }
44  inline bool isVector(TrackingRecHit const& hit) { return rtti(hit) == vector; }
45  inline unsigned int projId(TrackingRecHit const& hit) { return hit.rawId() + int(rtti(hit)) - 1; }
46 } // namespace trackerHitRTTI
47 
48 #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)
bool isSingle(TrackingRecHit const &hit)
bool isMulti(TrackingRecHit const &hit)
bool isVector(TrackingRecHit const &hit)
bool isUndef(TrackingRecHit const &hit)
bool isFromDetOrFast(TrackingRecHit const &hit)
bool isProjected(TrackingRecHit const &hit)