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, 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 40 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_.

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

101 {
102 }

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,
CSCCLCTPreTriggerDigiCollection oc_clctpretrigger,
CSCCLCTPreTriggerCollection oc_pretrig,
CSCCorrelatedLCTDigiCollection oc_lct,
CSCCorrelatedLCTDigiCollection oc_sorted_lct,
GEMCoPadDigiCollection oc_gemcopad 
)

Definition at line 127 of file CSCTriggerPrimitivesBuilder.cc.

References CSCMotherboard::alctProc, 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().

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

References LogTrace.

Referenced by build().

152 {
153  if (!t.empty()) {
154  LogTrace("L1CSCTrigger")
155  << "Put " << t.size() << comment
156  << ((t.size() > 1) ? "s " : " ") << "in collection\n";
157  s.put(std::make_pair(t.begin(),t.end()), detid);
158  }
159 }
#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 104 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_.

105 {
106  // Receives CSCDBL1TPParameters percolated down from ESProducer.
107 
108  for (int endc = min_endcap; endc <= max_endcap; endc++)
109  {
110  for (int stat = min_station; stat <= max_station; stat++)
111  {
112  int numsubs = ((stat == 1) ? max_subsector : 1);
113  for (int sect = min_sector; sect <= max_sector; sect++)
114  {
115  for (int subs = min_subsector; subs <= numsubs; subs++)
116  {
117  for (int cham = min_chamber; cham <= max_chamber; cham++)
118  {
119  tmb_[endc-1][stat-1][sect-1][subs-1][cham-1]->setConfigParameters(conf);
120  }
121  }
122  }
123  }
124  }
125 }
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 56 of file CSCTriggerPrimitivesBuilder.h.

References csc_g, and g.

56 { 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 57 of file CSCTriggerPrimitivesBuilder.h.

References build(), g, and gem_g.

57 { 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 109 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const CSCGeometry* CSCTriggerPrimitivesBuilder::csc_g
private

Definition at line 142 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setCSCGeometry().

bool CSCTriggerPrimitivesBuilder::disableME1a_
private

SLHC: special switch for disabling ME42

Definition at line 115 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::disableME42_
private

SLHC: special switch for disabling ME42

Definition at line 118 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const GEMGeometry* CSCTriggerPrimitivesBuilder::gem_g
private

Definition at line 143 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setGEMGeometry().

int CSCTriggerPrimitivesBuilder::infoV
private

Definition at line 107 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::isSLHC_
private

SLHC: special configuration parameters for ME11 treatment.

Definition at line 112 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

int CSCTriggerPrimitivesBuilder::m_maxBX_
private

Definition at line 135 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

int CSCTriggerPrimitivesBuilder::m_minBX_
private

Definition at line 135 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

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

Pointer to MPC processor.

Definition at line 146 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 95 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 127 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME11Up_
private

SLHC: individual switches

Definition at line 121 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME21ILT_
private

SLHC: special switch for the upgrade ME2/1 TMB

Definition at line 130 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME21Up_
private

Definition at line 122 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME31Up_
private

Definition at line 123 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME41Up_
private

Definition at line 124 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 139 of file CSCTriggerPrimitivesBuilder.h.

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

bool CSCTriggerPrimitivesBuilder::useClusters_
private

SLHC: special switch to use gem clusters

Definition at line 133 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().