CMS 3D CMS Logo

CSCAnodeLCTProcessor.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCAnodeLCTProcessor_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCAnodeLCTProcessor_h
3 
45 
46 #include <vector>
47 
49 public:
52  unsigned station,
53  unsigned sector,
54  unsigned subsector,
55  unsigned chamber,
56  const edm::ParameterSet& conf);
57 
59  ~CSCAnodeLCTProcessor() override = default;
60 
62  void setConfigParameters(const CSCDBL1TPParameters* conf);
63 
65  void clear();
66 
67  // This is the main routine for normal running. It gets wire times
68  // from the wire digis and then passes them on to another run() function.
69  std::vector<CSCALCTDigi> run(const CSCWireDigiCollection* wiredc);
70 
71  // This version of the run() function can either be called in a standalone
72  // test, being passed the time array, or called by the run() function above.
73  // It gets wire times from an input array and then loops over the keywires.
74  // All found LCT candidates are sorted and the best two are retained.
75  void run(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]);
76 
78  std::vector<CSCALCTDigi> readoutALCTs() const;
79 
81  std::vector<CSCALCTDigi> getALCTs() const;
82 
84  std::vector<CSCALCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
85 
87  CSCALCTDigi getBestALCT(int bx) const;
88  CSCALCTDigi getSecondALCT(int bx) const;
89 
90  /* get special bits for high multiplicity triggers */
91  unsigned getInTimeHMT() const { return inTimeHMT_; }
92  unsigned getOutTimeHMT() const { return outTimeHMT_; }
93 
96 
97 protected:
104 
107 
109 
111 
113  bool getDigis(const CSCWireDigiCollection* wiredc);
114  void getDigis(const CSCWireDigiCollection* wiredc, const CSCDetId& id);
115 
118 
121 
123  std::vector<CSCWireDigi> digiV[CSCConstants::NUM_LAYERS];
124 
125  std::vector<CSCALCTDigi> lct_list;
126 
127  std::vector<CSCALCTPreTriggerDigi> thePreTriggerDigis;
128 
129  /* data members for high multiplicity triggers */
131  const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]);
132  unsigned inTimeHMT_;
133  unsigned outTimeHMT_;
134  std::vector<unsigned> thresholds_;
139 
145 
147  unsigned int hit_persist;
148 
151 
154 
158 
161 
164 
167 
169  static const unsigned int def_fifo_tbins, def_fifo_pretrig;
170  static const unsigned int def_drift_delay;
172  static const unsigned int def_nplanes_hit_accel_pretrig;
173  static const unsigned int def_nplanes_hit_accel_pattern;
174  static const unsigned int def_trig_mode, def_accel_mode;
175  static const unsigned int def_l1a_window_width;
176 
177  /* quality control */
178  std::unique_ptr<LCTQualityControl> qualityControl_;
179 
182 
184  void loadPatternMask();
185 
188 
190  void checkConfigParameters();
191 
193  void clear(const int wire, const int pattern);
194 
195  /* Gets wire times from the wire digis and fills wire[][] vector */
197 
198  /* A pulse array will be used as a bit representation of hit times.
199  For example: if a keywire has a bx_time of 3, then 1 shifted
200  left 3 will be bit pattern 0000000000001000. Bits are then added to
201  signify the duration of a signal (hit_persist, formerly bx_width). So
202  for the pulse with a hit_persist of 6 will look like 0000000111111000. */
204 
205  /* Check that there are nplanes_hit_pretrig or more layers hit in collision
206  or accelerator patterns for a particular key_wire. If so, return
207  true and the PatternDetection process will start. */
208  bool preTrigger(const int key_wire, const int start_bx);
209 
210  /* See if there is a pattern that satisfies nplanes_hit_pattern number of
211  layers hit for either the accelerator or collision patterns. Use
212  the pattern with the best quality. */
213  bool patternDetection(const int key_wire,
214  std::map<int, std::map<int, CSCALCTDigi::WireContainer> >& hits_in_patterns);
215 
216  // remove the invalid wires from the container
217  void cleanWireContainer(CSCALCTDigi::WireContainer& wireHits) const;
218 
219  // set the wire hit container
221 
222  /* In older versions of the ALCT emulation, the ghost cancellation was performed after
223  the ALCTs were found. In December 2018 it became clear that during the study of data
224  and emulation comparison on 2018 data, a small disagreement between data and emulation
225  was found. The changes we implemented then allow re-triggering on one wiregroup after
226  some dead time once an earlier ALCT was constructed built on this wiregroup. Before this
227  commit the ALCT processor would prohibit the wiregroup from triggering in one event after
228  an ALCT was found on that wiregroup. In the firwmare, the wiregroup with ALCT is only dead
229  for a few BX before it can be triggered by next muon. The implementation of ghost cancellation
230  logic wqas changed to accommodate the re-triggering change while the idea of the ghost
231  cancellation logic is kept the same.
232  */
233  virtual void ghostCancellationLogicOneWire(const int key_wire, int* ghost_cleared);
234 
235  virtual int getTempALCTQuality(int temp_quality) const;
236 
237  void lctSearch();
238  /* Function which enables/disables either collision or accelerator tracks.
239  The function uses the trig_mode parameter to decide. */
240  void trigMode(const int key_wire);
241 
242  /* Function which gives a preference either to the collision patterns
243  or accelerator patterns. The function uses the accel_mode parameter
244  to decide. */
245  void accelMode(const int key_wire);
246 
247  /* Selects two collision and two accelerator ALCTs per time bin with
248  the best quality. */
249  std::vector<CSCALCTDigi> bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);
250 
251  /* This method should have been an overloaded > operator, but we
252  have to keep it here since need to check values in quality[][]
253  array modified according to accel_mode parameter. */
254  bool isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALCTDigi& rhsALCT) const;
255 
257  void dumpConfigParams() const;
258 
260  void dumpDigis(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]) const;
261 
262  void showPatterns(const int key_wire);
263 };
264 
265 #endif
CSCShowerDigi.h
CSCAnodeLCTProcessor::nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:143
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCAnodeLCTProcessor::narrow_mask_r1
bool narrow_mask_r1
Definition: CSCAnodeLCTProcessor.h:166
CSCAnodeLCTProcessor::readWireDigis
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
Definition: CSCAnodeLCTProcessor.cc:425
CSCAnodeLCTProcessor::pretrig_extra_deadtime
unsigned int pretrig_extra_deadtime
Definition: CSCAnodeLCTProcessor.h:160
CSCAnodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:143
CSCAnodeLCTProcessor::thresholds_
std::vector< unsigned > thresholds_
Definition: CSCAnodeLCTProcessor.h:134
CSCAnodeLCTProcessor::getALCTs
std::vector< CSCALCTDigi > getALCTs() const
Definition: CSCAnodeLCTProcessor.cc:1264
CSCAnodeLCTProcessor::setWireContainer
void setWireContainer(CSCALCTDigi &, CSCALCTDigi::WireContainer &wireHits) const
Definition: CSCAnodeLCTProcessor.cc:1331
CSCAnodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCAnodeLCTProcessor.h:170
CSCAnodeLCTProcessor::getTempALCTQuality
virtual int getTempALCTQuality(int temp_quality) const
Definition: CSCAnodeLCTProcessor.cc:1314
CSCAnodeLCTProcessor::getInTimeHMT
unsigned getInTimeHMT() const
Definition: CSCAnodeLCTProcessor.h:91
CSCAnodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCAnodeLCTProcessor.h:147
CSCAnodeLCTProcessor::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCAnodeLCTProcessor.h:178
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:127
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCAnodeLCTProcessor::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
Definition: CSCAnodeLCTProcessor.cc:1339
CSCShowerDigi
Definition: CSCShowerDigi.h:9
CSCAnodeLCTProcessor::run
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:195
CSCAnodeLCTProcessor::MESelection
int MESelection
Definition: CSCAnodeLCTProcessor.h:117
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCAnodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCAnodeLCTProcessor.h:150
CSCAnodeLCTProcessor::showPatterns
void showPatterns(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1285
CSCAnodeLCTProcessor::trig_mode
unsigned int trig_mode
Definition: CSCAnodeLCTProcessor.h:144
CSCAnodeLCTProcessor::loadPatternMask
void loadPatternMask()
Definition: CSCAnodeLCTProcessor.cc:93
CSCConstants::NUM_ALCT_PATTERNS
Definition: CSCConstants.h:107
CSCAnodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:139
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig
static const unsigned int def_nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:172
CSCAnodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCAnodeLCTProcessor.h:169
CSCAnodeLCTProcessor::def_accel_mode
static const unsigned int def_accel_mode
Definition: CSCAnodeLCTProcessor.h:174
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCAnodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCAnodeLCTProcessor.cc:1132
CSCAnodeLCTProcessor::l1a_window_width
unsigned int l1a_window_width
Definition: CSCAnodeLCTProcessor.h:144
CSCDBL1TPParameters.h
CSCAnodeLCTProcessor::trigMode
void trigMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1050
CSCAnodeLCTProcessor::accel_mode
unsigned int accel_mode
Definition: CSCAnodeLCTProcessor.h:144
CSCAnodeLCTProcessor::preTrigger
bool preTrigger(const int key_wire, const int start_bx)
Definition: CSCAnodeLCTProcessor.cc:553
CSCAnodeLCTProcessor::outTimeHMT_
unsigned outTimeHMT_
Definition: CSCAnodeLCTProcessor.h:133
CSCAnodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::MAX_NUM_WIREGROUPS]
Definition: CSCAnodeLCTProcessor.h:120
CSCAnodeLCTProcessor::pulse_
PulseArray pulse_
Definition: CSCAnodeLCTProcessor.h:108
CSCAnodeLCTProcessor::lct_list
std::vector< CSCALCTDigi > lct_list
Definition: CSCAnodeLCTProcessor.h:125
CSCALCTDigi.h
CSCAnodeLCTProcessor::showerMinOutTBin_
unsigned showerMinOutTBin_
Definition: CSCAnodeLCTProcessor.h:137
CSCAnodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:169
CSCAnodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:171
CSCAnodeLCTProcessor::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCAnodeLCTProcessor.cc:117
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:103
PulseArray.h
CSCAnodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCAnodeLCTProcessor.h:141
CSCAnodeLCTProcessor::pulseExtension
bool pulseExtension(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS])
Definition: CSCAnodeLCTProcessor.cc:482
CSCAnodeLCTProcessor::thePreTriggerDigis
std::vector< CSCALCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCAnodeLCTProcessor.h:127
CSCAnodeLCTProcessor::clear
void clear()
Definition: CSCAnodeLCTProcessor.cc:175
CSCAnodeLCTProcessor::inTimeHMT_
unsigned inTimeHMT_
Definition: CSCAnodeLCTProcessor.h:132
CSCAnodeLCTProcessor::showerMaxInTBin_
unsigned showerMaxInTBin_
Definition: CSCAnodeLCTProcessor.h:136
CSCAnodeLCTProcessor::shower_
CSCShowerDigi shower_
Definition: CSCAnodeLCTProcessor.h:110
CSCAnodeLCTProcessor::secondALCT
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:106
CSCAnodeLCTProcessor::getOutTimeHMT
unsigned getOutTimeHMT() const
Definition: CSCAnodeLCTProcessor.h:92
edm::ParameterSet
Definition: ParameterSet.h:47
CSCAnodeLCTProcessor::ghostCancellationLogicOneWire
virtual void ghostCancellationLogicOneWire(const int key_wire, int *ghost_cleared)
Definition: CSCAnodeLCTProcessor.cc:765
PulseArray
Definition: PulseArray.h:11
CSCBaseboard
Definition: CSCBaseboard.h:14
CSCAnodeLCTProcessor::bestTrackSelector
std::vector< CSCALCTDigi > bestTrackSelector(const std::vector< CSCALCTDigi > &all_alcts)
Definition: CSCAnodeLCTProcessor.cc:910
CSCDetId
Definition: CSCDetId.h:26
CSCAnodeLCTProcessor::def_l1a_window_width
static const unsigned int def_l1a_window_width
Definition: CSCAnodeLCTProcessor.h:175
CSCAnodeLCTProcessor::use_corrected_bx
bool use_corrected_bx
Definition: CSCAnodeLCTProcessor.h:163
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCALCTPreTriggerDigi.h
CSCAnodeLCTProcessor::numWireGroups
int numWireGroups
Definition: CSCAnodeLCTProcessor.h:116
CSCAnodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:141
CSCAnodeLCTProcessor::readoutALCTs
std::vector< CSCALCTDigi > readoutALCTs() const
Definition: CSCAnodeLCTProcessor.cc:1189
CSCAnodeLCTProcessor::ghost_cancellation_side_quality
bool ghost_cancellation_side_quality
Definition: CSCAnodeLCTProcessor.h:157
CSCAnodeLCTProcessor::accelMode
void accelMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1087
CSCPatternBank::LCTPatterns
std::vector< LCTPattern > LCTPatterns
Definition: CSCPatternBank.h:15
CSCAnodeLCTProcessor::isBetterALCT
bool isBetterALCT(const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT) const
Definition: CSCAnodeLCTProcessor.cc:1010
CSCAnodeLCTProcessor::CSCAnodeLCTProcessor
CSCAnodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
Definition: CSCAnodeLCTProcessor.cc:20
CSCAnodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:171
CSCAnodeLCTProcessor::showerMaxOutTBin_
unsigned showerMaxOutTBin_
Definition: CSCAnodeLCTProcessor.h:138
CSCAnodeLCTProcessor::cleanWireContainer
void cleanWireContainer(CSCALCTDigi::WireContainer &wireHits) const
Definition: CSCAnodeLCTProcessor.cc:1324
CSCWireDigiCollection
CSCAnodeLCTProcessor::getSecondALCT
CSCALCTDigi getSecondALCT(int bx) const
Definition: CSCAnodeLCTProcessor.cc:1277
CSCAnodeLCTProcessor::alct_pattern_
CSCPatternBank::LCTPatterns alct_pattern_
Definition: CSCAnodeLCTProcessor.h:181
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern
static const unsigned int def_nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:173
CSCALCTDigi::WireContainer
std::vector< std::vector< uint16_t > > WireContainer
Definition: CSCALCTDigi.h:21
CSCAnodeLCTProcessor::def_trig_mode
static const unsigned int def_trig_mode
Definition: CSCAnodeLCTProcessor.h:174
CSCAnodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:102
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCAnodeLCTProcessor::patternDetection
bool patternDetection(const int key_wire, std::map< int, std::map< int, CSCALCTDigi::WireContainer > > &hits_in_patterns)
Definition: CSCAnodeLCTProcessor.cc:620
CSCAnodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:142
CSCAnodeLCTProcessor
Definition: CSCAnodeLCTProcessor.h:48
CSCWireDigiCollection.h
CSCAnodeLCTProcessor::first_bx
int first_bx[CSCConstants::MAX_NUM_WIREGROUPS]
Definition: CSCAnodeLCTProcessor.h:119
CSCAnodeLCTProcessor::preTriggerDigis
std::vector< CSCALCTPreTriggerDigi > preTriggerDigis() const
Definition: CSCAnodeLCTProcessor.h:84
genParticles_cff.map
map
Definition: genParticles_cff.py:11
CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
int ghost_cancellation_bx_depth
Definition: CSCAnodeLCTProcessor.h:153
CSCAnodeLCTProcessor::getDigis
bool getDigis(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:385
CSCAnodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIREGROUPS]) const
Definition: CSCAnodeLCTProcessor.cc:1155
CSCAnodeLCTProcessor::getBestALCT
CSCALCTDigi getBestALCT(int bx) const
Definition: CSCAnodeLCTProcessor.cc:1275
CSCAnodeLCTProcessor::showerMinInTBin_
unsigned showerMinInTBin_
Definition: CSCAnodeLCTProcessor.h:135
CSCAnodeLCTProcessor::quality
int quality[CSCConstants::MAX_NUM_WIREGROUPS][CSCConstants::NUM_ALCT_PATTERNS]
Definition: CSCAnodeLCTProcessor.h:122
CSCAnodeLCTProcessor::lctSearch
void lctSearch()
Definition: CSCAnodeLCTProcessor.cc:838
CSCAnodeLCTProcessor::bestALCT
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:103
CSCAnodeLCTProcessor::nplanes_hit_accel_pretrig
unsigned int nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:142
CSCAnodeLCTProcessor::readoutShower
CSCShowerDigi readoutShower() const
Definition: CSCAnodeLCTProcessor.cc:1280
CSCAnodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCAnodeLCTProcessor.h:141
CSCAnodeLCTProcessor::digiV
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCAnodeLCTProcessor.h:123
CSCConstants::MAX_NUM_WIREGROUPS
Definition: CSCConstants.h:51
CSCAnodeLCTProcessor::~CSCAnodeLCTProcessor
~CSCAnodeLCTProcessor() override=default
LCTQualityControl.h
CSCBaseboard.h