CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CSCTriggerPrimitivesBuilder Class Reference

#include <CSCTriggerPrimitivesBuilder.h>

Public Types

enum  trig_cscs {
  MAX_ENDCAPS = 2, MAX_STATIONS = 4, MAX_SECTORS = 6, MAX_SUBSECTORS = 2,
  MAX_CHAMBERS = 9
}
 

Public Member Functions

void build (const CSCBadChambers *badChambers, const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPadClusters, CSCALCTDigiCollection &oc_alct, CSCALCTDigiCollection &oc_alct_all, CSCCLCTDigiCollection &oc_clct, CSCCLCTDigiCollection &oc_clct_all, CSCALCTPreTriggerDigiCollection &oc_alctpretrigger, CSCCLCTPreTriggerDigiCollection &oc_clctpretrigger, CSCCLCTPreTriggerCollection &oc_pretrig, CSCCorrelatedLCTDigiCollection &oc_lct, CSCCorrelatedLCTDigiCollection &oc_sorted_lct, GEMCoPadDigiCollection &oc_gemcopad)
 
 CSCTriggerPrimitivesBuilder (const edm::ParameterSet &)
 
void setConfigParameters (const CSCDBL1TPParameters *conf)
 
void setCSCGeometry (const CSCGeometry *g)
 set CSC and GEM geometries for the matching needs More...
 
void setGEMGeometry (const GEMGeometry *g)
 
 ~CSCTriggerPrimitivesBuilder ()
 

Private Member Functions

template<class T , class S >
void put (const T &, S &, const CSCDetId &, std::string comment)
 

Private Attributes

bool checkBadChambers_
 a flag whether to skip chambers from the bad chambers map More...
 
const CSCGeometrycsc_g
 
bool disableME1a_
 
bool disableME42_
 
const GEMGeometrygem_g
 
int infoV
 
std::unique_ptr< CSCMuonPortCardmpc_ [MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS]
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
std::unique_ptr< CSCMotherboardtmb_ [MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
 

Static Private Attributes

static const int max_chamber = CSCTriggerNumbering::maxTriggerCscId()
 
static const int max_endcap = CSCDetId::maxEndcapId()
 
static const int max_sector = CSCTriggerNumbering::maxTriggerSectorId()
 
static const int max_station = CSCDetId::maxStationId()
 
static const int max_subsector = CSCTriggerNumbering::maxTriggerSubSectorId()
 
static const int min_chamber = CSCTriggerNumbering::minTriggerCscId()
 
static const int min_endcap = CSCDetId::minEndcapId()
 
static const int min_sector = CSCTriggerNumbering::minTriggerSectorId()
 
static const int min_station = CSCDetId::minStationId()
 
static const int min_subsector = CSCTriggerNumbering::minTriggerSubSectorId()
 

Detailed Description

Definition at line 40 of file CSCTriggerPrimitivesBuilder.h.

Member Enumeration Documentation

◆ trig_cscs

Max values of trigger labels for all CSCs; used to construct TMB processors.

Enumerator
MAX_ENDCAPS 
MAX_STATIONS 
MAX_SECTORS 
MAX_SUBSECTORS 
MAX_CHAMBERS 

Definition at line 83 of file CSCTriggerPrimitivesBuilder.h.

Constructor & Destructor Documentation

◆ CSCTriggerPrimitivesBuilder()

CSCTriggerPrimitivesBuilder::CSCTriggerPrimitivesBuilder ( const edm::ParameterSet conf)
explicit

Configure the algorithm via constructor. Receives ParameterSet percolated down from EDProducer which owns this Builder.

Definition at line 22 of file CSCTriggerPrimitivesBuilder.cc.

22  {
23  // special configuration parameters for ME11 treatment
24  edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
25  runPhase2_ = commonParams.getParameter<bool>("runPhase2");
26  infoV = commonParams.getParameter<int>("verbosity");
27  disableME1a_ = commonParams.getParameter<bool>("disableME1a");
28  disableME42_ = commonParams.getParameter<bool>("disableME42");
29 
30  checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");
31 
32  runME11Up_ = commonParams.getParameter<bool>("runME11Up");
33  runME21Up_ = commonParams.getParameter<bool>("runME21Up");
34  runME31Up_ = commonParams.getParameter<bool>("runME31Up");
35  runME41Up_ = commonParams.getParameter<bool>("runME41Up");
36 
37  runME11ILT_ = commonParams.getParameter<bool>("runME11ILT");
38  runME21ILT_ = commonParams.getParameter<bool>("runME21ILT");
39 
40  // Initializing boards.
41  for (int endc = min_endcap; endc <= max_endcap; endc++) {
42  for (int stat = min_station; stat <= max_station; stat++) {
43  int numsubs = ((stat == 1) ? max_subsector : 1);
44  for (int sect = min_sector; sect <= max_sector; sect++) {
45  for (int subs = min_subsector; subs <= numsubs; subs++) {
46  for (int cham = min_chamber; cham <= max_chamber; cham++) {
47  if ((endc <= 0 || endc > MAX_ENDCAPS) || (stat <= 0 || stat > MAX_STATIONS) ||
48  (sect <= 0 || sect > MAX_SECTORS) || (subs <= 0 || subs > MAX_SUBSECTORS) ||
49  (cham <= 0 || cham > MAX_CHAMBERS)) {
50  edm::LogError("CSCTriggerPrimitivesBuilder|SetupError")
51  << "+++ trying to instantiate TMB of illegal CSC id ["
52  << " endcap = " << endc << " station = " << stat << " sector = " << sect << " subsector = " << subs
53  << " chamber = " << cham << "]; skipping it... +++\n";
54  continue;
55  }
57  // When the motherboard is instantiated, it instantiates ALCT
58  // and CLCT processors.
59 
60  // go through all possible cases
61  if (runPhase2_ and ring == 1 and stat == 1 and runME11Up_ and !runME11ILT_)
62  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1] =
63  std::make_unique<CSCMotherboardME11>(endc, stat, sect, subs, cham, conf);
64  else if (runPhase2_ and ring == 1 and stat == 1 and runME11Up_ and runME11ILT_)
65  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1] =
66  std::make_unique<CSCGEMMotherboardME11>(endc, stat, sect, subs, cham, conf);
67  else if (runPhase2_ and ring == 1 and stat == 2 and runME21Up_ and runME21ILT_)
68  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1] =
69  std::make_unique<CSCGEMMotherboardME21>(endc, stat, sect, subs, cham, conf);
70  else if (runPhase2_ and ring == 1 and
71  ((stat == 2 and runME21Up_ and !runME21ILT_) || (stat == 3 and runME31Up_) ||
72  (stat == 4 and runME41Up_)))
73  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1] =
74  std::make_unique<CSCUpgradeMotherboard>(endc, stat, sect, subs, cham, conf);
75  else
76  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1] =
77  std::make_unique<CSCMotherboard>(endc, stat, sect, subs, cham, conf);
78  }
79  }
80  // Init MPC
81  mpc_[endc - 1][stat - 1][sect - 1] = std::make_unique<CSCMuonPortCard>(endc, stat, sect, conf);
82  }
83  }
84  }
85 }

