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 GEMPadDigiCollection *gemPads, const GEMPadDigiClusterCollection *gemPadClusters, CSCALCTDigiCollection &oc_alct, CSCCLCTDigiCollection &oc_clct, 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
 
bool isSLHC_
 
int m_maxBX_
 
int m_minBX_
 
std::unique_ptr< CSCMuonPortCardm_muonportcard
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
std::unique_ptr< CSCMotherboardtmb_ [MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
 
bool useClusters_
 

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 41 of file CSCTriggerPrimitivesBuilder.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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 20 of file CSCTriggerPrimitivesBuilder.cc.

References relativeConstraints::cham, checkBadChambers_, disableME1a_, disableME42_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), infoV, isSLHC_, m_maxBX_, m_minBX_, m_muonportcard, 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, relativeConstraints::ring, CSCTriggerNumbering::ringFromTriggerLabels(), runME11ILT_, runME11Up_, runME21ILT_, runME21Up_, runME31Up_, runME41Up_, tmb_, and useClusters_.

20  {
21  // special configuration parameters for ME11 treatment
22  edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
23  isSLHC_ = commonParams.getParameter<bool>("isSLHC");
24  infoV = commonParams.getParameter<int>("verbosity");
25  disableME1a_ = commonParams.getParameter<bool>("disableME1a");
26  disableME42_ = commonParams.getParameter<bool>("disableME42");
27 
28  checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");
29 
30  runME11Up_ = commonParams.existsAs<bool>("runME11Up") ? commonParams.getParameter<bool>("runME11Up") : false;
31  runME21Up_ = commonParams.existsAs<bool>("runME21Up") ? commonParams.getParameter<bool>("runME21Up") : false;
32  runME31Up_ = commonParams.existsAs<bool>("runME31Up") ? commonParams.getParameter<bool>("runME31Up") : false;
33  runME41Up_ = commonParams.existsAs<bool>("runME41Up") ? commonParams.getParameter<bool>("runME41Up") : false;
34 
35  runME11ILT_ = commonParams.existsAs<bool>("runME11ILT") ? commonParams.getParameter<bool>("runME11ILT") : false;
36  runME21ILT_ = commonParams.existsAs<bool>("runME21ILT") ? commonParams.getParameter<bool>("runME21ILT") : false;
37 
38  useClusters_ = commonParams.existsAs<bool>("useClusters") ? commonParams.getParameter<bool>("useClusters") : false;
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 (isSLHC_ and ring == 1 and stat == 1 and runME11Up_ and !runME11ILT_)
62  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].reset(
63  new CSCMotherboardME11(endc, stat, sect, subs, cham, conf));
64  else if (isSLHC_ and ring == 1 and stat == 1 and runME11Up_ and runME11ILT_)
65  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].reset(
66  new CSCGEMMotherboardME11(endc, stat, sect, subs, cham, conf));
67  else if (isSLHC_ and ring == 1 and stat == 2 and runME21Up_ and !runME21ILT_)
68  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].reset(
69  new CSCUpgradeMotherboard(endc, stat, sect, subs, cham, conf));
70  else if (isSLHC_ and ring == 1 and stat == 2 and runME21Up_ and runME21ILT_)
71  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].reset(
72  new CSCGEMMotherboardME21(endc, stat, sect, subs, cham, conf));
73  else if (isSLHC_ and ring == 1 and ((stat == 3 and runME31Up_) || (stat == 4 and runME41Up_)))
74  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].reset(
75  new CSCUpgradeMotherboard(endc, stat, sect, subs, cham, conf));
76  else
77  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].reset(
78  new CSCMotherboard(endc, stat, sect, subs, cham, conf));
79  }
80  }
81  }
82  }
83  }
84 
85  // Get min and max BX to sort LCTs in MPC.
86  m_minBX_ = conf.getParameter<int>("MinBX");
87  m_maxBX_ = conf.getParameter<int>("MaxBX");
88 
89  // Init MPC
90  m_muonportcard.reset(new CSCMuonPortCard(conf));
91 }
T getParameter(std::string const &) const
std::unique_ptr< CSCMotherboard > tmb_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
static int ringFromTriggerLabels(int station, int triggerCSCID)
bool checkBadChambers_
a flag whether to skip chambers from the bad chambers map
std::unique_ptr< CSCMuonPortCard > m_muonportcard
CSCTriggerPrimitivesBuilder::~CSCTriggerPrimitivesBuilder ( )

