CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
GEMClusterProcessor Class Reference

#include <GEMClusterProcessor.h>

Public Types

enum  ClusterTypes { AllClusters = 1, SingleClusters = 2, CoincidenceClusters = 3 }
 

Public Member Functions

void clear ()
 
 GEMClusterProcessor (int region, unsigned station, unsigned chamber, const edm::ParameterSet &conf)
 
std::vector< GEMInternalClustergetClusters (int bx, int deltaBX=0, ClusterTypes option=AllClusters) const
 
std::vector< GEMInternalClustergetCoincidenceClusters (int bx) const
 
bool hasGE21Geometry16Partitions () const
 
std::vector< GEMCoPadDigireadoutCoPads () const
 
void run (const GEMPadDigiClusterCollection *)
 
void setESLookupTables (const CSCL1TPLookupTableME11ILT *conf)
 
void setESLookupTables (const CSCL1TPLookupTableME21ILT *conf)
 

Private Member Functions

void addCoincidenceClusters (const GEMPadDigiClusterCollection *)
 
void addSingleClusters (const GEMPadDigiClusterCollection *)
 
void doCoordinateConversion ()
 

Private Attributes

const int chamber_
 
std::vector< GEMInternalClusterclusters_
 
bool hasGE21Geometry16Partitions_
 
bool isEven_
 
const CSCL1TPLookupTableME11ILTlookupTableME11ILT_
 
const CSCL1TPLookupTableME21ILTlookupTableME21ILT_
 
unsigned int maxDeltaBX_
 
unsigned int maxDeltaPad_
 
unsigned int maxDeltaRoll_
 
const int region_
 
const int station_
 

Detailed Description

Author
Sven Dildick (Rice University)

Definition at line 19 of file GEMClusterProcessor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

GEMClusterProcessor::GEMClusterProcessor ( int  region,
unsigned  station,
unsigned  chamber,
const edm::ParameterSet conf 
)

Normal constructor.

Definition at line 7 of file GEMClusterProcessor.cc.

References chamber_, edm::ParameterSet::getParameter(), hasGE21Geometry16Partitions_, isEven_, maxDeltaBX_, maxDeltaPad_, maxDeltaRoll_, and station_.