References relativeConstraints::cham, checkBadChambers_, disableME1a_, disableME42_, edm::ParameterSet::getParameter(), infoV, max_chamber, MAX_CHAMBERS, max_endcap, MAX_ENDCAPS, max_sector, MAX_SECTORS, max_station, MAX_STATIONS, max_subsector, MAX_SUBSECTORS, min_chamber, min_endcap, min_sector, min_station, min_subsector, mpc_, relativeConstraints::ring, CSCTriggerNumbering::ringFromTriggerLabels(), runME11ILT_, runME11Up_, runME21ILT_, runME21Up_, runME31Up_, runME41Up_, runPhase2_, hgcalPlots::stat, and tmb_.

◆ ~CSCTriggerPrimitivesBuilder()

CSCTriggerPrimitivesBuilder::~CSCTriggerPrimitivesBuilder ( )

Definition at line 90 of file CSCTriggerPrimitivesBuilder.cc.

90 {}

Member Function Documentation

◆ build()

void CSCTriggerPrimitivesBuilder::build ( const CSCBadChambers badChambers,
const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiClusterCollection gemPadClusters,
CSCALCTDigiCollection oc_alct,
CSCALCTDigiCollection oc_alct_all,
CSCCLCTDigiCollection oc_clct,
CSCCLCTDigiCollection oc_clct_all,
CSCALCTPreTriggerDigiCollection oc_alctpretrigger,
CSCCLCTPreTriggerDigiCollection oc_clctpretrigger,
CSCCLCTPreTriggerCollection oc_pretrig,
CSCCorrelatedLCTDigiCollection oc_lct,
CSCCorrelatedLCTDigiCollection oc_sorted_lct,
GEMCoPadDigiCollection oc_gemcopad 
)

Definition at line 109 of file CSCTriggerPrimitivesBuilder.cc.

