CMS 3D CMS Logo

CSCUpgradeMotherboard.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboard_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCUpgradeMotherboard_h
3 
17 
18 // generic container type
19 namespace {
20 
21  // first: raw detid, second: digi
22  template <class T>
23  using match = std::pair<unsigned int, T>;
24 
25  // vector of template above
26  template <class T>
27  using matches = std::vector<std::pair<unsigned int, T> >;
28 
29  // first: BX number, second: vector of template above
30  template <class T>
31  using matchesBX = std::map<int, std::vector<std::pair<unsigned int, T> > >;
32 
33 } // namespace
34 
36 public:
37  // standard constructor
39  unsigned station,
40  unsigned sector,
41  unsigned subsector,
42  unsigned chamber,
43  const edm::ParameterSet& conf);
44 
45  //Default constructor for testing
47 
48  ~CSCUpgradeMotherboard() override;
49 
50  // Empty the LCT container
51  void clear();
52 
53  // Compare two matches of type <ID,DIGI>
54  // The template is match<GEMPadDigi> or match<GEMCoPadDigi>
55  template <class S>
56  bool compare(const S& p, const S& q) const;
57 
58  // Get the common matches of type <ID,DIGI>. Could be more than 1
59  // The template is matches<GEMPadDigi> or matches<GEMCoPadDigi>
60  template <class S>
61  void intersection(const S& d1, const S& d2, S& result) const;
62 
66  // generic sorting function
67  // provide an LCT collection and a sorting function
68  void sortLCTs(std::vector<CSCCorrelatedLCTDigi>& lcts,
69  bool (*sorter)(const CSCCorrelatedLCTDigi&, const CSCCorrelatedLCTDigi&)) const;
70 
72  enum CSCPart getCSCPart(int keystrip) const;
73 
74  // run TMB with GEM pad clusters as input
75  void run(const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc) override;
76 
77  /* readout the two best LCTs in this CSC */
78  std::vector<CSCCorrelatedLCTDigi> readoutLCTs() const override;
79 
80 protected:
81  void correlateLCTs(const CSCALCTDigi& bestALCT,
82  const CSCALCTDigi& secondALCT,
83  const CSCCLCTDigi& bestCLCT,
84  const CSCCLCTDigi& secondCLCT,
86  CSCCorrelatedLCTDigi& lct2) const;
87 
89 
90  void setPrefIndex();
91 
95 
98 
101 
102  /* type of algorithm to sort the stubs */
103  unsigned int tmb_cross_bx_algo;
104 
106  unsigned int max_lcts;
107 
108  // debug gem matching
110 
111  // check look-up-tables
113 };
114 
115 template <class S>
116 bool CSCUpgradeMotherboard::compare(const S& p, const S& q) const {
117  return (p.first == q.first) and (p.second == q.second);
118 }
119 
120 template <class S>
121 void CSCUpgradeMotherboard::intersection(const S& d1, const S& d2, S& result) const {
122  for (const auto& p : d1) {
123  for (const auto& q : d2) {
124  if (compare(p, q)) {
125  result.push_back(p);
126  }
127  }
128  }
129 }
130 
131 #endif
CSCUpgradeMotherboard
Definition: CSCUpgradeMotherboard.h:35
relativeConstraints.station
station
Definition: relativeConstraints.py:67
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCUpgradeMotherboard::clear
void clear()
Definition: CSCUpgradeMotherboard.cc:322
oniaPATMuonsWithTrigger_cff.matches
matches
Definition: oniaPATMuonsWithTrigger_cff.py:77
CSCUpgradeMotherboard::intersection
void intersection(const S &d1, const S &d2, S &result) const
Definition: CSCUpgradeMotherboard.h:121
LCTContainer
Definition: LCTContainer.h:20
CSCUpgradeMotherboard::compare
bool compare(const S &p, const S &q) const
Definition: CSCUpgradeMotherboard.h:116
CSCMotherboard
Definition: CSCMotherboard.h:41
CSCUpgradeMotherboard::tmb_cross_bx_algo
unsigned int tmb_cross_bx_algo
Definition: CSCUpgradeMotherboard.h:103
Parity
Parity
Definition: CSCUpgradeMotherboardLUT.h:13
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCUpgradeMotherboard::readoutLCTs
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const override
Definition: CSCUpgradeMotherboard.cc:259
CSCPart
CSCPart
Definition: CSCUpgradeMotherboardLUT.h:12
CSCUpgradeMotherboard::getCSCPart
enum CSCPart getCSCPart(int keystrip) const
Definition: CSCUpgradeMotherboard.cc:276
CSCUpgradeMotherboard::match_earliest_clct_only
bool match_earliest_clct_only
Definition: CSCUpgradeMotherboard.h:100
CSCUpgradeMotherboard::sortLCTsByGEMDphi
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:303
CSCUpgradeMotherboard::theParity
Parity theParity
Definition: CSCUpgradeMotherboard.h:88
CSCConstants::MAX_LCT_TBINS
Definition: CSCConstants.h:65
CSCMotherboard.h
CSCUpgradeMotherboard::correlateLCTs
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2) const
Definition: CSCUpgradeMotherboard.cc:219
edm::ParameterSet
Definition: ParameterSet.h:47
CSCUpgradeMotherboard::debug_matching
bool debug_matching
Definition: CSCUpgradeMotherboard.h:109
sorter
Definition: SETFilter.cc:31
LCTContainer.h
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
CSCUpgradeCathodeLCTProcessor.h
CSCUpgradeAnodeLCTProcessor.h
CSCUpgradeMotherboard::sortLCTs
void sortLCTs(std::vector< CSCCorrelatedLCTDigi > &lcts, bool(*sorter)(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)) const
Definition: CSCUpgradeMotherboard.cc:307
CSCUpgradeMotherboard::pref
int pref[CSCConstants::MAX_LCT_TBINS]
Definition: CSCUpgradeMotherboard.h:97
CSCComparatorDigiCollection
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CSCUpgradeMotherboard::match_earliest_alct_only
bool match_earliest_alct_only
Definition: CSCUpgradeMotherboard.h:99
CSCUpgradeMotherboard::~CSCUpgradeMotherboard
~CSCUpgradeMotherboard() override
Definition: CSCUpgradeMotherboard.cc:274
CSCUpgradeMotherboard::CSCUpgradeMotherboard
CSCUpgradeMotherboard()
Definition: CSCUpgradeMotherboard.cc:50
CSCUpgradeMotherboard::sortLCTsByQuality
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:299
CSCUpgradeMotherboard::allLCTs
LCTContainer allLCTs
Definition: CSCUpgradeMotherboard.h:94
CSCWireDigiCollection
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCUpgradeMotherboard::setPrefIndex
void setPrefIndex()
Definition: CSCUpgradeMotherboard.cc:314
CSCUpgradeMotherboard::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
Definition: CSCUpgradeMotherboard.cc:68
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
S
Definition: CSCDBL1TPParametersExtended.h:16
CSCUpgradeMotherboard::debug_luts
bool debug_luts
Definition: CSCUpgradeMotherboard.h:112
mps_fire.result
result
Definition: mps_fire.py:311
CSCUpgradeMotherboard::max_lcts
unsigned int max_lcts
Definition: CSCUpgradeMotherboard.h:106
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19