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 
42 
43 #include <vector>
44 
46 public:
49  unsigned station,
50  unsigned sector,
51  unsigned subsector,
52  unsigned chamber,
53  const edm::ParameterSet& conf);
54 
57 
59  void setConfigParameters(const CSCDBL1TPParameters* conf);
60 
62  void clear();
63 
64  // This is the main routine for normal running. It gets wire times
65  // from the wire digis and then passes them on to another run() function.
66  std::vector<CSCALCTDigi> run(const CSCWireDigiCollection* wiredc);
67 
68  // This version of the run() function can either be called in a standalone
69  // test, being passed the time array, or called by the run() function above.
70  // It gets wire times from an input array and then loops over the keywires.
71  // All found LCT candidates are sorted and the best two are retained.
72  void run(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
73 
75  std::vector<CSCALCTDigi> readoutALCTs(int nMaxALCTs = CSCConstants::MAX_ALCTS_READOUT) const;
76 
78  std::vector<CSCALCTDigi> getALCTs(unsigned nMaxALCTs = CSCConstants::MAX_ALCTS_READOUT) const;
79 
81  std::vector<CSCALCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
82 
84  CSCALCTDigi getBestALCT(int bx) const;
85  CSCALCTDigi getSecondALCT(int bx) const;
86 
87  /* encode special bits for high multiplicity triggers */
88  unsigned getHighMultiplictyBits() const { return highMultiplicityBits_; }
89 
90 protected:
97 
100 
102  std::vector<std::vector<CSCALCTDigi> > ALCTContainer_;
103 
105  bool getDigis(const CSCWireDigiCollection* wiredc);
106  void getDigis(const CSCWireDigiCollection* wiredc, const CSCDetId& id);
107 
110 
114  std::vector<CSCWireDigi> digiV[CSCConstants::NUM_LAYERS];
116 
117  std::vector<CSCALCTDigi> lct_list;
118 
119  std::vector<CSCALCTPreTriggerDigi> thePreTriggerDigis;
120 
121  /* data members for high multiplicity triggers */
123  unsigned int highMultiplicityBits_;
124 
130 
132  unsigned int hit_persist;
133 
136 
139 
143 
146 
149 
152 
154  static const unsigned int def_fifo_tbins, def_fifo_pretrig;
155  static const unsigned int def_drift_delay;
157  static const unsigned int def_nplanes_hit_accel_pretrig;
158  static const unsigned int def_nplanes_hit_accel_pattern;
159  static const unsigned int def_trig_mode, def_accel_mode;
160  static const unsigned int def_l1a_window_width;
161 
164 
166  void loadPatternMask();
167 
170 
172  void checkConfigParameters();
173 
175  void clear(const int wire, const int pattern);
176 
177  /* Gets wire times from the wire digis and fills wire[][] vector */
179 
180  /* A pulse array will be used as a bit representation of hit times.
181  For example: if a keywire has a bx_time of 3, then 1 shifted
182  left 3 will be bit pattern 0000000000001000. Bits are then added to
183  signify the duration of a signal (hit_persist, formerly bx_width). So
184  for the pulse with a hit_persist of 6 will look like 0000000111111000. */
185  bool pulseExtension(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]);
186 
187  /* Check that there are nplanes_hit_pretrig or more layers hit in collision
188  or accelerator patterns for a particular key_wire. If so, return
189  true and the PatternDetection process will start. */
190  bool preTrigger(const int key_wire, const int start_bx);
191 
192  /* See if there is a pattern that satisfies nplanes_hit_pattern number of
193  layers hit for either the accelerator or collision patterns. Use
194  the pattern with the best quality. */
195  bool patternDetection(const int key_wire);
196 
197  /* This function looks for LCTs on the previous and next wires. If one
198  exists and it has a better quality and a bx_time up to 4 clocks earlier
199  than the present, then the present LCT is cancelled. The present LCT
200  also gets cancelled if it has the same quality as the one on the
201  previous wire (this has not been done in 2003 test beam). The
202  cancellation is done separately for collision and accelerator patterns. */
203  virtual void ghostCancellationLogic();
204 
205  virtual void ghostCancellationLogicOneWire(const int key_wire, int* ghost_cleared);
206 
207  virtual int getTempALCTQuality(int temp_quality) const;
208 
209  void lctSearch();
210  /* Function which enables/disables either collision or accelerator tracks.
211  The function uses the trig_mode parameter to decide. */
212  void trigMode(const int key_wire);
213 
214  /* Function which gives a preference either to the collision patterns
215  or accelerator patterns. The function uses the accel_mode parameter
216  to decide. */
217  void accelMode(const int key_wire);
218 
219  /* Selects two collision and two accelerator ALCTs per time bin with
220  the best quality. */
221  std::vector<CSCALCTDigi> bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts);
222 
223  /* This method should have been an overloaded > operator, but we
224  have to keep it here since need to check values in quality[][]
225  array modified according to accel_mode parameter. */
226  bool isBetterALCT(const CSCALCTDigi& lhsALCT, const CSCALCTDigi& rhsALCT) const;
227 
229  void dumpConfigParams() const;
230 
232  void dumpDigis(const std::vector<int> wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const;
233 
234  // Check if the ALCT is valid
235  void checkValidReadout(const CSCALCTDigi& alct) const;
236  void checkValid(const CSCALCTDigi& alct, unsigned max_stubs = CSCConstants::MAX_ALCTS_PER_PROCESSOR) const;
237 
238  void showPatterns(const int key_wire);
239 };
240 
241 #endif
CSCConstants::MAX_NUM_WIRES
Definition: CSCConstants.h:22
CSCAnodeLCTProcessor::nplanes_hit_accel_pattern
unsigned int nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:128
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCAnodeLCTProcessor::narrow_mask_r1
bool narrow_mask_r1
Definition: CSCAnodeLCTProcessor.h:151
CSCAnodeLCTProcessor::patternDetection
bool patternDetection(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:586
CSCAnodeLCTProcessor::pretrig_extra_deadtime
unsigned int pretrig_extra_deadtime
Definition: CSCAnodeLCTProcessor.h:145
CSCAnodeLCTProcessor::readWireDigis
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
Definition: CSCAnodeLCTProcessor.cc:403
CSCAnodeLCTProcessor::highMultiplicityBits_
unsigned int highMultiplicityBits_
Definition: CSCAnodeLCTProcessor.h:123
CSCAnodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:128
CSCAnodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCAnodeLCTProcessor.h:155
CSCAnodeLCTProcessor::getTempALCTQuality
virtual int getTempALCTQuality(int temp_quality) const
Definition: CSCAnodeLCTProcessor.cc:1390
CSCAnodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCAnodeLCTProcessor.h:132
CSCConstants::MAX_ALCT_TBINS
Definition: CSCConstants.h:62
CSCAnodeLCTProcessor::getALCTs
std::vector< CSCALCTDigi > getALCTs(unsigned nMaxALCTs=CSCConstants::MAX_ALCTS_READOUT) const
Definition: CSCAnodeLCTProcessor.cc:1344
CSCAnodeLCTProcessor::encodeHighMultiplicityBits
void encodeHighMultiplicityBits()
relativeConstraints.station
station
Definition: relativeConstraints.py:67
CSCAnodeLCTProcessor::run
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:213
CSCAnodeLCTProcessor::MESelection
int MESelection
Definition: CSCAnodeLCTProcessor.h:109
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCAnodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCAnodeLCTProcessor.h:135
CSCAnodeLCTProcessor::showPatterns
void showPatterns(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1362
CSCAnodeLCTProcessor::trig_mode
unsigned int trig_mode
Definition: CSCAnodeLCTProcessor.h:129
CSCAnodeLCTProcessor::loadPatternMask
void loadPatternMask()
Definition: CSCAnodeLCTProcessor.cc:110
CSCConstants::NUM_ALCT_PATTERNS
Definition: CSCConstants.h:50
CSCAnodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:159
CSCAnodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:112
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pretrig
static const unsigned int def_nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:157
CSCAnodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCAnodeLCTProcessor.h:154
CSCAnodeLCTProcessor::def_accel_mode
static const unsigned int def_accel_mode
Definition: CSCAnodeLCTProcessor.h:159
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCAnodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCAnodeLCTProcessor.cc:1153
CSCAnodeLCTProcessor::l1a_window_width
unsigned int l1a_window_width
Definition: CSCAnodeLCTProcessor.h:129
CSCDBL1TPParameters.h
CSCAnodeLCTProcessor::trigMode
void trigMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1071
CSCAnodeLCTProcessor::quality
int quality[CSCConstants::MAX_NUM_WIRES][3]
Definition: CSCAnodeLCTProcessor.h:113
CSCAnodeLCTProcessor::accel_mode
unsigned int accel_mode
Definition: CSCAnodeLCTProcessor.h:129
CSCAnodeLCTProcessor::preTrigger
bool preTrigger(const int key_wire, const int start_bx)
Definition: CSCAnodeLCTProcessor.cc:523
CSCAnodeLCTProcessor::lct_list
std::vector< CSCALCTDigi > lct_list
Definition: CSCAnodeLCTProcessor.h:117
CSCALCTDigi.h
CSCAnodeLCTProcessor::readoutALCTs
std::vector< CSCALCTDigi > readoutALCTs(int nMaxALCTs=CSCConstants::MAX_ALCTS_READOUT) const
Definition: CSCAnodeLCTProcessor.cc:1270
CSCAnodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:154
CSCAnodeLCTProcessor::pattern_mask
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
Definition: CSCAnodeLCTProcessor.h:163
CSCConstants::MAX_WIRES_IN_PATTERN
Definition: CSCConstants.h:54
CSCAnodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCAnodeLCTProcessor.h:156
CSCAnodeLCTProcessor::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCAnodeLCTProcessor.cc:136
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:46
CSCAnodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCAnodeLCTProcessor.h:126
CSCConstants::MAX_ALCTS_READOUT
Definition: CSCConstants.h:71
CSCAnodeLCTProcessor::thePreTriggerDigis
std::vector< CSCALCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCAnodeLCTProcessor.h:119
CSCAnodeLCTProcessor::clear
void clear()
Definition: CSCAnodeLCTProcessor.cc:195
CSCAnodeLCTProcessor::secondALCT
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:99
CSCAnodeLCTProcessor::ghostCancellationLogic
virtual void ghostCancellationLogic()
Definition: CSCAnodeLCTProcessor.cc:713
edm::ParameterSet
Definition: ParameterSet.h:36
CSCAnodeLCTProcessor::CSCAnodeLCTProcessor
CSCAnodeLCTProcessor()
Definition: CSCAnodeLCTProcessor.cc:85
CSCAnodeLCTProcessor::ghostCancellationLogicOneWire
virtual void ghostCancellationLogicOneWire(const int key_wire, int *ghost_cleared)
Definition: CSCAnodeLCTProcessor.cc:787
CSCConstants::MAX_ALCTS_PER_PROCESSOR
Definition: CSCConstants.h:70
CSCBaseboard
Definition: CSCBaseboard.h:15
CSCAnodeLCTProcessor::checkValidReadout
void checkValidReadout(const CSCALCTDigi &alct) const
Definition: CSCAnodeLCTProcessor.cc:1210
CSCAnodeLCTProcessor::bestTrackSelector
std::vector< CSCALCTDigi > bestTrackSelector(const std::vector< CSCALCTDigi > &all_alcts)
Definition: CSCAnodeLCTProcessor.cc:931
CSCDetId
Definition: CSCDetId.h:26
CSCAnodeLCTProcessor::def_l1a_window_width
static const unsigned int def_l1a_window_width
Definition: CSCAnodeLCTProcessor.h:160
CSCAnodeLCTProcessor::checkValid
void checkValid(const CSCALCTDigi &alct, unsigned max_stubs=CSCConstants::MAX_ALCTS_PER_PROCESSOR) const
Definition: CSCAnodeLCTProcessor.cc:1215
CSCAnodeLCTProcessor::use_corrected_bx
bool use_corrected_bx
Definition: CSCAnodeLCTProcessor.h:148
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
CSCALCTPreTriggerDigi.h
CSCAnodeLCTProcessor::numWireGroups
int numWireGroups
Definition: CSCAnodeLCTProcessor.h:108
CSCAnodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const
Definition: CSCAnodeLCTProcessor.cc:1177
CSCAnodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCAnodeLCTProcessor.h:126
CSCAnodeLCTProcessor::ghost_cancellation_side_quality
bool ghost_cancellation_side_quality
Definition: CSCAnodeLCTProcessor.h:142
CSCAnodeLCTProcessor::accelMode
void accelMode(const int key_wire)
Definition: CSCAnodeLCTProcessor.cc:1108
CSCAnodeLCTProcessor::isBetterALCT
bool isBetterALCT(const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT) const
Definition: CSCAnodeLCTProcessor.cc:1031
CSCAnodeLCTProcessor::ALCTContainer_
std::vector< std::vector< CSCALCTDigi > > ALCTContainer_
Definition: CSCAnodeLCTProcessor.h:102
CSCAnodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:156
CSCWireDigiCollection
CSCAnodeLCTProcessor::pulseExtension
bool pulseExtension(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
Definition: CSCAnodeLCTProcessor.cc:459
CSCAnodeLCTProcessor::getSecondALCT
CSCALCTDigi getSecondALCT(int bx) const
Definition: CSCAnodeLCTProcessor.cc:1357
CSCAnodeLCTProcessor::getHighMultiplictyBits
unsigned getHighMultiplictyBits() const
Definition: CSCAnodeLCTProcessor.h:88
CSCALCTDigi
Definition: CSCALCTDigi.h:16
CSCAnodeLCTProcessor::def_nplanes_hit_accel_pattern
static const unsigned int def_nplanes_hit_accel_pattern
Definition: CSCAnodeLCTProcessor.h:158
CSCAnodeLCTProcessor::first_bx
int first_bx[CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:111
CSCAnodeLCTProcessor::def_trig_mode
static const unsigned int def_trig_mode
Definition: CSCAnodeLCTProcessor.h:159
CSCAnodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCAnodeLCTProcessor.cc:121
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCAnodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCAnodeLCTProcessor.h:127
CSCAnodeLCTProcessor
Definition: CSCAnodeLCTProcessor.h:45
CSCAnodeLCTProcessor::pulse
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
Definition: CSCAnodeLCTProcessor.h:115
CSCWireDigiCollection.h
CSCAnodeLCTProcessor::preTriggerDigis
std::vector< CSCALCTPreTriggerDigi > preTriggerDigis() const
Definition: CSCAnodeLCTProcessor.h:81
CSCAnodeLCTProcessor::ghost_cancellation_bx_depth
int ghost_cancellation_bx_depth
Definition: CSCAnodeLCTProcessor.h:138
CSCAnodeLCTProcessor::getDigis
bool getDigis(const CSCWireDigiCollection *wiredc)
Definition: CSCAnodeLCTProcessor.cc:363
CSCAnodeLCTProcessor::getBestALCT
CSCALCTDigi getBestALCT(int bx) const
Definition: CSCAnodeLCTProcessor.cc:1355
CSCAnodeLCTProcessor::lctSearch
void lctSearch()
Definition: CSCAnodeLCTProcessor.cc:859
CSCAnodeLCTProcessor::bestALCT
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
Definition: CSCAnodeLCTProcessor.h:96
CSCAnodeLCTProcessor::nplanes_hit_accel_pretrig
unsigned int nplanes_hit_accel_pretrig
Definition: CSCAnodeLCTProcessor.h:127
CSCAnodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCAnodeLCTProcessor.h:126
CSCAnodeLCTProcessor::digiV
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCAnodeLCTProcessor.h:114
CSCBaseboard.h