CMS 3D CMS Logo

List of all members | Public Types | Public 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, CSCCLCTPreTriggerCollection &oc_pretrig, CSCCorrelatedLCTDigiCollection &oc_lct, CSCCorrelatedLCTDigiCollection &oc_sorted_lct, GEMCoPadDigiCollection &oc_gemcopad)
 
 CSCTriggerPrimitivesBuilder (const edm::ParameterSet &)
 
void runOnData (bool runOnData)
 
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 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 m_maxBX
 
int m_minBX
 
std::unique_ptr< CSCMuonPortCardm_muonportcard
 
bool runME11ILT_
 
bool runME21ILT_
 
bool runME3141ILT_
 
bool runOnData_
 temporary flag to run on data More...
 
bool smartME1aME1b
 
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 38 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 46 of file CSCTriggerPrimitivesBuilder.cc.

References relativeConstraints::cham, checkBadChambers_, disableME1a, disableME42, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), 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_, runME21ILT_, runME3141ILT_, smartME1aME1b, tmb_, and useClusters_.

47 {
48  // Receives ParameterSet percolated down from EDProducer.
49 
50  // special configuration parameters for ME11 treatment
51  edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam");
52  smartME1aME1b = commonParams.getParameter<bool>("smartME1aME1b");
53  disableME1a = commonParams.getParameter<bool>("disableME1a");
54  disableME42 = commonParams.getParameter<bool>("disableME42");
55 
56  checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");
57 
58  runME11ILT_ = commonParams.existsAs<bool>("runME11ILT")?commonParams.getParameter<bool>("runME11ILT"):false;
59  runME21ILT_ = commonParams.existsAs<bool>("runME21ILT")?commonParams.getParameter<bool>("runME21ILT"):false;
60  runME3141ILT_ = commonParams.existsAs<bool>("runME3141ILT")?commonParams.getParameter<bool>("runME3141ILT"):false;
61  useClusters_ = commonParams.existsAs<bool>("useClusters")?commonParams.getParameter<bool>("useClusters"):false;
62 
63  // ORCA way of initializing boards.
64  for (int endc = min_endcap; endc <= max_endcap; endc++)
65  {
66  for (int stat = min_station; stat <= max_station; stat++)
67  {
68  int numsubs = ((stat == 1) ? max_subsector : 1);
69  for (int sect = min_sector; sect <= max_sector; sect++)
70  {
71  for (int subs = min_subsector; subs <= numsubs; subs++)
72  {
73  for (int cham = min_chamber; cham <= max_chamber; cham++)
74  {
75  if ((endc <= 0 || endc > MAX_ENDCAPS) ||
76  (stat <= 0 || stat > MAX_STATIONS) ||
77  (sect <= 0 || sect > MAX_SECTORS) ||
78  (subs <= 0 || subs > MAX_SUBSECTORS) ||
79  (cham <= 0 || cham > MAX_CHAMBERS))
80  {
81  edm::LogError("L1CSCTPEmulatorSetupError")
82  << "+++ trying to instantiate TMB of illegal CSC id ["
83  << " endcap = " << endc << " station = " << stat
84  << " sector = " << sect << " subsector = " << subs
85  << " chamber = " << cham << "]; skipping it... +++\n";
86  continue;
87  }
89  // When the motherboard is instantiated, it instantiates ALCT
90  // and CLCT processors.
91  if (stat==1 && ring==1 && smartME1aME1b && !runME11ILT_)
92  tmb_[endc-1][stat-1][sect-1][subs-1][cham-1].reset( new CSCMotherboardME11(endc, stat, sect, subs, cham, conf) );
93  else if (stat==1 && ring==1 && smartME1aME1b && runME11ILT_)
94  tmb_[endc-1][stat-1][sect-1][subs-1][cham-1].reset( new CSCGEMMotherboardME11(endc, stat, sect, subs, cham, conf) );
95  else if (stat==2 && ring==1 && runME21ILT_)
96  tmb_[endc-1][stat-1][sect-1][subs-1][cham-1].reset( new CSCGEMMotherboardME21(endc, stat, sect, subs, cham, conf) );
97  else
98  tmb_[endc-1][stat-1][sect-1][subs-1][cham-1].reset( new CSCMotherboard(endc, stat, sect, subs, cham, conf) );
99  }
100  }
101  }
102  }
103  }
104 
105  // Get min and max BX to sort LCTs in MPC.
106  m_minBX = conf.getParameter<int>("MinBX");
107  m_maxBX = conf.getParameter<int>("MaxBX");
108 
109  // Init MPC
110  m_muonportcard.reset( new CSCMuonPortCard(conf) );
111 }
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:186
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 116 of file CSCTriggerPrimitivesBuilder.cc.

