CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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  unsigned showerSource_;
151 
153 
154  /*
155  Preferential index array in matching window, relative to the ALCT BX.
156  Where the central match BX goes first,
157  then the closest early, the closest late, etc.
158  */
159  std::vector<int> preferred_bx_match_;
160 
162  static const unsigned int def_mpc_block_me1a;
163  static const unsigned int def_alct_trig_enable, def_clct_trig_enable;
165  static const unsigned int def_tmb_l1a_window_size;
166 
167  /* quality assignment */
168  std::unique_ptr<LCTQualityAssignment> qualityAssignment_;
169 
170  /* quality control */
171  std::unique_ptr<LCTQualityControl> qualityControl_;
172 
173  /*
174  Helper class to check if an ALCT intersects with a CLCT. Normally
175  this class should not be used. It is left in the code as a potential
176  improvement for ME1/1 when unphysical LCTs are not desired. This
177  function is not implemented in the firmware.
178  */
179  std::unique_ptr<CSCALCTCrossCLCT> cscOverlap_;
180 
182  void checkConfigParameters();
183 
184  /*
185  For valid ALCTs in the trigger time window, look for CLCTs within the
186  match-time window. Valid CLCTs are matched in-time. If a match was found
187  for the best ALCT and best CLCT, also the second best ALCT and second
188  best CLCT are sent to a correlation function "correlateLCTs" that will
189  make the best-best pair and second-second pair (if applicable). This
190  "matchALCTCLCT" function used to be directly in the "run" function, but
191  was put in a separate procedure so it can be reused for the GEM-CSC
192  motherboards. The argument is a mask, which plays no role for regular
193  CSC motherboards (TMB or OTMB). It does play a role in the GEM-CSC
194  motherboard. Different kinds of LCTs can be made there (see
195  CSCGEMMotherboard class), and the matching follows a sequence of priority
196  (first ALCT-CLCT-(2)GEM, then ALCT-CLCT, then CLCT-2GEM, then ALCT-2GEM).
197  At each step bunch crossings are masked where at least one LCT was found.
198  */
199  void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]);
200 
201  /*
202  This function matches maximum two ALCTs with maximum two CLCTs in
203  a bunch crossing. The best ALCT is considered the one with the highest
204  quality in a BX. Similarly for the best CLCT. If there is just one
205  ALCT and just one CLCT, the correlated LCT is made from those two
206  components. If there are exactly two ALCTs and two CLCTs, the best
207  LCT and second best LCT are formed from the best ALCT-CLCT combination
208  and the second best ALCT-CLCT combination. In case there is missing
209  information (e.g. second best ALCT, but no second best CLCT), information
210  is copied over.
211  */
212  void correlateLCTs(const CSCALCTDigi& bestALCT,
213  const CSCALCTDigi& secondALCT,
214  const CSCCLCTDigi& bestCLCT,
215  const CSCCLCTDigi& secondCLCT,
216  CSCCorrelatedLCTDigi& bLCT,
217  CSCCorrelatedLCTDigi& sLCT,
218  int type) const;
219 
220  /*
221  This method calculates all the TMB words and then passes them to the
222  constructor of correlated LCTs. The LCT data members are filled with
223  information from the ALCT-CLCT combination.
224  */
225  void constructLCTs(
226  const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT, int type, int trknmb, CSCCorrelatedLCTDigi& lct) const;
227 
228  /*
229  This function copies valid ALCT/CLCT information to invalid the ALCT/CLCT
230  if present, so that we always construct the maximum number of valid LCts
231  */
233 
234  bool doesALCTCrossCLCT(const CSCALCTDigi&, const CSCCLCTDigi&) const;
235 
236  // CLCT pattern number: encodes the pattern number itself
237  unsigned int encodePattern(const int clctPattern) const;
238 
240  void dumpConfigParams() const;
241 
242  /* encode high multiplicity bits for Run-3 exotic triggers */
244 };
245 #endif
void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS])
LCTContainer allLCTs_
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
std::vector< CSCCLCTDigi > clctV
unsigned int clct_trig_enable
void setESLookupTables(const CSCL1TPLookupTableCCLUT *conf)
unsigned int match_trig_window_size
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &bLCT, CSCCorrelatedLCTDigi &sLCT, int type) const
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
static const unsigned int def_alct_trig_enable
static const unsigned int def_mpc_block_me1a
std::vector< CSCCorrelatedLCTDigi > lctV
std::unique_ptr< CSCCathodeLCTProcessor > clctProc
static const unsigned int def_clct_trig_enable
void copyValidToInValid(CSCALCTDigi &, CSCALCTDigi &, CSCCLCTDigi &, CSCCLCTDigi &) const
CSCShowerDigi readoutShower() const
unsigned int mpc_block_me1a
bool doesALCTCrossCLCT(const CSCALCTDigi &, const CSCCLCTDigi &) const
~CSCMotherboard() override=default
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
unsigned int encodePattern(const int clctPattern) const
unsigned int tmb_l1a_window_size
void checkConfigParameters()
unsigned int match_trig_enable
CSCShowerDigi shower_
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
static const unsigned int def_match_trig_window_size
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const
unsigned int alct_trig_enable
const CSCL1TPLookupTableME21ILT * lookupTableME21ILT_
std::unique_ptr< CSCAnodeLCTProcessor > alctProc
unsigned showerSource_
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void dumpConfigParams() const
void encodeHighMultiplicityBits()
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::unique_ptr< LCTQualityControl > qualityControl_
static const unsigned int def_match_trig_enable
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
std::unique_ptr< LCTQualityAssignment > qualityAssignment_