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 
43 
44 #include <vector>
45 
47 public:
50  unsigned station,
51  unsigned sector,
52  unsigned subsector,
53  unsigned chamber,
54  const edm::ParameterSet& conf);
55 
58 
60  ~CSCAnodeLCTProcessor() override = default;
61 
63  void setConfigParameters(const CSCDBL1TPParameters* conf);
64 
66  void clear();
67 
68  // This is the main routine for normal running. It gets wire times
69  // from the wire digis and then passes them on to another run() function.
70  std::vector<CSCALCTDigi> run(const CSCWireDigiCollection* wiredc);
71 
72  // This version of the run() function can either be called in a standalone
73  // test, being passed the time array, or called by the run() function above.
74  // It gets wire times from an input array and then loops over the keywires.
75  // All found LCT candidates are sorted and the best two are retained.
76  void run(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
77 
79  std::vector<CSCALCTDigi> readoutALCTs(int nMaxALCTs = CSCConstants::MAX_ALCTS_READOUT) const;
80 
82  std::vector<CSCALCTDigi> getALCTs(unsigned nMaxALCTs = CSCConstants::MAX_ALCTS_READOUT) const;
83 
85  std::vector<CSCALCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
86 
88  CSCALCTDigi getBestALCT(int bx) const;
89  CSCALCTDigi getSecondALCT(int bx) const;
90 
91  /* encode special bits for high multiplicity triggers */
92  unsigned getHighMultiplictyBits() const { return highMultiplicityBits_; }
93 
94 protected:
101 
104 
106  std::vector<std::vector<CSCALCTDigi> > ALCTContainer_;
107 
109  bool getDigis(const CSCWireDigiCollection* wiredc);
110  void getDigis(const CSCWireDigiCollection* wiredc, const CSCDetId& id);
111 
114 
118  std::vector<CSCWireDigi> digiV[CSCConstants::NUM_LAYERS];
120 
121  std::vector<CSCALCTDigi> lct_list;
122 
123  std::vector<CSCALCTPreTriggerDigi> thePreTriggerDigis;
124 
125  /* data members for high multiplicity triggers */
127  unsigned int highMultiplicityBits_;
128 
134 
136  unsigned int hit_persist;
137 
140 
143 
147 
150 
153 
156 
158  static const unsigned int def_fifo_tbins, def_fifo_pretrig;
159  static const unsigned int def_drift_delay;
161  static const unsigned int def_nplanes_hit_accel_pretrig;
162  static const unsigned int def_nplanes_hit_accel_pattern;
163  static const unsigned int def_trig_mode, def_accel_mode;
164  static const unsigned int def_l1a_window_width;
165 
166  /* quality control */
167  std::unique_ptr<LCTQualityControl> qualityControl_;
168 
171 
173  void loadPatternMask();
174 
177 
179  void checkConfigParameters();
180 
182  void clear(const int wire, const int pattern);
183 
184  /* Gets wire times from the wire digis and fills wire[][] vector */
186 
187  /* A pulse array will be used as a bit representation of hit times.
188  For example: if a keywire has a bx_time of 3, then 1 shifted
189  left 3 will be bit pattern 0000000000001000. Bits are then added to
190  signify the duration of a signal (hit_persist, formerly bx_width). So
191  for the pulse with a hit_persist of 6 will look like 0000000111111000. */
192  bool pulseExtension(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
193 
194  /* Check that there are nplanes_hit_pretrig or more layers hit in collision
195  or accelerator patterns for a particular key_wire. If so, return
196  true and the PatternDetection process will start. */
197  bool preTrigger(const int key_wire, const int start_bx);
198 
199  /* See if there is a pattern that satisfies nplanes_hit_pattern number of
200  layers hit for either the accelerator or collision patterns. Use
201  the pattern with the best quality. */
202  bool patternDetection(const int key_wire,
203  std::map<int, std::map<int, CSCALCTDigi::WireContainer> >& hits_in_patterns);
204 
205  // enum used in the wire hit assignment
206  enum ALCT_WireInfo { INVALID_WIRE = 65535 };
207 
208  // remove the invalid wires from the container
209  void cleanWireContainer(CSCALCTDigi::WireContainer& wireHits) const;
210 
211  // set the wire hit container
213 
214  /* This function looks for LCTs on the previous and next wires. If one
215  exists and it has a better quality and a bx_time up to 4 clocks earlier
216  than the present, then the present LCT is cancelled. The present LCT
217  also gets cancelled if it has the same quality as the one on the
218  previous wire (this has not been done in 2003 test beam). The
219  cancellation is done separately for collision and accelerator patterns. */
220  virtual void ghostCancellationLogic();
221 
222  virtual void ghostCancellationLogicOneWire(const int key_wire, int* ghost_cleared);
223 
224  virtual int getTempALCTQuality(int temp_quality) const;
225 
226  void lctSearch();
227  /* Function which enables/disables either collision or accelerator tracks.
228  The function uses the trig_mode parameter to decide. */
229  void trigMode(const int key_wire);
230 
231  /* Function which gives a preference either to the collision patterns
232  or accelerator patterns. The function uses the accel_mode parameter
233  to decide. */
234  void accelMode(const int key_wire);
235 
236  /* Selects two collision and two accelerator ALCTs per time bin with
237  the best quality. */
238  std::vector<CSCALCTDigi> bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);
239 
240  /* This method should have been an overloaded > operator, but we
241  have to keep it here since need to check values in quality[][]
242  array modified according to accel_mode parameter. */
243  bool isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALCTDigi& rhsALCT) const;
244 
246  void dumpConfigParams() const;
247 
249  void dumpDigis(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const;
250 
251  void showPatterns(const int key_wire);
252 };
253 
254 #endif
CSCConstants::MAX_NUM_WIRES
Definition: CSCConstants.h:22
CSCAnodeLCTProcessor::nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:132
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCAnodeLCTProcessor::narrow_mask_r1
bool narrow_mask_r1
Definition: CSCAnodeLCTProcessor.h:155
CSCAnodeLCTProcessor::pretrig_extra_deadtime
unsigned int pretrig_extra_deadtime
Definition: CSCAnodeLCTProcessor.h:149
CSCAnodeLCTProcessor::readWireDigis
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
Definition: CSCAnodeLCTProcessor.cc:410
CSCAnodeLCTProcessor::highMultiplicityBits_
unsigned int highMultiplicityBits_
Definition: CSCAnodeLCTProcessor.h:127
CSCAnodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:132
CSCAnodeLCTProcessor::setWireContainer
void setWireContainer(CSCALCTDigi &, CSCALCTDigi::WireContainer &wireHits) const
Definition: CSCAnodeLCTProcessor.cc:1379
CSCAnodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCAnodeLCTProcessor.h:159
CSCAnodeLCTProcessor::getTempALCTQuality
virtual int getTempALCTQuality(int temp_quality) const
Definition: CSCAnodeLCTProcessor.cc:1361
CSCAnodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCAnodeLCTProcessor.h:136
CSCAnodeLCTProcessor::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCAnodeLCTProcessor.h:167
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:64
CSCAnodeLCTProcessor::getALCTs
std::vector< CSCALCTDigi > getALCTs(unsigned nMaxALCTs=CSCConstants::MAX_ALCTS_READOUT) const
Definition: CSCAnodeLCTProcessor.cc:1314
CSCAnodeLCTProcessor::encodeHighMultiplicityBits
void encodeHighMultiplicityBits()
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCAnodeLCTProcessor::run
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:210
CSCAnodeLCTProcessor::MESelection
int MESelection
Definition: CSCAnodeLCTProcessor.h:113
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCAnodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCAnodeLCTProcessor.h:139
CSCAnodeLCTProcessor::showPatterns
void showPatterns(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1332
CSCAnodeLCTProcessor::trig_mode
unsigned int trig_mode
Definition: CSCAnodeLCTProcessor.h:133
CSCAnodeLCTProcessor::loadPatternMask
void loadPatternMask()
Definition: CSCAnodeLCTProcessor.cc:110
CSCAnodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:156
CSCAnodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:116
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig
static const unsigned int def_nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:161
CSCAnodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCAnodeLCTProcessor.h:158
CSCAnodeLCTProcessor::def_accel_mode
static const unsigned int def_accel_mode
Definition: CSCAnodeLCTProcessor.h:163
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCAnodeLCTProcessor::ALCT_WireInfo
ALCT_WireInfo
Definition: CSCAnodeLCTProcessor.h:206
CSCAnodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCAnodeLCTProcessor.cc:1182
CSCAnodeLCTProcessor::l1a_window_width
unsigned int l1a_window_width
Definition: CSCAnodeLCTProcessor.h:133
CSCDBL1TPParameters.h
CSCAnodeLCTProcessor::trigMode
void trigMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1100
CSCAnodeLCTProcessor::quality
int quality[CSCConstants::MAX_NUM_WIRES][3]
Definition: CSCAnodeLCTProcessor.h:117
CSCAnodeLCTProcessor::accel_mode
unsigned int accel_mode
Definition: CSCAnodeLCTProcessor.h:133
CSCAnodeLCTProcessor::preTrigger
bool preTrigger(const int key_wire, const int start_bx)
Definition: CSCAnodeLCTProcessor.cc:530
CSCAnodeLCTProcessor::lct_list
std::vector< CSCALCTDigi > lct_list
Definition: CSCAnodeLCTProcessor.h:121
CSCALCTDigi.h
CSCAnodeLCTProcessor::readoutALCTs
std::vector< CSCALCTDigi > readoutALCTs(int nMaxALCTs=CSCConstants::MAX_ALCTS_READOUT) const
Definition: CSCAnodeLCTProcessor.cc:1239
CSCAnodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:158
CSCAnodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:160
CSCAnodeLCTProcessor::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCAnodeLCTProcessor.cc:134
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:46
CSCAnodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCAnodeLCTProcessor.h:130
CSCConstants::MAX_ALCTS_READOUT
Definition: CSCConstants.h:73
CSCAnodeLCTProcessor::thePreTriggerDigis
std::vector< CSCALCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCAnodeLCTProcessor.h:123
CSCAnodeLCTProcessor::clear
void clear()
Definition: CSCAnodeLCTProcessor.cc:192
CSCAnodeLCTProcessor::secondALCT
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:103
CSCAnodeLCTProcessor::ghostCancellationLogic
virtual void ghostCancellationLogic()
Definition: CSCAnodeLCTProcessor.cc:742
edm::ParameterSet
Definition: ParameterSet.h:47
CSCAnodeLCTProcessor::CSCAnodeLCTProcessor
CSCAnodeLCTProcessor()
Definition: CSCAnodeLCTProcessor.cc:86
CSCAnodeLCTProcessor::ghostCancellationLogicOneWire
virtual void ghostCancellationLogicOneWire(const int key_wire, int *ghost_cleared)
Definition: CSCAnodeLCTProcessor.cc:816
CSCBaseboard
Definition: CSCBaseboard.h:15
CSCAnodeLCTProcessor::bestTrackSelector
std::vector< CSCALCTDigi > bestTrackSelector(const std::vector< CSCALCTDigi > &all_alcts)
Definition: CSCAnodeLCTProcessor.cc:960
CSCDetId
Definition: CSCDetId.h:26
CSCAnodeLCTProcessor::def_l1a_window_width
static const unsigned int def_l1a_window_width
Definition: CSCAnodeLCTProcessor.h:164
CSCAnodeLCTProcessor::INVALID_WIRE
Definition: CSCAnodeLCTProcessor.h:206
CSCAnodeLCTProcessor::use_corrected_bx
bool use_corrected_bx
Definition: CSCAnodeLCTProcessor.h:152
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCALCTPreTriggerDigi.h
CSCAnodeLCTProcessor::numWireGroups
int numWireGroups
Definition: CSCAnodeLCTProcessor.h:112
CSCAnodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const
Definition: CSCAnodeLCTProcessor.cc:1205
CSCAnodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:130
CSCAnodeLCTProcessor::ghost_cancellation_side_quality
bool ghost_cancellation_side_quality
Definition: CSCAnodeLCTProcessor.h:146
CSCAnodeLCTProcessor::accelMode
void accelMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1137
CSCPatternBank::LCTPatterns
std::vector< LCTPattern > LCTPatterns
Definition: CSCPatternBank.h:15
CSCAnodeLCTProcessor::isBetterALCT
bool isBetterALCT(const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT) const
Definition: CSCAnodeLCTProcessor.cc:1060
CSCAnodeLCTProcessor::ALCTContainer_
std::vector< std::vector< CSCALCTDigi > > ALCTContainer_
Definition: CSCAnodeLCTProcessor.h:106
CSCAnodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:160
CSCAnodeLCTProcessor::cleanWireContainer
void cleanWireContainer(CSCALCTDigi::WireContainer &wireHits) const
Definition: CSCAnodeLCTProcessor.cc:1371
CSCWireDigiCollection
CSCAnodeLCTProcessor::pulseExtension
bool pulseExtension(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
Definition: CSCAnodeLCTProcessor.cc:466
CSCAnodeLCTProcessor::getSecondALCT
CSCALCTDigi getSecondALCT(int bx) const
Definition: CSCAnodeLCTProcessor.cc:1327
CSCAnodeLCTProcessor::getHighMultiplictyBits
unsigned getHighMultiplictyBits() const
Definition: CSCAnodeLCTProcessor.h:92
CSCAnodeLCTProcessor::alct_pattern_
CSCPatternBank::LCTPatterns alct_pattern_
Definition: CSCAnodeLCTProcessor.h:170
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern
static const unsigned int def_nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:162
CSCAnodeLCTProcessor::first_bx
int first_bx[CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:115
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:163
CSCAnodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:119
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:597
CSCAnodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:131
CSCAnodeLCTProcessor
Definition: CSCAnodeLCTProcessor.h:46
CSCAnodeLCTProcessor::pulse
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:119
CSCWireDigiCollection.h
CSCAnodeLCTProcessor::preTriggerDigis
std::vector< CSCALCTPreTriggerDigi > preTriggerDigis() const
Definition: CSCAnodeLCTProcessor.h:85
genParticles_cff.map
map
Definition: genParticles_cff.py:11
CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
int ghost_cancellation_bx_depth
Definition: CSCAnodeLCTProcessor.h:142
CSCAnodeLCTProcessor::getDigis
bool getDigis(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:370
CSCAnodeLCTProcessor::getBestALCT
CSCALCTDigi getBestALCT(int bx) const
Definition: CSCAnodeLCTProcessor.cc:1325
CSCAnodeLCTProcessor::lctSearch
void lctSearch()
Definition: CSCAnodeLCTProcessor.cc:888
CSCAnodeLCTProcessor::bestALCT
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:100
CSCAnodeLCTProcessor::nplanes_hit_accel_pretrig
unsigned int nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:131
CSCAnodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCAnodeLCTProcessor.h:130
CSCAnodeLCTProcessor::digiV
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCAnodeLCTProcessor.h:118
CSCAnodeLCTProcessor::~CSCAnodeLCTProcessor
~CSCAnodeLCTProcessor() override=default
LCTQualityControl.h
CSCBaseboard.h