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 RPCDigiCollection *rpcDigis, 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)
 
void setRPCGeometry (const RPCGeometry *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
 
const RPCGeometryrpc_g
 
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]
 

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

Algorithm to build anode, cathode, and correlated LCTs from wire and comparator digis in endcap muon CSCs by implementing a 'build' function required by CSCTriggerPrimitivesProducer.

Configured via the Producer's ParameterSet.

Author
Slava Valuev, UCLA.

Definition at line 36 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 49 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, and tmb_.

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

121 {
122 }

Member Function Documentation

void CSCTriggerPrimitivesBuilder::build ( const CSCBadChambers badChambers,
const CSCWireDigiCollection wiredc,
const CSCComparatorDigiCollection compdc,
const GEMPadDigiCollection gemPads,
const RPCDigiCollection rpcDigis,
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 160 of file CSCTriggerPrimitivesBuilder.cc.

References CSCMotherboard::alct, relativeConstraints::cham, CSCTriggerGeomManager::chamber(), relativeConstraints::chamber, CSCTriggerNumbering::chamberFromTriggerLabels(), checkBadChambers_, CSCMotherboard::clct, CSCMotherboardME11::clct1a, CSCMotherboardME11GEM::clct1a, CSCMotherboardME11GEM::coPadProcessor, CSCMotherboardME21GEM::coPadProcessor, csc_g, disableME1a, disableME42, MillePedeFileConverter_cfg::e, gem_g, CSCTriggerGeometry::get(), 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, or, CSCMotherboard::readoutLCTs(), CSCMotherboardME3141RPC::readoutLCTs(), CSCMotherboardME21GEM::readoutLCTs(), CSCMotherboardME11::readoutLCTs1a(), CSCMotherboardME11GEM::readoutLCTs1a(), CSCMotherboardME11::readoutLCTs1b(), CSCMotherboardME11GEM::readoutLCTs1b(), mps_fire::result, relativeConstraints::ring, CSCTriggerNumbering::ringFromTriggerLabels(), rpc_g, CSCMotherboardME11::run(), CSCMotherboardME3141RPC::run(), CSCMotherboardME21GEM::run(), CSCMotherboardME11GEM::run(), CSCMotherboard::run(), runME11ILT_, runME21ILT_, runME3141ILT_, runOnData_, CSCMotherboardME21GEM::setCSCGeometry(), CSCMotherboardME3141RPC::setCSCGeometry(), CSCMotherboardME11GEM::setCSCGeometry(), CSCMotherboardME21GEM::setGEMGeometry(), CSCMotherboardME11GEM::setGEMGeometry(), CSCMotherboardME3141RPC::setRPCGeometry(), smartME1aME1b, tmb_, and CSCDetId::zendcap().

Referenced by runOnData().

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

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

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

References csc_g, and g.

52 { 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 53 of file CSCTriggerPrimitivesBuilder.h.

References g, and gem_g.

53 { 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
void CSCTriggerPrimitivesBuilder::setRPCGeometry ( const RPCGeometry g)
inline

Definition at line 54 of file CSCTriggerPrimitivesBuilder.h.

References g, and rpc_g.

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

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const CSCGeometry* CSCTriggerPrimitivesBuilder::csc_g
private

Definition at line 119 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setCSCGeometry().

bool CSCTriggerPrimitivesBuilder::disableME1a
private

Definition at line 99 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::disableME42
private

SLHC: special switch for disabling ME42

Definition at line 102 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

const GEMGeometry* CSCTriggerPrimitivesBuilder::gem_g
private

Definition at line 120 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setGEMGeometry().

int CSCTriggerPrimitivesBuilder::m_maxBX
private

Definition at line 113 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

int CSCTriggerPrimitivesBuilder::m_minBX
private

Definition at line 113 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

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

Pointer to MPC processor.

Definition at line 124 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 81 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
const RPCGeometry* CSCTriggerPrimitivesBuilder::rpc_g
private

Definition at line 121 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and setRPCGeometry().

bool CSCTriggerPrimitivesBuilder::runME11ILT_
private

SLHC: special switch for the upgrade ME1/1 TMB

Definition at line 105 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 108 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 111 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and CSCTriggerPrimitivesBuilder().

bool CSCTriggerPrimitivesBuilder::runOnData_
private

temporary flag to run on data

Definition at line 93 of file CSCTriggerPrimitivesBuilder.h.

Referenced by build(), and runOnData().

bool CSCTriggerPrimitivesBuilder::smartME1aME1b
private

SLHC: special configuration parameters for ME11 treatment.

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

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