CMS 3D CMS Logo

SiStripSubStructure.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripDetId
4 // Class : SiStripSubStructure
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: dkcira
10 // Created: Wed Jan 25 07:19:38 CET 2006
11 //
14 #include <algorithm>
15 
17 
18 void SiStripSubStructure::getTIBDetectors(const std::vector<uint32_t> &inputDetRawIds,
19  std::vector<uint32_t> &tibDetRawIds,
20  const TrackerTopology *tTopo,
21  uint32_t rq_layer,
22  uint32_t rq_bkw_frw,
23  uint32_t rq_int_ext,
24  uint32_t rq_string) {
25  std::copy_if(std::begin(inputDetRawIds),
26  std::end(inputDetRawIds),
27  std::back_inserter(tibDetRawIds),
28  [tTopo, rq_layer, rq_bkw_frw, rq_int_ext, rq_string](DetId det) {
29  return ((StripSubdetector::TIB == det.subdetId())
30  // check if TIB is from the ones requested
31  // take everything if default value is 0
32  && ((rq_layer == 0) || (rq_layer == tTopo->tibLayer(det))) &&
33  ((rq_bkw_frw == 0) || (rq_bkw_frw == tTopo->tibSide(det))) &&
34  ((rq_int_ext == 0) || (rq_int_ext == tTopo->tibOrder(det))) &&
35  ((rq_string == 0) || (rq_string == tTopo->tibString(det))));
36  });
37 }
38 
39 void SiStripSubStructure::getTIDDetectors(const std::vector<uint32_t> &inputDetRawIds,
40  std::vector<uint32_t> &tidDetRawIds,
41  const TrackerTopology *tTopo,
42  uint32_t rq_side,
43  uint32_t rq_wheel,
44  uint32_t rq_ring,
45  uint32_t rq_ster) {
46  std::copy_if(std::begin(inputDetRawIds),
47  std::end(inputDetRawIds),
48  std::back_inserter(tidDetRawIds),
49  [tTopo, rq_side, rq_wheel, rq_ring, rq_ster](DetId det) {
50  return ((StripSubdetector::TID == det.subdetId())
51  // check if TID is from the ones requested
52  // take everything if default value is 0
53  && ((rq_side == 0) || (rq_side == tTopo->tidSide(det))) &&
54  ((rq_wheel == 0) || (rq_wheel == tTopo->tidWheel(det))) &&
55  ((rq_ring == 0) || (rq_ring == tTopo->tidRing(det))) &&
56  ((rq_ster == 0) || (rq_ster == tTopo->tidStereo(det))));
57  });
58 }
59 
60 void SiStripSubStructure::getTOBDetectors(const std::vector<uint32_t> &inputDetRawIds,
61  std::vector<uint32_t> &tobDetRawIds,
62  const TrackerTopology *tTopo,
63  uint32_t rq_layer,
64  uint32_t rq_bkw_frw,
65  uint32_t rq_rod) {
66  std::copy_if(std::begin(inputDetRawIds),
67  std::end(inputDetRawIds),
68  std::back_inserter(tobDetRawIds),
69  [tTopo, rq_layer, rq_bkw_frw, rq_rod](DetId det) {
70  return ((StripSubdetector::TOB == det.subdetId())
71  // check if TOB is from the ones requested
72  // take everything if default value is 0
73  && ((rq_layer == 0) || (rq_layer == tTopo->tobLayer(det))) &&
74  ((rq_bkw_frw == 0) || (rq_bkw_frw == tTopo->tobSide(det))) &&
75  ((rq_rod == 0) || (rq_rod == tTopo->tobRod(det))));
76  });
77 }
78 
79 void SiStripSubStructure::getTECDetectors(const std::vector<uint32_t> &inputDetRawIds,
80  std::vector<uint32_t> &tecDetRawIds,
81  const TrackerTopology *tTopo,
82  uint32_t rq_side,
83  uint32_t rq_wheel,
84  uint32_t rq_petal_bkw_frw,
85  uint32_t rq_petal,
86  uint32_t rq_ring,
87  uint32_t rq_ster) {
88  std::copy_if(std::begin(inputDetRawIds),
89  std::end(inputDetRawIds),
90  std::back_inserter(tecDetRawIds),
91  [tTopo, rq_side, rq_wheel, rq_petal_bkw_frw, rq_petal, rq_ring, rq_ster](DetId det) {
92  return ((StripSubdetector::TEC == det.subdetId())
93  // check if TEC is from the ones requested
94  // take everything if default value is 0
95  && ((rq_side == 0) || (rq_side == tTopo->tecSide(det))) &&
96  ((rq_wheel == 0) || (rq_wheel == tTopo->tecWheel(det))) &&
97  ((rq_petal_bkw_frw == 0) || (rq_petal_bkw_frw - 1 == tTopo->tecOrder(det))) &&
98  ((rq_petal == 0) || (rq_petal == tTopo->tecPetalNumber(det))) &&
99  ((rq_ring == 0) || (rq_ring == tTopo->tecRing(det))) &&
100  ((rq_ster == 0) || (rq_ster == tTopo->tecStereo(det))));
101  });
102 }
unsigned int tecPetalNumber(const DetId &id) const
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
unsigned int tibSide(const DetId &id) const
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0)
unsigned int tobSide(const DetId &id) const
unsigned int tibOrder(const DetId &id) const
uint32_t tidStereo(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tibString(const DetId &id) const
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0)
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0)
unsigned int tecRing(const DetId &id) const
ring id
unsigned int tecSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int tecOrder(const DetId &id) const
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TIB
unsigned int tobRod(const DetId &id) const
unsigned int tidRing(const DetId &id) const
uint32_t tecStereo(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0)
static constexpr auto TID