15 <<
"+++ Upgrade CSCUpgradeCathodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
32 <<
"+++ Upgrade CSCUpgradeCathodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
49 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
50 <<
"....................PreTrigger, SLHC version with localized dead time zone...........................";
57 bool pre_trig =
false;
61 for (
unsigned int bx_time = start_bx; bx_time <
fifo_tbins; bx_time++) {
71 if (
nhits[hstrip] > 0) {
72 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
73 <<
" bx = " << std::setw(2) << bx_time <<
" --->" 74 <<
" halfstrip = " << std::setw(3) << hstrip <<
" best pid = " << std::setw(2) <<
best_pid[hstrip]
75 <<
" nhits = " <<
nhits[hstrip];
90 1,
nhits[hstrip], best_pid[hstrip], 1, bend, halfstrip, cfeb, bx_time, nPreTriggers, 0));
96 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
97 <<
" halfstrip " << std::setw(3) << hstrip <<
" in dead zone and is pretriggerred";
107 int min_hstrip = hstrip - delta_hs;
108 int max_hstrip = hstrip + delta_hs;
111 if (max_hstrip >= nStrips)
112 max_hstrip = nStrips - 1;
113 for (
int hs = min_hstrip; hs <= max_hstrip; hs++)
114 busyMap[hs][bx_time + 1] =
true;
116 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
117 <<
" marked zone around pretriggerred halfstrip " << hstrip <<
" as dead zone for pretriggering at bx" 118 << bx_time + 1 <<
" halfstrip: [" << min_hstrip <<
"," << max_hstrip <<
"]";
134 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
"no pretrigger, returning \n";
147 std::vector<CSCCLCTDigi> lctList;
150 const int maxHalfStrips = 2 *
numStrips + 1;
167 std::vector<CSCCLCTDigi> lctListBX;
181 while (start_bx < stop_bx) {
192 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
193 <<
"..... pretrigger at bx = " << first_bx <<
"; waiting drift delay .....";
197 bool hits_in_time =
patternFinding(pulse, maxHalfStrips, latch_bx);
201 if (
nhits[hstrip] > 0) {
202 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
203 <<
" bx = " << std::setw(2) << latch_bx <<
" --->" 204 <<
" halfstrip = " << std::setw(3) << hstrip <<
" best pid = " << std::setw(2) <<
best_pid[hstrip]
205 <<
" nhits = " <<
nhits[hstrip];
218 best_halfstrip[ilct] = -1;
219 best_quality[ilct] = 0;
230 pretrig_zone[hstrip] =
false;
237 if (max_hs > CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1)
238 max_hs = CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1;
239 for (
int hs = min_hs; hs <= max_hs; hs++)
240 pretrig_zone[hs] =
true;
242 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
243 <<
" marked pretrigger halfstrip zone [" << min_hs <<
"," << max_hs <<
"]";
249 quality[hstrip] = (
best_pid[hstrip] & 14) | (
nhits[hstrip] << 5);
253 if (quality[hstrip] > best_quality[0] && pretrig_zone[hstrip] && !
busyMap[hstrip][first_bx])
256 best_halfstrip[0] = hstrip;
257 best_quality[0] = quality[hstrip];
259 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
260 <<
" 1st CLCT: halfstrip = " << std::setw(3) << hstrip <<
" quality = " << std::setw(3)
261 << quality[hstrip] <<
" best halfstrip = " << std::setw(3) << best_halfstrip[0]
262 <<
" best quality = " << std::setw(3) << best_quality[0];
269 if (best_halfstrip[0] >= 0) {
274 if (quality[hstrip] > best_quality[1] && pretrig_zone[hstrip] && !
busyMap[hstrip][first_bx])
277 best_halfstrip[1] = hstrip;
278 best_quality[1] = quality[hstrip];
280 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
281 <<
" 2nd CLCT: halfstrip = " << std::setw(3) << hstrip <<
" quality = " << std::setw(3)
282 << quality[hstrip] <<
" best halfstrip = " << std::setw(3) << best_halfstrip[1]
283 <<
" best quality = " << std::setw(3) << best_quality[1];
291 int best_hs = best_halfstrip[ilct];
309 int halfstrip_in_cfeb = keystrip_data[ilct][
CLCT_STRIP] -
313 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
314 <<
" Final selection: ilct " << ilct <<
" key halfstrip " << keystrip_data[ilct][
CLCT_STRIP]
315 <<
" quality " << keystrip_data[ilct][
CLCT_QUALITY] <<
" pattern " 327 lctList.push_back(thisLCT);
328 lctListBX.push_back(thisLCT);
336 start_bx = first_bx + 1;
T getParameter(std::string const &) const
void dumpDigis(const std::vector< int > strip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips) const
bool patternFinding(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, const unsigned int bx_time)
unsigned int nplanes_hit_pretrig
bool ispretrig[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
virtual std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
int first_bx_corrected[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
bool busyMap[CSCConstants::NUM_HALF_STRIPS_7CFEBS][CSCConstants::MAX_CLCT_TBINS]
virtual bool preTrigger(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int start_bx, int &first_bx)
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
bool use_dead_time_zoning
unsigned int best_pid[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
void markBusyKeys(const int best_hstrip, const int best_patid, int quality[CSCConstants::NUM_HALF_STRIPS_7CFEBS])
std::vector< CSCCLCTDigi > findLCTs(const std::vector< int > halfstrip[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS]) override
edm::ParameterSet clctParams_
std::vector< CSCCLCTPreTriggerDigi > thePreTriggerDigis
unsigned int nplanes_hit_pattern
bool preTrigger(const unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int start_bx, int &first_bx) override
double pulse(double x, double y, double z, double t)
int stagger[CSCConstants::NUM_LAYERS]
void setFullBX(const uint16_t fullbx)
Set 12-bit full BX.
unsigned int nhits[CSCConstants::NUM_HALF_STRIPS_7CFEBS]
CSCUpgradeCathodeLCTProcessor()
unsigned int clct_state_machine_zone
void pulseExtension(const std::vector< int > time[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS], const int nStrips, unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS_7CFEBS])
unsigned int pid_thresh_pretrig
unsigned int pretrig_trig_zone
static const int clct_pattern[CSCConstants::NUM_CLCT_PATTERNS][CSCConstants::MAX_HALFSTRIPS_IN_PATTERN+2]
bool dynamic_state_machine_zone