122  {
123  // CSC geometry.
124  for (int endc = min_endcap; endc <= max_endcap; endc++) {
125  for (int stat = min_station; stat <= max_station; stat++) {
126  int numsubs = ((stat == 1) ? max_subsector : 1);
127  for (int sect = min_sector; sect <= max_sector; sect++) {
128  for (int subs = min_subsector; subs <= numsubs; subs++) {
129  for (int cham = min_chamber; cham <= max_chamber; cham++) {
130  // extract the ring number
132 
133  // case when you want to ignore ME42
134  if (disableME42_ && stat == 4 && ring == 2)
135  continue;
136 
137  CSCMotherboard* tmb = tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].get();
138 
139  tmb->setCSCGeometry(csc_g);
140 
141  // actual chamber number =/= trigger chamber number
143 
144  // 0th layer means whole chamber.
145  CSCDetId detid(endc, stat, ring, chid, 0);
146 
147  // Run processors only if chamber exists in geometry.
148  if (tmb == nullptr || csc_g->chamber(detid) == nullptr)
149  continue;
150 
151  // Skip chambers marked as bad (usually includes most of ME4/2 chambers;
152  // also, there's no ME1/a-1/b separation, it's whole ME1/1)
153  if (checkBadChambers_ && badChambers->isInBadChamber(detid))
154  continue;
155 
156  // running upgraded ME1/1 TMBs
157  if (stat == 1 && ring == 1 && runPhase2_ && !runME11ILT_) {
158  // run the TMB
159  CSCMotherboardME11* tmb11 = static_cast<CSCMotherboardME11*>(tmb);
160  if (infoV > 1)
161  LogTrace("CSCTriggerPrimitivesBuilder")
162  << "CSCTriggerPrimitivesBuilder::build in E:" << endc << " S:" << stat << " R:" << ring;
163  tmb11->run(wiredc, compdc);
164 
165  // get all collections
166  // all ALCTs, CLCTs, LCTs are written with detid ring = 1, as data did
167  // but CLCTs and LCTs are written sperately in ME1a and ME1b, considering whether ME1a is disabled or not
168  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb11->readoutLCTs1b();
169  const std::vector<CSCCorrelatedLCTDigi>& lctV1a = tmb11->readoutLCTs1a();
170  const std::vector<CSCALCTDigi>& alctV = tmb11->alctProc->readoutALCTs();
171  const std::vector<CSCALCTDigi>& alctV_all =
172  tmb11->alctProc->readoutALCTs(CSCConstants::MAX_ALCTS_PER_PROCESSOR);
173  const std::vector<CSCCLCTDigi>& clctV = tmb11->clctProc->readoutCLCTsME1b();
174  const std::vector<CSCCLCTDigi>& clctV_all =
175  tmb11->clctProc->readoutCLCTsME1b(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
176  const std::vector<int>& preTriggerBXs = tmb11->clctProc->preTriggerBXs();
177  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb11->clctProc->preTriggerDigisME1b();
178  const std::vector<CSCCLCTDigi>& clctV1a = tmb11->clctProc->readoutCLCTsME1a();
179  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV1a = tmb11->clctProc->preTriggerDigisME1a();
180  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb11->alctProc->preTriggerDigis();
181 
182  if (infoV > 1)
183  LogTrace("CSCTriggerPrimitivesBuilder")
184  << "CSCTriggerPrimitivesBuilder:: a=" << alctV.size() << " c=" << clctV.size()
185  << " l=" << lctV.size() << " c=" << clctV1a.size() << " l=" << lctV1a.size();
186 
187  // ME1/b
188 
189  if (!(lctV.empty() && alctV.empty() && clctV.empty()) and infoV > 1) {
190  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid;
191  }
192  // put collections in event
193  put(lctV, oc_lct, detid, " ME1b LCT digi");
194  put(alctV, oc_alct, detid, " ME1b ALCT digi");
195  put(alctV_all, oc_alct_all, detid, " ME1b ALCT digi");
196  put(clctV, oc_clct, detid, " ME1b CLCT digi");
197  put(clctV_all, oc_clct_all, detid, " ME1b CLCT digi");
198  put(pretriggerV, oc_pretrigger, detid, " ME1b CLCT pre-trigger digi");
199  put(preTriggerBXs, oc_pretrig, detid, " ME1b CLCT pre-trigger BX");
200  put(alctpretriggerV, oc_alctpretrigger, detid, " ME1b ALCT pre-trigger digi");
201 
202  // ME1/a
203 
204  if (disableME1a_)
205  continue;
206 
207  CSCDetId detid1a(endc, stat, 4, chid, 0);
208 
209  if (!(lctV1a.empty() && clctV1a.empty()) and infoV > 1) {
210  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid1a;
211  }
212 
213  // put collections in event, still use detid ring =1
214  put(lctV1a, oc_lct, detid, " ME1a LCT digi");
215  put(clctV1a, oc_clct, detid, " ME1a CLCT digi");
216  put(pretriggerV1a, oc_pretrigger, detid, " ME1a CLCT pre-trigger digi");
217  } // upgraded TMB
218 
219  // running upgraded ME1/1 TMBs with GEMs
220  else if (stat == 1 && ring == 1 && runPhase2_ && runME11ILT_) {
221  // run the TMB
222  CSCGEMMotherboardME11* tmb11GEM = static_cast<CSCGEMMotherboardME11*>(tmb);
223  tmb11GEM->setCSCGeometry(csc_g);
224  tmb11GEM->setGEMGeometry(gem_g);
225  if (infoV > 1)
226  LogTrace("CSCTriggerPrimitivesBuilder")
227  << "CSCTriggerPrimitivesBuilder::build in E:" << endc << " S:" << stat << " R:" << ring;
228 
229  tmb11GEM->run(wiredc, compdc, gemClusters);
230 
231  // 0th layer means whole chamber.
232  GEMDetId gemId(detid.zendcap(), 1, 1, 0, chid, 0);
233 
234  // get the collections
235  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb11GEM->readoutLCTs1b();
236  const std::vector<CSCCorrelatedLCTDigi>& lctV1a = tmb11GEM->readoutLCTs1a();
237  const std::vector<CSCALCTDigi>& alctV = tmb11GEM->alctProc->readoutALCTs();
238  const std::vector<CSCALCTDigi>& alctV_all =
239  tmb11GEM->alctProc->readoutALCTs(CSCConstants::MAX_ALCTS_PER_PROCESSOR);
240  const std::vector<CSCCLCTDigi>& clctV = tmb11GEM->clctProc->readoutCLCTsME1b();
241  const std::vector<CSCCLCTDigi>& clctV_all =
242  tmb11GEM->clctProc->readoutCLCTsME1b(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
243  const std::vector<int>& preTriggerBXs = tmb11GEM->clctProc->preTriggerBXs();
244  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb11GEM->clctProc->preTriggerDigisME1b();
245  const std::vector<CSCCLCTDigi>& clctV1a = tmb11GEM->clctProc->readoutCLCTsME1a();
246  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV1a = tmb11GEM->clctProc->preTriggerDigisME1a();
247  const std::vector<GEMCoPadDigi>& copads = tmb11GEM->coPadProcessor->readoutCoPads();
248  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb11GEM->alctProc->preTriggerDigis();
249 
250  // ME1/b
251  if (!(lctV.empty() && alctV.empty() && clctV.empty()) and infoV > 1) {
252  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid;
253  }
254 
255  // put collections in event
256  put(lctV, oc_lct, detid, " ME1b LCT digi");
257  put(alctV, oc_alct, detid, " ME1b ALCT digi");
258  put(alctV_all, oc_alct_all, detid, " ME1b ALCT digi");
259  put(clctV, oc_clct, detid, " ME1b CLCT digi");
260  put(clctV_all, oc_clct_all, detid, " ME1b CLCT digi");
261  put(pretriggerV, oc_pretrigger, detid, " ME1b CLCT pre-trigger digi");
262  put(preTriggerBXs, oc_pretrig, detid, " ME1b CLCT pre-trigger BX");
263  put(copads, oc_gemcopad, gemId, " GEM coincidence pad");
264  put(alctpretriggerV, oc_alctpretrigger, detid, " ME1b ALCT pre-trigger digi");
265 
266  // ME1/a
267  if (disableME1a_)
268  continue;
269 
270  CSCDetId detid1a(endc, stat, 4, chid, 0);
271 
272  if (!(lctV1a.empty() && clctV1a.empty()) and infoV > 1) {
273  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid1a;
274  }
275 
276  // put collections in event, still use detid ring =1
277  put(lctV1a, oc_lct, detid, " ME1a LCT digi");
278  put(clctV1a, oc_clct, detid, " ME1a CLCT digi");
279  put(pretriggerV1a, oc_pretrigger, detid, " ME1a CLCT pre-trigger digi");
280  }
281 
282  // running upgraded ME2/1 TMBs
283  else if (stat == 2 && ring == 1 && runPhase2_ && runME21ILT_) {
284  // run the TMB
285  CSCGEMMotherboardME21* tmb21GEM = static_cast<CSCGEMMotherboardME21*>(tmb);
286  tmb21GEM->setCSCGeometry(csc_g);
287  tmb21GEM->setGEMGeometry(gem_g);
288 
289  tmb21GEM->run(wiredc, compdc, gemClusters);
290 
291  // 0th layer means whole chamber.
292  GEMDetId gemId(detid.zendcap(), 1, 2, 0, chid, 0);
293 
294  // get the collections
295  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb21GEM->readoutLCTs();
296  const std::vector<CSCALCTDigi>& alctV = tmb21GEM->alctProc->readoutALCTs();
297  const std::vector<CSCALCTDigi>& alctV_all =
298  tmb21GEM->alctProc->readoutALCTs(CSCConstants::MAX_ALCTS_PER_PROCESSOR);
299  const std::vector<CSCCLCTDigi>& clctV = tmb21GEM->clctProc->readoutCLCTs();
300  const std::vector<CSCCLCTDigi>& clctV_all =
301  tmb21GEM->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
302  const std::vector<int>& preTriggerBXs = tmb21GEM->clctProc->preTriggerBXs();
303  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb21GEM->clctProc->preTriggerDigis();
304  const std::vector<GEMCoPadDigi>& copads = tmb21GEM->coPadProcessor->readoutCoPads();
305  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb21GEM->alctProc->preTriggerDigis();
306 
307  if (!(alctV.empty() && clctV.empty() && lctV.empty()) and infoV > 1) {
308  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder got results in " << detid;
309  }
310 
311  // put collections in event
312  put(lctV, oc_lct, detid, " ME21 LCT digi");
313  put(alctV, oc_alct, detid, " ME21 ALCT digi");
314  put(alctV_all, oc_alct_all, detid, " ME21 ALCT digi");
315  put(clctV, oc_clct, detid, " ME21 CLCT digi");
316  put(clctV_all, oc_clct_all, detid, " ME21 CLCT digi");
317  put(pretriggerV, oc_pretrigger, detid, " ME21 CLCT pre-trigger digi");
318  put(preTriggerBXs, oc_pretrig, detid, " ME21 CLCT pre-trigger BX");
319  put(copads, oc_gemcopad, gemId, " GEM coincidence pad");
320  put(alctpretriggerV, oc_alctpretrigger, detid, " ME21 ALCT pre-trigger digi");
321  }
322  // running upgraded ME2/1-ME3/1-ME4/1 TMBs (without GEMs or RPCs)
323  else if (runPhase2_ and ring == 1 and
324  ((stat == 2 and runME21Up_ and !runME21ILT_) || (stat == 3 and runME31Up_) ||
325  (stat == 4 and runME41Up_))) {
326  // run the TMB
327  CSCUpgradeMotherboard* utmb = static_cast<CSCUpgradeMotherboard*>(tmb);
328  utmb->setCSCGeometry(csc_g);
329  utmb->run(wiredc, compdc);
330 
331  // get the collections
332  const std::vector<CSCCorrelatedLCTDigi>& lctV = utmb->readoutLCTs();
333  const std::vector<CSCALCTDigi>& alctV = utmb->alctProc->readoutALCTs();
334  const std::vector<CSCALCTDigi>& alctV_all =
335  utmb->alctProc->readoutALCTs(CSCConstants::MAX_ALCTS_PER_PROCESSOR);
336  const std::vector<CSCCLCTDigi>& clctV = utmb->clctProc->readoutCLCTs();
337  const std::vector<CSCCLCTDigi>& clctV_all =
338  utmb->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
339  const std::vector<int>& preTriggerBXs = utmb->clctProc->preTriggerBXs();
340  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = utmb->clctProc->preTriggerDigis();
341  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = utmb->alctProc->preTriggerDigis();
342 
343  if (!(alctV.empty() && clctV.empty() && lctV.empty()) and infoV > 1) {
344  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder got results in " << detid;
345  }
346 
347  // put collections in event
348  put(lctV, oc_lct, detid, " LCT digi");
349  put(alctV, oc_alct, detid, " ALCT digi");
350  put(alctV_all, oc_alct_all, detid, " ALCT digi");
351  put(clctV, oc_clct, detid, " CLCT digi");
352  put(clctV_all, oc_clct_all, detid, tmb->getCSCName() + " CLCT digi");
353  put(pretriggerV, oc_pretrigger, detid, " CLCT pre-trigger digi");
354  put(preTriggerBXs, oc_pretrig, detid, " CLCT pre-trigger BX");
355  put(alctpretriggerV, oc_alctpretrigger, detid, " ALCT pre-trigger digi");
356  }
357 
358  // running non-upgraded TMB
359  else {
360  // run the TMB
361  tmb->run(wiredc, compdc);
362 
363  // get the collections
364  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb->readoutLCTs();
365  const std::vector<CSCALCTDigi>& alctV = tmb->alctProc->readoutALCTs();
366  const std::vector<CSCALCTDigi>& alctV_all =
368  const std::vector<CSCCLCTDigi>& clctV = tmb->clctProc->readoutCLCTs();
369  const std::vector<CSCCLCTDigi>& clctV_all =
371  const std::vector<int>& preTriggerBXs = tmb->clctProc->preTriggerBXs();
372  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb->clctProc->preTriggerDigis();
373  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb->alctProc->preTriggerDigis();
374 
375  if (!(alctV.empty() && clctV.empty() && lctV.empty()) and infoV > 1) {
376  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder got results in " << detid;
377  }
378 
379  // put collections in event
380  put(lctV, oc_lct, detid, tmb->getCSCName() + " LCT digi");
381  put(alctV, oc_alct, detid, tmb->getCSCName() + " ALCT digi");
382  put(alctV_all, oc_alct_all, detid, tmb->getCSCName() + " ALCT digi");
383  put(clctV, oc_clct, detid, tmb->getCSCName() + " CLCT digi");
384  put(clctV_all, oc_clct_all, detid, tmb->getCSCName() + " CLCT digi");
385  put(pretriggerV, oc_pretrigger, detid, tmb->getCSCName() + " CLCT pre-trigger digi");
386  put(preTriggerBXs, oc_pretrig, detid, tmb->getCSCName() + " CLCT pre-trigger BX");
387  put(alctpretriggerV, oc_alctpretrigger, detid, tmb->getCSCName() + " ALCT pre-trigger digi");
388  } // non-upgraded TMB
389  }
390  }
391  }
392  }
393  }
394 
395  // run MPC simulation
396  // there are 2 x 4 x 6 MPC VME cards
397  for (int endc = min_endcap; endc <= max_endcap; endc++) {
398  for (int stat = min_station; stat <= max_station; stat++) {
399  for (int sect = min_sector; sect <= max_sector; sect++) {
400  auto mpc = mpc_[endc - 1][stat - 1][sect - 1].get();
401 
402  // load the LCTs relevant for this MPC
403  mpc->loadLCTs(oc_lct);
404 
405  // sort and select the LCTs (if applicable)
406  mpc->sortLCTs();
407 
408  // get sorted+selected LCTs
409  const auto& result = mpc->getLCTs();
410 
411  // now convert csctf::TrackStub back into CSCCorrelatedLCTDigi
412  // put MPC stubs into the event
413  for (const auto& lct : result) {
414  oc_sorted_lct.insertDigi(CSCDetId(lct.getDetId().rawId()), *(lct.getDigi()));
415  if (infoV > 1)
416  LogDebug("CSCTriggerPrimitivesBuilder")
417  << "MPC " << *(lct.getDigi()) << " found in ME" << ((lct.endcap() == 1) ? "+" : "-") << lct.station()
418  << "/" << CSCDetId(lct.getDetId().rawId()).ring() << "/" << CSCDetId(lct.getDetId().rawId()).chamber()
419  << " (sector " << lct.sector() << " trig id. " << lct.cscid() << ")"
420  << "\n";
421  }
422  }
423  }
424  }
425 }

References CSCMotherboard::alctProc, relativeConstraints::cham, relativeConstraints::chamber, CSCGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), checkBadChambers_, CSCMotherboard::clctProc, CSCGEMMotherboard::coPadProcessor, csc_g, disableME1a_, disableME42_, gem_g, CSCBaseboard::getCSCName(), infoV, CSCBadChambers::isInBadChamber(), LogDebug, LogTrace, CSCConstants::MAX_ALCTS_PER_PROCESSOR, max_chamber, CSCConstants::MAX_CLCTS_PER_PROCESSOR, max_endcap, max_sector, max_station, max_subsector, min_chamber, min_endcap, min_sector, min_station, min_subsector, mpc_, put(), CSCGEMMotherboardME21::readoutLCTs(), CSCMotherboard::readoutLCTs(), CSCUpgradeMotherboard::readoutLCTs(), CSCGEMMotherboardME11::readoutLCTs1a(), CSCMotherboardME11::readoutLCTs1a(), CSCGEMMotherboardME11::readoutLCTs1b(), CSCMotherboardME11::readoutLCTs1b(), mps_fire::result, relativeConstraints::ring, CSCTriggerNumbering::ringFromTriggerLabels(), CSCGEMMotherboardME21::run(), CSCGEMMotherboardME11::run(), CSCMotherboardME11::run(), CSCMotherboard::run(), CSCUpgradeMotherboard::run(), runME11ILT_, runME21ILT_, runME21Up_, runME31Up_, runME41Up_, runPhase2_, CSCBaseboard::setCSCGeometry(), CSCGEMMotherboard::setGEMGeometry(), hgcalPlots::stat, tmb_, and CSCDetId::zendcap().

