26 {0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
27 {0, 95},{0, 95},{0, 95},{0, 95},{0, 95},
28 {0, 95},{0, 95},{0, 77},{0, 61},{0, 39},
29 {0, 22},{-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},{-1,-1},{-1,-1},
34 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
35 {-1,-1},{-1,-1},{-1,-1} };
38 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
39 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
40 {0, 31},{0, 31},{0, 31},{0, 31},{0, 31},
41 {0, 22},{-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},{-1,-1},{-1,-1},
46 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
47 {-1,-1},{-1,-1},{-1,-1} };
53 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
54 {-1,-1},{-1,-1},{-1,-1},{-1,-1},{-1,-1},
55 {100, 127},{73, 127},{47, 127},{22, 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, 127},
60 {0, 127},{0, 127},{0, 127},{0, 127},{0, 127},
61 {0, 127},{0, 127},{0, 127},{0, 127},{0, 105},
62 {0, 93},{0, 78},{0, 63} };
66 unsigned sector,
unsigned subsector,
79 <<
"+++ Upgrade CSCMotherboardME11 constructed while isSLHC is not set! +++\n";
80 if (!smartME1aME1b)
edm::LogError(
"L1CSCTPEmulatorConfigError")
81 <<
"+++ Upgrade CSCMotherboardME11 constructed while smartME1aME1b is not set! +++\n";
95 clct_to_alct = tmbParams.getUntrackedParameter<
bool>(
"clctToAlct",
true);
99 drop_used_clcts = tmbParams.getUntrackedParameter<
bool>(
"tmbDropUsedClcts",
true);
101 tmb_cross_bx_algo = tmbParams.getUntrackedParameter<
unsigned int>(
"tmbCrossBxAlgorithm");
104 max_me11_lcts = tmbParams.getUntrackedParameter<
unsigned int>(
"maxME11LCTs",4);
109 pref[
m-1] = pref[0] -
m/2;
110 pref[
m] = pref[0] +
m/2;
146 for (
int i=0;
i<2;
i++)
172 <<
"+++ 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;
197 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
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;
211 if (
allLCTs1b[bx_alct][mbx][0].isValid())
213 used_alct_mask[bx_alct] += 1;
225 for (
int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++)
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;
260 for (
int bx_clct = bx_clct_start; bx_clct <= bx_clct_stop; bx_clct++)
262 if (bx_clct < 0 || bx_clct >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
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;
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 >= CSCCathodeLCTProcessor::MAX_CLCT_BINS)
continue;
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;
313 for (
int i=0;
i<2;
i++)
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;
334 for (
int i=0;
i<2;
i++)
348 if (
infoV > 0)
LogDebug(
"CSCMotherboard") <<
"After x-bx sorting:";
351 for (
int i=0;
i<2;
i++)
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;
377 for (
int i=0;
i<2;
i++)
383 if (
infoV > 0 && nLCT>0)
LogDebug(
"CSCMotherboard") <<
"bx "<<bx<<
" nnnLCT:"<<n1a<<
" "<<n1b<<
" "<<n1a+n1b;
410 std::vector<CSCCorrelatedLCTDigi> tmpV;
419 static int lct_bins =
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;
463 for (
int i=0;
i<2;
i++)
471 std::vector<CSCCorrelatedLCTDigi> tmpV;
479 for (
int i=0;
i<2;
i++)
525 bool anodeBestValid = bestALCT.
isValid();
526 bool anodeSecondValid = secondALCT.
isValid();
527 bool cathodeBestValid = bestCLCT.
isValid();
528 bool cathodeSecondValid = secondCLCT.
isValid();
530 if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT;
531 if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT;
532 if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT;
533 if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT;
545 if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) &&
566 if (secondALCT == bestALCT) secondALCT.
clear();
567 if (secondCLCT == bestCLCT) secondCLCT.
clear();
573 int code = (ok11<<3) | (ok12<<2) | (ok21<<1) | (ok22);
579 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"debug correlateLCTs in "<<did<<std::endl
580 <<
"ALCT1: "<<bestALCT<<std::endl
581 <<
"ALCT2: "<<secondALCT<<std::endl
582 <<
"CLCT1: "<<bestCLCT<<std::endl
583 <<
"CLCT2: "<<secondCLCT<<std::endl
584 <<
"ok 11 12 21 22 code = "<<ok11<<
" "<<ok12<<
" "<<ok21<<
" "<<ok22<<
" "<<code<<std::endl;
586 if ( code==0 )
return;
610 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lut 0 1 = "<<lut[code][0]<<
" "<<lut[code][1]<<std::endl;
612 switch (lut[code][0]) {
629 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct1: "<<lct1<<std::endl;
631 switch (lut[code][1])
636 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
641 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
646 if (dbg)
LogTrace(
"CSCMotherboardME11")<<
"lct2: "<<lct2<<std::endl;
650 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()