23 {0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
24 {0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
25 {0, 95},{0, 95},{0, 77},{0, 61},{0, 39},
26 {0, 22},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
27 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
28 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
29 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
30 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
31 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
32 {-1,-1},{-1,-1},{-1,-1} };
35 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
36 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
37 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
38 {0, 22},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
39 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
40 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
41 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
42 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
43 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
44 {-1,-1},{-1,-1},{-1,-1} };
50 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
51 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
52 {100, 127},{73, 127},{47, 127},{22, 127},{0, 127},
53 {0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
54 {0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
55 {0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
56 {0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
57 {0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
58 {0, 127},{0, 127},{0, 127},{0, 127},{0, 105},
59 {0, 93},{0, 78},{0, 63} };
63 unsigned sector,
unsigned subsector,
76 <<
"+++ Upgrade CSCMotherboardME11 constructed while isSLHC is not set! +++\n";
77 if (!smartME1aME1b)
edm::LogError(
"L1CSCTPEmulatorConfigError")
78 <<
"+++ Upgrade CSCMotherboardME11 constructed while smartME1aME1b is not set! +++\n";
92 clct_to_alct = tmbParams.getParameter<
bool>(
"clctToAlct");
101 max_me11_lcts = tmbParams.getParameter<
unsigned int>(
"maxME11LCTs");
106 pref[
m-1] = pref[0] -
m/2;
107 pref[
m] = pref[0] +
m/2;
151 alct->setConfigParameters(conf);
152 clct->setConfigParameters(conf);
153 clct1a->setConfigParameters(conf);
166 <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
182 int used_alct_mask[20], used_alct_mask_1a[20];
183 int used_clct_mask[20], used_clct_mask_1a[20];
184 for (
int b=0;
b<20;
b++)
185 used_alct_mask[
b] = used_alct_mask_1a[
b] = used_clct_mask[
b] = used_clct_mask_1a[
b] = 0;
191 if (
clct->bestCLCT[bx_clct].isValid())
195 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
199 if (
alct->bestALCT[bx_alct].isValid())
202 <<
"Successful CLCT-ALCT match in ME1b: bx_clct = " << bx_clct
203 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
204 <<
"]; bx_alct = " << bx_alct;
205 int mbx = bx_alct_stop - bx_alct;
207 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
209 if (
allLCTs1b[bx_alct][mbx][0].isValid())
211 used_alct_mask[bx_alct] += 1;
219 if (
clct1a->bestCLCT[bx_clct].isValid())
223 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
227 if (
alct->bestALCT[bx_alct].isValid())
230 <<
"Successful CLCT-ALCT match in ME1a: bx_clct = " << bx_clct
231 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
232 <<
"]; bx_alct = " << bx_alct;
233 int mbx = bx_alct_stop - bx_alct;
237 if (
allLCTs1a[bx_alct][mbx][0].isValid())
239 used_alct_mask_1a[bx_alct] += 1;
252 if (
alct->bestALCT[bx_alct].isValid())
258 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
260 if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS)
continue;
262 if (
clct->bestCLCT[bx_clct].isValid())
265 <<
"Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
266 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
267 <<
"]; bx_clct = " << bx_clct;
268 int mbx = bx_clct-bx_clct_start;
270 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
272 if (
allLCTs1b[bx_alct][mbx][0].isValid())
274 used_clct_mask[bx_clct] += 1;
281 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
283 if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS)
continue;
285 if (
clct1a->bestCLCT[bx_clct].isValid())
288 <<
"Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
289 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
290 <<
"]; bx_clct = " << bx_clct;
291 int mbx = bx_clct-bx_clct_start;
295 if (
allLCTs1a[bx_alct][mbx][0].isValid())
297 used_clct_mask_1a[bx_clct] += 1;
309 unsigned int n1a=0, n1b=0;
313 int cbx = bx + mbx - match_trig_window_size/2;
325 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
346 if (
infoV > 0)
LogDebug(
"CSCMotherboard") <<
"After x-bx sorting:";
351 int cbx = bx + mbx - match_trig_window_size/2;
363 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
371 unsigned int nLCT=n1b;
381 if (
infoV > 0 && nLCT>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
408 std::vector<CSCCorrelatedLCTDigi> tmpV;
425 std::vector<CSCCorrelatedLCTDigi> all_lcts;
428 std::vector <CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
429 for (; plct != all_lcts.end(); plct++)
431 if (!plct->isValid())
continue;
433 int bx = (*plct).getBX();
438 if (bx > late_tbins)
continue;
445 tmpV.push_back(*plct);
446 if (bx_readout == -1) bx_readout = bx;
448 else tmpV.push_back(*plct);
457 std::vector<CSCCorrelatedLCTDigi> tmpV;
469 std::vector<CSCCorrelatedLCTDigi> tmpV;
530 if (secondALCT == bestALCT) secondALCT.
clear();
531 if (secondCLCT == bestCLCT) secondCLCT.
clear();
537 int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
543 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"debug correlateLCTs in "<<did<<std::endl
544 <<
"ALCT1: "<<bestALCT<<std::endl
545 <<
"ALCT2: "<<secondALCT<<std::endl
546 <<
"CLCT1: "<<bestCLCT<<std::endl
547 <<
"CLCT2: "<<secondCLCT<<std::endl
548 <<
"ok 11 12 21 22 code = "<<ok11<<
" "<<ok12<<
" "<<ok21<<
" "<<ok22<<
" "<<code<<std::endl;
550 if ( code==0 )
return;
574 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lut 0 1 = "<<lut[code][0]<<
" "<<lut[code][1]<<std::endl;
576 switch (lut[code][0]) {
592 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct1: "<<lct1<<std::endl;
594 switch (lut[code][1])
598 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
602 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
606 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
610 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"out of correlateLCTs"<<std::endl;
T getParameter(std::string const &) const
CSCCorrelatedLCTDigi allLCTs1a[CSCConstants::MAX_LCT_TBINS][15][2]
std::vector< CSCCLCTDigi > clctV1a
void correlateLCTs(const CSCALCTDigi &bestALCT, const CSCALCTDigi &secondALCT, const CSCCLCTDigi &bestCLCT, const CSCCLCTDigi &secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me) const
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
void setConfigParameters(const CSCDBL1TPParameters *conf)
unsigned int match_trig_window_size
std::vector< CSCCorrelatedLCTDigi > getLCTs1a() const
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
unsigned int max_me11_lcts
unsigned int alctClctOffset
void clear()
clear this ALCT
static const int lut_wg_vs_hs_me1a[48][2]
const CSCGeometry * csc_g
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
unsigned int mpc_block_me1a
unsigned int tmb_cross_bx_algo
const unsigned theStation
std::vector< CSCALCTDigi > alctV
const unsigned theSubsector
~CSCMotherboardME11() override
unsigned int tmb_l1a_window_size
bool isValid() const
check CLCT validity (1 - valid CLCT)
int pref[CSCConstants::MAX_LCT_TBINS]
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type, int trknmb) const
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a() const
static const int lut_wg_vs_hs_me1b[48][2]
static const int lut_wg_vs_hs_me1ag[48][2]
bool match_earliest_clct_me11_only
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b() const
bool doesALCTCrossCLCT(const CSCALCTDigi &a, const CSCCLCTDigi &c, int me) const
CSCCorrelatedLCTDigi allLCTs1b[CSCConstants::MAX_LCT_TBINS][15][2]
std::vector< CSCCorrelatedLCTDigi > getLCTs1b() const
std::vector< CSCCLCTDigi > clctV1b
std::unique_ptr< CSCAnodeLCTProcessor > alct
std::unique_ptr< CSCCathodeLCTProcessor > clct
void clear()
clear this CLCT
bool match_earliest_alct_me11_only
int getKeyWG() const
return key wire group
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs() const