CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GEMInternalCluster.cc
Go to the documentation of this file.
3 
5  const GEMPadDigiCluster& cluster1,
6  const GEMPadDigiCluster& cluster2) {
7  id_ = id;
8 
9  // set coincidence to false first
10  isCoincidence_ = false;
11  isValid_ = false;
12 
13  if (cluster1.isValid()) {
14  isValid_ = true;
15  cl1_ = cluster1;
16  bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX;
17  layer1_pad_ = cluster1.pads()[0];
18  layer1_size_ = cluster1.pads().size();
19  }
20  if (cluster2.isValid()) {
21  isValid_ = true;
22  cl2_ = cluster2;
23  bx_ = cluster2.bx() + CSCConstants::LCT_CENTRAL_BX;
24  layer2_pad_ = cluster2.pads()[0];
25  layer2_size_ = cluster2.pads().size();
26  }
27 
28  if (cluster1.isValid() and cluster2.isValid()) {
29  bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX;
30  isCoincidence_ = true;
31  }
32 
33  layer1_min_wg_ = -1;
34  layer1_max_wg_ = -1;
35  layer2_min_wg_ = -1;
36  layer2_max_wg_ = -1;
37 
38  layer1_first_hs_ = -1;
39  layer2_first_hs_ = -1;
40  layer1_last_hs_ = -1;
41  layer2_last_hs_ = -1;
42 
47 
48  layer1_middle_hs_ = -1;
49  layer2_middle_hs_ = -1;
50 
53 
54  layer1_first_es_ = -1;
55  layer2_first_es_ = -1;
56  layer1_last_es_ = -1;
57  layer2_last_es_ = -1;
58 
63 
64  layer1_middle_es_ = -1;
65  layer2_middle_es_ = -1;
66 
69 }
70 
72  // set coincidence to false first
73  isCoincidence_ = false;
74  isValid_ = false;
75 
76  layer1_min_wg_ = -1;
77  layer1_max_wg_ = -1;
78  layer2_min_wg_ = -1;
79  layer2_max_wg_ = -1;
80 
81  layer1_first_hs_ = -1;
82  layer2_first_hs_ = -1;
83  layer1_last_hs_ = -1;
84  layer2_last_hs_ = -1;
85 
90 
91  layer1_middle_hs_ = -1;
92  layer2_middle_hs_ = -1;
93 
96 
97  layer1_first_es_ = -1;
98  layer2_first_es_ = -1;
99  layer1_last_es_ = -1;
100  layer2_last_es_ = -1;
101 
106 
107  layer1_middle_es_ = -1;
108  layer2_middle_es_ = -1;
109 
112 }
113 
115  if (!cl1_.isValid())
116  return GEMPadDigi();
117  const unsigned pad = cl1_.pads()[cl1_.pads().size() / 2];
118 
119  return GEMPadDigi(pad, cl1_.bx(), cl1_.station(), cl1_.nPartitions());
120 }
121 
123  if (!cl2_.isValid())
124  return GEMPadDigi();
125  const unsigned pad = cl2_.pads()[cl2_.pads().size() / 2];
126 
127  return GEMPadDigi(pad, cl2_.bx(), cl2_.station(), cl2_.nPartitions());
128 }
129 
131  if (id_.layer() == 1)
132  return layer1_min_wg();
133  else
134  return layer2_min_wg();
135 }
136 
138  if (id_.layer() == 1)
139  return layer1_max_wg();
140  else
141  return layer2_max_wg();
142 }
143 
144 uint16_t GEMInternalCluster::getKeyStrip(int n) const {
145  // case for half-strips
146  if (n == 2) {
147  if (id_.layer() == 1) {
148  return (layer1_first_hs_ + layer1_last_hs_) / 2.;
149  } else {
150  return (layer2_first_hs_ + layer2_last_hs_) / 2.;
151  }
152  }
153 
154  // case for 1/8-strips
155  else {
156  if (id_.layer() == 1) {
157  return (layer1_first_es_ + layer1_last_es_) / 2.;
158  } else {
159  return (layer2_first_es_ + layer2_last_es_) / 2.;
160  }
161  }
162 }
163 
165  // case for half-strips
166  if (n == 2) {
167  if (id_.layer() == 1) {
169  } else {
171  }
172  }
173 
174  // case for 1/8-strips
175  else {
176  if (id_.layer() == 1) {
178  } else {
180  }
181  }
182 }
183 
185  return cl1_ == cluster or cl2_ == cluster;
186 }
187 
189  return id_ == cluster.id() and cl1_ == cluster.cl1() and cl2_ == cluster.cl2();
190 }
191 
192 std::ostream& operator<<(std::ostream& os, const GEMInternalCluster& cl) {
193  return os << cl.id() << " " << cl.cl1() << " " << cl.cl2();
194 }
GEMPadDigi mid1() const
unsigned nPartitions() const
uint16_t getKeyStrip(int n=2) const
uint16_t getKeyStripME1a(int n=2) const
int layer1_max_wg() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
GEMDetId id() const
bool operator==(const GEMInternalCluster &cluster) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
int layer2_min_wg() const
tuple cl
Definition: haddnano.py:49
const std::vector< uint16_t > & pads() const
GEMPadDigiCluster cl1() const
GEMPadDigi mid2() const
constexpr int layer() const
Definition: GEMDetId.h:190
int layer1_min_wg() const
int layer2_max_wg() const
GEMPadDigiCluster cl1_
bool isValid() const
GEMPadDigiCluster cl2() const
bool has_cluster(const GEMPadDigiCluster &cluster) const
GEMSubDetId::Station station() const
GEMPadDigiCluster cl2_