CMS 3D CMS Logo

CSCUpgradeMotherboard.cc
Go to the documentation of this file.
3 
4 void CSCUpgradeMotherboard::LCTContainer::getTimeMatched(const int bx, std::vector<CSCCorrelatedLCTDigi>& lcts) const
5 {
6  for (unsigned int mbx = 0; mbx < match_trig_window_size; mbx++)
7  for (int i=0;i<2;i++)
8  if (data[bx][mbx][i].isValid())
9  lcts.push_back(data[bx][mbx][i]);
10 }
11 
12 void CSCUpgradeMotherboard::LCTContainer::getMatched(std::vector<CSCCorrelatedLCTDigi>& lcts) const
13 {
14  for (int bx = 0; bx < MAX_LCT_BINS; bx++){
15  std::vector<CSCCorrelatedLCTDigi> temp_lcts;
17  lcts.insert(std::end(lcts), std::begin(temp_lcts), std::end(temp_lcts));
18  }
19 }
20 
22  unsigned sector, unsigned subsector,
23  unsigned chamber,
24  const edm::ParameterSet& conf) :
25  CSCMotherboard(endcap, station, sector, subsector, chamber, conf)
26 {
27  if (!isSLHC) edm::LogError("L1CSCTPEmulatorConfigError")
28  << "+++ Upgrade CSCUpgradeMotherboard constructed while isSLHC is not set! +++\n";
29 
30  theRegion = (theEndcap == 1) ? 1: -1;
33 
34  commonParams_ = conf.getParameter<edm::ParameterSet>("commonParam");
35  if (theStation==1) tmbParams_ = conf.getParameter<edm::ParameterSet>("me11tmbSLHCGEM");
36  else if (theStation==2) tmbParams_ = conf.getParameter<edm::ParameterSet>("me21tmbSLHCGEM");
37  else if (theStation==3 or theStation==4) tmbParams_ = conf.getParameter<edm::ParameterSet>("me3141tmbSLHCRPC");
38 
40 
41  match_earliest_alct_only = tmbParams_.getParameter<bool>("matchEarliestAlctOnly");
42  match_earliest_clct_only = tmbParams_.getParameter<bool>("matchEarliestClctOnly");
43  clct_to_alct = tmbParams_.getParameter<bool>("clctToAlct");
44  drop_used_clcts = tmbParams_.getParameter<bool>("tmbDropUsedClcts");
45  tmb_cross_bx_algo = tmbParams_.getParameter<unsigned int>("tmbCrossBxAlgorithm");
46  max_lcts = tmbParams_.getParameter<unsigned int>("maxLCTs");
47  debug_matching = tmbParams_.getParameter<bool>("debugMatching");
48  debug_luts = tmbParams_.getParameter<bool>("debugLUTs");
49 
51  for (unsigned int m=2; m<match_trig_window_size; m+=2)
52  {
53  pref[m-1] = pref[0] - m/2;
54  pref[m] = pref[0] + m/2;
55  }
56 }
57 
59 {
61  for (unsigned int m=2; m<match_trig_window_size; m+=2)
62  {
63  pref[m-1] = pref[0] - m/2;
64  pref[m] = pref[0] + m/2;
65  }
66 }
67 
69 {
70 }
71 
73 {
75 }
76 
78 {
79  return lct1.getQuality() > lct2.getQuality();
80 }
81 
83 {
84  return true;
85 }
86 
87 void CSCUpgradeMotherboard::sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts, bool (*sorter)(const CSCCorrelatedLCTDigi&,const CSCCorrelatedLCTDigi&)){
88  std::sort(lcts.begin(), lcts.end(), *sorter);
89  if (lcts.size() > max_lcts) lcts.erase(lcts.begin()+max_lcts, lcts.end());
90 }
91 
92 
94 {
95  // check whether chamber is even or odd
97  const CSCDetId csc_id(theEndcap, theStation, theStation, chid, 0);
98  cscChamber = csc_g->chamber(csc_id);
99  generator_->setCSCGeometry(csc_g);
100 }
T getParameter(std::string const &) const
const unsigned theSector
CSCCorrelatedLCTDigi data[CSCMotherboard::MAX_LCT_BINS][15][2]
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &))
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 &)
const CSCChamber * cscChamber
const unsigned theStation
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
const unsigned theSubsector
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
#define end
Definition: vmac.h:37
void getTimeMatched(const int bx, std::vector< CSCCorrelatedLCTDigi > &) const
edm::ParameterSet tmbParams_
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:30
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)