8  : region_(region), station_(station), chamber_(chamber) {
9  isEven_ = chamber_ % 2 == 0;
10 
11  if (station_ == 1) {
12  const edm::ParameterSet copad(conf.getParameter<edm::ParameterSet>("copadParamGE11"));
13  maxDeltaPad_ = copad.getParameter<unsigned int>("maxDeltaPad");
14  maxDeltaRoll_ = copad.getParameter<unsigned int>("maxDeltaRoll");
15  maxDeltaBX_ = copad.getParameter<unsigned int>("maxDeltaBX");
16  }
17 
18  if (station_ == 2) {
19  // by default set to true
21 
22  const edm::ParameterSet copad(conf.getParameter<edm::ParameterSet>("copadParamGE21"));
23  maxDeltaPad_ = copad.getParameter<unsigned int>("maxDeltaPad");
24  maxDeltaRoll_ = copad.getParameter<unsigned int>("maxDeltaRoll");
25  maxDeltaBX_ = copad.getParameter<unsigned int>("maxDeltaBX");
26  }
27 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303

Member Function Documentation

void GEMClusterProcessor::addCoincidenceClusters ( const GEMPadDigiClusterCollection in_clusters)
private

Definition at line 86 of file GEMClusterProcessor.cc.

References funct::abs(), chamber_, clusters_, GEMPadDigiCluster::GE21, hasGE21Geometry16Partitions_, GeomDetEnumerators::isME0(), phase1PixelTopology::layer, match(), maxDeltaBX_, maxDeltaPad_, maxDeltaRoll_, or, AlCaHLTBitMon_ParallelJobs::p, HLT_FULL_cff::region, region_, relativeConstraints::ring, relativeConstraints::station, and station_.

Referenced by run().

86  {
87  // Build coincidences
88  for (auto det_range = in_clusters->begin(); det_range != in_clusters->end(); ++det_range) {
89  const GEMDetId& id = (*det_range).first;
90 
91  // coincidence pads are not built for ME0
92  if (id.isME0())
93  continue;
94 
95  // same chamber (no restriction on the roll number)
96  if (id.region() != region_ or id.station() != station_ or id.chamber() != chamber_)
97  continue;
98 
99  // all coincidences detIDs will have layer=1
100  if (id.layer() != 1)
101  continue;
102 
103  // find all corresponding ids with layer 2 and same roll that differs at most maxDeltaRoll_
104  for (unsigned int roll = id.roll() - maxDeltaRoll_; roll <= id.roll() + maxDeltaRoll_; ++roll) {
105  GEMDetId co_id(id.region(), id.ring(), id.station(), 2, id.chamber(), roll);
106 
107  auto co_clusters_range = in_clusters->get(co_id);
108 
109  // empty range = no possible coincidence pads
110  if (co_clusters_range.first == co_clusters_range.second)
111  continue;
112 
113  // now let's correlate the pads in two layers of this partition
114  const auto& pads_range = (*det_range).second;
115  for (auto p = pads_range.first; p != pads_range.second; ++p) {
116  // ignore 8-partition GE2/1 pads
117  if (id.isGE21() and p->nPartitions() == GEMPadDigiCluster::GE21) {
119  continue;
120  }
121 
122  // only consider valid pads
123  if (!p->isValid())
124  continue;
125 
126  for (auto co_p = co_clusters_range.first; co_p != co_clusters_range.second; ++co_p) {
127  // only consider valid clusters
128  if (!co_p->isValid())
129  continue;
130 
131  // check the match in BX
132  if ((unsigned)std::abs(p->bx() - co_p->bx()) > maxDeltaBX_)
133  continue;
134 
135  // get the corrected minimum and maximum of cluster 1
136  int cl1_min = p->pads().front() - maxDeltaPad_;
137  int cl1_max = p->pads().back() + maxDeltaPad_;
138 
139  // get the minimum and maximum of cluster 2
140  int cl2_min = co_p->pads().front();
141  int cl2_max = co_p->pads().back();
142 
143  // match condition
144  const bool condition1(cl1_min <= cl2_min and cl1_max >= cl2_min);
145  const bool condition2(cl1_min <= cl2_max and cl1_max >= cl2_max);
146  const bool match(condition1 or condition2);
147 
148  if (!match)
149  continue;
150 
151  // make a new coincidence
152  clusters_.emplace_back(id, *p, *co_p);
153  }
154  }
155  }
156  }
157 }
std::vector< GEMInternalCluster > clusters_
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
bool isME0(GeomDetEnumerators::SubDetector m)
constexpr std::array< uint8_t, layerIndexSize > layer
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void GEMClusterProcessor::addSingleClusters ( const GEMPadDigiClusterCollection in_clusters)
private

Definition at line 159 of file GEMClusterProcessor.cc.

References SplitLinear::begin, chamber_, clusters_, dataset::end, GEMPadDigiCluster::GE21, GEMInternalCluster::has_cluster(), hasGE21Geometry16Partitions_, GeomDetEnumerators::isME0(), phase1PixelTopology::layer, or, AlCaHLTBitMon_ParallelJobs::p, submitPVResolutionJobs::q, HLT_FULL_cff::region, region_, and station_.

Referenced by run().

159  {
160  // first get the coincidences
161  const std::vector<GEMInternalCluster>& coincidences = clusters_;
162 
163  // now start add single clusters
164  for (auto det_range = in_clusters->begin(); det_range != in_clusters->end(); ++det_range) {
165  const GEMDetId& id = (*det_range).first;
166 
167  // ignore ME0
168  if (id.isME0())
169  continue;
170 
171  // same chamber (no restriction on the roll number)
172  if (id.region() != region_ or id.station() != station_ or id.chamber() != chamber_)
173  continue;
174 
175  const auto& clusters_range = (*det_range).second;
176  for (auto p = clusters_range.first; p != clusters_range.second; ++p) {
177  // only consider valid clusters
178  if (!p->isValid())
179  continue;
180 
181  // ignore 8-partition GE2/1 pads
182  if (id.isGE21() and p->nPartitions() == GEMPadDigiCluster::GE21) {
184  continue;
185  }
186 
187  // ignore clusters already contained in a coincidence cluster
188  if (std::find_if(std::begin(coincidences), std::end(coincidences), [p](const GEMInternalCluster& q) {
189  return q.has_cluster(*p);
190  }) != std::end(coincidences))
191  continue;
192 
193  // put the single clusters into the collection
194  if (id.layer() == 1)
195  clusters_.emplace_back(id, *p, GEMPadDigiCluster());
196  else
197  clusters_.emplace_back(id, GEMPadDigiCluster(), *p);
198  }
199  }
200 }
std::vector< GEMInternalCluster > clusters_
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
bool isME0(GeomDetEnumerators::SubDetector m)
constexpr std::array< uint8_t, layerIndexSize > layer
string end
Definition: dataset.py:937
bool has_cluster(const GEMPadDigiCluster &cluster) const
void GEMClusterProcessor::clear ( void  )

Clear copad vector

Definition at line 29 of file GEMClusterProcessor.cc.

References clusters_.

Referenced by run().

29 { clusters_.clear(); }
std::vector< GEMInternalCluster > clusters_
void GEMClusterProcessor::doCoordinateConversion ( )
private

Definition at line 202 of file GEMClusterProcessor.cc.

References clusters_, CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_even(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_odd(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_even(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_odd(), CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_even(), CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_odd(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_even(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_odd(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_even(), CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_odd(), CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_even(), CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_odd(), CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_even(), CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_odd(), CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_max_wg_ME21_even(), CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_max_wg_ME21_odd(), CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_even(), CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_odd(), CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_min_wg_ME21_even(), CSCL1TPLookupTableME21ILT::GEM_roll_L1_CSC_min_wg_ME21_odd(), CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_even(), CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_odd(), CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_even(), CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_odd(), CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_even(), CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_odd(), CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_min_wg_ME21_even(), CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_min_wg_ME21_odd(), isEven_, lookupTableME11ILT_, lookupTableME21ILT_, and station_.

Referenced by run().

202  {
203  // loop on clusters
204  for (auto& cluster : clusters_) {
205  if (cluster.cl1().isValid()) {
206  // starting coordinates
207  const int layer1_first_pad = cluster.layer1_pad();
208  const int layer1_last_pad = layer1_first_pad + cluster.layer1_size() - 1;
209 
210  // calculate the 1/2-strip
211  int layer1_pad_to_first_hs = -1;
212  int layer1_pad_to_last_hs = -1;
213  int layer1_pad_to_first_hs_me1a = -1;
214  int layer1_pad_to_last_hs_me1a = -1;
215 
216  // ME1/1
217  if (station_ == 1) {
218  if (isEven_) {
219  // ME1/b
220  layer1_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer1_first_pad);
221  layer1_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer1_last_pad);
222  // ME1/a
223  layer1_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer1_first_pad);
224  layer1_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer1_last_pad);
225  } else {
226  // ME1/b
227  layer1_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer1_first_pad);
228  layer1_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer1_last_pad);
229  // ME1/a
230  layer1_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer1_first_pad);
231  layer1_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer1_last_pad);
232  }
233  }
234  // ME2/1
235  if (station_ == 2) {
236  if (isEven_) {
237  layer1_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer1_first_pad);
238  layer1_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer1_last_pad);
239  } else {
240  layer1_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer1_first_pad);
241  layer1_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer1_last_pad);
242  }
243  }
244  // middle 1/2-strip
245  int layer1_middle_hs = 0.5 * (layer1_pad_to_first_hs + layer1_pad_to_last_hs);
246  int layer1_middle_hs_me1a = 0.5 * (layer1_pad_to_first_hs_me1a + layer1_pad_to_last_hs_me1a);
247 
248  // set the values
249  cluster.set_layer1_first_hs(layer1_pad_to_first_hs);
250  cluster.set_layer1_last_hs(layer1_pad_to_last_hs);
251  cluster.set_layer1_middle_hs(layer1_middle_hs);
252 
253  if (station_ == 1) {
254  cluster.set_layer1_first_hs_me1a(layer1_pad_to_first_hs_me1a);
255  cluster.set_layer1_last_hs_me1a(layer1_pad_to_last_hs_me1a);
256  cluster.set_layer1_middle_hs_me1a(layer1_middle_hs_me1a);
257  }
258  // calculate the 1/8-strips
259  int layer1_pad_to_first_es = -1;
260  int layer1_pad_to_last_es = -1;
261 
262  int layer1_pad_to_first_es_me1a = -1;
263  int layer1_pad_to_last_es_me1a = -1;
264 
265  // ME1/1
266  if (station_ == 1) {
267  if (isEven_) {
268  // ME1/b
269  layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer1_first_pad);
270  layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer1_last_pad);
271  // ME1/a
272  layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer1_first_pad);
273  layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer1_last_pad);
274  } else {
275  // ME1/b
276  layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer1_first_pad);
277  layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer1_last_pad);
278  // ME1/a
279  layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer1_first_pad);
280  layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer1_last_pad);
281  }
282  }
283  // ME2/1
284  if (station_ == 2) {
285  if (isEven_) {
286  layer1_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer1_first_pad);
287  layer1_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer1_last_pad);
288  } else {
289  layer1_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer1_first_pad);
290  layer1_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer1_last_pad);
291  }
292  }
293  // middle 1/8-strip
294  int layer1_middle_es = 0.5 * (layer1_pad_to_first_es + layer1_pad_to_last_es);
295  int layer1_middle_es_me1a = 0.5 * (layer1_pad_to_first_es_me1a + layer1_pad_to_last_es_me1a);
296 
297  cluster.set_layer1_first_es(layer1_pad_to_first_es);
298  cluster.set_layer1_last_es(layer1_pad_to_last_es);
299  cluster.set_layer1_middle_es(layer1_middle_es);
300 
301  if (station_ == 1) {
302  cluster.set_layer1_first_es_me1a(layer1_pad_to_first_es_me1a);
303  cluster.set_layer1_last_es_me1a(layer1_pad_to_last_es_me1a);
304  cluster.set_layer1_middle_es_me1a(layer1_middle_es_me1a);
305  }
306 
307  // calculate the wiregroups
308  // need to subtract 1 to use the LUTs
309  const int roll = cluster.roll() - 1;
310 
311  int roll_l1_to_min_wg = -1;
312  int roll_l1_to_max_wg = -1;
313 
314  // ME1/1
315  if (station_ == 1) {
316  if (isEven_) {
317  roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_min_wg_ME11_even(roll);
318  roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_max_wg_ME11_even(roll);
319  } else {
320  roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_min_wg_ME11_odd(roll);
321  roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_max_wg_ME11_odd(roll);
322  }
323  }
324 
325  // ME2/1
326  if (station_ == 2) {
327  if (isEven_) {
328  roll_l1_to_min_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_min_wg_ME21_even(roll);
329  roll_l1_to_max_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_max_wg_ME21_even(roll);
330  } else {
331  roll_l1_to_min_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_min_wg_ME21_odd(roll);
332  roll_l1_to_max_wg = lookupTableME21ILT_->GEM_roll_L1_CSC_max_wg_ME21_odd(roll);
333  }
334  }
335 
336  // set the values
337  cluster.set_layer1_min_wg(roll_l1_to_min_wg);
338  cluster.set_layer1_max_wg(roll_l1_to_max_wg);
339  }
340 
341  if (cluster.cl2().isValid()) {
342  // starting coordinates
343  const int layer2_first_pad = cluster.layer2_pad();
344  const int layer2_last_pad = layer2_first_pad + cluster.layer2_size() - 1;
345 
346  // calculate the 1/2-strip
347  int layer2_pad_to_first_hs = -1;
348  int layer2_pad_to_last_hs = -1;
349  int layer2_pad_to_first_hs_me1a = -1;
350  int layer2_pad_to_last_hs_me1a = -1;
351 
352  if (station_ == 1) {
353  if (isEven_) {
354  // ME1/b
355  layer2_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer2_first_pad);
356  layer2_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer2_last_pad);
357  // ME1/a
358  layer2_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer2_first_pad);
359  layer2_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer2_last_pad);
360  } else {
361  // ME1/b
362  layer2_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer2_first_pad);
363  layer2_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer2_last_pad);
364  // ME1/a
365  layer2_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer2_first_pad);
366  layer2_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer2_last_pad);
367  }
368  }
369  // ME2/1
370  if (station_ == 2) {
371  if (isEven_) {
372  layer2_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer2_first_pad);
373  layer2_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer2_last_pad);
374  } else {
375  layer2_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer2_first_pad);
376  layer2_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer2_last_pad);
377  }
378  }
379  // middle 1/2-strip
380  int layer2_middle_hs = 0.5 * (layer2_pad_to_first_hs + layer2_pad_to_last_hs);
381  int layer2_middle_hs_me1a = 0.5 * (layer2_pad_to_first_hs_me1a + layer2_pad_to_last_hs_me1a);
382 
383  // set the values
384  cluster.set_layer2_first_hs(layer2_pad_to_first_hs);
385  cluster.set_layer2_last_hs(layer2_pad_to_last_hs);
386  cluster.set_layer2_middle_hs(layer2_middle_hs);
387 
388  if (station_ == 1) {
389  cluster.set_layer2_first_hs_me1a(layer2_pad_to_first_hs_me1a);
390  cluster.set_layer2_last_hs_me1a(layer2_pad_to_last_hs_me1a);
391  cluster.set_layer2_middle_hs_me1a(layer2_middle_hs_me1a);
392  }
393  // calculate the 1/8-strips
394  int layer2_pad_to_first_es = -1;
395  int layer2_pad_to_last_es = -1;
396 
397  int layer2_pad_to_first_es_me1a = -1;
398  int layer2_pad_to_last_es_me1a = -1;
399 
400  if (station_ == 1) {
401  if (isEven_) {
402  // ME1/b
403  layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer2_first_pad);
404  layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer2_last_pad);
405  // ME1/a
406  layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer2_first_pad);
407  layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer2_last_pad);
408  } else {
409  // ME1/b
410  layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer2_first_pad);
411  layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer2_last_pad);
412  // ME1/a
413  layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer2_first_pad);
414  layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer2_last_pad);
415  }
416  }
417 
418  // ME2/1
419  if (station_ == 2) {
420  if (isEven_) {
421  layer2_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer2_first_pad);
422  layer2_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_even(layer2_last_pad);
423  } else {
424  layer2_pad_to_first_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer2_first_pad);
425  layer2_pad_to_last_es = lookupTableME21ILT_->GEM_pad_CSC_es_ME21_odd(layer2_last_pad);
426  }
427  }
428  // middle 1/8-strip
429  int layer2_middle_es = 0.5 * (layer2_pad_to_first_es + layer2_pad_to_last_es);
430  int layer2_middle_es_me1a = 0.5 * (layer2_pad_to_first_es_me1a + layer2_pad_to_last_es_me1a);
431 
432  cluster.set_layer2_first_es(layer2_pad_to_first_es);
433  cluster.set_layer2_last_es(layer2_pad_to_last_es);
434  cluster.set_layer2_middle_es(layer2_middle_es);
435 
436  if (station_ == 1) {
437  cluster.set_layer2_first_es_me1a(layer2_pad_to_first_es_me1a);
438  cluster.set_layer2_last_es_me1a(layer2_pad_to_last_es_me1a);
439  cluster.set_layer2_middle_es_me1a(layer2_middle_es_me1a);
440  }
441  }
442 
443  // calculate the wiregroups
444  // need to subtract 1 to use the LUTs
445  const int roll = cluster.roll() - 1;
446 
447  int roll_l2_to_min_wg = -1;
448  int roll_l2_to_max_wg = -1;
449 
450  // ME1/1
451  if (station_ == 1) {
452  if (isEven_) {
453  roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_min_wg_ME11_even(roll);
454  roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_max_wg_ME11_even(roll);
455  } else {
456  roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_min_wg_ME11_odd(roll);
457  roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_max_wg_ME11_odd(roll);
458  }
459  }
460 
461  // ME2/1
462  if (station_ == 2) {
463  if (isEven_) {
464  roll_l2_to_min_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_min_wg_ME21_even(roll);
465  roll_l2_to_max_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_max_wg_ME21_even(roll);
466  } else {
467  roll_l2_to_min_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_min_wg_ME21_odd(roll);
468  roll_l2_to_max_wg = lookupTableME21ILT_->GEM_roll_L2_CSC_max_wg_ME21_odd(roll);
469  }
470  }
471 
472  // set the values
473  cluster.set_layer2_min_wg(roll_l2_to_min_wg);
474  cluster.set_layer2_max_wg(roll_l2_to_max_wg);
475  }
476 }
unsigned GEM_pad_CSC_es_ME1b_odd(unsigned pad) const
unsigned GEM_pad_CSC_es_ME21_even(unsigned pad) const
unsigned GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const
std::vector< GEMInternalCluster > clusters_
unsigned GEM_roll_L2_CSC_min_wg_ME21_even(unsigned roll) const
unsigned GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const
unsigned GEM_roll_L1_CSC_min_wg_ME21_odd(unsigned roll) const
unsigned GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const
unsigned GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const
unsigned GEM_pad_CSC_hs_ME21_even(unsigned pad) const
unsigned GEM_pad_CSC_es_ME1a_even(unsigned pad) const
unsigned GEM_pad_CSC_es_ME21_odd(unsigned pad) const
unsigned GEM_roll_L1_CSC_max_wg_ME21_even(unsigned roll) const
unsigned GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const
unsigned GEM_roll_L1_CSC_max_wg_ME21_odd(unsigned roll) const
unsigned GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const
unsigned GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const
unsigned GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const
unsigned GEM_pad_CSC_es_ME1b_even(unsigned pad) const
unsigned GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
unsigned GEM_pad_CSC_hs_ME1b_even(unsigned pad) const
unsigned GEM_roll_L1_CSC_min_wg_ME21_even(unsigned roll) const
unsigned GEM_pad_CSC_hs_ME1a_even(unsigned pad) const
unsigned GEM_pad_CSC_es_ME1a_odd(unsigned pad) const
unsigned GEM_roll_L2_CSC_max_wg_ME21_even(unsigned roll) const
unsigned GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
unsigned GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const
unsigned GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const
unsigned GEM_pad_CSC_hs_ME21_odd(unsigned pad) const
std::vector< GEMInternalCluster > GEMClusterProcessor::getClusters ( int  bx,
int  deltaBX = 0,
ClusterTypes  option = AllClusters 
) const