117 {
118 }

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

Build anode, cathode, and correlated LCTs in each chamber and fill them into output collections. Select up to three best correlated LCTs in each (sub)sector and put them into an output collection as well.

Definition at line 156 of file CSCTriggerPrimitivesBuilder.cc.

References CSCMotherboard::alct, relativeConstraints::cham, relativeConstraints::chamber, CSCGeometry::chamber(), CSCTriggerNumbering::chamberFromTriggerLabels(), checkBadChambers_, CSCMotherboard::clct, CSCGEMMotherboardME11::clct1a, CSCMotherboardME11::clct1a, CSCGEMMotherboard::coPadProcessor, csc_g, disableME1a, disableME42, MillePedeFileConverter_cfg::e, gem_g, CSCBadChambers::isInBadChamber(), 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, CSCGEMMotherboardME21::readoutLCTs(), CSCMotherboard::readoutLCTs(), CSCGEMMotherboardME11::readoutLCTs1a(), CSCMotherboardME11::readoutLCTs1a(), CSCGEMMotherboardME11::readoutLCTs1b(), CSCMotherboardME11::readoutLCTs1b(), mps_fire::result, relativeConstraints::ring, CSCTriggerNumbering::ringFromTriggerLabels(), CSCMotherboardME11::run(), CSCGEMMotherboardME21::run(), CSCGEMMotherboardME11::run(), CSCMotherboard::run(), runME11ILT_, runME21ILT_, runOnData_, CSCMotherboard::setCSCGeometry(), CSCUpgradeMotherboard::setCSCGeometry(), CSCGEMMotherboard::setGEMGeometry(), smartME1aME1b, tmb_, and CSCDetId::zendcap().

Referenced by runOnData().

