24 {0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
25 {0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
26 {0, 95},{0, 95},{0, 77},{0, 61},{0, 39},
27 {0, 22},{-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},{-1,-1},{-1,-1},
33 {-1,-1},{-1,-1},{-1,-1} };
36 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
37 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
38 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
39 {0, 22},{-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},{-1,-1},{-1,-1},
45 {-1,-1},{-1,-1},{-1,-1} };
51 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
52 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
53 {100, 127},{73, 127},{47, 127},{22, 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, 127},
59 {0, 127},{0, 127},{0, 127},{0, 127},{0, 105},
60 {0, 93},{0, 78},{0, 63} };
64 unsigned sector,
unsigned subsector,
77 <<
"+++ Upgrade CSCMotherboardME11 constructed while isSLHC is not set! +++\n";
78 if (!smartME1aME1b)
edm::LogError(
"L1CSCTPEmulatorConfigError")
79 <<
"+++ Upgrade CSCMotherboardME11 constructed while smartME1aME1b is not set! +++\n";
93 clct_to_alct = tmbParams.getParameter<
bool>(
"clctToAlct");
102 max_me11_lcts = tmbParams.getParameter<
unsigned int>(
"maxME11LCTs");
107 pref[
m-1] = pref[0] -
m/2;
108 pref[
m] = pref[0] +
m/2;
143 for (
int i=0;
i<2;
i++)
154 alct->setConfigParameters(conf);
155 clct->setConfigParameters(conf);
156 clct1a->setConfigParameters(conf);
169 <<
"+++ run() called for non-existing ALCT/CLCT processor! +++ \n";
181 int used_alct_mask[20], used_alct_mask_1a[20];
182 int used_clct_mask[20], used_clct_mask_1a[20];
183 for (
int b=0;
b<20;
b++)
184 used_alct_mask[
b] = used_alct_mask_1a[
b] = used_clct_mask[
b] = used_clct_mask_1a[
b] = 0;
190 if (
clct->bestCLCT[bx_clct].isValid())
194 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
198 if (
alct->bestALCT[bx_alct].isValid())
201 <<
"Successful CLCT-ALCT match in ME1b: bx_clct = " << bx_clct
202 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
203 <<
"]; bx_alct = " << bx_alct;
204 int mbx = bx_alct_stop - bx_alct;
206 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
208 if (
allLCTs1b[bx_alct][mbx][0].isValid())
210 used_alct_mask[bx_alct] += 1;
218 if (
clct1a->bestCLCT[bx_clct].isValid())
222 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
226 if (
alct->bestALCT[bx_alct].isValid())
229 <<
"Successful CLCT-ALCT match in ME1a: bx_clct = " << bx_clct
230 <<
"; match window: [" << bx_alct_start <<
"; " << bx_alct_stop
231 <<
"]; bx_alct = " << bx_alct;
232 int mbx = bx_alct_stop - bx_alct;
236 if (
allLCTs1a[bx_alct][mbx][0].isValid())
238 used_alct_mask_1a[bx_alct] += 1;
251 if (
alct->bestALCT[bx_alct].isValid())
257 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
259 if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
261 if (
clct->bestCLCT[bx_clct].isValid())
264 <<
"Successful ALCT-CLCT match in ME1b: bx_alct = " << bx_alct
265 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
266 <<
"]; bx_clct = " << bx_clct;
267 int mbx = bx_clct-bx_clct_start;
269 clct->bestCLCT[bx_clct],
clct->secondCLCT[bx_clct],
271 if (
allLCTs1b[bx_alct][mbx][0].isValid())
273 used_clct_mask[bx_clct] += 1;
280 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
282 if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
284 if (
clct1a->bestCLCT[bx_clct].isValid())
287 <<
"Successful ALCT-CLCT match in ME1a: bx_alct = " << bx_alct
288 <<
"; match window: [" << bx_clct_start <<
"; " << bx_clct_stop
289 <<
"]; bx_clct = " << bx_clct;
290 int mbx = bx_clct-bx_clct_start;
294 if (
allLCTs1a[bx_alct][mbx][0].isValid())
296 used_clct_mask_1a[bx_clct] += 1;
308 unsigned int n1a=0, n1b=0;
310 for (
int i=0;
i<2;
i++)
312 int cbx = bx + mbx - match_trig_window_size/2;
324 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
331 for (
int i=0;
i<2;
i++)
345 if (
infoV > 0)
LogDebug(
"CSCMotherboard") <<
"After x-bx sorting:";
348 for (
int i=0;
i<2;
i++)
350 int cbx = bx + mbx - match_trig_window_size/2;
362 if (
infoV > 0 && n1a+n1b>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
370 unsigned int nLCT=n1b;
374 for (
int i=0;
i<2;
i++)
380 if (
infoV > 0 && nLCT>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
407 std::vector<CSCCorrelatedLCTDigi> tmpV;
416 static int lct_bins =
424 std::vector<CSCCorrelatedLCTDigi> all_lcts;
427 std::vector <CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin();
428 for (; plct != all_lcts.end(); plct++)
430 if (!plct->isValid())
continue;
432 int bx = (*plct).getBX();
437 if (bx > late_tbins)
continue;
444 tmpV.push_back(*plct);
445 if (bx_readout == -1) bx_readout = bx;
447 else tmpV.push_back(*plct);
456 std::vector<CSCCorrelatedLCTDigi> tmpV;
460 for (
int i=0;
i<2;
i++)
468 std::vector<CSCCorrelatedLCTDigi> tmpV;
476 for (
int i=0;
i<2;
i++)
522 bool anodeBestValid = bestALCT.
isValid();
523 bool anodeSecondValid = secondALCT.
isValid();
524 bool cathodeBestValid = bestCLCT.
isValid();
525 bool cathodeSecondValid = secondCLCT.
isValid();
527 if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
528 if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
529 if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
530 if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
542 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
563 if (secondALCT == bestALCT) secondALCT.
clear();
564 if (secondCLCT == bestCLCT) secondCLCT.
clear();
570 int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
576 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"debug correlateLCTs in "<<did<<std::endl
577 <<
"ALCT1: "<<bestALCT<<std::endl
578 <<
"ALCT2: "<<secondALCT<<std::endl
579 <<
"CLCT1: "<<bestCLCT<<std::endl
580 <<
"CLCT2: "<<secondCLCT<<std::endl
581 <<
"ok 11 12 21 22 code = "<<ok11<<
" "<<ok12<<
" "<<ok21<<
" "<<ok22<<
" "<<code<<std::endl;
583 if ( code==0 )
return;
607 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lut 0 1 = "<<lut[code][0]<<
" "<<lut[code][1]<<std::endl;
609 switch (lut[code][0]) {
626 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct1: "<<lct1<<std::endl;
628 switch (lut[code][1])
633 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
638 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
643 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
647 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"out of correlateLCTs"<<std::endl;
T getParameter(std::string const &) const
std::vector< CSCCLCTDigi > clctV1a
CSCCorrelatedLCTDigi constructLCTs(const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT)
CSCCorrelatedLCTDigi allLCTs1b[MAX_LCT_BINS][15][2]
void run(const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc)
unsigned int clct_trig_enable
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
void correlateLCTs(CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT, CSCCorrelatedLCTDigi &lct1, CSCCorrelatedLCTDigi &lct2)
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
const unsigned theSubsector
unsigned int tmb_l1a_window_size
bool isValid() const
check CLCT validity (1 - valid CLCT)
unsigned int match_trig_enable
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
unsigned int alct_trig_enable
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()