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  // functions to setup geometry and LUTs
75  void setupGeometry();
76  void debugLUTs();
77 
78  // run TMB with GEM pad clusters as input
79  void run(const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc) override;
80 
81  /* readout the two best LCTs in this CSC */
82  std::vector<CSCCorrelatedLCTDigi> readoutLCTs() const override;
83 
84 protected:
85  void correlateLCTs(const CSCALCTDigi& bestALCT,
86  const CSCALCTDigi& secondALCT,
87  const CSCCLCTDigi& bestCLCT,
88  const CSCCLCTDigi& secondCLCT,
90  CSCCorrelatedLCTDigi& lct2) const;
91 
93 
94  void setPrefIndex();
95 
99 
100  std::unique_ptr<CSCUpgradeMotherboardLUTGenerator> generator_;
101 
104 
107 
108  /* type of algorithm to sort the stubs */
109  unsigned int tmb_cross_bx_algo;
110 
112  unsigned int max_lcts;
113 
114  // debug gem matching
116 
117  // check look-up-tables
119 };
120 
121 template <class S>
122 bool CSCUpgradeMotherboard::compare(const S& p, const S& q) const {
123  return (p.first == q.first) and (p.second == q.second);
124 }
125 
126 template <class S>
127 void CSCUpgradeMotherboard::intersection(const S& d1, const S& d2, S& result) const {
128  for (const auto& p : d1) {
129  for (const auto& q : d2) {
130  if (compare(p, q)) {
131  result.push_back(p);
132  }
133  }
134  }
135 }
136 
137 #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:332
CSCUpgradeMotherboard::intersection
void intersection(const S &d1, const S &d2, S &result) const
Definition: CSCUpgradeMotherboard.h:127
LCTContainer
Definition: LCTContainer.h:20
CSCUpgradeMotherboard::compare
bool compare(const S &p, const S &q) const
Definition: CSCUpgradeMotherboard.h:122
CSCMotherboard
Definition: CSCMotherboard.h:41
CSCUpgradeMotherboard::tmb_cross_bx_algo
unsigned int tmb_cross_bx_algo
Definition: CSCUpgradeMotherboard.h:109
CSCUpgradeMotherboard::debugLUTs
void debugLUTs()
Definition: CSCUpgradeMotherboard.cc:302
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:262
CSCPart
CSCPart
Definition: CSCUpgradeMotherboardLUT.h:12
CSCUpgradeMotherboard::getCSCPart
enum CSCPart getCSCPart(int keystrip) const
Definition: CSCUpgradeMotherboard.cc:279
CSCUpgradeMotherboard::setupGeometry
void setupGeometry()
Definition: CSCUpgradeMotherboard.cc:322
CSCUpgradeMotherboard::match_earliest_clct_only
bool match_earliest_clct_only
Definition: CSCUpgradeMotherboard.h:106
CSCUpgradeMotherboard::sortLCTsByGEMDphi
static bool sortLCTsByGEMDphi(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:311
CSCUpgradeMotherboard::theParity
Parity theParity
Definition: CSCUpgradeMotherboard.h:92
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:222
edm::ParameterSet
Definition: ParameterSet.h:47
CSCUpgradeMotherboard::debug_matching
bool debug_matching
Definition: CSCUpgradeMotherboard.h:115
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:315
CSCUpgradeMotherboard::pref
int pref[CSCConstants::MAX_LCT_TBINS]
Definition: CSCUpgradeMotherboard.h:103
CSCComparatorDigiCollection
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
CSCUpgradeMotherboard::match_earliest_alct_only
bool match_earliest_alct_only
Definition: CSCUpgradeMotherboard.h:105
CSCUpgradeMotherboard::~CSCUpgradeMotherboard
~CSCUpgradeMotherboard() override
Definition: CSCUpgradeMotherboard.cc:277
CSCUpgradeMotherboard::CSCUpgradeMotherboard
CSCUpgradeMotherboard()
Definition: CSCUpgradeMotherboard.cc:53
CSCUpgradeMotherboard::sortLCTsByQuality
static bool sortLCTsByQuality(const CSCCorrelatedLCTDigi &, const CSCCorrelatedLCTDigi &)
Definition: CSCUpgradeMotherboard.cc:307
CSCUpgradeMotherboard::allLCTs
LCTContainer allLCTs
Definition: CSCUpgradeMotherboard.h:98
CSCWireDigiCollection
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCUpgradeMotherboard::setPrefIndex
void setPrefIndex()
Definition: CSCUpgradeMotherboard.cc:324
CSCUpgradeMotherboard::run
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) override
Definition: CSCUpgradeMotherboard.cc:71
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
patCandidatesForDimuonsSequences_cff.matches
matches
Definition: patCandidatesForDimuonsSequences_cff.py:131
S
Definition: CSCDBL1TPParametersExtended.h:16
CSCUpgradeMotherboard::debug_luts
bool debug_luts
Definition: CSCUpgradeMotherboard.h:118
mps_fire.result
result
Definition: mps_fire.py:311
CSCUpgradeMotherboard::generator_
std::unique_ptr< CSCUpgradeMotherboardLUTGenerator > generator_
Definition: CSCUpgradeMotherboard.h:100
CSCUpgradeMotherboard::max_lcts
unsigned int max_lcts
Definition: CSCUpgradeMotherboard.h:112
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19