CMS 3D CMS Logo

GEMInternalCluster.cc
Go to the documentation of this file.
3 
5  const GEMDetId& id2,
6  const GEMPadDigiCluster& cluster1,
7  const GEMPadDigiCluster& cluster2,
8  const unsigned delayGEMinOTMB,
9  const unsigned tmbL1aWindowSize) {
10  // set coincidence to false first
11  isCoincidence_ = false;
12  isValid_ = false;
13 
14  // set matches to false first
15  isMatchingLayer1_ = false;
16  isMatchingLayer2_ = false;
17 
18  id1_ = id1;
19  id2_ = id2;
20 
21  if (cluster1.isValid()) {
22  isValid_ = true;
23  cl1_ = cluster1;
24  if (cluster1.alctMatchTime() == -1) // It is a MC simulation
25  bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX;
26  else if (cluster1.alctMatchTime() >= 0) // It is real data
27  bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX - int(tmbL1aWindowSize / 2) - cluster1.alctMatchTime() +
29  layer1_pad_ = cluster1.pads()[0];
30  layer1_size_ = cluster1.pads().size();
31  }
32  if (cluster2.isValid()) {
33  isValid_ = true;
34  cl2_ = cluster2;
35  if (cluster2.alctMatchTime() == -1) // It is a MC simulation
36  bx_ = cluster2.bx() + CSCConstants::LCT_CENTRAL_BX;
37  else if (cluster2.alctMatchTime() >= 0) // It is real data
38  bx_ = cluster2.bx() + CSCConstants::LCT_CENTRAL_BX - int(tmbL1aWindowSize / 2) - cluster2.alctMatchTime() +
40  layer2_pad_ = cluster2.pads()[0];
41  layer2_size_ = cluster2.pads().size();
42  }
43 
44  if (cluster1.isValid() and cluster2.isValid()) {
45  if (cluster1.alctMatchTime() == -1) // It is a MC simulation
46  bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX;
47  else if (cluster1.alctMatchTime() >= 0) // It is real data
48  bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX - int(tmbL1aWindowSize / 2) - cluster1.alctMatchTime() +
50  isCoincidence_ = true;
51  }
52 
53  layer1_min_wg_ = -1;
54  layer1_max_wg_ = -1;
55  layer2_min_wg_ = -1;
56  layer2_max_wg_ = -1;
57 
58  layer1_first_es_ = -1;
59  layer2_first_es_ = -1;
60  layer1_last_es_ = -1;
61  layer2_last_es_ = -1;
62 
67 
68  layer1_middle_es_ = -1;
69  layer2_middle_es_ = -1;
70 
73 }
74 
76  // set coincidence to false first
77  isCoincidence_ = false;
78  isValid_ = false;
79 
80  // set matches to false first
81  isMatchingLayer1_ = false;
82  isMatchingLayer2_ = false;
83 
84  layer1_min_wg_ = -1;
85  layer1_max_wg_ = -1;
86  layer2_min_wg_ = -1;
87  layer2_max_wg_ = -1;
88 
89  layer1_first_es_ = -1;
90  layer2_first_es_ = -1;
91  layer1_last_es_ = -1;
92  layer2_last_es_ = -1;
93 
98 
99  layer1_middle_es_ = -1;
100  layer2_middle_es_ = -1;
101 
104 }
105 
107  if (!cl1_.isValid())
108  return GEMPadDigi();
109  const unsigned pad = cl1_.pads()[cl1_.pads().size() / 2];
110 
111  return GEMPadDigi(pad, cl1_.bx(), cl1_.station(), cl1_.nPartitions());
112 }
113 
115  if (!cl2_.isValid())
116  return GEMPadDigi();
117  const unsigned pad = cl2_.pads()[cl2_.pads().size() / 2];
118 
119  return GEMPadDigi(pad, cl2_.bx(), cl2_.station(), cl2_.nPartitions());
120 }
121 
122 uint16_t GEMInternalCluster::getKeyStrip(int n, bool isLayer2) const {
123  if (n == 8) {
124  if (!isLayer2) {
125  return (layer1_first_es_ + layer1_last_es_) / 2.;
126  } else {
127  return (layer2_first_es_ + layer2_last_es_) / 2.;
128  }
129  } else { // Half Strip units
130  if (!isLayer2) {
131  return (layer1_first_es_ + layer1_last_es_) / 8.;
132  } else {
133  return (layer2_first_es_ + layer2_last_es_) / 8.;
134  }
135  }
136 }
137 
138 uint16_t GEMInternalCluster::getKeyStripME1a(int n, bool isLayer2) const {
139  if (n == 8) {
140  if (!isLayer2) {
142  } else {
144  }
145  } else { // Half Strip units
146  if (!isLayer2) {
148  } else {
150  }
151  }
152 }
153 
155  return cl1_ == cluster or cl2_ == cluster;
156 }
157 
159  return id1_ == cluster.id1() and id2_ == cluster.id2() and cl1_ == cluster.cl1() and cl2_ == cluster.cl2();
160 }
161 
162 std::ostream& operator<<(std::ostream& os, const GEMInternalCluster& cl) {
163  return os << "Cluster Layer 1: " << cl.id1() << " " << cl.cl1() << ", Cluster Layer 2: " << cl.id2() << " "
164  << cl.cl2();
165 }
const std::vector< uint16_t > & pads() const
uint16_t getKeyStrip(int n=2, bool isLayer2=false) const
GEMPadDigi mid1() const
delayGEMinOTMB
Definition: tmbParams.py:99
GEMPadDigiCluster cl1() const
bool operator==(const GEMInternalCluster &cluster) const
GEMDetId id2() const
bool has_cluster(const GEMPadDigiCluster &cluster) 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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned nPartitions() const
uint16_t getKeyStripME1a(int n=2, bool isLayer2=false) const
GEMPadDigi mid2() const
tmbL1aWindowSize
Definition: tmbParams.py:22
GEMPadDigiCluster cl1_
GEMSubDetId::Station station() const
int alctMatchTime() const
GEMDetId id1() const
GEMPadDigiCluster cl2() const
std::ostream & operator<<(std::ostream &os, const GEMInternalCluster &cl)
GEMPadDigiCluster cl2_