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, 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, CSCMotherboardME11GEM::readoutCoPads(), CSCMotherboardME21GEM::readoutCoPads(), 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->readoutCoPads();
339 
340  // perform simple separation of ALCTs into 1/a and 1/b
341  // for 'smart' case. Some duplication occurs for WG [10,15]
342  std::vector<CSCALCTDigi> tmpV(alctV);
343  alctV.clear();
344  for (unsigned int al=0; al < tmpV.size(); al++)
345  {
346  if (tmpV[al].getKeyWG()<=15) alctV1a.push_back(tmpV[al]);
347  if (tmpV[al].getKeyWG()>=10) alctV.push_back(tmpV[al]);
348  }
349  //LogTrace("CSCTriggerPrimitivesBuilder")<<"CSCTriggerPrimitivesBuilder:: a="<<alctV.size()<<" c="<<clctV.size()<<" l="<<lctV.size()
350  // <<" 1a: a="<<alctV1a.size()<<" c="<<clctV1a.size()<<" l="<<lctV1a.size();
351 
352  // ME1/b
353 
354  if (!(lctV.empty()&&alctV.empty()&&clctV.empty())) {
355  LogTrace("L1CSCTrigger")
356  << "CSCTriggerPrimitivesBuilder results in " <<detid;
357  }
358 
359  // Correlated LCTs.
360  if (!lctV.empty()) {
361  LogTrace("L1CSCTrigger")
362  << "Put " << lctV.size() << " ME1b LCT digi"
363  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
364  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
365  }
366 
367  // Anode LCTs.
368  if (!alctV.empty()) {
369  LogTrace("L1CSCTrigger")
370  << "Put " << alctV.size() << " ME1b ALCT digi"
371  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
372  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
373  }
374 
375  // Cathode LCTs.
376  if (!clctV.empty()) {
377  LogTrace("L1CSCTrigger")
378  << "Put " << clctV.size() << " ME1b CLCT digi"
379  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
380  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
381  }
382 
383  // Cathode LCTs pretriggers
384  if (!preTriggerBXs.empty()) {
385  LogTrace("L1CSCTrigger")
386  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
387  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
388  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
389  }
390  // 0th layer means whole chamber.
391  GEMDetId gemId(detid.zendcap(), 1, 1, 1, chid, 0);
392 
393  // GEM coincidence pads
394  if (!copads.empty()) {
395  LogTrace("L1CSCTrigger")
396  << "Put " << copads.size() << " GEM coincidence pad"
397  << ((copads.size() > 1) ? "s " : " ") << "in collection\n";
398  oc_gemcopad.put(std::make_pair(copads.begin(),copads.end()), gemId);
399  }
400 
401  // ME1/a
402 
403  if (disableME1a) continue;
404 
405  CSCDetId detid1a(endc, stat, 4, chid, 0);
406 
407  if (!(lctV1a.empty()&&alctV1a.empty()&&clctV1a.empty())){
408  LogTrace("L1CSCTrigger") << "CSCTriggerPrimitivesBuilder results in " <<detid1a;
409  }
410 
411  // Correlated LCTs.
412  if (!lctV1a.empty()) {
413  LogTrace("L1CSCTrigger")
414  << "Put " << lctV1a.size() << " ME1a LCT digi"
415  << ((lctV1a.size() > 1) ? "s " : " ") << "in collection\n";
416  oc_lct.put(std::make_pair(lctV1a.begin(),lctV1a.end()), detid1a);
417  }
418 
419  // Anode LCTs.
420  if (!alctV1a.empty()) {
421  LogTrace("L1CSCTrigger")
422  << "Put " << alctV1a.size() << " ME1a ALCT digi"
423  << ((alctV1a.size() > 1) ? "s " : " ") << "in collection\n";
424  oc_alct.put(std::make_pair(alctV1a.begin(),alctV1a.end()), detid1a);
425  }
426 
427  // Cathode LCTs.
428  if (!clctV1a.empty()) {
429  LogTrace("L1CSCTrigger")
430  << "Put " << clctV1a.size() << " ME1a CLCT digi"
431  << ((clctV1a.size() > 1) ? "s " : " ") << "in collection\n";
432  oc_clct.put(std::make_pair(clctV1a.begin(),clctV1a.end()), detid1a);
433  }
434 
435  // Cathode LCTs pretriggers
436  if (!preTriggerBXs1a.empty()) {
437  LogTrace("L1CSCTrigger")
438  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
439  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
440  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
441  }
442  }
443 
444  // running upgraded ME2/1 TMBs
445  else if (stat==2 && ring==1 && runME21ILT_)
446  {
447  CSCMotherboardME21GEM* tmb21GEM = static_cast<CSCMotherboardME21GEM*>(tmb);
448  tmb21GEM->setCSCGeometry(csc_g);
449  tmb21GEM->setGEMGeometry(gem_g);
450  tmb21GEM->run(wiredc, compdc, gemPads);
451  std::vector<CSCCorrelatedLCTDigi> lctV = tmb21GEM->readoutLCTs();
452  std::vector<CSCALCTDigi> alctV = tmb21GEM->alct->readoutALCTs();
453  std::vector<CSCCLCTDigi> clctV = tmb21GEM->clct->readoutCLCTs();
454  std::vector<int> preTriggerBXs = tmb21GEM->clct->preTriggerBXs();
455 
456  std::vector<GEMCoPadDigi> copads = tmb21GEM->readoutCoPads();
457 
458  if (!(alctV.empty() && clctV.empty() && lctV.empty())) {
459  LogTrace("L1CSCTrigger")
460  << "CSCTriggerPrimitivesBuilder got results in " <<detid;
461  }
462 
463  // Correlated LCTs.
464  if (!lctV.empty()) {
465  LogTrace("L1CSCTrigger")
466  << "Put " << lctV.size() << " LCT digi"
467  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
468  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
469  }
470 
471  // Anode LCTs.
472  if (!alctV.empty()) {
473  LogTrace("L1CSCTrigger")
474  << "Put " << alctV.size() << " ALCT digi"
475  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
476  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
477  }
478 
479  // Cathode LCTs.
480  if (!clctV.empty()) {
481  LogTrace("L1CSCTrigger")
482  << "Put " << clctV.size() << " CLCT digi"
483  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
484  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
485  }
486 
487  // Cathode LCTs pretriggers
488  if (!preTriggerBXs.empty()) {
489  LogTrace("L1CSCTrigger")
490  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
491  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
492  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
493  }
494 
495  // 0th layer means whole chamber.
496  GEMDetId gemId(detid.zendcap(), 1, 2, 1, chid, 0);
497 
498  // GEM coincidence pads
499  if (!copads.empty()) {
500  LogTrace("L1CSCTrigger")
501  << "Put " << copads.size() << " GEM coincidence pad"
502  << ((copads.size() > 1) ? "s " : " ") << "in collection\n";
503  oc_gemcopad.put(std::make_pair(copads.begin(),copads.end()), gemId);
504  }
505  }
506  // running upgraded ME3/1-ME4/1 TMBs
507  else if ((stat==3 or stat==4) && ring==1 && runME3141ILT_)
508  {
509  CSCMotherboardME3141RPC* tmb3141RPC = static_cast<CSCMotherboardME3141RPC*>(tmb);
510  tmb3141RPC->setCSCGeometry(csc_g);
511  tmb3141RPC->setRPCGeometry(rpc_g);
512  tmb3141RPC->run(wiredc, compdc, rpcDigis);
513  std::vector<CSCCorrelatedLCTDigi> lctV = tmb3141RPC->readoutLCTs();
514  std::vector<CSCALCTDigi> alctV = tmb3141RPC->alct->readoutALCTs();
515  std::vector<CSCCLCTDigi> clctV = tmb3141RPC->clct->readoutCLCTs();
516  std::vector<int> preTriggerBXs = tmb3141RPC->clct->preTriggerBXs();
517 
518  if (!(alctV.empty() && clctV.empty() && lctV.empty())) {
519  LogTrace("L1CSCTrigger")
520  << "CSCTriggerPrimitivesBuilder got results in " <<detid;
521  }
522 
523  // Correlated LCTs.
524  if (!lctV.empty()) {
525  LogTrace("L1CSCTrigger")
526  << "Put " << lctV.size() << " LCT digi"
527  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
528  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
529  }
530  // Anode LCTs.
531  if (!alctV.empty()) {
532  LogTrace("L1CSCTrigger")
533  << "Put " << alctV.size() << " ALCT digi"
534  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
535  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
536  }
537 
538  // Cathode LCTs.
539  if (!clctV.empty()) {
540  LogTrace("L1CSCTrigger")
541  << "Put " << clctV.size() << " CLCT digi"
542  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
543  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
544  }
545 
546  // Cathode LCTs pretriggers
547  if (!preTriggerBXs.empty()) {
548  LogTrace("L1CSCTrigger")
549  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
550  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
551  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
552  }
553  }
554 
555  // running non-upgraded TMB
556  else
557  {
558  tmb->run(wiredc,compdc);
559 
560  std::vector<CSCCorrelatedLCTDigi> lctV = tmb->readoutLCTs();
561  std::vector<CSCALCTDigi> alctV = tmb->alct->readoutALCTs();
562  std::vector<CSCCLCTDigi> clctV = tmb->clct->readoutCLCTs();
563  std::vector<int> preTriggerBXs = tmb->clct->preTriggerBXs();
564 
565  if (!(alctV.empty() && clctV.empty() && lctV.empty())) {
566  LogTrace("L1CSCTrigger")
567  << "CSCTriggerPrimitivesBuilder got results in " <<detid;
568  }
569 
570  /*
571  // tmp kludge: tightening of ME1a LCTs
572  if (stat==1 && ring==1) {
573  std::vector<CSCCorrelatedLCTDigi> lctV11;
574  for (unsigned t=0;t<lctV.size();t++){
575  if (lctV[t].getStrip() < 127) lctV11.push_back(lctV[t]);
576  else if (lctV[t].getQuality() >= 14) lctV11.push_back(lctV[t]);
577  }
578  lctV = lctV11;
579  }
580  */
581 
582  // Correlated LCTs.
583  if (!lctV.empty()) {
584  LogTrace("L1CSCTrigger")
585  << "Put " << lctV.size() << " LCT digi"
586  << ((lctV.size() > 1) ? "s " : " ") << "in collection\n";
587  oc_lct.put(std::make_pair(lctV.begin(),lctV.end()), detid);
588  }
589 
590  // Anode LCTs.
591  if (!alctV.empty()) {
592  LogTrace("L1CSCTrigger")
593  << "Put " << alctV.size() << " ALCT digi"
594  << ((alctV.size() > 1) ? "s " : " ") << "in collection\n";
595  oc_alct.put(std::make_pair(alctV.begin(),alctV.end()), detid);
596  }
597 
598  // Cathode LCTs.
599  if (!clctV.empty()) {
600  LogTrace("L1CSCTrigger")
601  << "Put " << clctV.size() << " CLCT digi"
602  << ((clctV.size() > 1) ? "s " : " ") << "in collection\n";
603  oc_clct.put(std::make_pair(clctV.begin(),clctV.end()), detid);
604  }
605 
606  // Cathode LCTs pretriggers
607  if (!preTriggerBXs.empty()) {
608  LogTrace("L1CSCTrigger")
609  << "Put " << preTriggerBXs.size() << " CLCT pretrigger"
610  << ((preTriggerBXs.size() > 1) ? "s " : " ") << "in collection\n";
611  oc_pretrig.put(std::make_pair(preTriggerBXs.begin(),preTriggerBXs.end()), detid);
612  }
613  } // non-upgraded TMB
614  }
615  }
616  }
617  }
618  }
619 
620  // run MPC simulation
621  m_muonportcard->loadDigis(oc_lct);
622 
623  // temporary hack to ensure that all MPC LCTs are read out
624  if (runOnData_) {
625  m_minBX = 5;
626  m_maxBX = 11;
627  }
628 
629  std::vector<csctf::TrackStub> result;
630  for(int bx = m_minBX; bx <= m_maxBX; ++bx)
631  for(int e = min_endcap; e <= max_endcap; ++e)
632  for(int st = min_station; st <= max_station; ++st)
633  for(int se = min_sector; se <= max_sector; ++se)
634  {
635  if(st == 1)
636  {
637  std::vector<csctf::TrackStub> subs1, subs2;
638  subs1 = m_muonportcard->sort(e, st, se, 1, bx);
639  subs2 = m_muonportcard->sort(e, st, se, 2, bx);
640  result.insert(result.end(), subs1.begin(), subs1.end());
641  result.insert(result.end(), subs2.begin(), subs2.end());
642  }
643  else
644  {
645  std::vector<csctf::TrackStub> sector;
646  sector = m_muonportcard->sort(e, st, se, 0, bx);
647  result.insert(result.end(), sector.begin(), sector.end());
648  }
649  }
650 
651  std::vector<csctf::TrackStub>::const_iterator itr = result.begin();
652  for (; itr != result.end(); itr++)
653  {
654  oc_sorted_lct.insertDigi(CSCDetId(itr->getDetId().rawId()), *(itr->getDigi()));
655  LogDebug("L1CSCTrigger")
656  << "MPC " << *(itr->getDigi()) << " found in ME"
657  << ((itr->endcap() == 1) ? "+" : "-") << itr->station() << "/"
658  << CSCDetId(itr->getDetId().rawId()).ring() << "/"
659  << CSCDetId(itr->getDetId().rawId()).chamber()
660  << " (sector " << itr->sector()
661  << " trig id. " << itr->cscid() << ")" << "\n";
662  }
663 }
#define LogDebug(id)
std::vector< GEMCoPadDigi > readoutCoPads()
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::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])
#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)
std::vector< GEMCoPadDigi > readoutCoPads()
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().