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  else if (theStation==3 or theStation==4) tmbParams_ = conf.getParameter<edm::ParameterSet>("me3141tmbSLHC");
52 
54 
55  match_earliest_alct_only = tmbParams_.getParameter<bool>("matchEarliestAlctOnly");
56  match_earliest_clct_only = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
57  clct_to_alct = tmbParams_.getParameter<bool>("clctToAlct");
58  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
59  tmb_cross_bx_algo = tmbParams_.getParameter<unsigned int>("tmbCrossBxAlgorithm");
60  max_lcts = tmbParams_.getParameter<unsigned int>("maxLCTs");
61  debug_matching = tmbParams_.getParameter<bool>("debugMatching");
62  debug_luts = tmbParams_.getParameter<bool>("debugLUTs");
63 
65  for (unsigned int m=2; m<match_trig_window_size; m+=2)
66  {
67  pref[m-1] = pref[0] - m/2;
68  pref[m] = pref[0] + m/2;
69  }
70 }
71 
73 {
75  for (unsigned int m=2; m<match_trig_window_size; m+=2)
76  {
77  pref[m-1] = pref[0] - m/2;
78  pref[m] = pref[0] + m/2;
79  }
80 }
81 
83 {
84 }
85 
87 {
89 }
90 
92 {
93  return lct1.getQuality() > lct2.getQuality();
94 }
95 
97 {
98  return true;
99 }
100 
101 void CSCUpgradeMotherboard::sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts,
102  bool (*sorter)(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&)) const
103 {
104  std::sort(lcts.begin(), lcts.end(), *sorter);
105  if (lcts.size() > max_lcts) lcts.erase(lcts.begin()+max_lcts, lcts.end());
106 }
107 
108 
110 {
111  // check whether chamber is even or odd
113  const CSCDetId csc_id(theEndcap, theStation, theStation, chid, 0);
114  cscChamber = csc_g->chamber(csc_id);
115  generator_->setCSCGeometry(csc_g);
116 }
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_
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
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:133
#define begin
Definition: vmac.h:32
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)