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.getUntrackedParameter<
bool>(
"clctToAlct",
true);
97 drop_used_clcts = tmbParams.getUntrackedParameter<
bool>(
"tmbDropUsedClcts",
true);
99 tmb_cross_bx_algo = tmbParams.getUntrackedParameter<
unsigned int>(
"tmbCrossBxAlgorithm");
102 max_me11_lcts = tmbParams.getUntrackedParameter<
unsigned int>(
"maxME11LCTs",4);
107 pref[
m-1] = pref[0] -
m/2;
108 pref[
m] = pref[0] +
m/2;
144 for (
int i=0;
i<2;
i++)
170 <<
"+++ 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;
195 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
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;
209 if (
allLCTs1b[bx_alct][mbx][0].isValid())
211 used_alct_mask[bx_alct] += 1;
223 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
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;
258 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
260 if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
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;
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 >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
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;
311 for (
int i=0;
i<2;
i++)
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;
332 for (
int i=0;
i<2;
i++)
346 if (
infoV > 0)
LogDebug(
"CSCMotherboard") <<
"After x-bx sorting:";
349 for (
int i=0;
i<2;
i++)
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;
375 for (
int i=0;
i<2;
i++)
381 if (
infoV > 0 && nLCT>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
408 std::vector<CSCCorrelatedLCTDigi> tmpV;
417 static int lct_bins =
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;
461 for (
int i=0;
i<2;
i++)
469 std::vector<CSCCorrelatedLCTDigi> tmpV;
477 for (
int i=0;
i<2;
i++)
523 bool anodeBestValid = bestALCT.
isValid();
524 bool anodeSecondValid = secondALCT.
isValid();
525 bool cathodeBestValid = bestCLCT.
isValid();
526 bool cathodeSecondValid = secondCLCT.
isValid();
528 if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
529 if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
530 if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
531 if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
543 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
564 if (secondALCT == bestALCT) secondALCT.
clear();
565 if (secondCLCT == bestCLCT) secondCLCT.
clear();
571 int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
577 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"debug correlateLCTs in "<<did<<std::endl
578 <<
"ALCT1: "<<bestALCT<<std::endl
579 <<
"ALCT2: "<<secondALCT<<std::endl
580 <<
"CLCT1: "<<bestCLCT<<std::endl
581 <<
"CLCT2: "<<secondCLCT<<std::endl
582 <<
"ok 11 12 21 22 code = "<<ok11<<
" "<<ok12<<
" "<<ok21<<
" "<<ok22<<
" "<<code<<std::endl;
584 if ( code==0 )
return;
608 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lut 0 1 = "<<lut[code][0]<<
" "<<lut[code][1]<<std::endl;
610 switch (lut[code][0]) {
627 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct1: "<<lct1<<std::endl;
629 switch (lut[code][1])
634 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
639 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
644 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
648 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"out of correlateLCTs"<<std::endl;
CSCCLCTDigi secondCLCT[MAX_CLCT_BINS]
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T 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()
CSCALCTDigi bestALCT[MAX_ALCT_BINS]
unsigned int match_trig_window_size
CSCALCTDigi secondALCT[MAX_ALCT_BINS]
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()
CSCCLCTDigi bestCLCT[MAX_CLCT_BINS]
void setConfigParameters(const CSCDBL1TPParameters *conf)
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
CSCAnodeLCTProcessor * alct
unsigned int alct_trig_enable
std::vector< CSCCorrelatedLCTDigi > getLCTs1a()
CSCCathodeLCTProcessor * clct
std::vector< CSCCLCTDigi > run(const CSCComparatorDigiCollection *compdc)
std::vector< CSCCLCTDigi > clctV1b
bool doesALCTCrossCLCT(CSCALCTDigi &a, CSCCLCTDigi &c, int me)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1b()
void clear()
clear this CLCT
CSCCathodeLCTProcessor * clct1a
bool match_earliest_alct_me11_only
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
int getKeyWG() const
return key wire group
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
void setConfigParameters(const CSCDBL1TPParameters *conf)
std::vector< CSCCorrelatedLCTDigi > readoutLCTs1a()