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;
153 alct->setConfigParameters(conf);
154 clct->setConfigParameters(conf);
155 clct1a->setConfigParameters(conf);
168 <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
184 int used_alct_mask[20], used_alct_mask_1a[20];
185 int used_clct_mask[20], used_clct_mask_1a[20];
186 for (
int b=0;
b<20;
b++)
187 used_alct_mask[
b] = used_alct_mask_1a[
b] = used_clct_mask[
b] = used_clct_mask_1a[
b] = 0;
193 if (
clct->bestCLCT[bx_clct].isValid())
197 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
201 if (
alct->bestALCT[bx_alct].isValid())
204 <<
"Successful CLCT-ALCT match in ME1b: bx_clct = " << bx_clct
205 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
206 <<
"]; bx_alct = " << bx_alct;
207 int mbx = bx_alct_stop - bx_alct;
209 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
211 if (
allLCTs1b[bx_alct][mbx][0].isValid())
213 used_alct_mask[bx_alct] += 1;
221 if (
clct1a->bestCLCT[bx_clct].isValid())
225 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
229 if (
alct->bestALCT[bx_alct].isValid())
232 <<
"Successful CLCT-ALCT match in ME1a: bx_clct = " << bx_clct
233 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
234 <<
"]; bx_alct = " << bx_alct;
235 int mbx = bx_alct_stop - bx_alct;
239 if (
allLCTs1a[bx_alct][mbx][0].isValid())
241 used_alct_mask_1a[bx_alct] += 1;
254 if (
alct->bestALCT[bx_alct].isValid())
260 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
262 if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS)
continue;
264 if (
clct->bestCLCT[bx_clct].isValid())
267 <<
"Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
268 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
269 <<
"]; bx_clct = " << bx_clct;
270 int mbx = bx_clct-bx_clct_start;
272 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
274 if (
allLCTs1b[bx_alct][mbx][0].isValid())
276 used_clct_mask[bx_clct] += 1;
283 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
285 if (bx_clct < 0 || bx_clct >= CSCConstants::MAX_CLCT_TBINS)
continue;
287 if (
clct1a->bestCLCT[bx_clct].isValid())
290 <<
"Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
291 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
292 <<
"]; bx_clct = " << bx_clct;
293 int mbx = bx_clct-bx_clct_start;
297 if (
allLCTs1a[bx_alct][mbx][0].isValid())
299 used_clct_mask_1a[bx_clct] += 1;
311 unsigned int n1a=0, n1b=0;
315 int cbx = bx + mbx - match_trig_window_size/2;
327 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
348 if (
infoV > 0)
LogDebug(
"CSCMotherboard") <<
"After x-bx sorting:";
353 int cbx = bx + mbx - match_trig_window_size/2;
365 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
373 unsigned int nLCT=n1b;
383 if (
infoV > 0 && nLCT>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
410 std::vector<CSCCorrelatedLCTDigi> tmpV;
427 std::vector<CSCCorrelatedLCTDigi> all_lcts;
430 std::vector <CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
431 for (; plct != all_lcts.end(); plct++)
433 if (!plct->isValid())
continue;
435 int bx = (*plct).getBX();
440 if (bx > late_tbins)
continue;
447 tmpV.push_back(*plct);
448 if (bx_readout == -1) bx_readout = bx;
450 else tmpV.push_back(*plct);
459 std::vector<CSCCorrelatedLCTDigi> tmpV;
471 std::vector<CSCCorrelatedLCTDigi> tmpV;
528 if (secondALCT == bestALCT) secondALCT.
clear();
529 if (secondCLCT == bestCLCT) secondCLCT.
clear();
535 int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
541 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"debug correlateLCTs in "<<did<<std::endl
542 <<
"ALCT1: "<<bestALCT<<std::endl
543 <<
"ALCT2: "<<secondALCT<<std::endl
544 <<
"CLCT1: "<<bestCLCT<<std::endl
545 <<
"CLCT2: "<<secondCLCT<<std::endl
546 <<
"ok 11 12 21 22 code = "<<ok11<<
" "<<ok12<<
" "<<ok21<<
" "<<ok22<<
" "<<code<<std::endl;
548 if ( code==0 )
return;
572 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lut 0 1 = "<<lut[code][0]<<
" "<<lut[code][1]<<std::endl;
574 switch (lut[code][0]) {
591 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct1: "<<lct1<<std::endl;
593 switch (lut[code][1])
598 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
603 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
608 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
612 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 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()
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]
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
CSCCorrelatedLCTDigi allLCTs1b[CSCConstants::MAX_LCT_TBINS][15][2]
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
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT, int type) const
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)