◆ put()

template<class T , class S >
void CSCTriggerPrimitivesBuilder::put ( const T t,
S s,
const CSCDetId detid,
std::string  comment 
)
private

template function to put data in the output helps to reduce the large amount of code duplication!

Definition at line 143 of file CSCTriggerPrimitivesBuilder.h.

143  {
144  if (!t.empty()) {
145  LogTrace("L1CSCTrigger") << "Put " << t.size() << comment << ((t.size() > 1) ? "s " : " ") << "in collection\n";
146  s.put(std::make_pair(t.begin(), t.end()), detid);
147  }
148 }

References LogTrace, alignCSCRings::s, and submitPVValidationJobs::t.

Referenced by build().

◆ setConfigParameters()

void CSCTriggerPrimitivesBuilder::setConfigParameters ( const CSCDBL1TPParameters conf)

Sets configuration parameters obtained via EventSetup mechanism.

Definition at line 92 of file CSCTriggerPrimitivesBuilder.cc.

92  {
93  // Receives CSCDBL1TPParameters percolated down from ESProducer.
94 
95  for (int endc = min_endcap; endc <= max_endcap; endc++) {
96  for (int stat = min_station; stat <= max_station; stat++) {
97  int numsubs = ((stat == 1) ? max_subsector : 1);
98  for (int sect = min_sector; sect <= max_sector; sect++) {
99  for (int subs = min_subsector; subs <= numsubs; subs++) {
100  for (int cham = min_chamber; cham <= max_chamber; cham++) {
101  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->setConfigParameters(conf);
102  }
103  }
104  }
105  }
106  }
107 }