Definition at line 54 of file GEMClusterProcessor.cc.

References funct::abs(), makePileupJSON::bx, haddnano::cl, clusters_, CoincidenceClusters, convertSQLitetoXML_cfg::output, and SingleClusters.

54  {
55  std::vector<GEMInternalCluster> output;
56 
57  for (const auto& cl : clusters_) {
58  // valid single clusters with the right BX
59  if (std::abs(cl.bx() - bx) <= deltaBX and cl.isValid()) {
60  // ignore the coincidence clusters
61  if (option == SingleClusters and cl.isCoincidence())
62  continue;
63  // ignore the single clusters
64  if (option == CoincidenceClusters and !cl.isCoincidence())
65  continue;
66  output.push_back(cl);
67  }
68  }
69 
70  return output;
71 }
std::vector< GEMInternalCluster > clusters_
tuple cl
Definition: haddnano.py:49
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< GEMInternalCluster > GEMClusterProcessor::getCoincidenceClusters ( int  bx) const

Definition at line 73 of file GEMClusterProcessor.cc.

References haddnano::cl, clusters_, and convertSQLitetoXML_cfg::output.

73  {
74  std::vector<GEMInternalCluster> output;
75 
76  for (const auto& cl : clusters_) {
77  // valid coincidences with the right BX
78  if (cl.bx() == bx and cl.isCoincidence()) {
79  output.push_back(cl);
80  }
81  }
82 
83  return output;
84 }
std::vector< GEMInternalCluster > clusters_
tuple cl
Definition: haddnano.py:49
bool GEMClusterProcessor::hasGE21Geometry16Partitions ( ) const
inline

