CMS 3D CMS Logo

CSCUpgradeMotherboard.cc
Go to the documentation of this file.
3 
5  : match_trig_window_size(trig_window_size)
6 {
7 }
8 
11 {
12  return data[bx][match_bx][lct];
13 }
14 
15 void
17  std::vector<CSCCorrelatedLCTDigi>& lcts) const
18 {
19  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
20  for (int i=0;i<2;i++)
21  if (data[bx][mbx][i].isValid())
22  lcts.push_back(data[bx][mbx][i]);
23 }
24 
25 void
26 CSCUpgradeMotherboard::LCTContainer::getMatched(std::vector<CSCCorrelatedLCTDigi>& lcts) const
27 {
28  for (int bx = 0; bx < CSCConstants::MAX_LCT_TBINS; bx++){
29  std::vector<CSCCorrelatedLCTDigi> temp_lcts;
31  lcts.insert(std::end(lcts), std::begin(temp_lcts), std::end(temp_lcts));
32  }
33 }
34 
36  unsigned sector, unsigned subsector,
37  unsigned chamber,
38  const edm::ParameterSet& conf) :
39  CSCMotherboard(endcap, station, sector, subsector, chamber, conf)
40 {
41  if (!isSLHC) edm::LogError("L1CSCTPEmulatorConfigError")
42  << "+++ Upgrade CSCUpgradeMotherboard constructed while isSLHC is not set! +++\n";
43 
44  theRegion = (theEndcap == 1) ? 1: -1;
47 
48  commonParams_ = conf.getParameter<edm::ParameterSet>("commonParam");
49  if (theStation==1) tmbParams_ = conf.getParameter<edm::ParameterSet>("me11tmbSLHCGEM");
50  else if (theStation==2) tmbParams_ = conf.getParameter<edm::ParameterSet>("me21tmbSLHCGEM");
51 
53 
54  match_earliest_alct_only = tmbParams_.getParameter<bool>("matchEarliestAlctOnly");
55  match_earliest_clct_only = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
56  clct_to_alct = tmbParams_.getParameter<bool>("clctToAlct");
57  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
58  tmb_cross_bx_algo = tmbParams_.getParameter<unsigned int>("tmbCrossBxAlgorithm");
59  max_lcts = tmbParams_.getParameter<unsigned int>("maxLCTs");
60  debug_matching = tmbParams_.getParameter<bool>("debugMatching");
61  debug_luts = tmbParams_.getParameter<bool>("debugLUTs");
62 
64  for (unsigned int m=2; m<match_trig_window_size; m+=2)
65  {
66  pref[m-1] = pref[0] - m/2;
67  pref[m] = pref[0] + m/2;
68  }
69 }
70 
72 {
74  for (unsigned int m=2; m<match_trig_window_size; m+=2)
75  {
76  pref[m-1] = pref[0] - m/2;
77  pref[m] = pref[0] + m/2;
78  }
79 }
80 
82 {
83 }
84 
86 {
88 }
89 
91 {
92  return lct1.getQuality() > lct2.getQuality();
93 }
94 
96 {
97  return true;
98 }
99 
100 void CSCUpgradeMotherboard::sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts,
101  bool (*sorter)(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&)) const
102 {
103  std::sort(lcts.begin(), lcts.end(), *sorter);
104  if (lcts.size() > max_lcts) lcts.erase(lcts.begin()+max_lcts, lcts.end());
105 }
106 
107 
109 {
110  // check whether chamber is even or odd
112  const CSCDetId csc_id(theEndcap, theStation, theStation, chid, 0);
113  cscChamber = csc_g->chamber(csc_id);
114  generator_->setCSCGeometry(csc_g);
115 }
T getParameter(std::string const &) const
const unsigned theSector
unsigned int match_trig_window_size
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
const unsigned theTrigChamber
int getQuality() const
return the 4 bit Correlated LCT Quality
const unsigned theEndcap
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
int pref[CSCConstants::MAX_LCT_TBINS]
const CSCChamber * cscChamber
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
const unsigned theStation
LCTContainer(unsigned int trig_window_size)
const CSCGeometry * csc_g
edm::ParameterSet commonParams_
CSCCorrelatedLCTDigi data[CSCConstants::MAX_LCT_TBINS][15][2]
const unsigned theSubsector
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
#define end
Definition: vmac.h:39
void getTimeMatched(const int bx, std::vector< CSCCorrelatedLCTDigi > &) const
edm::ParameterSet tmbParams_
CSCCorrelatedLCTDigi & operator()(int bx, int match_bx, int lct)
void getMatched(std::vector< CSCCorrelatedLCTDigi > &) const
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Definition: CSCGeometry.cc:118
#define begin
Definition: vmac.h:32
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)