References relativeConstraints::cham, max_chamber, max_endcap, max_sector, max_station, max_subsector, min_chamber, min_endcap, min_sector, min_station, min_subsector, hgcalPlots::stat, and tmb_.

◆ setCSCGeometry()

void CSCTriggerPrimitivesBuilder::setCSCGeometry ( const CSCGeometry g)
inline

set CSC and GEM geometries for the matching needs

Definition at line 54 of file CSCTriggerPrimitivesBuilder.h.

54 { csc_g = g; }

References csc_g, and g.

◆ setGEMGeometry()

void CSCTriggerPrimitivesBuilder::setGEMGeometry ( const GEMGeometry g)
inline

Definition at line 55 of file CSCTriggerPrimitivesBuilder.h.

55 { gem_g = g; }

References g, and gem_g.

Member Data Documentation

◆ checkBadChambers_

bool CSCTriggerPrimitivesBuilder::checkBadChambers_
private

a flag whether to skip chambers from the bad chambers map

Definition at line 108 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ csc_g

const CSCGeometry* CSCTriggerPrimitivesBuilder::csc_g
private

Definition at line 138 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setCSCGeometry().

◆ disableME1a_

bool CSCTriggerPrimitivesBuilder::disableME1a_
private

Phase2: special switch for disabling ME42