Definition at line 96 of file CSCTriggerPrimitivesBuilder.cc.

96 {}

Member Function Documentation

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

Definition at line 115 of file CSCTriggerPrimitivesBuilder.cc.

References CSCMotherboard::alctProc, l1GtPatternGenerator_cfi::bx, relativeConstraints::cham, relativeConstraints::chamber, CSCGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), checkBadChambers_, CSCMotherboard::clctProc, CSCGEMMotherboard::coPadProcessor, csc_g, disableME1a_, disableME42_, MillePedeFileConverter_cfg::e, gem_g, CSCBaseboard::getCSCName(), infoV, CSCBadChambers::isInBadChamber(), isSLHC_, LogDebug, LogTrace, m_maxBX_, m_minBX_, m_muonportcard, max_chamber, max_endcap, max_sector, max_station, max_subsector, min_chamber, min_endcap, min_sector, min_station, min_subsector, or, 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_, CSCBaseboard::setCSCGeometry(), CSCGEMMotherboard::setGEMGeometry(), tmb_, and CSCDetId::zendcap().

Referenced by setGEMGeometry().

127  {
128  // CSC geometry.
129  for (int endc = min_endcap; endc <= max_endcap; endc++) {
130  for (int stat = min_station; stat <= max_station; stat++) {
131  int numsubs = ((stat == 1) ? max_subsector : 1);
132  for (int sect = min_sector; sect <= max_sector; sect++) {
133  for (int subs = min_subsector; subs <= numsubs; subs++) {
134  for (int cham = min_chamber; cham <= max_chamber; cham++) {
135  // extract the ring number
137 
138  // case when you want to ignore ME42
139  if (disableME42_ && stat == 4 && ring == 2)
140  continue;
141 
142  CSCMotherboard* tmb = tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1].get();
143 
144  tmb->setCSCGeometry(csc_g);
145 
146  // actual chamber number =/= trigger chamber number
148 
149  // 0th layer means whole chamber.
150  CSCDetId detid(endc, stat, ring, chid, 0);
151 
152  // Run processors only if chamber exists in geometry.
153  if (tmb == nullptr || csc_g->chamber(detid) == nullptr)
154  continue;
155 
156  // Skip chambers marked as bad (usually includes most of ME4/2 chambers;
157  // also, there's no ME1/a-1/b separation, it's whole ME1/1)
158  if (checkBadChambers_ && badChambers->isInBadChamber(detid))
159  continue;
160 
161  // running upgraded ME1/1 TMBs
162  if (stat == 1 && ring == 1 && isSLHC_ && !runME11ILT_) {
163  // run the TMB
164  CSCMotherboardME11* tmb11 = static_cast<CSCMotherboardME11*>(tmb);
165  if (infoV > 1)
166  LogTrace("CSCTriggerPrimitivesBuilder")
167  << "CSCTriggerPrimitivesBuilder::build in E:" << endc << " S:" << stat << " R:" << ring;
168  tmb11->run(wiredc, compdc);
169 
170  // get all collections
171  // all ALCTs, CLCTs, LCTs are written with detid ring = 1, as data did
172  // but CLCTs and LCTs are written sperately in ME1a and ME1b, considering whether ME1a is disabled or not
173  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb11->readoutLCTs1b();
174  const std::vector<CSCCorrelatedLCTDigi>& lctV1a = tmb11->readoutLCTs1a();
175  const std::vector<CSCALCTDigi>& alctV = tmb11->alctProc->readoutALCTs();
176  const std::vector<CSCCLCTDigi>& clctV = tmb11->clctProc->readoutCLCTsME1b();
177  const std::vector<int> preTriggerBXs = tmb11->clctProc->preTriggerBXs();
178  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb11->clctProc->preTriggerDigisME1b();
179  const std::vector<CSCCLCTDigi>& clctV1a = tmb11->clctProc->readoutCLCTsME1a();
180  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV1a = tmb11->clctProc->preTriggerDigisME1a();
181  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb11->alctProc->preTriggerDigis();
182 
183  if (infoV > 1)
184  LogTrace("CSCTriggerPrimitivesBuilder")
185  << "CSCTriggerPrimitivesBuilder:: a=" << alctV.size() << " c=" << clctV.size()
186  << " l=" << lctV.size() << " c=" << clctV1a.size() << " l=" << lctV1a.size();
187 
188  // ME1/b
189 
190  if (!(lctV.empty() && alctV.empty() && clctV.empty()) and infoV > 1) {
191  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid;
192  }
193 
194  // put collections in event
195  put(lctV, oc_lct, detid, " ME1b LCT digi");
196  put(alctV, oc_alct, detid, " ME1b ALCT digi");
197  put(clctV, oc_clct, 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 && isSLHC_ && 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  tmb11GEM->run(wiredc, compdc, gemPads);
229 
230  // 0th layer means whole chamber.
231  GEMDetId gemId(detid.zendcap(), 1, 1, 0, chid, 0);
232 
233  // get the collections
234  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb11GEM->readoutLCTs1b();
235  const std::vector<CSCCorrelatedLCTDigi>& lctV1a = tmb11GEM->readoutLCTs1a();
236  const std::vector<CSCALCTDigi>& alctV = tmb11GEM->alctProc->readoutALCTs();
237  const std::vector<CSCCLCTDigi>& clctV = tmb11GEM->clctProc->readoutCLCTsME1b();
238  const std::vector<int>& preTriggerBXs = tmb11GEM->clctProc->preTriggerBXs();
239  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb11GEM->clctProc->preTriggerDigisME1b();
240  const std::vector<CSCCLCTDigi>& clctV1a = tmb11GEM->clctProc->readoutCLCTsME1a();
241  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV1a = tmb11GEM->clctProc->preTriggerDigisME1a();
242  const std::vector<GEMCoPadDigi>& copads = tmb11GEM->coPadProcessor->readoutCoPads();
243  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb11GEM->alctProc->preTriggerDigis();
244 
245  // ME1/b
246  if (!(lctV.empty() && alctV.empty() && clctV.empty()) and infoV > 1) {
247  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid;
248  }
249 
250  // put collections in event
251  put(lctV, oc_lct, detid, " ME1b LCT digi");
252  put(alctV, oc_alct, detid, " ME1b ALCT digi");
253  put(clctV, oc_clct, detid, " ME1b CLCT digi");
254  put(pretriggerV, oc_pretrigger, detid, " ME1b CLCT pre-trigger digi");
255  put(preTriggerBXs, oc_pretrig, detid, " ME1b CLCT pre-trigger BX");
256  put(copads, oc_gemcopad, gemId, " GEM coincidence pad");
257  put(alctpretriggerV, oc_alctpretrigger, detid, " ME1b ALCT pre-trigger digi");
258 
259  // ME1/a
260  if (disableME1a_)
261  continue;
262 
263  CSCDetId detid1a(endc, stat, 4, chid, 0);
264 
265  if (!(lctV1a.empty() && clctV1a.empty()) and infoV > 1) {
266  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " << detid1a;
267  }
268 
269  // put collections in event, still use detid ring =1
270  put(lctV1a, oc_lct, detid, " ME1a LCT digi");
271  put(clctV1a, oc_clct, detid, " ME1a CLCT digi");
272  put(pretriggerV1a, oc_pretrigger, detid, " ME1a CLCT pre-trigger digi");
273  }
274 
275  // running upgraded ME2/1 TMBs
276  else if (stat == 2 && ring == 1 && isSLHC_ && runME21ILT_) {
277  // run the TMB
278  CSCGEMMotherboardME21* tmb21GEM = static_cast<CSCGEMMotherboardME21*>(tmb);
279  tmb21GEM->setCSCGeometry(csc_g);
280  tmb21GEM->setGEMGeometry(gem_g);
281  tmb21GEM->run(wiredc, compdc, gemPads);
282 
283  // 0th layer means whole chamber.
284  GEMDetId gemId(detid.zendcap(), 1, 2, 0, chid, 0);
285 
286  // get the collections
287  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb21GEM->readoutLCTs();
288  const std::vector<CSCALCTDigi>& alctV = tmb21GEM->alctProc->readoutALCTs();
289  const std::vector<CSCCLCTDigi>& clctV = tmb21GEM->clctProc->readoutCLCTs();
290  const std::vector<int>& preTriggerBXs = tmb21GEM->clctProc->preTriggerBXs();
291  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb21GEM->clctProc->preTriggerDigis();
292  const std::vector<GEMCoPadDigi>& copads = tmb21GEM->coPadProcessor->readoutCoPads();
293  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb21GEM->alctProc->preTriggerDigis();
294 
295  if (!(alctV.empty() && clctV.empty() && lctV.empty()) and infoV > 1) {
296  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder got results in " << detid;
297  }
298 
299  // put collections in event
300  put(lctV, oc_lct, detid, " ME21 LCT digi");
301  put(alctV, oc_alct, detid, " ME21 ALCT digi");
302  put(clctV, oc_clct, detid, " ME21 CLCT digi");
303  put(pretriggerV, oc_pretrigger, detid, " ME21 CLCT pre-trigger digi");
304  put(preTriggerBXs, oc_pretrig, detid, " ME21 CLCT pre-trigger BX");
305  put(copads, oc_gemcopad, gemId, " GEM coincidence pad");
306  put(alctpretriggerV, oc_alctpretrigger, detid, " ME21 ALCT pre-trigger digi");
307  }
308  // running upgraded ME2/1-ME3/1-ME4/1 TMBs (without GEMs or RPCs)
309  else if ((stat == 2 or stat == 3 or stat == 4) && ring == 1 && isSLHC_) {
310  // run the TMB
311  CSCUpgradeMotherboard* utmb = static_cast<CSCUpgradeMotherboard*>(tmb);
312  utmb->setCSCGeometry(csc_g);
313  utmb->run(wiredc, compdc);
314 
315  // get the collections
316  const std::vector<CSCCorrelatedLCTDigi>& lctV = utmb->readoutLCTs();
317  const std::vector<CSCALCTDigi>& alctV = utmb->alctProc->readoutALCTs();
318  const std::vector<CSCCLCTDigi>& clctV = utmb->clctProc->readoutCLCTs();
319  const std::vector<int>& preTriggerBXs = utmb->clctProc->preTriggerBXs();
320  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = utmb->clctProc->preTriggerDigis();
321  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = utmb->alctProc->preTriggerDigis();
322 
323  if (!(alctV.empty() && clctV.empty() && lctV.empty()) and infoV > 1) {
324  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder got results in " << detid;
325  }
326 
327  // put collections in event
328  put(lctV, oc_lct, detid, " LCT digi");
329  put(alctV, oc_alct, detid, " ALCT digi");
330  put(clctV, oc_clct, detid, " CLCT digi");
331  put(pretriggerV, oc_pretrigger, detid, " CLCT pre-trigger digi");
332  put(preTriggerBXs, oc_pretrig, detid, " CLCT pre-trigger BX");
333  put(alctpretriggerV, oc_alctpretrigger, detid, " ALCT pre-trigger digi");
334  }
335 
336  // running non-upgraded TMB
337  else {
338  // run the TMB
339  tmb->run(wiredc, compdc);
340 
341  // get the collections
342  const std::vector<CSCCorrelatedLCTDigi>& lctV = tmb->readoutLCTs();
343  const std::vector<CSCALCTDigi>& alctV = tmb->alctProc->readoutALCTs();
344  const std::vector<CSCCLCTDigi>& clctV = tmb->clctProc->readoutCLCTs();
345  const std::vector<int>& preTriggerBXs = tmb->clctProc->preTriggerBXs();
346  const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb->clctProc->preTriggerDigis();
347  const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb->alctProc->preTriggerDigis();
348 
349  if (!(alctV.empty() && clctV.empty() && lctV.empty()) and infoV > 1) {
350  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder got results in " << detid;
351  }
352 
353  // put collections in event
354  put(lctV, oc_lct, detid, tmb->getCSCName() + " LCT digi");
355  put(alctV, oc_alct, detid, tmb->getCSCName() + " ALCT digi");
356  put(clctV, oc_clct, detid, tmb->getCSCName() + " CLCT digi");
357  put(pretriggerV, oc_pretrigger, detid, tmb->getCSCName() + " CLCT pre-trigger digi");
358  put(preTriggerBXs, oc_pretrig, detid, tmb->getCSCName() + " CLCT pre-trigger BX");
359  put(alctpretriggerV, oc_alctpretrigger, detid, tmb->getCSCName() + " ALCT pre-trigger digi");
360  } // non-upgraded TMB
361  }
362  }
363  }
364  }
365  }
366 
367  // run MPC simulation
368  m_muonportcard->loadDigis(oc_lct);
369 
370  // sort the LCTs per sector
371  // insert them into the result vector
372  std::vector<csctf::TrackStub> result;
373  for (int bx = m_minBX_; bx <= m_maxBX_; ++bx)
374  for (int e = min_endcap; e <= max_endcap; ++e)
375  for (int st = min_station; st <= max_station; ++st)
376  for (int se = min_sector; se <= max_sector; ++se) {
377  if (st == 1) {
378  std::vector<csctf::TrackStub> subs1, subs2;
379  subs1 = m_muonportcard->sort(e, st, se, 1, bx);
380  subs2 = m_muonportcard->sort(e, st, se, 2, bx);
381  result.insert(result.end(), subs1.begin(), subs1.end());
382  result.insert(result.end(), subs2.begin(), subs2.end());
383  } else {
384  std::vector<csctf::TrackStub> sector;
385  sector = m_muonportcard->sort(e, st, se, 0, bx);
386  result.insert(result.end(), sector.begin(), sector.end());
387  }
388  }
389 
390  // now convert csctf::TrackStub back into CSCCorrelatedLCTDigi
391  // put MPC stubs into the event
392  std::vector<csctf::TrackStub>::const_iterator itr = result.begin();
393  for (; itr != result.end(); itr++) {
394  oc_sorted_lct.insertDigi(CSCDetId(itr->getDetId().rawId()), *(itr->getDigi()));
395  if (infoV > 1)
396  LogDebug("L1CSCTrigger") << "MPC " << *(itr->getDigi()) << " found in ME" << ((itr->endcap() == 1) ? "+" : "-")
397  << itr->station() << "/" << CSCDetId(itr->getDetId().rawId()).ring() << "/"
398  << CSCDetId(itr->getDetId().rawId()).chamber() << " (sector " << itr->sector()
399  << " trig id. " << itr->cscid() << ")"
400  << "\n";
401  }
402 }
#define LogDebug(id)
std::unique_ptr< CSCMotherboard > tmb_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads) override
void setGEMGeometry(const GEMGeometry *g)
set CSC and GEM geometries for the matching needs
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static int ringFromTriggerLabels(int station, int triggerCSCID)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
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
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
#define LogTrace(id)
std::string getCSCName() const
Definition: CSCBaseboard.h:33
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
virtual void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:100
void put(const T &, S &, const CSCDetId &, std::string comment)
bool checkBadChambers_
a flag whether to skip chambers from the bad chambers map
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
void setCSCGeometry(const CSCGeometry *g)
Definition: CSCBaseboard.cc:87
std::unique_ptr< CSCMuonPortCard > m_muonportcard
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads) override
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 148 of file CSCTriggerPrimitivesBuilder.h.

