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;
142 for (
int i=0;
i<2;
i++)
153 alct->setConfigParameters(conf);
154 clct->setConfigParameters(conf);
155 clct1a->setConfigParameters(conf);
168 <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
180 int used_alct_mask[20], used_alct_mask_1a[20];
181 int used_clct_mask[20], used_clct_mask_1a[20];
182 for (
int b=0;
b<20;
b++)
183 used_alct_mask[
b] = used_alct_mask_1a[
b] = used_clct_mask[
b] = used_clct_mask_1a[
b] = 0;
189 if (
clct->bestCLCT[bx_clct].isValid())
193 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
197 if (
alct->bestALCT[bx_alct].isValid())
200 <<
"Successful CLCT-ALCT match in ME1b: bx_clct = " << bx_clct
201 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
202 <<
"]; bx_alct = " << bx_alct;
203 int mbx = bx_alct_stop - bx_alct;
205 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
207 if (
allLCTs1b[bx_alct][mbx][0].isValid())
209 used_alct_mask[bx_alct] += 1;
217 if (
clct1a->bestCLCT[bx_clct].isValid())
221 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
225 if (
alct->bestALCT[bx_alct].isValid())
228 <<
"Successful CLCT-ALCT match in ME1a: bx_clct = " << bx_clct
229 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
230 <<
"]; bx_alct = " << bx_alct;
231 int mbx = bx_alct_stop - bx_alct;
235 if (
allLCTs1a[bx_alct][mbx][0].isValid())
237 used_alct_mask_1a[bx_alct] += 1;
250 if (
alct->bestALCT[bx_alct].isValid())
256 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
258 if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
260 if (
clct->bestCLCT[bx_clct].isValid())
263 <<
"Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
264 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
265 <<
"]; bx_clct = " << bx_clct;
266 int mbx = bx_clct-bx_clct_start;
268 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
270 if (
allLCTs1b[bx_alct][mbx][0].isValid())
272 used_clct_mask[bx_clct] += 1;
279 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
281 if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
283 if (
clct1a->bestCLCT[bx_clct].isValid())
286 <<
"Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
287 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
288 <<
"]; bx_clct = " << bx_clct;
289 int mbx = bx_clct-bx_clct_start;
293 if (
allLCTs1a[bx_alct][mbx][0].isValid())
295 used_clct_mask_1a[bx_clct] += 1;
307 unsigned int n1a=0, n1b=0;
309 for (
int i=0;
i<2;
i++)
311 int cbx = bx + mbx - match_trig_window_size/2;
323 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
330 for (
int i=0;
i<2;
i++)
344 if (
infoV > 0)
LogDebug(
"CSCMotherboard") <<
"After x-bx sorting:";
347 for (
int i=0;
i<2;
i++)
349 int cbx = bx + mbx - match_trig_window_size/2;
361 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
369 unsigned int nLCT=n1b;
373 for (
int i=0;
i<2;
i++)
379 if (
infoV > 0 && nLCT>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
406 std::vector<CSCCorrelatedLCTDigi> tmpV;
423 std::vector<CSCCorrelatedLCTDigi> all_lcts;
426 std::vector <CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
427 for (; plct != all_lcts.end(); plct++)
429 if (!plct->isValid())
continue;
431 int bx = (*plct).getBX();
436 if (bx > late_tbins)
continue;
443 tmpV.push_back(*plct);
444 if (bx_readout == -1) bx_readout = bx;
446 else tmpV.push_back(*plct);
455 std::vector<CSCCorrelatedLCTDigi> tmpV;
459 for (
int i=0;
i<2;
i++)
467 std::vector<CSCCorrelatedLCTDigi> tmpV;
475 for (
int i=0;
i<2;
i++)
524 if (secondALCT == bestALCT) secondALCT.
clear();
525 if (secondCLCT == bestCLCT) secondCLCT.
clear();
531 int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
537 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"debug correlateLCTs in "<<did<<std::endl
538 <<
"ALCT1: "<<bestALCT<<std::endl
539 <<
"ALCT2: "<<secondALCT<<std::endl
540 <<
"CLCT1: "<<bestCLCT<<std::endl
541 <<
"CLCT2: "<<secondCLCT<<std::endl
542 <<
"ok 11 12 21 22 code = "<<ok11<<
" "<<ok12<<
" "<<ok21<<
" "<<ok22<<
" "<<code<<std::endl;
544 if ( code==0 )
return;
568 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lut 0 1 = "<<lut[code][0]<<
" "<<lut[code][1]<<std::endl;
570 switch (lut[code][0]) {
587 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct1: "<<lct1<<std::endl;
589 switch (lut[code][1])
594 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
599 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
604 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
608 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"out of correlateLCTs"<<std::endl;
T getParameter(std::string const &) const
std::vector< CSCCLCTDigi > clctV1a
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs()
unsigned int match_trig_window_size
const unsigned theTrigChamber
bool isValid() const
check ALCT validity (1 - valid ALCT)
unsigned int max_me11_lcts
void clear()
clear this ALCT
static const int lut_wg_vs_hs_me1a[48][2]
std::vector< CSCCorrelatedLCTDigi > getLCTs1b()
std::unique_ptr< CSCCathodeLCTProcessor > clct1a
unsigned int mpc_block_me1a
unsigned int tmb_cross_bx_algo
CSCCorrelatedLCTDigi allLCTs1a[MAX_LCT_BINS][15][2]
const unsigned theStation
std::vector< CSCALCTDigi > alctV
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int)
const unsigned theSubsector
~CSCMotherboardME11() override
unsigned int tmb_l1a_window_size
bool isValid() const
check CLCT validity (1 - valid CLCT)
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 > getLCTs1a()
std::vector< CSCCLCTDigi > clctV1b
std::unique_ptr< CSCAnodeLCTProcessor > alct
bool doesALCTCrossCLCT(CSCALCTDigi &a, CSCCLCTDigi &c, int me)
std::unique_ptr< CSCCathodeLCTProcessor > clct
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b()
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 > readoutLCTs1a()
void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2, int me)