Definition at line 114 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ disableME42_

bool CSCTriggerPrimitivesBuilder::disableME42_
private

Phase2: special switch for disabling ME42

Definition at line 117 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ gem_g

const GEMGeometry* CSCTriggerPrimitivesBuilder::gem_g
private

Definition at line 139 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setGEMGeometry().

◆ infoV

int CSCTriggerPrimitivesBuilder::infoV
private

Definition at line 106 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ max_chamber

const int CSCTriggerPrimitivesBuilder::max_chamber = CSCTriggerNumbering::maxTriggerCscId()
staticprivate

◆ max_endcap

const int CSCTriggerPrimitivesBuilder::max_endcap = CSCDetId::maxEndcapId()
staticprivate

◆ max_sector

const int CSCTriggerPrimitivesBuilder::max_sector = CSCTriggerNumbering::maxTriggerSectorId()
staticprivate

◆ max_station

const int CSCTriggerPrimitivesBuilder::max_station = CSCDetId::maxStationId()
staticprivate

◆ max_subsector

const int CSCTriggerPrimitivesBuilder::max_subsector = CSCTriggerNumbering::maxTriggerSubSectorId()
staticprivate

◆ min_chamber

const int CSCTriggerPrimitivesBuilder::min_chamber = CSCTriggerNumbering::minTriggerCscId()
staticprivate

