CMS 3D CMS Logo

CSCMotherboard.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCMotherboard_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCMotherboard_h
3 
49 
50 class CSCMotherboard : public CSCBaseboard {
51 public:
53  CSCMotherboard(unsigned endcap,
54  unsigned station,
55  unsigned sector,
56  unsigned subsector,
57  unsigned chamber,
58  const edm::ParameterSet& conf);
59 
61  ~CSCMotherboard() override = default;
62 
65  void run(const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc);
66 
67  /*
68  Returns vector of good correlated LCTs in the read-out time window.
69  LCTs in the BX window [early_tbins,...,late_tbins] are considered
70  good for physics. The central LCT BX is time bin 8.
71  - tmb_l1a_window_size = 7 (Run-1, Run-2) -> [5, 6, 7, 8, 9, 10, 11]
72  - tmb_l1a_window_size = 5 (Run-3) -> [6, 7, 8, 9, 10]
73  - tmb_l1a_window_size = 3 (Run-4?) -> [7, 8, 9]
74 
75  Note, this function does not have an exact counterpart in the
76  firmware. The reason is that the DAQ of LCTs is not correctly
77  simulated in CMSSW - at least the simulation of the L1-accept.
78  So, this function corresponds to both the trigger path and the
79  DAQ path in the firmware. In general, the function will return
80  LCTs that would not be used in the OMTF or EMTF emulator,
81  because they are out-of-time relative for tracking purposes. For
82  instance an LCT with BX5 would be read out by the DAQ, but would
83  likely not be used by the EMTF.
84  */
85  virtual std::vector<CSCCorrelatedLCTDigi> readoutLCTs() const;
86 
87  // LCT selection: at most 2 in each BX
88  void selectLCTs();
89 
91  std::vector<CSCShowerDigi> readoutShower() const;
92 
95  void clear();
96 
98  void setConfigParameters(const CSCDBL1TPParameters* conf);
102 
104  std::unique_ptr<CSCAnodeLCTProcessor> alctProc;
105 
107  std::unique_ptr<CSCCathodeLCTProcessor> clctProc;
108 
109  // VK: change to protected, to allow inheritance
110 protected:
111  // access to lookup tables via eventsetup
115 
116  /* Containers for reconstructed ALCTs and CLCTs */
117  std::vector<CSCALCTDigi> alctV;
118  std::vector<CSCCLCTDigi> clctV;
119 
122 
123  /* Container with sorted and selected LCTs */
124  std::vector<CSCCorrelatedLCTDigi> lctV;
125 
127 
128  // helper function to return ALCT/CLCT with correct central BX
131 
133  unsigned int mpc_block_me1a;
136 
139 
142 
145 
146  // when set to true, ignore CLCTs found in later BX's
148 
149  // encode special bits for high-multiplicity triggers
150  std::vector<unsigned> showerSource_;
152  unsigned minbx_readout_;
153  unsigned maxbx_readout_;
154 
156 
157  /*
158  Preferential index array in matching window, relative to the ALCT BX.
159  Where the central match BX goes first,
160  then the closest early, the closest late, etc.
161  */
162  std::vector<int> preferred_bx_match_;
163 
165  static const unsigned int def_mpc_block_me1a;
166  static const unsigned int def_alct_trig_enable, def_clct_trig_enable;
168  static const unsigned int def_tmb_l1a_window_size;
169 
170  /* quality assignment */
171  std::unique_ptr<LCTQualityAssignment> qualityAssignment_;
172 
173  /* quality control */
174  std::unique_ptr<LCTQualityControl> qualityControl_;
175 
176  /*
177  Helper class to check if an ALCT intersects with a CLCT. Normally
178  this class should not be used. It is left in the code as a potential
179  improvement for ME1/1 when unphysical LCTs are not desired. This
180  function is not implemented in the firmware.
181  */
182  std::unique_ptr<CSCALCTCrossCLCT> cscOverlap_;
183 
185  void checkConfigParameters();
186 
187  /*
188  For valid ALCTs in the trigger time window, look for CLCTs within the
189  match-time window. Valid CLCTs are matched in-time. If a match was found
190  for the best ALCT and best CLCT, also the second best ALCT and second
191  best CLCT are sent to a correlation function "correlateLCTs" that will
192  make the best-best pair and second-second pair (if applicable).
193  */
194  void matchALCTCLCT();
195 
196  /*
197  This function matches maximum two ALCTs with maximum two CLCTs in
198  a bunch crossing. The best ALCT is considered the one with the highest
199  quality in a BX. Similarly for the best CLCT. If there is just one
200  ALCT and just one CLCT, the correlated LCT is made from those two
201  components. If there are exactly two ALCTs and two CLCTs, the best
202  LCT and second best LCT are formed from the best ALCT-CLCT combination
203  and the second best ALCT-CLCT combination. In case there is missing
204  information (e.g. second best ALCT, but no second best CLCT), information
205  is copied over.
206  */
207  void correlateLCTs(const CSCALCTDigi& bestALCT,
208  const CSCALCTDigi& secondALCT,
209  const CSCCLCTDigi& bestCLCT,
210  const CSCCLCTDigi& secondCLCT,
211  CSCCorrelatedLCTDigi& bLCT,
212  CSCCorrelatedLCTDigi& sLCT,
213  int type) const;
214 
215  /*
216  This method calculates all the TMB words and then passes them to the
217  constructor of correlated LCTs. The LCT data members are filled with
218  information from the ALCT-CLCT combination.
219  */
220  void constructLCTs(
221  const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT, int type, int trknmb, CSCCorrelatedLCTDigi& lct) const;
222 
223  /*
224  These functions copy valid ALCT/CLCT information to invalid the ALCT/CLCT
225  if present, so that we always construct the maximum number of valid LCTs
226  */
229 
230  bool doesALCTCrossCLCT(const CSCALCTDigi&, const CSCCLCTDigi&) const;
231 
232  // CLCT pattern number: encodes the pattern number itself
233  unsigned int encodePattern(const int clctPattern) const;
234 
236  void dumpConfigParams() const;
237 
238  /* match cathode shower and anode shower with and/or logic */
239  void matchShowers(CSCShowerDigi* anode_showers, CSCShowerDigi* cathode_showers, bool andlogic);
240 
241  /* encode high multiplicity bits for Run-3 exotic triggers */
243 };
244 #endif
LCTContainer allLCTs_
unsigned thisShowerSource_
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
unsigned maxbx_readout_
std::vector< CSCCLCTDigi > clctV
unsigned int clct_trig_enable
void setESLookupTables(const CSCL1TPLookupTableCCLUT *conf)
unsigned int encodePattern(const int clctPattern) const
unsigned int match_trig_window_size
static const unsigned int def_alct_trig_enable
CSCShowerDigi showers_[CSCConstants::MAX_LCT_TBINS]
static const unsigned int def_mpc_block_me1a
std::vector< CSCCorrelatedLCTDigi > lctV
void matchShowers(CSCShowerDigi *anode_showers, CSCShowerDigi *cathode_showers, bool andlogic)
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
void copyValidToInValidALCT(CSCALCTDigi &, CSCALCTDigi &) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
unsigned int mpc_block_me1a
unsigned minbx_readout_
~CSCMotherboard() override=default
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
std::vector< int > preferred_bx_match_
bool match_earliest_clct_only_
CSCMotherboard(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
std::unique_ptr< CSCALCTCrossCLCT > cscOverlap_
static const unsigned int def_tmb_l1a_window_size
std::vector< CSCALCTDigi > alctV
void dumpConfigParams() const
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
void copyValidToInValidCLCT(CSCCLCTDigi &, CSCCLCTDigi &) const
std::vector< unsigned > showerSource_
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
static const unsigned int def_match_trig_window_size
unsigned int alct_trig_enable
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void encodeHighMultiplicityBits()
std::vector< CSCShowerDigi > readoutShower() const
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::unique_ptr< LCTQualityControl > qualityControl_
static const unsigned int def_match_trig_enable
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const