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 
41 
42 #include <vector>
43 
45 public:
48  unsigned station,
49  unsigned sector,
50  unsigned subsector,
51  unsigned chamber,
52  const edm::ParameterSet& conf);
53 
55  ~CSCCathodeLCTProcessor() override = default;
56 
58  void setConfigParameters(const CSCDBL1TPParameters* conf);
59 
61  void clear();
62 
65  std::vector<CSCCLCTDigi> run(const CSCComparatorDigiCollection* compdc);
66 
69  void run(const std::vector<int> halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]);
70 
72  std::vector<CSCCLCTDigi> readoutCLCTs() const;
73 
75  std::vector<CSCCLCTDigi> getCLCTs() const;
76 
79  CSCCLCTDigi getBestCLCT(int bx) const;
80  CSCCLCTDigi getSecondCLCT(int bx) const;
81 
82  std::vector<int> preTriggerBXs() const { return thePreTriggerBXs; }
83 
85  std::vector<CSCCLCTPreTriggerDigi> preTriggerDigis() const { return thePreTriggerDigis; }
86 
87  /* get special bits for high multiplicity triggers */
88  unsigned getInTimeHMT() const { return inTimeHMT_; }
89  unsigned getOutTimeHMT() const { return outTimeHMT_; }
90 
91 protected:
94 
97 
99  bool getDigis(const CSCComparatorDigiCollection* compdc);
100  void getDigis(const CSCComparatorDigiCollection* compdc, const CSCDetId& id);
101 
104 
106  void checkConfigParameters();
107 
108  //---------------- Methods common to all firmware versions ------------------
109  // Single-argument version for TMB07 (halfstrip-only) firmware.
110  // Takes the comparator & time info and stuffs it into halfstrip vector.
111  // Multiple hits on the same strip are allowed.
112  void readComparatorDigis(
114  void pulseExtension(
116 
117  //--------------- Functions for post-2007 version of the firmware -----------
118  virtual std::vector<CSCCLCTDigi> findLCTs(
120 
121  /* Check all half-strip pattern envelopes simultaneously, on every clock cycle, for a matching pattern
122  Returns true if a pretrigger was found, and the first BX of the pretrigger */
123  virtual bool preTrigger(const int start_bx, int& first_bx);
124 
125  /* For a given clock cycle, check each half-strip if a pattern matches
126  This function determines best_pid_ and nhits_ for each half-strip */
127  bool patternFinding(const unsigned int bx_time,
128  std::map<int, std::map<int, CSCCLCTDigi::ComparatorContainer> >& hits_in_patterns);
129 
130  void cleanComparatorContainer(CSCCLCTDigi& lct) const;
131 
132  /* Mark the half-strips around the best half-strip as busy */
133  void markBusyKeys(const int best_hstrip,
134  const int best_patid,
136 
137  // build a new CLCT trigger
138  CSCCLCTDigi constructCLCT(const int bx,
139  const unsigned halfstrip_withstagger,
141 
142  // build a new CLCT pretrigger
143  CSCCLCTPreTriggerDigi constructPreCLCT(const int bx, const unsigned halfstrip, const unsigned index) const;
144 
145  // resets ispretrig_
146  void clearPreTriggers();
147  //--------------------------- Auxiliary methods -----------------------------
149  void dumpConfigParams() const;
150 
152  void dumpDigis(
154 
155  //--------------------------- Member variables -----------------------------
156 
158 
159  /* best pattern Id for a given half-strip */
161 
162  /* number of layers hit on a given half-strip */
164 
165  /* does a given half-strip have a pre-trigger? */
167 
168  // actual LUT used
170 
171  /* number of strips used in this processor */
175 
176  /* Is the layer in the chamber staggered? */
178 
179  std::vector<CSCComparatorDigi> digiV[CSCConstants::NUM_LAYERS];
180  std::vector<int> thePreTriggerBXs;
181  std::vector<CSCCLCTPreTriggerDigi> thePreTriggerDigis;
182 
183  /* data members for high multiplicity triggers */
186  unsigned inTimeHMT_;
187  unsigned outTimeHMT_;
188  std::vector<unsigned> thresholds_;
193 
195  unsigned int fifo_tbins, fifo_pretrig; // only for test beam mode.
196  unsigned int hit_persist, drift_delay;
199  unsigned int tmb_l1a_window_size;
200 
203 
206 
209 
211  static const unsigned int def_fifo_tbins, def_fifo_pretrig;
212  static const unsigned int def_hit_persist, def_drift_delay;
213  static const unsigned int def_nplanes_hit_pretrig;
214  static const unsigned int def_nplanes_hit_pattern;
215  static const unsigned int def_pid_thresh_pretrig, def_min_separation;
216  static const unsigned int def_tmb_l1a_window_size;
217 
218  /* quality control */
219  std::unique_ptr<LCTQualityControl> qualityControl_;
220 
221  /* comparator-code lookup table algorithm */
222  std::unique_ptr<ComparatorCodeLUT> cclut_;
223 };
224 
225 #endif
CSCDBL1TPParameters
Definition: CSCDBL1TPParameters.h:14
CSCCathodeLCTProcessor::qualityControl_
std::unique_ptr< LCTQualityControl > qualityControl_
Definition: CSCCathodeLCTProcessor.h:219
CSCCathodeLCTProcessor::markBusyKeys
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:908
CSCCathodeLCTProcessor::showerMaxInTBin_
unsigned showerMaxInTBin_
Definition: CSCCathodeLCTProcessor.h:190
CSCCathodeLCTProcessor::nhits
unsigned int nhits[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]
Definition: CSCCathodeLCTProcessor.h:163
CSCCathodeLCTProcessor::findLCTs
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:528
CSCCathodeLCTProcessor::numStrips_
int numStrips_
Definition: CSCCathodeLCTProcessor.h:172
CSCCathodeLCTProcessor::stagger
int stagger[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:177
CSCCathodeLCTProcessor::getSecondCLCT
CSCCLCTDigi getSecondCLCT(int bx) const
Definition: CSCCathodeLCTProcessor.cc:1168
CSCCathodeLCTProcessor
Definition: CSCCathodeLCTProcessor.h:44
CSCCathodeLCTProcessor::getOutTimeHMT
unsigned getOutTimeHMT() const
Definition: CSCCathodeLCTProcessor.h:89
CSCCathodeLCTProcessor::getCLCTs
std::vector< CSCCLCTDigi > getCLCTs() const
Definition: CSCCathodeLCTProcessor.cc:1146
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
CSCCathodeLCTProcessor::showerMinInTBin_
unsigned showerMinInTBin_
Definition: CSCCathodeLCTProcessor.h:189
CSCCathodeLCTProcessor::outTimeHMT_
unsigned outTimeHMT_
Definition: CSCCathodeLCTProcessor.h:187
CSCCathodeLCTProcessor::dumpConfigParams
void dumpConfigParams() const
Definition: CSCCathodeLCTProcessor.cc:994
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:195
CSCCathodeLCTProcessor::showerMinOutTBin_
unsigned showerMinOutTBin_
Definition: CSCCathodeLCTProcessor.h:191
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
protons_cff.time
time
Definition: protons_cff.py:35
CSCCathodeLCTProcessor::getDigis
bool getDigis(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:387
CSCCathodeLCTProcessor::def_nplanes_hit_pattern
static const unsigned int def_nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:214
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCathodeLCTProcessor::def_drift_delay
static const unsigned int def_drift_delay
Definition: CSCCathodeLCTProcessor.h:212
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCCathodeLCTProcessor::early_tbins
int early_tbins
Definition: CSCCathodeLCTProcessor.h:205
CSCCathodeLCTProcessor::ispretrig_
bool ispretrig_[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]
Definition: CSCCathodeLCTProcessor.h:166
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
CSCCathodeLCTProcessor::setConfigParameters
void setConfigParameters(const CSCDBL1TPParameters *conf)
Definition: CSCCathodeLCTProcessor.cc:123
CSCCathodeLCTProcessor::def_fifo_tbins
static const unsigned int def_fifo_tbins
Definition: CSCCathodeLCTProcessor.h:211
CSCCathodeLCTProcessor::best_pid
unsigned int best_pid[CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]
Definition: CSCCathodeLCTProcessor.h:160
CSCCathodeLCTProcessor::thePreTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
Definition: CSCCathodeLCTProcessor.h:181
CSCCathodeLCTProcessor::readout_earliest_2
bool readout_earliest_2
Definition: CSCCathodeLCTProcessor.h:208
CSCCathodeLCTProcessor::CSCCathodeLCTProcessor
CSCCathodeLCTProcessor(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
Definition: CSCCathodeLCTProcessor.cc:21
CSCCathodeLCTProcessor::getBestCLCT
CSCCLCTDigi getBestCLCT(int bx) const
Definition: CSCCathodeLCTProcessor.cc:1162
CSCCathodeLCTProcessor::cclut_
std::unique_ptr< ComparatorCodeLUT > cclut_
Definition: CSCCathodeLCTProcessor.h:222
CSCCathodeLCTProcessor::dumpDigis
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER]) const
Definition: CSCCathodeLCTProcessor.cc:1013
CSCCathodeLCTProcessor::readoutCLCTs
std::vector< CSCCLCTDigi > readoutCLCTs() const
Definition: CSCCathodeLCTProcessor.cc:1054
CSCCathodeLCTProcessor::bestCLCT
CSCCLCTDigi bestCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:93
CSCCathodeLCTProcessor::numHalfStrips_
int numHalfStrips_
Definition: CSCCathodeLCTProcessor.h:174
CSCConstants::NUM_LAYERS
Definition: CSCConstants.h:103
PulseArray.h
CSCCathodeLCTProcessor::showerMaxOutTBin_
unsigned showerMaxOutTBin_
Definition: CSCCathodeLCTProcessor.h:192
CSCCLCTPreTriggerDigi
Definition: CSCCLCTPreTriggerDigi.h:15
CSCCathodeLCTProcessor::thePreTriggerBXs
std::vector< int > thePreTriggerBXs
Definition: CSCCathodeLCTProcessor.h:180
CSCCathodeLCTProcessor::def_fifo_pretrig
static const unsigned int def_fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:211
CSCCathodeLCTProcessor::def_hit_persist
static const unsigned int def_hit_persist
Definition: CSCCathodeLCTProcessor.h:212
CSCCathodeLCTProcessor::preTrigger
virtual bool preTrigger(const int start_bx, int &first_bx)
Definition: CSCCathodeLCTProcessor.cc:742
CSCLUTReader.h
CSCCathodeLCTProcessor::inTimeHMT_
unsigned inTimeHMT_
Definition: CSCCathodeLCTProcessor.h:186
CSCCathodeLCTProcessor::def_min_separation
static const unsigned int def_min_separation
Definition: CSCCathodeLCTProcessor.h:215
CSCCathodeLCTProcessor::run
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
Definition: CSCCathodeLCTProcessor.cc:184
CSCCathodeLCTProcessor::readComparatorDigis
void readComparatorDigis(std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:436
CSCCLCTDigi::ComparatorContainer
std::vector< std::vector< uint16_t > > ComparatorContainer
Definition: CSCCLCTDigi.h:19
edm::ParameterSet
Definition: ParameterSet.h:47
CSCCathodeLCTProcessor::preTriggerDigis
std::vector< CSCCLCTPreTriggerDigi > preTriggerDigis() const
Definition: CSCCathodeLCTProcessor.h:85
CSCCathodeLCTProcessor::constructCLCT
CSCCLCTDigi constructCLCT(const int bx, const unsigned halfstrip_withstagger, const CSCCLCTDigi::ComparatorContainer &hits)
Definition: CSCCathodeLCTProcessor.cc:921
CSCCathodeLCTProcessor::preTriggerBXs
std::vector< int > preTriggerBXs() const
Definition: CSCCathodeLCTProcessor.h:82
PulseArray
Definition: PulseArray.h:11
CSCBaseboard
Definition: CSCBaseboard.h:14
CSCCathodeLCTProcessor::secondCLCT
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS]
Definition: CSCCathodeLCTProcessor.h:96
CSCCathodeLCTProcessor::digiV
std::vector< CSCComparatorDigi > digiV[CSCConstants::NUM_LAYERS]
Definition: CSCCathodeLCTProcessor.h:179
CSCDetId
Definition: CSCDetId.h:26
CSCCathodeLCTProcessor::cleanComparatorContainer
void cleanComparatorContainer(CSCCLCTDigi &lct) const
Definition: CSCCathodeLCTProcessor.cc:980
CSCCathodeLCTProcessor::patternFinding
bool patternFinding(const unsigned int bx_time, std::map< int, std::map< int, CSCCLCTDigi::ComparatorContainer > > &hits_in_patterns)
Definition: CSCCathodeLCTProcessor.cc:801
CSCCathodeLCTProcessor::def_pid_thresh_pretrig
static const unsigned int def_pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:215
CSCCathodeLCTProcessor::tmb_l1a_window_size
unsigned int tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:199
CSCCathodeLCTProcessor::thresholds_
std::vector< unsigned > thresholds_
Definition: CSCCathodeLCTProcessor.h:188
CSCComparatorDigiCollection
CSCCathodeLCTProcessor::def_nplanes_hit_pretrig
static const unsigned int def_nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:213
CSCCathodeLCTProcessor::constructPreCLCT
CSCCLCTPreTriggerDigi constructPreCLCT(const int bx, const unsigned halfstrip, const unsigned index) const
Definition: CSCCathodeLCTProcessor.cc:965
CSCCLCTPreTriggerDigi.h
CSCCathodeLCTProcessor::hit_persist
unsigned int hit_persist
Definition: CSCCathodeLCTProcessor.h:196
CSCCathodeLCTProcessor::encodeHighMultiplicityBits
void encodeHighMultiplicityBits(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:1174
CSCPatternBank::LCTPatterns
std::vector< LCTPattern > LCTPatterns
Definition: CSCPatternBank.h:15
CSCCathodeLCTProcessor::pid_thresh_pretrig
unsigned int pid_thresh_pretrig
Definition: CSCCathodeLCTProcessor.h:198
CSCCathodeLCTProcessor::clear
void clear()
Definition: CSCCathodeLCTProcessor.cc:173
CSCCathodeLCTProcessor::setDefaultConfigParameters
void setDefaultConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:109
CSCCathodeLCTProcessor::def_tmb_l1a_window_size
static const unsigned int def_tmb_l1a_window_size
Definition: CSCCathodeLCTProcessor.h:216
CSCCathodeLCTProcessor::fifo_pretrig
unsigned int fifo_pretrig
Definition: CSCCathodeLCTProcessor.h:195
CSCCathodeLCTProcessor::start_bx_shift
int start_bx_shift
Definition: CSCCathodeLCTProcessor.h:202
CSCCathodeLCTProcessor::~CSCCathodeLCTProcessor
~CSCCathodeLCTProcessor() override=default
CSCCathodeLCTProcessor::nplanes_hit_pretrig
unsigned int nplanes_hit_pretrig
Definition: CSCCathodeLCTProcessor.h:197
CSCCLCTDigi.h
CSCConstants::MAX_CLCT_TBINS
Definition: CSCConstants.h:126
CSCCathodeLCTProcessor::numCFEBs_
int numCFEBs_
Definition: CSCCathodeLCTProcessor.h:173
CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER
Definition: CSCConstants.h:74
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCComparatorDigiCollection.h
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
CSCCathodeLCTProcessor::min_separation
unsigned int min_separation
Definition: CSCCathodeLCTProcessor.h:198
genParticles_cff.map
map
Definition: genParticles_cff.py:11
CSCCathodeLCTProcessor::clearPreTriggers
void clearPreTriggers()
Definition: CSCCathodeLCTProcessor.cc:974
ComparatorCodeLUT.h
CSCCathodeLCTProcessor::getInTimeHMT
unsigned getInTimeHMT() const
Definition: CSCCathodeLCTProcessor.h:88
CSCCathodeLCTProcessor::checkConfigParameters
void checkConfigParameters()
Definition: CSCCathodeLCTProcessor.cc:143
CSCCathodeLCTProcessor::drift_delay
unsigned int drift_delay
Definition: CSCCathodeLCTProcessor.h:196
CSCCathodeLCTProcessor::nplanes_hit_pattern
unsigned int nplanes_hit_pattern
Definition: CSCCathodeLCTProcessor.h:197
CSCCathodeLCTProcessor::pulseExtension
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_HALF_STRIPS_RUN2_TRIGGER])
Definition: CSCCathodeLCTProcessor.cc:701
CSCCathodeLCTProcessor::clct_pattern_
CSCPatternBank::LCTPatterns clct_pattern_
Definition: CSCCathodeLCTProcessor.h:169
LCTQualityControl.h
CSCBaseboard.h
CSCCathodeLCTProcessor::pulse_
PulseArray pulse_
Definition: CSCCathodeLCTProcessor.h:157