CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 //
12 
19 
20 using namespace std;
21 
23 }
24 
26 }
27 
28 
29 void SiStripSubStructure::getTIBDetectors(const std::vector<uint32_t> & inputDetRawIds,
30  std::vector<uint32_t> & tibDetRawIds,
31  uint32_t requested_layer,
32  uint32_t requested_bkw_frw,
33  uint32_t requested_int_ext,
34  uint32_t requested_string) const{
35  // loop over all input detectors
36  for(vector<uint32_t>::const_iterator it = inputDetRawIds.begin(); it!=inputDetRawIds.end();it++){
37  uint32_t therawid = (*it); // raw id of single detector
38  TIBDetId potentialTIB = TIBDetId(therawid); // build TIBDetId, at this point is just DetId, but do not want to cast twice
39  if( potentialTIB.subdetId() == int (StripSubdetector::TIB) ){ // check if subdetector field is a TIB, both tested numbers are int
40  if( // check if TIB is from the ones requested
41  ( (potentialTIB.layer()==requested_layer) || requested_layer==0 ) // take everything if default value is 0
42  && ( ((potentialTIB.string()).at(0)==(requested_bkw_frw)) || requested_bkw_frw==0 )
43  && ( ((potentialTIB.string()).at(1)==(requested_int_ext)) || requested_int_ext==0 )
44  && ( ((potentialTIB.string()).at(2)==requested_string) || requested_string==0 )
45  ){
46  tibDetRawIds.push_back(therawid); // add detector to list of selected TIBdets
47  }
48  }
49  }
50 }
51 
52 
53 void SiStripSubStructure::getTIDDetectors(const std::vector<uint32_t> & inputDetRawIds,
54  std::vector<uint32_t> & tidDetRawIds,
55  uint32_t requested_side,
56  uint32_t requested_wheel,
57  uint32_t requested_ring,
58  uint32_t requested_ster) const{
59  // loop over all input detectors
60  for(vector<uint32_t>::const_iterator it = inputDetRawIds.begin(); it!=inputDetRawIds.end();it++){
61  uint32_t therawid = (*it); // raw id of single detector
62  TIDDetId potentialTID = TIDDetId(therawid); // build TIDDetId, at this point is just DetId, but do not want to cast twice
63  if( potentialTID.subdetId() == int (StripSubdetector::TID) ){ // check if subdetector field is a TID, both tested numbers are int
64  if( // check if TID is from the ones requested
65  ( (potentialTID.side()==requested_side) || requested_side==0 ) // take everything if default value is 0
66  && ( (potentialTID.wheel()==requested_wheel) || requested_wheel==0 )
67  && ( (potentialTID.ring()==requested_ring) || requested_ring==0 )
68  && ( (potentialTID.stereo()==requested_ster) || requested_ster==0 )
69  ){
70  tidDetRawIds.push_back(therawid); // add detector to list of selected TIDdets
71  }
72  }
73  }
74 }
75 
76 
77 void SiStripSubStructure::getTOBDetectors(const std::vector<uint32_t> & inputDetRawIds,
78  std::vector<uint32_t> & tobDetRawIds,
79  uint32_t requested_layer,
80  uint32_t requested_bkw_frw,
81  uint32_t requested_rod) const{
82  // loop over all input detectors
83  for(vector<uint32_t>::const_iterator it = inputDetRawIds.begin(); it!=inputDetRawIds.end();it++){
84  uint32_t therawid = (*it); // raw id of single detector
85  TOBDetId potentialTOB = TOBDetId(therawid); // build TOBDetId, at this point is just DetId, but do not want to cast twice
86  if( potentialTOB.subdetId() == int (StripSubdetector::TOB) ){ // check if subdetector field is a TOB, both tested numbers are int
87  if( // check if TOB is from the ones requested
88  ( (potentialTOB.layer()==requested_layer) || requested_layer==0 ) // take everything if default value is 0
89  && ( ((potentialTOB.rod()).at(0)==(requested_bkw_frw)) || requested_bkw_frw==0 )
90  && ( ((potentialTOB.rod()).at(1)==requested_rod) || requested_rod==0 )
91  ){
92  tobDetRawIds.push_back(therawid); // add detector to list of selected TOBdets
93  }
94  }
95  }
96 }
97 
98 
99 void SiStripSubStructure::getTECDetectors(const std::vector<uint32_t> & inputDetRawIds,
100  std::vector<uint32_t> & tecDetRawIds,
101  uint32_t requested_side,
102  uint32_t requested_wheel,
103  uint32_t requested_petal_bkw_frw,
104  uint32_t requested_petal,
105  uint32_t requested_ring,
106  uint32_t requested_ster) const{
107  // loop over all input detectors
108  for(vector<uint32_t>::const_iterator it = inputDetRawIds.begin(); it!=inputDetRawIds.end();it++){
109  uint32_t therawid = (*it); // raw id of single detector
110  TECDetId potentialTEC = TECDetId(therawid); // build TECDetId, at this point is just DetId, but do not want to cast twice
111  if( potentialTEC.subdetId() == int (StripSubdetector::TEC) ){ // check if subdetector field is a TEC, both tested numbers are int
112  if( // check if TEC is from the ones requested
113  ( (potentialTEC.side()==requested_side) || requested_side==0 ) // take everything if default value is 0
114  && ( (potentialTEC.wheel()==requested_wheel) || requested_wheel==0 )
115  && ( ((potentialTEC.petal()).at(0)==(requested_petal_bkw_frw-1)) || requested_petal_bkw_frw==0 )
116  && ( ((potentialTEC.petal()).at(1)==requested_petal) || requested_petal==0 )
117  && ( (potentialTEC.ring()==requested_ring) || requested_ring==0 )
118  && ( (potentialTEC.stereo()==requested_ster) || requested_ster==0 )
119  ){
120  tecDetRawIds.push_back(therawid); // add detector to list of selected TECdets
121  }
122  }
123  }
124 }
125 
126 
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
uint32_t stereo() const
Definition: SiStripDetId.h:176
std::vector< unsigned int > string() const
string id
Definition: TIBDetId.h:53
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
std::vector< unsigned int > rod() const
rod id
Definition: TOBDetId.h:49
std::vector< unsigned int > petal() const
petal id
Definition: TECDetId.h:61
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
unsigned int ring() const
ring id
Definition: TIDDetId.h:55
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
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
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, 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) const
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
unsigned int ring() const
ring id
Definition: TECDetId.h:71
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50