CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerLayerIdAccessor.h
Go to the documentation of this file.
1 #ifndef TRACKERLAYERIDACCESSOR_H
2 #define TRACKERLAYERIDACCESSOR_H
3 
4 
13 
14 #include<ext/functional>
15 
16 
17 //class DetIdComparator : public binary_function<DetId, DetId, bool> {
19 public:
20  bool operator()( DetId i1, DetId i2 ) const {
21  return (*this)(i1.rawId(),i2.rawId());
22  };
23  virtual bool operator()(uint32_t i1, uint32_t i2 ) const =0;
24 };
25 
27  public:
28  virtual bool operator()(uint32_t i1,uint32_t i2 ) const {
29  TIBDetId id1(i1);
30  TIBDetId id2(i2);
31  if ((id1.det() == id2.det()) &&
32  (id1.subdetId() == id2.subdetId()) &&
33  (id1.layer() == id2.layer())) return false;
34  return (id1<id2);
35  }
36 };
38  public:
39  virtual bool operator()(uint32_t i1,uint32_t i2 ) const {
40  TOBDetId id1(i1);
41  TOBDetId id2(i2);
42  if ((id1.det() == id2.det()) &&
43  (id1.subdetId() == id2.subdetId()) &&
44  (id1.layer() == id2.layer())) return false;
45  return (id1<id2);
46  }
47 };
49  public:
50  virtual bool operator()(uint32_t i1,uint32_t i2 ) const {
51  PXBDetId id1(i1);
52  PXBDetId id2(i2);
53  if ((id1.det() == id2.det()) &&
54  (id1.subdetId() == id2.subdetId()) &&
55  (id1.layer() == id2.layer())) return false;
56  return (id1<id2);
57  }
58 };
60  public:
61  virtual bool operator()(uint32_t i1,uint32_t i2 ) const {
62  PXFDetId id1(i1);
63  PXFDetId id2(i2);
64  if ((id1.det() == id2.det()) &&
65  (id1.subdetId() == id2.subdetId()) &&
66  (id1.side() == id2.side()) &&
67  (id1.disk() == id2.disk())) return false;
68  return (id1<id2);
69  }
70 };
72  public:
73  virtual bool operator()(uint32_t i1,uint32_t i2 ) const {
74  TECDetId id1(i1);
75  TECDetId id2(i2);
76  if ((id1.det() == id2.det()) &&
77  (id1.subdetId() == id2.subdetId()) &&
78  (id1.side() == id2.side()) &&
79  (id1.wheel() == id2.wheel())) return false;
80  return (id1<id2);
81  }
82 };
84  public:
85  virtual bool operator()(uint32_t i1,uint32_t i2 ) const {
86  TIDDetId id1(i1);
87  TIDDetId id2(i2);
88  if ((id1.det() == id2.det()) &&
89  (id1.subdetId() == id2.subdetId()) &&
90  (id1.side() == id2.side()) &&
91  (id1.wheel() == id2.wheel())) return false;
92  return (id1<id2);
93  }
94 };
95 
96 
98  public:
99  //
100  // returns a valid DetId + a valid comaprator for the RangeMap
101  //
102  typedef std::pair<DetId,DetIdComparator&> returnType;
104  std::pair<DetId,DetIdPXBSameLayerComparator> pixelBarrelLayer(int layer);
105  std::pair<DetId,DetIdPXFSameDiskComparator> pixelForwardDisk(int side,int disk);
106  std::pair<DetId,DetIdTIBSameLayerComparator> stripTIBLayer(int layer);
107  std::pair<DetId,DetIdTOBSameLayerComparator> stripTOBLayer(int layer);
108  std::pair<DetId,DetIdTECSameDiskComparator> stripTECDisk(int side,int disk);
109  std::pair<DetId,DetIdTIDSameDiskComparator> stripTIDDisk(int side,int disk);
110 
111  private:
112 
113 };
114 
115 #endif
116 
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
std::pair< DetId, DetIdTIDSameDiskComparator > stripTIDDisk(int side, int disk)
virtual bool operator()(uint32_t i1, uint32_t i2) const
std::pair< DetId, DetIdComparator & > returnType
std::pair< DetId, DetIdTIBSameLayerComparator > stripTIBLayer(int layer)
std::pair< DetId, DetIdPXFSameDiskComparator > pixelForwardDisk(int side, int disk)
virtual bool operator()(uint32_t i1, uint32_t i2) const
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
std::pair< DetId, DetIdTOBSameLayerComparator > stripTOBLayer(int layer)
virtual bool operator()(uint32_t i1, uint32_t i2) const
std::pair< DetId, DetIdTECSameDiskComparator > stripTECDisk(int side, int disk)
virtual bool operator()(uint32_t i1, uint32_t i2) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
bool operator()(DetId i1, DetId i2) const
Definition: DetId.h:20
virtual bool operator()(uint32_t i1, uint32_t i2) const
unsigned int side() const
positive or negative id
Definition: TIDDetId.h:45
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
std::pair< DetId, DetIdPXBSameLayerComparator > pixelBarrelLayer(int layer)
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
virtual bool operator()(uint32_t i1, uint32_t i2) const
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50