167 {
168  // CSC geometry.
169  for (int endc = min_endcap; endc <= max_endcap; endc++)
170  {
171  for (int stat = min_station; stat <= max_station; stat++)
172  {
173  int numsubs = ((stat == 1) ? max_subsector : 1);
174  for (int sect = min_sector; sect <= max_sector; sect++)
175  {
176  for (int subs = min_subsector; subs <= numsubs; subs++)
177  {
178  for (int cham = min_chamber; cham <= max_chamber; cham++)
179  {
180  // extract the ring number
182 
183  // case when you want to ignore ME42
184  if (disableME42 && stat==4 && ring==2) continue;
185 
186  CSCMotherboard* tmb = tmb_[endc-1][stat-1][sect-1][subs-1][cham-1].get();
187 
188  tmb->setCSCGeometry(csc_g);
189 
190  // actual chamber number =/= trigger chamber number
192 
193  // 0th layer means whole chamber.
194  CSCDetId detid(endc, stat, ring, chid, 0);
195 
196  // Run processors only if chamber exists in geometry.
197  if (tmb == nullptr || csc_g->chamber(detid) == nullptr) continue;
198 
199  // Skip chambers marked as bad (usually includes most of ME4/2 chambers;
200  // also, there's no ME1/a-1/b separation, it's whole ME1/1)
201  if (checkBadChambers_ && badChambers->isInBadChamber(detid)) continue;
202 
203 
204  // running upgraded ME1/1 TMBs
205  if (stat==1 && ring==1 && smartME1aME1b && !runME11ILT_)
206  {
207  CSCMotherboardME11* tmb11 = static_cast<CSCMotherboardME11*>(tmb);
208 
209  //LogTrace("CSCTriggerPrimitivesBuilder")<<"CSCTriggerPrimitivesBuilder::build in E:"<<endc<<" S:"<<stat<<" R:"<<ring;
210 
211  tmb11->run(wiredc,compdc);
212  std::vector<CSCCorrelatedLCTDigi> lctV = tmb11->readoutLCTs1b();
213  std::vector<CSCCorrelatedLCTDigi> lctV1a = tmb11->readoutLCTs1a();
214 
215  std::vector<CSCALCTDigi> alctV1a, alctV = tmb11->alct->readoutALCTs();
216 
217  std::vector<CSCCLCTDigi> clctV = tmb11->clct->readoutCLCTs();
218  std::vector<int> preTriggerBXs = tmb11->clct->preTriggerBXs();
219  std::vector<CSCCLCTDigi> clctV1a = tmb11->clct1a->readoutCLCTs();
220  std::vector<int> preTriggerBXs1a = tmb11->clct1a->preTriggerBXs();
221 
222  // perform simple separation of ALCTs into 1/a and 1/b
223  // for 'smart' case. Some duplication occurs for WG [10,15]
224  std::vector<CSCALCTDigi> tmpV(alctV);
225  alctV.clear();
226  for (unsigned int al=0; al < tmpV.size(); al++)
227  {
228  if (tmpV[al].getKeyWG()<=15) alctV1a.push_back(tmpV[al]);
229  if (tmpV[al].getKeyWG()>=10) alctV.push_back(tmpV[al]);
230  }
231  //LogTrace("CSCTriggerPrimitivesBuilder")<<"CSCTriggerPrimitivesBuilder:: a="<<alctV.size()<<" c="<<clctV.size()<<" l="<<lctV.size()
232  // <<" 1a: a="<<alctV1a.size()<<" c="<<clctV1a.size()<<" l="<<lctV1a.size();
233 
234  // ME1/b
235 
236  if (!(lctV.empty()&&alctV.empty()&&clctV.empty())) {
237  LogTrace("L1CSCTrigger")
238  << "CSCTriggerPrimitivesBuilder results in " <<detid;
239  }
240 
241  // Correlated LCTs.
242  if (!lctV.empty()) {
243  LogTrace("L1CSCTrigger")
244  << "Put " << lctV.size() << " ME1b LCT digi"
245  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
246  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
247  }
248 
249  // Anode LCTs.
250  if (!alctV.empty()) {
251  LogTrace("L1CSCTrigger")
252  << "Put " << alctV.size() << " ME1b ALCT digi"
253  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
254  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
255  }
256 
257  // Cathode LCTs.
258  if (!clctV.empty()) {
259  LogTrace("L1CSCTrigger")
260  << "Put " << clctV.size() << " ME1b CLCT digi"
261  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
262  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
263  }
264 
265  // Cathode LCTs pretriggers
266  if (!preTriggerBXs.empty()) {
267  LogTrace("L1CSCTrigger")
268  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
269  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
270  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
271  }
272 
273  // ME1/a
274 
275  if (disableME1a) continue;
276 
277  CSCDetId detid1a(endc, stat, 4, chid, 0);
278 
279  if (!(lctV1a.empty()&&alctV1a.empty()&&clctV1a.empty())){
280  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " <<detid1a;
281  }
282 
283  // Correlated LCTs.
284  if (!lctV1a.empty()) {
285  LogTrace("L1CSCTrigger")
286  << "Put " << lctV1a.size() << " ME1a LCT digi"
287  << ((lctV1a.size() > 1) ? "s " : " ") << "in collection\n";
288  oc_lct.put(std::make_pair(lctV1a.begin(),lctV1a.end()), detid1a);
289  }
290 
291  // Anode LCTs.
292  if (!alctV1a.empty()) {
293  LogTrace("L1CSCTrigger")
294  << "Put " << alctV1a.size() << " ME1a ALCT digi"
295  << ((alctV1a.size() > 1) ? "s " : " ") << "in collection\n";
296  oc_alct.put(std::make_pair(alctV1a.begin(),alctV1a.end()), detid1a);
297  }
298 
299  // Cathode LCTs.
300  if (!clctV1a.empty()) {
301  LogTrace("L1CSCTrigger")
302  << "Put " << clctV1a.size() << " ME1a CLCT digi"
303  << ((clctV1a.size() > 1) ? "s " : " ") << "in collection\n";
304  oc_clct.put(std::make_pair(clctV1a.begin(),clctV1a.end()), detid1a);
305  }
306 
307  // Cathode LCTs pretriggers
308  if (!preTriggerBXs1a.empty()) {
309  LogTrace("L1CSCTrigger")
310  << "Put " << preTriggerBXs1a.size() << " CLCT pretrigger"
311  << ((preTriggerBXs1a.size() > 1) ? "s " : " ") << "in collection\n";
312  oc_pretrig.put(std::make_pair(preTriggerBXs1a.begin(),preTriggerBXs1a.end()), detid1a);
313  }
314  } // upgraded TMB
315 
316  // running upgraded ME1/1 TMBs with GEMs
317  else if (stat==1 && ring==1 && smartME1aME1b && runME11ILT_)
318  {
319  CSCGEMMotherboardME11* tmb11GEM = static_cast<CSCGEMMotherboardME11*>(tmb);
320 
321  tmb11GEM->setCSCGeometry(csc_g);
322  tmb11GEM->setGEMGeometry(gem_g);
323  //LogTrace("CSCTriggerPrimitivesBuilder")<<"CSCTriggerPrimitivesBuilder::build in E:"<<endc<<" S:"<<stat<<" R:"<<ring;
324  tmb11GEM->run(wiredc, compdc, gemPads);
325 
326  std::vector<CSCCorrelatedLCTDigi> lctV = tmb11GEM->readoutLCTs1b();
327  std::vector<CSCCorrelatedLCTDigi> lctV1a = tmb11GEM->readoutLCTs1a();
328 
329  std::vector<CSCALCTDigi> alctV1a, alctV = tmb11GEM->alct->readoutALCTs();
330 
331  std::vector<CSCCLCTDigi> clctV = tmb11GEM->clct->readoutCLCTs();
332  std::vector<int> preTriggerBXs = tmb11GEM->clct->preTriggerBXs();
333  std::vector<CSCCLCTDigi> clctV1a = tmb11GEM->clct1a->readoutCLCTs();
334  std::vector<int> preTriggerBXs1a = tmb11GEM->clct1a->preTriggerBXs();
335 
336  std::vector<GEMCoPadDigi> copads = tmb11GEM->coPadProcessor->readoutCoPads();
337  // perform simple separation of ALCTs into 1/a and 1/b
338  // for 'smart' case. Some duplication occurs for WG [10,15]
339  std::vector<CSCALCTDigi> tmpV(alctV);
340  alctV.clear();
341  for (unsigned int al=0; al < tmpV.size(); al++)
342  {
343  if (tmpV[al].getKeyWG()<=15) alctV1a.push_back(tmpV[al]);
344  if (tmpV[al].getKeyWG()>=10) alctV.push_back(tmpV[al]);
345  }
346  //LogTrace("CSCTriggerPrimitivesBuilder")<<"CSCTriggerPrimitivesBuilder:: a="<<alctV.size()<<" c="<<clctV.size()<<" l="<<lctV.size()
347  // <<" 1a: a="<<alctV1a.size()<<" c="<<clctV1a.size()<<" l="<<lctV1a.size();
348 
349  // ME1/b
350 
351  if (!(lctV.empty()&&alctV.empty()&&clctV.empty())) {
352  LogTrace("L1CSCTrigger")
353  << "CSCTriggerPrimitivesBuilder results in " <<detid;
354  }
355 
356  // Correlated LCTs.
357  if (!lctV.empty()) {
358  LogTrace("L1CSCTrigger")
359  << "Put " << lctV.size() << " ME1b LCT digi"
360  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
361  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
362  }
363 
364  // Anode LCTs.
365  if (!alctV.empty()) {
366  LogTrace("L1CSCTrigger")
367  << "Put " << alctV.size() << " ME1b ALCT digi"
368  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
369  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
370  }
371 
372  // Cathode LCTs.
373  if (!clctV.empty()) {
374  LogTrace("L1CSCTrigger")
375  << "Put " << clctV.size() << " ME1b CLCT digi"
376  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
377  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
378  }
379 
380  // Cathode LCTs pretriggers
381  if (!preTriggerBXs.empty()) {
382  LogTrace("L1CSCTrigger")
383  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
384  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
385  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
386  }
387  // 0th layer means whole chamber.
388  GEMDetId gemId(detid.zendcap(), 1, 1, 0, chid, 0);
389 
390  // GEM coincidence pads
391  if (!copads.empty()) {
392  LogTrace("L1CSCTrigger")
393  << "Put " << copads.size() << " GEM coincidence pad"
394  << ((copads.size() > 1) ? "s " : " ") << "in collection\n";
395  oc_gemcopad.put(std::make_pair(copads.begin(),copads.end()), gemId);
396  }
397 
398  // ME1/a
399 
400  if (disableME1a) continue;
401 
402  CSCDetId detid1a(endc, stat, 4, chid, 0);
403 
404  if (!(lctV1a.empty()&&alctV1a.empty()&&clctV1a.empty())){
405  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " <<detid1a;
406  }
407 
408  // Correlated LCTs.
409  if (!lctV1a.empty()) {
410  LogTrace("L1CSCTrigger")
411  << "Put " << lctV1a.size() << " ME1a LCT digi"
412  << ((lctV1a.size() > 1) ? "s " : " ") << "in collection\n";
413  oc_lct.put(std::make_pair(lctV1a.begin(),lctV1a.end()), detid1a);
414  }
415 
416  // Anode LCTs.
417  if (!alctV1a.empty()) {
418  LogTrace("L1CSCTrigger")
419  << "Put " << alctV1a.size() << " ME1a ALCT digi"
420  << ((alctV1a.size() > 1) ? "s " : " ") << "in collection\n";
421  oc_alct.put(std::make_pair(alctV1a.begin(),alctV1a.end()), detid1a);
422  }
423 
424  // Cathode LCTs.
425  if (!clctV1a.empty()) {
426  LogTrace("L1CSCTrigger")
427  << "Put " << clctV1a.size() << " ME1a CLCT digi"
428  << ((clctV1a.size() > 1) ? "s " : " ") << "in collection\n";
429  oc_clct.put(std::make_pair(clctV1a.begin(),clctV1a.end()), detid1a);
430  }
431 
432  // Cathode LCTs pretriggers
433  if (!preTriggerBXs1a.empty()) {
434  LogTrace("L1CSCTrigger")
435  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
436  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
437  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
438  }
439  }
440 
441  // running upgraded ME2/1 TMBs
442  else if (stat==2 && ring==1 && runME21ILT_)
443  {
444  CSCGEMMotherboardME21* tmb21GEM = static_cast<CSCGEMMotherboardME21*>(tmb);
445  tmb21GEM->setCSCGeometry(csc_g);
446  tmb21GEM->setGEMGeometry(gem_g);
447  tmb21GEM->run(wiredc, compdc, gemPads);
448  std::vector<CSCCorrelatedLCTDigi> lctV = tmb21GEM->readoutLCTs();
449  std::vector<CSCALCTDigi> alctV = tmb21GEM->alct->readoutALCTs();
450  std::vector<CSCCLCTDigi> clctV = tmb21GEM->clct->readoutCLCTs();
451  std::vector<int> preTriggerBXs = tmb21GEM->clct->preTriggerBXs();
452 
453  std::vector<GEMCoPadDigi> copads = tmb21GEM->coPadProcessor->readoutCoPads();
454 
455  if (!(alctV.empty() && clctV.empty() && lctV.empty())) {
456  LogTrace("L1CSCTrigger")
457  << "CSCTriggerPrimitivesBuilder got results in " <<detid;
458  }
459 
460  // Correlated LCTs.
461  if (!lctV.empty()) {
462  LogTrace("L1CSCTrigger")
463  << "Put " << lctV.size() << " LCT digi"
464  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
465  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
466  }
467 
468  // Anode LCTs.
469  if (!alctV.empty()) {
470  LogTrace("L1CSCTrigger")
471  << "Put " << alctV.size() << " ALCT digi"
472  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
473  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
474  }
475 
476  // Cathode LCTs.
477  if (!clctV.empty()) {
478  LogTrace("L1CSCTrigger")
479  << "Put " << clctV.size() << " CLCT digi"
480  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
481  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
482  }
483 
484  // Cathode LCTs pretriggers
485  if (!preTriggerBXs.empty()) {
486  LogTrace("L1CSCTrigger")
487  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
488  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
489  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
490  }
491 
492  // 0th layer means whole chamber.
493  GEMDetId gemId(detid.zendcap(), 1, 2, 0, chid, 0);
494 
495  // GEM coincidence pads
496  if (!copads.empty()) {
497  LogTrace("L1CSCTrigger")
498  << "Put " << copads.size() << " GEM coincidence pad"
499  << ((copads.size() > 1) ? "s " : " ") << "in collection\n";
500  oc_gemcopad.put(std::make_pair(copads.begin(),copads.end()), gemId);
501  }
502  }
503  // running non-upgraded TMB
504  else
505  {
506  tmb->run(wiredc,compdc);
507 
508  std::vector<CSCCorrelatedLCTDigi> lctV = tmb->readoutLCTs();
509  std::vector<CSCALCTDigi> alctV = tmb->alct->readoutALCTs();
510  std::vector<CSCCLCTDigi> clctV = tmb->clct->readoutCLCTs();
511  std::vector<int> preTriggerBXs = tmb->clct->preTriggerBXs();
512 
513  if (!(alctV.empty() && clctV.empty() && lctV.empty())) {
514  LogTrace("L1CSCTrigger")
515  << "CSCTriggerPrimitivesBuilder got results in " <<detid;
516  }
517 
518  // Correlated LCTs.
519  if (!lctV.empty()) {
520  LogTrace("L1CSCTrigger")
521  << "Put " << lctV.size() << " LCT digi"
522  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
523  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
524  }
525 
526  // Anode LCTs.
527  if (!alctV.empty()) {
528  LogTrace("L1CSCTrigger")
529  << "Put " << alctV.size() << " ALCT digi"
530  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
531  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
532  }
533 
534  // Cathode LCTs.
535  if (!clctV.empty()) {
536  LogTrace("L1CSCTrigger")
537  << "Put " << clctV.size() << " CLCT digi"
538  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
539  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
540  }
541 
542  // Cathode LCTs pretriggers
543  if (!preTriggerBXs.empty()) {
544  LogTrace("L1CSCTrigger")
545  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
546  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
547  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
548  }
549  } // non-upgraded TMB
550  }
551  }
552  }
553  }
554  }
555 
556  // run MPC simulation
557  m_muonportcard->loadDigis(oc_lct);
558 
559  // temporary hack to ensure that all MPC LCTs are read out
560  // in the correct readout window
561  if (runOnData_) {
562  m_minBX = 5;
563  m_maxBX = 11;
564  }
565 
566  // sort the LCTs per sector
567  // insert them into the result vector
568  std::vector<csctf::TrackStub> result;
569  for(int bx = m_minBX; bx <= m_maxBX; ++bx)
570  for(int e = min_endcap; e <= max_endcap; ++e)
571  for(int st = min_station; st <= max_station; ++st)
572  for(int se = min_sector; se <= max_sector; ++se)
573  {
574  if(st == 1)
575  {
576  std::vector<csctf::TrackStub> subs1, subs2;
577  subs1 = m_muonportcard->sort(e, st, se, 1, bx);
578  subs2 = m_muonportcard->sort(e, st, se, 2, bx);
579  result.insert(result.end(), subs1.begin(), subs1.end());
580  result.insert(result.end(), subs2.begin(), subs2.end());
581  }
582  else
583  {
584  std::vector<csctf::TrackStub> sector;
585  sector = m_muonportcard->sort(e, st, se, 0, bx);
586  result.insert(result.end(), sector.begin(), sector.end());
587  }
588  }
589 
590  // now convert csctf::TrackStub back into CSCCorrelatedLCTDigi
591  // put MPC stubs into the event
592  std::vector<csctf::TrackStub>::const_iterator itr = result.begin();
593  for (; itr != result.end(); itr++)
594  {
595  oc_sorted_lct.insertDigi(CSCDetId(itr->getDetId().rawId()), *(itr->getDigi()));
596  LogDebug("L1CSCTrigger")
597  << "MPC " << *(itr->getDigi()) << " found in ME"
598  << ((itr->endcap() == 1) ? "+" : "-") << itr->station() << "/"
599  << CSCDetId(itr->getDetId().rawId()).ring() << "/"
600  << CSCDetId(itr->getDetId().rawId()).chamber()
601  << " (sector " << itr->sector()
602  << " trig id. " << itr->cscid() << ")" << "\n";
603  }
604 }
#define LogDebug(id)
void setCSCGeometry(const CSCGeometry *g)
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
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
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
void setGEMGeometry(const GEMGeometry *g)
set CSC and GEM geometries for the matching needs
void setCSCGeometry(const CSCGeometry *g)
static int ringFromTriggerLabels(int station, int triggerCSCID)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
bool runOnData_
temporary flag to run on data
std::unique_ptr< GEMCoPadProcessor > coPadProcessor
void run(const std::vector< int > w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES], const std::vector< int > hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const std::vector< int > ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
#define LogTrace(id)
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
bool checkBadChambers_
a flag whether to skip chambers from the bad chambers map
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b()
std::unique_ptr< CSCMuonPortCard > m_muonportcard
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a()
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc, const GEMPadDigiCollection *gemPads) override
void CSCTriggerPrimitivesBuilder::runOnData ( bool  runOnData)
inline

