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