◆ min_endcap

const int CSCTriggerPrimitivesBuilder::min_endcap = CSCDetId::minEndcapId()
staticprivate

Min and max allowed values for various CSC elements, defined in CSCDetId and CSCTriggerNumbering classes.

Definition at line 94 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), CSCTriggerPrimitivesBuilder(), and setConfigParameters().

◆ min_sector

const int CSCTriggerPrimitivesBuilder::min_sector = CSCTriggerNumbering::minTriggerSectorId()
staticprivate

◆ min_station

const int CSCTriggerPrimitivesBuilder::min_station = CSCDetId::minStationId()
staticprivate

◆ min_subsector

const int CSCTriggerPrimitivesBuilder::min_subsector = CSCTriggerNumbering::minTriggerSubSectorId()
staticprivate

◆ mpc_

std::unique_ptr<CSCMuonPortCard> CSCTriggerPrimitivesBuilder::mpc_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS]
private

Pointer to MPC processors.

Definition at line 135 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ runME11ILT_

bool CSCTriggerPrimitivesBuilder::runME11ILT_
private

Phase2: special switch for the upgrade ME1/1 TMB

Definition at line 126 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ runME11Up_

bool CSCTriggerPrimitivesBuilder::runME11Up_
private

Phase2: individual switches

Definition at line 120 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

◆ runME21ILT_

bool CSCTriggerPrimitivesBuilder::runME21ILT_
private

Phase2: special switch for the upgrade ME2/1 TMB

Definition at line 129 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ runME21Up_

bool CSCTriggerPrimitivesBuilder::runME21Up_
private

Definition at line 121 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ runME31Up_

bool CSCTriggerPrimitivesBuilder::runME31Up_
private

Definition at line 122 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ runME41Up_

bool CSCTriggerPrimitivesBuilder::runME41Up_
private

Definition at line 123 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ runPhase2_

bool CSCTriggerPrimitivesBuilder::runPhase2_
private

Phase2: special configuration parameters for ME11 treatment.

Definition at line 111 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

◆ tmb_

std::unique_ptr<CSCMotherboard> CSCTriggerPrimitivesBuilder::tmb_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
private

Pointers to TMB processors for all possible chambers.

Definition at line 132 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), CSCTriggerPrimitivesBuilder(), and setConfigParameters().

