CMS 3D CMS Logo

CSCCathodeLCTProcessor.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_CSCCathodeLCTProcessor_h
2 #define L1Trigger_CSCTriggerPrimitives_CSCCathodeLCTProcessor_h
3 
37 
38 #include <vector>
39 
41 public:
44  unsigned station,
45  unsigned sector,
46  unsigned subsector,
47  unsigned chamber,
48  const edm::ParameterSet& conf);
49 
52 
54  void setConfigParameters(const CSCDBL1TPParameters* conf);
55 
57  void clear();
58 
61  std::vector<CSCCLCTDigi> run(const CSCComparatorDigiCollection* compdc);
62 
65  void run(const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
66 
68  std::vector<CSCCLCTDigi> readoutCLCTs(int nMaxCLCTs = CSCConstants::MAX_CLCTS_READOUT) const;
69  std::vector<CSCCLCTDigi> readoutCLCTsME1a(int nMaxCLCTs = CSCConstants::MAX_CLCTS_READOUT) const;
70  std::vector<CSCCLCTDigi> readoutCLCTsME1b(int nMaxCLCTs = CSCConstants::MAX_CLCTS_READOUT) const;
71 
73  std::vector<CSCCLCTDigi> getCLCTs(unsigned nMaxCLCTs = CSCConstants::MAX_CLCTS_PER_PROCESSOR) const;
74 
77  CSCCLCTDigi getBestCLCT(int bx) const;
78  CSCCLCTDigi getSecondCLCT(int bx) const;
79 
80  std::vector<int> preTriggerBXs() const { return thePreTriggerBXs; }
81 
83  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
84  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1a() const;
85  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1b() const;
86 
87 protected:
90 
93 
95  bool getDigis(const CSCComparatorDigiCollection* compdc);
96  void getDigis(const CSCComparatorDigiCollection* compdc, const CSCDetId& id);
97 
100 
102  void checkConfigParameters();
103 
105 
106  //---------------- Methods common to all firmware versions ------------------
107  // Single-argument version for TMB07 (halfstrip-only) firmware.
108  // Takes the comparator & time info and stuffs it into halfstrip vector.
109  // Multiple hits on the same strip are allowed.
112  const int nStrips,
113  PulseArray pulse);
114 
115  //--------------- Functions for post-2007 version of the firmware -----------
116  virtual std::vector<CSCCLCTDigi> findLCTs(
117  const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
118 
119  /* Check all half-strip pattern envelopes simultaneously, on every clock cycle, for a matching pattern */
120  virtual bool preTrigger(const PulseArray pulse, const int start_bx, int& first_bx);
121 
122  /* For a given clock cycle, check each half-strip if a pattern matches */
123  bool patternFinding(const PulseArray pulse,
124  const int nStrips,
125  const unsigned int bx_time,
126  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer> >& hits_in_patterns);
127 
128  // enum used in the comparator code logic
130 
132 
133  /* Mark the half-strips around the best half-strip as busy */
134  void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS]);
135 
136  //--------------------------- Auxiliary methods -----------------------------
138  void dumpConfigParams() const;
139 
142  const int nStrips) const;
143 
144  // Check if the CLCT is valid
145  void checkValid(const CSCCLCTDigi& lct, unsigned max_stubs = CSCConstants::MAX_CLCTS_PER_PROCESSOR) const;
146 
147  //--------------------------- Member variables -----------------------------
148 
149  /* best pattern Id for a given half-strip */
151 
152  /* number of layers hit on a given half-strip */
154 
156 
157  /* does a given half-strip have a pre-trigger? */
159 
160  // actual LUT used
162 
163  // we use these next ones to address the various bits inside the array that's
164  // used to make the cathode LCTs.
174  };
175 
176  /* number of strips used in this processor */
178 
179  /* Is the layer in the chamber staggered? */
181 
182  std::vector<CSCComparatorDigi> digiV[CSCConstants::NUM_LAYERS];
183  std::vector<int> thePreTriggerBXs;
184  std::vector<CSCCLCTPreTriggerDigi> thePreTriggerDigis;
185 
187  unsigned int fifo_tbins, fifo_pretrig; // only for test beam mode.
188  unsigned int hit_persist, drift_delay;
191  unsigned int tmb_l1a_window_size;
192 
195 
198 
201 
202  // Use the new patterns according to the comparator code format
205 
206  // which hits per CLCT?
208 
210  static const unsigned int def_fifo_tbins, def_fifo_pretrig;
211  static const unsigned int def_hit_persist, def_drift_delay;
212  static const unsigned int def_nplanes_hit_pretrig;
213  static const unsigned int def_nplanes_hit_pattern;
214  static const unsigned int def_pid_thresh_pretrig, def_min_separation;
215  static const unsigned int def_tmb_l1a_window_size;
216 };
217 
218 #endif
CSCPatternBank::CLCTPatterns
std::vector< std::vector< std::vector< int > > > CLCTPatterns
Definition: CSCPatternBank.h:13
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCCathodeLCTProcessor::markBusyKeys
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:990
CSCCathodeLCTProcessor::stagger
int stagger[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:180
CSCCathodeLCTProcessor::getSecondCLCT
CSCCLCTDigi getSecondCLCT(int bx) const
Definition: CSCCathodeLCTProcessor.cc:1338
CSCCathodeLCTProcessor
Definition: CSCCathodeLCTProcessor.h:40
CSCCathodeLCTProcessor::hitsCLCT
PulseArray hitsCLCT[99]
Definition: CSCCathodeLCTProcessor.h:207
CSCCathodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCCathodeLCTProcessor.cc:1015
relativeConstraints.station
station
Definition: relativeConstraints.py:67
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCCathodeLCTProcessor::fifo_tbins
unsigned int fifo_tbins
Definition: CSCCathodeLCTProcessor.h:187
CSCCathodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
Definition: CSCCathodeLCTProcessor.cc:1034
pulse
double pulse(double x, double y, double z, double t)
Definition: SiStripPulseShape.cc:49
CSCCathodeLCTProcessor::readComparatorDigis
void readComparatorDigis(std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:431
CSCCathodeLCTProcessor::use_comparator_codes_
bool use_comparator_codes_
Definition: CSCCathodeLCTProcessor.h:204
CSCCathodeLCTProcessor::readoutCLCTs
std::vector< CSCCLCTDigi > readoutCLCTs(int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
Definition: CSCCathodeLCTProcessor.cc:1181
CSCCathodeLCTProcessor::CLCT_PATTERN
Definition: CSCCathodeLCTProcessor.h:166
CSCCathodeLCTProcessor::getDigis
bool getDigis(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:382
CSCCathodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:213
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCathodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCCathodeLCTProcessor.h:211
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:67
CSCCathodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCCathodeLCTProcessor.h:197
CSCCathodeLCTProcessor::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCCathodeLCTProcessor.cc:136
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
CSCCathodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCCathodeLCTProcessor.h:210
CSCCathodeLCTProcessor::thePreTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCCathodeLCTProcessor.h:184
CSCCathodeLCTProcessor::readout_earliest_2
bool readout_earliest_2
Definition: CSCCathodeLCTProcessor.h:200
CSCCathodeLCTProcessor::INVALID_HALFSTRIP
Definition: CSCCathodeLCTProcessor.h:129
CSCCathodeLCTProcessor::checkValid
void checkValid(const CSCCLCTDigi &lct, unsigned max_stubs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
Definition: CSCCathodeLCTProcessor.cc:1075
CSCCathodeLCTProcessor::getBestCLCT
CSCCLCTDigi getBestCLCT(int bx) const
Definition: CSCCathodeLCTProcessor.cc:1332
CSCCathodeLCTProcessor::pulseExtension
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, PulseArray pulse)
Definition: CSCCathodeLCTProcessor.cc:735
CSCCathodeLCTProcessor::ispretrig
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:158
CSCCathodeLCTProcessor::bestCLCT
CSCCLCTDigi bestCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:89
CSCCathodeLCTProcessor::findLCTs
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
Definition: CSCCathodeLCTProcessor.cc:523
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:46
CSCCathodeLCTProcessor::first_bx_corrected
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:155
CSCCathodeLCTProcessor::thePreTriggerBXs
std::vector< int > thePreTriggerBXs
Definition: CSCCathodeLCTProcessor.h:183
CSCCathodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:210
CSCCathodeLCTProcessor::def_hit_persist
static const unsigned int def_hit_persist
Definition: CSCCathodeLCTProcessor.h:211
CSCCathodeLCTProcessor::use_run3_patterns_
bool use_run3_patterns_
Definition: CSCCathodeLCTProcessor.h:203
CSCCathodeLCTProcessor::preTrigger
virtual bool preTrigger(const PulseArray pulse, const int start_bx, int &first_bx)
Definition: CSCCathodeLCTProcessor.cc:781
CSCCathodeLCTProcessor::nhits
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:153
CSCCathodeLCTProcessor::def_min_separation
static const unsigned int def_min_separation
Definition: CSCCathodeLCTProcessor.h:214
CSCCathodeLCTProcessor::numStrips
int numStrips
Definition: CSCCathodeLCTProcessor.h:177
CSCCathodeLCTProcessor::CLCT_CFEB
Definition: CSCCathodeLCTProcessor.h:172
CSCCathodeLCTProcessor::run
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:195
CSCCathodeLCTProcessor::CLCT_STRIP
Definition: CSCCathodeLCTProcessor.h:168
CSCCLCTDigi::ComparatorContainer
std::vector< std::vector< uint16_t > > ComparatorContainer
Definition: CSCCLCTDigi.h:19
edm::ParameterSet
Definition: ParameterSet.h:36
CSCCathodeLCTProcessor::preTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigis() const
Definition: CSCCathodeLCTProcessor.h:83
CSCCathodeLCTProcessor::preTriggerBXs
std::vector< int > preTriggerBXs() const
Definition: CSCCathodeLCTProcessor.h:80
CSCCathodeLCTProcessor::CLCT_BEND
Definition: CSCCathodeLCTProcessor.h:167
CSCBaseboard
Definition: CSCBaseboard.h:15
CSCCathodeLCTProcessor::CLCT_QUALITY
Definition: CSCCathodeLCTProcessor.h:171
CSCCathodeLCTProcessor::secondCLCT
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:92
CSCCathodeLCTProcessor::digiV
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:182
CSCDetId
Definition: CSCDetId.h:26
CSCCathodeLCTProcessor::CLCT_INDICES
CLCT_INDICES
Definition: CSCCathodeLCTProcessor.h:165
CSCCathodeLCTProcessor::def_pid_thresh_pretrig
static const unsigned int def_pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:214
CSCCathodeLCTProcessor::tmb_l1a_window_size
unsigned int tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:191
CSCCathodeLCTProcessor::readoutCLCTsME1a
std::vector< CSCCLCTDigi > readoutCLCTsME1a(int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
Definition: CSCCathodeLCTProcessor.cc:1269
CSCComparatorDigiCollection
CSCCathodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:212
CSCCLCTPreTriggerDigi.h
CSCCathodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCCathodeLCTProcessor.h:188
CSCCathodeLCTProcessor::pid_thresh_pretrig
unsigned int pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:190
CSCCathodeLCTProcessor::PulseArray
unsigned int PulseArray[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:104
CSCCathodeLCTProcessor::readoutCLCTsME1b
std::vector< CSCCLCTDigi > readoutCLCTsME1b(int nMaxCLCTs=CSCConstants::MAX_CLCTS_READOUT) const
Definition: CSCCathodeLCTProcessor.cc:1282
CSCCathodeLCTProcessor::clear
void clear()
Definition: CSCCathodeLCTProcessor.cc:186
CSCCathodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:122
me0TriggerPseudoDigis_cff.nStrips
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
Definition: me0TriggerPseudoDigis_cff.py:26
CSCCathodeLCTProcessor::preTriggerDigisME1b
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigisME1b() const
Definition: CSCCathodeLCTProcessor.cc:1304
CSCCathodeLCTProcessor::def_tmb_l1a_window_size
static const unsigned int def_tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:215
CSCCathodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:187
CSCCathodeLCTProcessor::best_pid
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
Definition: CSCCathodeLCTProcessor.h:150
CSCConstants::MAX_CLCTS_READOUT
Definition: CSCConstants.h:68
CSCCathodeLCTProcessor::CLCT_CompCode
CLCT_CompCode
Definition: CSCCathodeLCTProcessor.h:129
CSCCathodeLCTProcessor::start_bx_shift
int start_bx_shift
Definition: CSCCathodeLCTProcessor.h:194
CSCCathodeLCTProcessor::preTriggerDigisME1a
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigisME1a() const
Definition: CSCCathodeLCTProcessor.cc:1293
CSCCathodeLCTProcessor::clct_pattern_
CSCPatternBank::CLCTPatterns clct_pattern_
Definition: CSCCathodeLCTProcessor.h:161
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
CSCCathodeLCTProcessor::CSCCathodeLCTProcessor
CSCCathodeLCTProcessor()
Definition: CSCCathodeLCTProcessor.cc:91
CSCCathodeLCTProcessor::patternFinding
bool patternFinding(const PulseArray pulse, const int nStrips, const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
Definition: CSCCathodeLCTProcessor.cc:843
CSCCathodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:189
CSCCLCTDigi.h
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:61
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCComparatorDigiCollection.h
CSCConstants::NUM_HALF_STRIPS_7CFEBS
Definition: CSCConstants.h:28
CSCCathodeLCTProcessor::min_separation
unsigned int min_separation
Definition: CSCCathodeLCTProcessor.h:190
genParticles_cff.map
map
Definition: genParticles_cff.py:11
ntuplemaker.time
time
Definition: ntuplemaker.py:310
CSCCathodeLCTProcessor::getCLCTs
std::vector< CSCCLCTDigi > getCLCTs(unsigned nMaxCLCTs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
Definition: CSCCathodeLCTProcessor.cc:1316
CSCCathodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:156
CSCCathodeLCTProcessor::CLCT_STRIP_TYPE
Definition: CSCCathodeLCTProcessor.h:170
CSCCathodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCCathodeLCTProcessor.h:188
CSCCathodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:189
CSCCathodeLCTProcessor::CLCT_BX
Definition: CSCCathodeLCTProcessor.h:169
CSCCathodeLCTProcessor::cleanComparatorContainer
void cleanComparatorContainer(CSCCLCTDigi::ComparatorContainer &compHits) const
Definition: CSCCathodeLCTProcessor.cc:1003
CSCBaseboard.h
CSCCathodeLCTProcessor::CLCT_NUM_QUANTITIES
Definition: CSCCathodeLCTProcessor.h:173