References LogTrace.

Referenced by build().

148  {
149  if (!t.empty()) {
150  LogTrace("L1CSCTrigger") << "Put " << t.size() << comment << ((t.size() > 1) ? "s " : " ") << "in collection\n";
151  s.put(std::make_pair(t.begin(), t.end()), detid);
152  }
153 }
#define LogTrace(id)
#define comment(par)
Definition: vmac.h:163
void CSCTriggerPrimitivesBuilder::setConfigParameters ( const CSCDBL1TPParameters conf)

Sets configuration parameters obtained via EventSetup mechanism.

Definition at line 98 of file CSCTriggerPrimitivesBuilder.cc.

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

98  {
99  // Receives CSCDBL1TPParameters percolated down from ESProducer.
100 
101  for (int endc = min_endcap; endc <= max_endcap; endc++) {
102  for (int stat = min_station; stat <= max_station; stat++) {
103  int numsubs = ((stat == 1) ? max_subsector : 1);
104  for (int sect = min_sector; sect <= max_sector; sect++) {
105  for (int subs = min_subsector; subs <= numsubs; subs++) {
106  for (int cham = min_chamber; cham <= max_chamber; cham++) {
107  tmb_[endc - 1][stat - 1][sect - 1][subs - 1][cham - 1]->setConfigParameters(conf);
108  }
109  }
110  }
111  }
112  }
113 }
std::unique_ptr< CSCMotherboard > tmb_[MAX_ENDCAPS][MAX_STATIONS][MAX_SECTORS][MAX_SUBSECTORS][MAX_CHAMBERS]
void CSCTriggerPrimitivesBuilder::setCSCGeometry ( const CSCGeometry g)
inline