CSCMotherboard::run
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
Definition: CSCMotherboard.cc:131
CSCTriggerPrimitivesBuilder::max_sector
static const int max_sector
Definition: CSCTriggerPrimitivesBuilder.h:99
CSCUpgradeMotherboard
Definition: CSCUpgradeMotherboard.h:35
CSCTriggerPrimitivesBuilder::tmb_
std::unique_ptr< CSCMotherboard > tmb_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
Definition: CSCTriggerPrimitivesBuilder.h:132
CSCTriggerPrimitivesBuilder::max_endcap
static const int max_endcap
Definition: CSCTriggerPrimitivesBuilder.h:95
CSCTriggerPrimitivesBuilder::max_chamber
static const int max_chamber
Definition: CSCTriggerPrimitivesBuilder.h:103
CSCTriggerPrimitivesBuilder::put
void put(const T &, S &, const CSCDetId &, std::string comment)
Definition: CSCTriggerPrimitivesBuilder.h:143
relativeConstraints.cham
cham
Definition: relativeConstraints.py:69
CSCTriggerPrimitivesBuilder::checkBadChambers_
bool checkBadChambers_
a flag whether to skip chambers from the bad chambers map
Definition: CSCTriggerPrimitivesBuilder.h:108
CSCMotherboard::alctProc
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
Definition: CSCMotherboard.h:75
CSCTriggerPrimitivesBuilder::min_subsector
static const int min_subsector
Definition: CSCTriggerPrimitivesBuilder.h:100
CSCGEMMotherboardME21::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads) override
Definition: CSCGEMMotherboardME21.cc:40
CSCTriggerPrimitivesBuilder::max_subsector
static const int max_subsector
Definition: CSCTriggerPrimitivesBuilder.h:101
CSCGEMMotherboardME21::readoutLCTs
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
Definition: CSCGEMMotherboardME21.cc:422
CSCGEMMotherboardME11::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiClusterCollection *gemPads) override
Definition: CSCGEMMotherboardME11.cc:57
CSCTriggerPrimitivesBuilder::mpc_
std::unique_ptr< CSCMuonPortCard > mpc_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS]
Definition: CSCTriggerPrimitivesBuilder.h:135
CSCGEMMotherboardME11::readoutLCTs1a
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
Definition: CSCGEMMotherboardME11.cc:396
CSCMotherboard
Definition: CSCMotherboard.h:41
CSCGEMMotherboard::setGEMGeometry
void setGEMGeometry(const GEMGeometry *g)
set CSC and GEM geometries for the matching needs
Definition: CSCGEMMotherboard.h:62
CSCTriggerPrimitivesBuilder::MAX_ENDCAPS
Definition: CSCTriggerPrimitivesBuilder.h:83
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:69
CSCMotherboard::clctProc
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
Definition: CSCMotherboard.h:78
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CSCBaseboard::setCSCGeometry
void setCSCGeometry(const CSCGeometry *g)
Definition: CSCBaseboard.cc:87
CSCTriggerPrimitivesBuilder::runME21Up_
bool runME21Up_
Definition: CSCTriggerPrimitivesBuilder.h:121
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1119
CSCUpgradeMotherboard::readoutLCTs
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
Definition: CSCUpgradeMotherboard.cc:262
CSCGEMMotherboardME21
Definition: CSCGEMMotherboardME21.h:16
CSCTriggerPrimitivesBuilder::MAX_SUBSECTORS
Definition: CSCTriggerPrimitivesBuilder.h:83
CSCTriggerPrimitivesBuilder::min_sector
static const int min_sector
Definition: CSCTriggerPrimitivesBuilder.h:98
CSCTriggerPrimitivesBuilder::infoV
int infoV
Definition: CSCTriggerPrimitivesBuilder.h:106
CSCGEMMotherboard::coPadProcessor
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
Definition: CSCGEMMotherboard.h:59
CSCBaseboard::getCSCName
std::string getCSCName() const
Definition: CSCBaseboard.h:33
CSCTriggerPrimitivesBuilder::MAX_CHAMBERS
Definition: CSCTriggerPrimitivesBuilder.h:83
CSCTriggerPrimitivesBuilder::disableME42_
bool disableME42_
Definition: CSCTriggerPrimitivesBuilder.h:117
CSCBadChambers::isInBadChamber
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index 'ichamber' flagged as bad?
Definition: CSCBadChambers.cc:4
CSCGEMMotherboardME11::readoutLCTs1b
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
Definition: CSCGEMMotherboardME11.cc:398
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
CSCTriggerPrimitivesBuilder::runME31Up_
bool runME31Up_
Definition: CSCTriggerPrimitivesBuilder.h:122
CSCTriggerPrimitivesBuilder::runME41Up_
bool runME41Up_
Definition: CSCTriggerPrimitivesBuilder.h:123
CSCMotherboardME11::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
Definition: CSCMotherboardME11.cc:55
CSCConstants::MAX_ALCTS_PER_PROCESSOR
Definition: CSCConstants.h:72
CSCTriggerPrimitivesBuilder::gem_g
const GEMGeometry * gem_g
Definition: CSCTriggerPrimitivesBuilder.h:139
GEMDetId
Definition: GEMDetId.h:18
CSCDetId
Definition: CSCDetId.h:26
CSCTriggerPrimitivesBuilder::MAX_SECTORS
Definition: CSCTriggerPrimitivesBuilder.h:83
CSCMotherboardME11
Definition: CSCMotherboardME11.h:18
CSCTriggerNumbering::ringFromTriggerLabels
static int ringFromTriggerLabels(int station, int triggerCSCID)
Definition: CSCTriggerNumbering.cc:5
CSCTriggerNumbering::chamberFromTriggerLabels
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
Definition: CSCTriggerNumbering.cc:30
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
CSCMotherboard::readoutLCTs
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
Definition: CSCMotherboard.cc:332
CSCTriggerPrimitivesBuilder::runME11Up_
bool runME11Up_
Definition: CSCTriggerPrimitivesBuilder.h:120
CSCTriggerPrimitivesBuilder::MAX_STATIONS
Definition: CSCTriggerPrimitivesBuilder.h:83
CSCTriggerPrimitivesBuilder::min_chamber
static const int min_chamber
Definition: CSCTriggerPrimitivesBuilder.h:102
CSCTriggerPrimitivesBuilder::csc_g
const CSCGeometry * csc_g
Definition: CSCTriggerPrimitivesBuilder.h:138
CSCTriggerPrimitivesBuilder::min_station
static const int min_station
Definition: CSCTriggerPrimitivesBuilder.h:96
CSCTriggerPrimitivesBuilder::runPhase2_
bool runPhase2_
Definition: CSCTriggerPrimitivesBuilder.h:111
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
CSCUpgradeMotherboard::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
Definition: CSCUpgradeMotherboard.cc:71
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCTriggerPrimitivesBuilder::min_endcap
static const int min_endcap
Definition: CSCTriggerPrimitivesBuilder.h:94
mps_fire.result
result
Definition: mps_fire.py:311
CSCGEMMotherboardME11
Definition: CSCGEMMotherboardME11.h:16
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCMotherboardME11::readoutLCTs1a
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
Definition: CSCMotherboardME11.cc:229
CSCTriggerPrimitivesBuilder::max_station
static const int max_station
Definition: CSCTriggerPrimitivesBuilder.h:97
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CSCTriggerPrimitivesBuilder::runME21ILT_
bool runME21ILT_
Definition: CSCTriggerPrimitivesBuilder.h:129
CSCMotherboardME11::readoutLCTs1b
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
Definition: CSCMotherboardME11.cc:231
CSCGeometry::chamber
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
g
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 g
Definition: Activities.doc:4
CSCTriggerPrimitivesBuilder::runME11ILT_
bool runME11ILT_
Definition: CSCTriggerPrimitivesBuilder.h:126
CSCTriggerPrimitivesBuilder::disableME1a_
bool disableME1a_
Definition: CSCTriggerPrimitivesBuilder.h:114