Definition at line 43 of file GEMClusterProcessor.h.

References hasGE21Geometry16Partitions_.

std::vector< GEMCoPadDigi > GEMClusterProcessor::readoutCoPads ( ) const

Returns vector of CoPads in the read-out time window, if any.

Definition at line 478 of file GEMClusterProcessor.cc.

References clusters_, and convertSQLitetoXML_cfg::output.

478  {
479  std::vector<GEMCoPadDigi> output;
480 
481  // loop on clusters
482  for (const auto& cluster : clusters_) {
483  // ignore single clusters
484  if (!cluster.isCoincidence())
485  continue;
486 
487  // construct coincidence pads out of the centers of the coincidence clusters
488  output.emplace_back(cluster.roll(), cluster.mid1(), cluster.mid2());
489  }
490 
491  return output;
492 }
std::vector< GEMInternalCluster > clusters_
void GEMClusterProcessor::run ( const GEMPadDigiClusterCollection in_clusters)

Runs the CoPad processor code.

Definition at line 35 of file GEMClusterProcessor.cc.

References addCoincidenceClusters(), addSingleClusters(), clear(), and doCoordinateConversion().

35  {
36  // Step 1: clear the GEMInternalCluster vector
37  clear();
38 
39  if (in_clusters == nullptr) {
40  edm::LogWarning("GEMClusterProcessor") << "Attempt to run without valid in_clusters pointer.";
41  return;
42  }
43 
44  // Step 2: put coincidence clusters in GEMInternalCluster vector
45  addCoincidenceClusters(in_clusters);
46 
47  // Step 3: put single clusters in GEMInternalCluster vector who are not part of any coincidence cluster
48  addSingleClusters(in_clusters);
49 
50  // Step 4: translate the cluster central pad numbers into 1/8-strip number for matching with CSC trigger primitives
52 }
void addSingleClusters(const GEMPadDigiClusterCollection *)
void addCoincidenceClusters(const GEMPadDigiClusterCollection *)
Log< level::Warning, false > LogWarning
void GEMClusterProcessor::setESLookupTables ( const CSCL1TPLookupTableME11ILT conf)

