CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DetLayer.h
Go to the documentation of this file.
1 #ifndef DetLayers_DetLayer_h
2 #define DetLayers_DetLayer_h
3 
17 
21 
22 #include <vector>
23 
24 class DetLayer : public virtual GeometricSearchDet {
25  public:
26 
29 
30  DetLayer(bool ibar) : theNavigableLayer(0), theSeqNum(-1), iAmBarrel(ibar) {}
31 
32  virtual ~DetLayer();
33 
34  // a detLayer can be either barrel or forward
35  bool isBarrel() const { return iAmBarrel;}
36  bool isForward() const { return !isBarrel();}
37 
38  // sequential number to be used in "maps"
39  int seqNum() const { return theSeqNum;}
40  void setSeqNum(int sq) { theSeqNum=sq;}
41 
42  // Extension of the interface
43 
45  virtual SubDetector subDetector() const = 0;
46 
48  virtual Location location() const = 0;
49 
52 
55 
58  template<typename... Args>
59  std::vector<const DetLayer*>
60  nextLayers(Args && ...args) const {
61  return theNavigableLayer
62  ? theNavigableLayer->nextLayers(std::forward<Args>(args)...)
63  : std::vector<const DetLayer*>();
64  }
65 
67  template<typename... Args>
68  std::vector<const DetLayer*>
69  compatibleLayers(Args && ...args) const {
70  return theNavigableLayer
71  ? theNavigableLayer->compatibleLayers(std::forward<Args>(args)...)
72  : std::vector<const DetLayer*>();
73  }
74 
75 
76  private:
78  int theSeqNum;
79  bool iAmBarrel;
80 };
81 
82 #endif
NavigableLayer * navigableLayer() const
Return the NavigableLayer associated with this DetLayer.
Definition: DetLayer.h:51
GeomDetEnumerators::Location Location
Definition: DetLayer.h:28
std::vector< const DetLayer * > compatibleLayers(Args &&...args) const
Returns all layers compatible.
Definition: DetLayer.h:69
void setSeqNum(int sq)
Definition: DetLayer.h:40
virtual Location location() const =0
Which part of the detector (barrel, endcap)
bool isForward() const
Definition: DetLayer.h:36
void setNavigableLayer(NavigableLayer *nlp)
Set the NavigableLayer associated with this DetLayer.
Definition: DetLayer.cc:7
virtual SubDetector subDetector() const =0
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)
virtual std::vector< const DetLayer * > compatibleLayers(NavigationDirection direction) const =0
int seqNum() const
Definition: DetLayer.h:39
NavigableLayer * theNavigableLayer
Definition: DetLayer.h:77
virtual ~DetLayer()
Definition: DetLayer.cc:4
bool iAmBarrel
Definition: DetLayer.h:79
GeomDetEnumerators::SubDetector SubDetector
Definition: DetLayer.h:27
bool isBarrel() const
Definition: DetLayer.h:35
int theSeqNum
Definition: DetLayer.h:78
dictionary args
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection direction) const =0
DetLayer(bool ibar)
Definition: DetLayer.h:30
std::vector< const DetLayer * > nextLayers(Args &&...args) const
Definition: DetLayer.h:60