set CSC and GEM geometries for the matching needs

Definition at line 55 of file CSCTriggerPrimitivesBuilder.h.

References csc_g, and g.

55 { csc_g = 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
void CSCTriggerPrimitivesBuilder::setGEMGeometry ( const GEMGeometry g)
inline

Definition at line 56 of file CSCTriggerPrimitivesBuilder.h.

References build(), g, and gem_g.

56 { gem_g = 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

Member Data Documentation

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().

const CSCGeometry* CSCTriggerPrimitivesBuilder::csc_g
private

Definition at line 140 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setCSCGeometry().

bool CSCTriggerPrimitivesBuilder::disableME1a_
private

SLHC: special switch for disabling ME42

Definition at line 114 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::disableME42_
private

SLHC: special switch for disabling ME42

Definition at line 117 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const GEMGeometry* CSCTriggerPrimitivesBuilder::gem_g
private

Definition at line 141 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setGEMGeometry().

int CSCTriggerPrimitivesBuilder::infoV
private

Definition at line 106 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::isSLHC_
private

SLHC: special configuration parameters for ME11 treatment.

Definition at line 111 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

int CSCTriggerPrimitivesBuilder::m_maxBX_
private

Definition at line 134 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

int CSCTriggerPrimitivesBuilder::m_minBX_
private

Definition at line 134 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

std::unique_ptr<CSCMuonPortCard> CSCTriggerPrimitivesBuilder::m_muonportcard
private

Pointer to MPC processor.

Definition at line 144 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const int CSCTriggerPrimitivesBuilder::max_chamber = CSCTriggerNumbering::maxTriggerCscId()
staticprivate
const int CSCTriggerPrimitivesBuilder::max_endcap = CSCDetId::maxEndcapId()
staticprivate
const int CSCTriggerPrimitivesBuilder::max_sector = CSCTriggerNumbering::maxTriggerSectorId()
staticprivate
const int CSCTriggerPrimitivesBuilder::max_station = CSCDetId::maxStationId()
staticprivate
const int CSCTriggerPrimitivesBuilder::max_subsector = CSCTriggerNumbering::maxTriggerSubSectorId()
staticprivate
const int CSCTriggerPrimitivesBuilder::min_chamber = CSCTriggerNumbering::minTriggerCscId()
staticprivate
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().

const int CSCTriggerPrimitivesBuilder::min_sector = CSCTriggerNumbering::minTriggerSectorId()
staticprivate
const int CSCTriggerPrimitivesBuilder::min_station = CSCDetId::minStationId()
staticprivate
const int CSCTriggerPrimitivesBuilder::min_subsector = CSCTriggerNumbering::minTriggerSubSectorId()
staticprivate
bool CSCTriggerPrimitivesBuilder::runME11ILT_
private

SLHC: special switch for the upgrade ME1/1 TMB

Definition at line 126 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME11Up_
private

SLHC: individual switches

Definition at line 120 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME21ILT_
private

SLHC: special switch for the upgrade ME2/1 TMB

Definition at line 129 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME21Up_
private

Definition at line 121 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME31Up_
private

Definition at line 122 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME41Up_
private

Definition at line 123 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

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 137 of file CSCTriggerPrimitivesBuilder.h.

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

bool CSCTriggerPrimitivesBuilder::useClusters_
private

SLHC: special switch to use gem clusters

Definition at line 132 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().