Definition at line 64 of file CSCTriggerPrimitivesBuilder.h.

References build(), runOnData(), and runOnData_.

Referenced by runOnData().

bool runOnData_
temporary flag to run on data
void CSCTriggerPrimitivesBuilder::setConfigParameters ( const CSCDBL1TPParameters conf)

Sets configuration parameters obtained via EventSetup mechanism.

Definition at line 124 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_.

125 {
126  // Receives CSCDBL1TPParameters percolated down from ESProducer.
127 
128  for (int endc = min_endcap; endc <= max_endcap; endc++)
129  {
130  for (int stat = min_station; stat <= max_station; stat++)
131  {
132  int numsubs = ((stat == 1) ? max_subsector : 1);
133  for (int sect = min_sector; sect <= max_sector; sect++)
134  {
135  for (int subs = min_subsector; subs <= numsubs; subs++)
136  {
137  for (int cham = min_chamber; cham <= max_chamber; cham++)
138  {
139  tmb_[endc-1][stat-1][sect-1][subs-1][cham-1]->setConfigParameters(conf);
140  }
141  }
142  }
143  }
144  }
145 }
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 54 of file CSCTriggerPrimitivesBuilder.h.

References csc_g, and g.

54 { 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 55 of file CSCTriggerPrimitivesBuilder.h.

References g, and gem_g.

55 { 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 103 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const CSCGeometry* CSCTriggerPrimitivesBuilder::csc_g
private

Definition at line 130 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setCSCGeometry().

bool CSCTriggerPrimitivesBuilder::disableME1a
private

Definition at line 106 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::disableME42
private

SLHC: special switch for disabling ME42

Definition at line 109 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const GEMGeometry* CSCTriggerPrimitivesBuilder::gem_g
private

Definition at line 131 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setGEMGeometry().

int CSCTriggerPrimitivesBuilder::m_maxBX
private

Definition at line 123 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

int CSCTriggerPrimitivesBuilder::m_minBX
private

Definition at line 123 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

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

Pointer to MPC processor.

Definition at line 134 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 88 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 112 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME21ILT_
private

SLHC: special switch for the upgrade ME2/1 TMB

Definition at line 115 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runME3141ILT_
private

SLHC: special switch for the upgrade ME3/1 and ME4/1 TMB

Definition at line 118 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runOnData_
private

temporary flag to run on data

Definition at line 100 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and runOnData().

bool CSCTriggerPrimitivesBuilder::smartME1aME1b
private

SLHC: special configuration parameters for ME11 treatment.

Definition at line 106 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and 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 127 of file CSCTriggerPrimitivesBuilder.h.

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

bool CSCTriggerPrimitivesBuilder::useClusters_
private

SLHC: special switch to use gem clusters

Definition at line 121 of file CSCTriggerPrimitivesBuilder.h.

Referenced by CSCTriggerPrimitivesBuilder().