15 <<
"+++ Upgrade CSCUpgradeCathodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
33 <<
"+++ Upgrade CSCUpgradeCathodeLCTProcessor constructed while isSLHC_ is not set! +++\n";
44 const int start_bx,
int& first_bx)
51 <<
"....................PreTrigger, SLHC version with localized dead time zone...........................";
58 bool pre_trig =
false;
62 for (
unsigned int bx_time = start_bx; bx_time <
fifo_tbins; bx_time++) {
71 hstrip < nStrips; hstrip++) {
73 if (
nhits[hstrip] > 0) {
74 LogTrace(
"CSCUpgradeCathodeLCTProcessor")
75 <<
" bx = " << std::setw(2) << bx_time <<
" --->" 76 <<
" halfstrip = " << std::setw(3) << hstrip
77 <<
" best pid = " << std::setw(2) <<
best_pid[hstrip]
78 <<
" nhits = " <<
nhits[hstrip];
94 1, bend, halfstrip, cfeb, bx_time, nPreTriggers, 0));
100 <<
" halfstrip "<< std::setw(3) << hstrip <<
" in dead zone and is pretriggerred";
109 hstrip < nStrips; hstrip++) {
112 int min_hstrip = hstrip - delta_hs;
113 int max_hstrip = hstrip + delta_hs;
116 if (max_hstrip >= nStrips)
117 max_hstrip = nStrips-1;
118 for (
int hs = min_hstrip; hs <= max_hstrip; hs++)
121 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
" marked zone around pretriggerred halfstrip " << hstrip <<
" as dead zone for pretriggering at bx" 122 << bx_time+1 <<
" halfstrip: [" << min_hstrip <<
"," << max_hstrip <<
"]";
131 hstrip < nStrips; hstrip++){
139 "no pretrigger, returning \n";
145 std::vector<CSCCLCTDigi>
153 std::vector<CSCCLCTDigi> lctList;
157 const int maxHalfStrips = 2 *
numStrips + 1;
161 hstrip < maxHalfStrips; hstrip++){
174 std::vector<CSCCLCTDigi> lctListBX;
188 while (start_bx < stop_bx)
201 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
"..... pretrigger at bx = " << first_bx <<
"; waiting drift delay .....";
205 bool hits_in_time =
patternFinding(pulse, maxHalfStrips, latch_bx);
212 if (
nhits[hstrip] > 0)
214 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
" bx = " << std::setw(2) << latch_bx <<
" --->" <<
" halfstrip = " 215 << std::setw(3) << hstrip <<
" best pid = " << std::setw(2) <<
best_pid[hstrip] <<
" nhits = " <<
nhits[hstrip];
229 best_halfstrip[ilct] = -1;
230 best_quality[ilct] = 0;
242 pretrig_zone[hstrip] =
false;
251 if (max_hs > CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1)
252 max_hs = CSCConstants::NUM_HALF_STRIPS_7CFEBS - 1;
253 for (
int hs = min_hs; hs <= max_hs; hs++)
254 pretrig_zone[hs] =
true;
256 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
" marked pretrigger halfstrip zone [" << min_hs <<
"," << max_hs <<
"]";
263 quality[hstrip] = (
best_pid[hstrip] & 14) | (
nhits[hstrip] << 5);
267 if (quality[hstrip] > best_quality[0] &&
268 pretrig_zone[hstrip] &&
272 best_halfstrip[0] = hstrip;
273 best_quality[0] = quality[hstrip];
276 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
" 1st CLCT: halfstrip = " << std::setw(3) << hstrip <<
" quality = " 277 << std::setw(3) << quality[hstrip] <<
" best halfstrip = " << std::setw(3) << best_halfstrip[0]
278 <<
" best quality = " << std::setw(3) << best_quality[0];
285 if (best_halfstrip[0] >= 0)
292 if (quality[hstrip] > best_quality[1] &&
293 pretrig_zone[hstrip] &&
297 best_halfstrip[1] = hstrip;
298 best_quality[1] = quality[hstrip];
301 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
" 2nd CLCT: halfstrip = " << std::setw(3) << hstrip <<
" quality = " 302 << std::setw(3) << quality[hstrip] <<
" best halfstrip = " << std::setw(3) << best_halfstrip[1]
303 <<
" best quality = " << std::setw(3) << best_quality[1];
312 int best_hs = best_halfstrip[ilct];
326 keystrip_data[ilct][
CLCT_BX] = bx;
333 LogTrace(
"CSCUpgradeCathodeLCTProcessor") <<
" Final selection: ilct " << ilct <<
" key halfstrip " 341 lctList.push_back(thisLCT);
342 lctListBX.push_back(thisLCT);
350 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)
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])
static const int pattern2007[CSCConstants::NUM_CLCT_PATTERNS][CSCConstants::MAX_HALFSTRIPS_IN_PATTERN+2]
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
bool dynamic_state_machine_zone