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, std::vector<uint32_t> & tibDetRawIds,
19  const TrackerTopology* tTopo,
20  uint32_t rq_layer, uint32_t rq_bkw_frw, uint32_t rq_int_ext, uint32_t rq_string)
21 {
22  std::copy_if(std::begin(inputDetRawIds), std::end(inputDetRawIds), std::back_inserter(tibDetRawIds),
23  [tTopo,rq_layer,rq_bkw_frw,rq_int_ext,rq_string] ( DetId det ) {
24  return ( ( StripSubdetector::TIB == det.subdetId() )
25  // check if TIB is from the ones requested
26  // take everything if default value is 0
27  && ( (rq_layer == 0) || (rq_layer == tTopo->tibLayer (det)) )
28  && ( (rq_bkw_frw == 0) || (rq_bkw_frw == tTopo->tibSide (det)) )
29  && ( (rq_int_ext == 0) || (rq_int_ext == tTopo->tibOrder (det)) )
30  && ( (rq_string == 0) || (rq_string == tTopo->tibString(det)) )
31  );
32  });
33 }
34 
35 void SiStripSubStructure::getTIDDetectors(const std::vector<uint32_t> & inputDetRawIds, std::vector<uint32_t> & tidDetRawIds,
36  const TrackerTopology* tTopo,
37  uint32_t rq_side, uint32_t rq_wheel, uint32_t rq_ring, uint32_t rq_ster)
38 {
39  std::copy_if(std::begin(inputDetRawIds), std::end(inputDetRawIds), std::back_inserter(tidDetRawIds),
40  [tTopo,rq_side,rq_wheel,rq_ring,rq_ster] ( DetId det ) {
41  return ( ( StripSubdetector::TID == det.subdetId() )
42  // check if TID is from the ones requested
43  // take everything if default value is 0
44  && ( (rq_side == 0) || (rq_side == tTopo->tidSide (det)) )
45  && ( (rq_wheel == 0) || (rq_wheel == tTopo->tidWheel (det)) )
46  && ( (rq_ring == 0) || (rq_ring == tTopo->tidRing (det)) )
47  && ( (rq_ster == 0) || (rq_ster == tTopo->tidStereo(det)) )
48  );
49  });
50 }
51 
52 void SiStripSubStructure::getTOBDetectors(const std::vector<uint32_t> & inputDetRawIds, std::vector<uint32_t> & tobDetRawIds,
53  const TrackerTopology* tTopo,
54  uint32_t rq_layer, uint32_t rq_bkw_frw, uint32_t rq_rod)
55 {
56  std::copy_if(std::begin(inputDetRawIds), std::end(inputDetRawIds), std::back_inserter(tobDetRawIds),
57  [tTopo,rq_layer,rq_bkw_frw,rq_rod] ( DetId det ) {
58  return ( ( StripSubdetector::TOB == det.subdetId() )
59  // check if TOB is from the ones requested
60  // take everything if default value is 0
61  && ( (rq_layer == 0) || (rq_layer == tTopo->tobLayer (det)) )
62  && ( (rq_bkw_frw == 0) || (rq_bkw_frw == tTopo->tobSide (det)) )
63  && ( (rq_rod == 0) || (rq_rod == tTopo->tobRod (det)) )
64  );
65  });
66 }
67 
68 
69 void SiStripSubStructure::getTECDetectors(const std::vector<uint32_t> & inputDetRawIds, std::vector<uint32_t> & tecDetRawIds,
70  const TrackerTopology* tTopo,
71  uint32_t rq_side, uint32_t rq_wheel, uint32_t rq_petal_bkw_frw, uint32_t rq_petal, uint32_t rq_ring, uint32_t rq_ster)
72 {
73  std::copy_if(std::begin(inputDetRawIds), std::end(inputDetRawIds), std::back_inserter(tecDetRawIds),
74  [tTopo,rq_side,rq_wheel,rq_petal_bkw_frw,rq_petal,rq_ring,rq_ster] ( DetId det ) {
75  return ( ( StripSubdetector::TEC == det.subdetId() )
76  // check if TEC is from the ones requested
77  // take everything if default value is 0
78  && ( (rq_side == 0) || (rq_side == tTopo->tecSide (det)) )
79  && ( (rq_wheel == 0) || (rq_wheel == tTopo->tecWheel (det)) )
80  && ( (rq_petal_bkw_frw == 0) || (rq_petal_bkw_frw-1 == tTopo->tecOrder (det)) )
81  && ( (rq_petal == 0) || (rq_petal == tTopo->tecPetalNumber(det)) )
82  && ( (rq_ring == 0) || (rq_ring == tTopo->tecRing (det)) )
83  && ( (rq_ster == 0) || (rq_ster == tTopo->tecStereo (det)) )
84  );
85  });
86 }
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 tibLayer(const DetId &id) const
unsigned int tibString(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
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)
unsigned int tidWheel(const DetId &id) const
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 tibSide(const DetId &id) const
unsigned int tidSide(const DetId &id) const
uint32_t tidStereo(const DetId &id) const
unsigned int tobSide(const DetId &id) const
#define end
Definition: vmac.h:39
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
unsigned int tecOrder(const DetId &id) const
#define begin
Definition: vmac.h:32
uint32_t tecStereo(const DetId &id) const
unsigned int tecPetalNumber(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)
unsigned int tobRod(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
unsigned int tibOrder(const DetId &id) const