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 
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).
190  */
191  void matchALCTCLCT();
192 
193  /*
194  This function matches maximum two ALCTs with maximum two CLCTs in
195  a bunch crossing. The best ALCT is considered the one with the highest
196  quality in a BX. Similarly for the best CLCT. If there is just one
197  ALCT and just one CLCT, the correlated LCT is made from those two
198  components. If there are exactly two ALCTs and two CLCTs, the best
199  LCT and second best LCT are formed from the best ALCT-CLCT combination
200  and the second best ALCT-CLCT combination. In case there is missing
201  information (e.g. second best ALCT, but no second best CLCT), information
202  is copied over.
203  */
204  void correlateLCTs(const CSCALCTDigi& bestALCT,
205  const CSCALCTDigi& secondALCT,
206  const CSCCLCTDigi& bestCLCT,
207  const CSCCLCTDigi& secondCLCT,
208  CSCCorrelatedLCTDigi& bLCT,
209  CSCCorrelatedLCTDigi& sLCT,
210  int type) const;
211 
212  /*
213  This method calculates all the TMB words and then passes them to the
214  constructor of correlated LCTs. The LCT data members are filled with
215  information from the ALCT-CLCT combination.
216  */
217  void constructLCTs(
218  const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT, int type, int trknmb, CSCCorrelatedLCTDigi& lct) const;
219 
220  /*
221  These functions copy valid ALCT/CLCT information to invalid the ALCT/CLCT
222  if present, so that we always construct the maximum number of valid LCTs
223  */
226 
227  bool doesALCTCrossCLCT(const CSCALCTDigi&, const CSCCLCTDigi&) const;
228 
229  // CLCT pattern number: encodes the pattern number itself
230  unsigned int encodePattern(const int clctPattern) const;
231 
233  void dumpConfigParams() const;
234 
235  /* encode high multiplicity bits for Run-3 exotic triggers */
237 };
238 #endif
LCTContainer allLCTs_
virtual std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const
const CSCL1TPLookupTableME11ILT * lookupTableME11ILT_
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
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 copyValidToInValidALCT(CSCALCTDigi &, CSCALCTDigi &) const
CSCCLCTDigi getBXShiftedCLCT(const CSCCLCTDigi &) const
unsigned int mpc_block_me1a
~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
CSCShowerDigi shower_
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
unsigned showerSource_
const CSCL1TPLookupTableCCLUT * lookupTableCCLUT_
void encodeHighMultiplicityBits()
CSCALCTDigi getBXShiftedALCT(const CSCALCTDigi &) const
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::unique_ptr< LCTQualityControl > qualityControl_
static const unsigned int def_match_trig_enable
CSCShowerDigi readoutShower() const
std::unique_ptr< LCTQualityAssignment > qualityAssignment_
void constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb, CSCCorrelatedLCTDigi &lct) const