Definition at line 31 of file GEMClusterProcessor.cc.

References lookupTableME11ILT_.

31 { lookupTableME11ILT_ = conf; }
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
void GEMClusterProcessor::setESLookupTables ( const CSCL1TPLookupTableME21ILT conf)

Definition at line 33 of file GEMClusterProcessor.cc.

References lookupTableME21ILT_.

33 { lookupTableME21ILT_ = conf; }
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_

Member Data Documentation

const int GEMClusterProcessor::chamber_
private
std::vector<GEMInternalCluster> GEMClusterProcessor::clusters_
private
bool GEMClusterProcessor::hasGE21Geometry16Partitions_
private
bool GEMClusterProcessor::isEven_
private

Definition at line 66 of file GEMClusterProcessor.h.

Referenced by doCoordinateConversion(), and GEMClusterProcessor().

const CSCL1TPLookupTableME11ILT* GEMClusterProcessor::lookupTableME11ILT_
private

Definition at line 77 of file GEMClusterProcessor.h.

Referenced by doCoordinateConversion(), and setESLookupTables().

const CSCL1TPLookupTableME21ILT* GEMClusterProcessor::lookupTableME21ILT_
private

Definition at line 78 of file GEMClusterProcessor.h.

Referenced by doCoordinateConversion(), and setESLookupTables().

unsigned int GEMClusterProcessor::maxDeltaBX_
private

Definition at line 69 of file GEMClusterProcessor.h.

Referenced by addCoincidenceClusters(), and GEMClusterProcessor().

unsigned int GEMClusterProcessor::maxDeltaPad_
private

Definition at line 68 of file GEMClusterProcessor.h.

Referenced by addCoincidenceClusters(), and GEMClusterProcessor().

unsigned int GEMClusterProcessor::maxDeltaRoll_
private

Definition at line 70 of file GEMClusterProcessor.h.

Referenced by addCoincidenceClusters(), and GEMClusterProcessor().

const int GEMClusterProcessor::region_
private

Chamber id (trigger-type labels).

Definition at line 63 of file GEMClusterProcessor.h.

Referenced by addCoincidenceClusters(), and addSingleClusters().

const int GEMClusterProcessor::station_
private