185 unsigned sector,
unsigned subsector,
189 theEndcap(endcap), theStation(station), theSector(sector),
190 theSubsector(subsector), theTrigChamber(chamber) {
191 static bool config_dumped =
false;
198 conf.
getParameter<
unsigned int>(
"alctNplanesHitPretrig");
200 conf.
getParameter<
unsigned int>(
"alctNplanesHitPattern");
202 conf.
getParameter<
unsigned int>(
"alctNplanesHitAccelPretrig");
204 conf.
getParameter<
unsigned int>(
"alctNplanesHitAccelPattern");
228 int fpga_latency = 6;
229 if (early_tbins<0) early_tbins = fifo_pretrig - fpga_latency;
245 if ((infoV > 0 || isSLHC) && !config_dumped) {
248 config_dumped =
true;
249 if (isSLHC)
std::cout<<
"disableME1a = "<<disableME1a<<std::endl;
276 theEndcap(1), theStation(1), theSector(1),
277 theSubsector(1), theTrigChamber(1) {
279 static bool config_dumped =
false;
294 if (!config_dumped) {
297 config_dumped =
true;
346 static bool config_dumped =
false;
361 if (!config_dumped) {
364 config_dumped =
true;
372 static const unsigned int max_fifo_tbins = 1 << 5;
373 static const unsigned int max_fifo_pretrig = 1 << 5;
374 static const unsigned int max_drift_delay = 1 << 2;
375 static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
376 static const unsigned int max_nplanes_hit_pattern = 1 << 3;
377 static const unsigned int max_nplanes_hit_accel_pretrig = 1 << 3;
378 static const unsigned int max_nplanes_hit_accel_pattern = 1 << 3;
379 static const unsigned int max_trig_mode = 1 << 2;
380 static const unsigned int max_accel_mode = 1 << 2;
381 static const unsigned int max_l1a_window_width =
MAX_ALCT_BINS;
387 <<
", exceeds max allowed, " << max_fifo_tbins-1 <<
" +++\n"
388 <<
"+++ Try to proceed with the default value, fifo_tbins="
395 <<
", exceeds max allowed, " << max_fifo_pretrig-1 <<
" +++\n"
396 <<
"+++ Try to proceed with the default value, fifo_pretrig="
403 <<
", exceeds max allowed, " << max_drift_delay-1 <<
" +++\n"
404 <<
"+++ Try to proceed with the default value, drift_delay="
411 <<
", exceeds max allowed, " << max_nplanes_hit_pretrig-1 <<
" +++\n"
412 <<
"+++ Try to proceed with the default value, nplanes_hit_pretrig="
419 <<
", exceeds max allowed, " << max_nplanes_hit_pattern-1 <<
" +++\n"
420 <<
"+++ Try to proceed with the default value, nplanes_hit_pattern="
426 <<
"+++ Value of nplanes_hit_accel_pretrig, "
428 << max_nplanes_hit_accel_pretrig-1 <<
" +++\n"
429 <<
"+++ Try to proceed with the default value, "
435 <<
"+++ Value of nplanes_hit_accel_pattern, "
437 << max_nplanes_hit_accel_pattern-1 <<
" +++\n"
438 <<
"+++ Try to proceed with the default value, "
444 <<
"+++ Value of trig_mode, " <<
trig_mode
445 <<
", exceeds max allowed, " << max_trig_mode-1 <<
" +++\n"
446 <<
"+++ Try to proceed with the default value, trig_mode="
453 <<
", exceeds max allowed, " << max_accel_mode-1 <<
" +++\n"
454 <<
"+++ Try to proceed with the default value, accel_mode="
461 <<
", exceeds max allowed, " << max_l1a_window_width-1 <<
" +++\n"
462 <<
"+++ Try to proceed with the default value, l1a_window_width="
477 if (pattern == 0)
quality[wire][0] = -999;
484 std::vector<CSCALCTDigi>
491 static bool config_dumped =
false;
495 config_dumped =
true;
510 <<
" found in ME" << ((
theEndcap == 1) ?
"+" :
"-")
516 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
522 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
526 <<
" is not defined in current geometry! +++\n"
527 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
534 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
539 <<
"; ALCT emulation skipped! +++";
540 std::vector<CSCALCTDigi> emptyV;
556 const unsigned int min_layers =
564 unsigned int layersHit = 0;
567 if (!wire[i_layer][i_wire].
empty()) {layersHit++;
break;}
570 if (layersHit >= min_layers)
run(wire);
574 std::vector<CSCALCTDigi> tmpV =
getALCTs();
584 bool trigger =
false;
593 if (!chamber_empty) {
595 unsigned int start_bx = 0;
597 while (start_bx < stop_bx) {
632 digiV[i_layer].clear();
647 <<
"found " <<
digiV[i_layer].size()
648 <<
" wire digi(s) in layer " << i_layer <<
" of ME"
652 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
653 pld !=
digiV[i_layer].end(); pld++) {
654 LogTrace(
"CSCAnodeLCTProcessor") <<
" " << (*pld);
667 digiIt != rwired.second; ++digiIt) {
668 digiV[
id.layer()-1].push_back(*digiIt);
679 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
680 pld !=
digiV[i_layer].end(); pld++) {
681 int i_wire = pld->getWireGroup()-1;
682 std::vector<int> bx_times = pld->getTimeBinsOn();
687 <<
"+++ Found wire digi with wrong wire number = " << i_wire
688 <<
" (max wires = " <<
numWireGroups <<
"); skipping it... +++\n";
698 int last_time = -999;
700 wire[i_layer][i_wire].push_back(0);
701 wire[i_layer][i_wire].push_back(6);
704 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
706 if (
i > 0 && bx_times[
i] == (bx_times[
i-1]+1))
continue;
709 <<
"Digi on layer " << i_layer <<
" wire " << i_wire
710 <<
" at time " << bx_times[
i];
715 if (last_time < 0 || ((bx_times[
i]-last_time) >= 6) ) {
716 wire[i_layer][i_wire].push_back(bx_times[
i]);
717 last_time = bx_times[
i];
722 <<
"+++ Skipping wire digi: wire = " << i_wire
723 <<
" layer = " << i_layer <<
", bx = " << bx_times[
i] <<
" +++";
738 bool chamber_empty =
true;
739 int i_wire, i_layer, digi_num;
740 static unsigned int bits_in_pulse = 8*
sizeof(
pulse[0][0]);
744 pulse[i_layer][i_wire] = 0;
748 for (
int j = 0;
j < 3;
j++)
quality[i_wire][
j] = -999;
754 if (wire[i_layer][i_wire].
size() > 0) {
755 std::vector<int> bx_times = wire[i_layer][i_wire];
756 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
758 if (bx_times[
i] < 0 || bx_times[
i] +
hit_persist >= bits_in_pulse) {
760 <<
"+++ BX time of wire digi (wire = " << i_wire
761 <<
" layer = " << i_layer <<
") bx = " << bx_times[
i]
762 <<
" is not within the range (0-" << bits_in_pulse
763 <<
"] allowed for pulse extension. Skip this digi! +++\n";
768 if (chamber_empty) chamber_empty =
false;
771 for (
unsigned int bx = bx_times[
i];
773 pulse[i_layer][i_wire] =
pulse[i_layer][i_wire] | (1 << bx);
778 <<
"Wire digi: layer " << i_layer
779 <<
" digi #" << ++digi_num <<
" wire group " << i_wire
780 <<
" time " << bx_times[
i];
782 std::ostringstream strstrm;
783 for (
int i = 1;
i <= 32;
i++) {
784 strstrm << ((pulse[i_layer][i_wire]>>(32-
i)) & 1);
786 LogTrace(
"CSCAnodeLCTProcessor") <<
" Pulse: " << strstrm.str();
794 if (
infoV > 1 && !chamber_empty) {
798 return chamber_empty;
806 unsigned int layers_hit;
808 int this_layer, this_wire;
811 const unsigned int nplanes_hit_pretrig_acc =
823 for (
unsigned int bx_time = start_bx; bx_time < stop_bx; bx_time++) {
826 hit_layer[i_layer] =
false;
835 if (((
pulse[this_layer][this_wire] >> bx_time) & 1) == 1) {
837 if (hit_layer[this_layer] ==
false){
838 hit_layer[this_layer] =
true;
844 if (layers_hit >= pretrig_thresh[i_pattern]) {
848 <<
"Pretrigger was satisfied for wire: " << key_wire
849 <<
" pattern: " << i_pattern
850 <<
" bx_time: " << bx_time;
869 bool trigger =
false;
871 unsigned int temp_quality;
872 int this_layer, this_wire, delta_wire;
875 const unsigned int nplanes_hit_pattern_acc =
881 const std::string ptn_label[] = {
"Accelerator",
"CollisionA",
"CollisionB"};
886 hit_layer[i_layer] =
false;
888 double num_pattern_hits=0., times_sum=0.;
889 std::multiset<int> mset_for_median;
890 mset_for_median.clear();
896 this_wire = delta_wire + key_wire;
901 if ( ( (
pulse[this_layer][this_wire] >>
906 if (hit_layer[this_layer] ==
false){
909 hit_layer[this_layer] =
true;
912 <<
"bx_time: " <<
first_bx[key_wire]
913 <<
" pattern: " << i_pattern <<
" keywire: " << key_wire
914 <<
" layer: " << this_layer
915 <<
" quality: " << temp_quality;
919 if (
abs(delta_wire)<2) {
924 if (((
pulse[this_layer][this_wire] >> (first_bx_layer-1)) & 1) == 1) first_bx_layer--;
927 times_sum += (double)first_bx_layer;
928 num_pattern_hits += 1.;
929 mset_for_median.insert(first_bx_layer);
932 <<
" 1st bx in layer: "<<first_bx_layer
933 <<
" sum bx: "<<times_sum
934 <<
" #pat. hits: "<<num_pattern_hits;
942 const int sz = mset_for_median.size();
944 std::multiset<int>::iterator im = mset_for_median.begin();
945 if (sz > 1) std::advance(im,sz/2-1);
952 for (im = mset_for_median.begin(); im != mset_for_median.end(); im++)
953 sprintf(bxs,
"%s %d", bxs, *im);
959 if (temp_quality >= pattern_thresh[i_pattern]) {
965 temp_quality -= (pattern_thresh[i_pattern]-1);
970 if (temp_quality > 3) temp_quality -= 3;
971 else temp_quality = 0;
974 if (i_pattern == 0) {
976 quality[key_wire][0] = temp_quality;
980 if (static_cast<int>(temp_quality) >
quality[key_wire][1]) {
981 quality[key_wire][1] = temp_quality;
982 quality[key_wire][2] = i_pattern-1;
987 <<
"Pattern found; keywire: " << key_wire
988 <<
" type: " << ptn_label[i_pattern]
989 <<
" quality: " << temp_quality <<
"\n";
996 <<
"Collision Pattern A is chosen" <<
"\n";
997 else if (
quality[key_wire][2] == 1)
999 <<
"Collision Pattern B is chosen" <<
"\n";
1014 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1015 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1016 ghost_cleared[key_wire][i_pattern] = 0;
1019 int qual_this =
quality[key_wire][i_pattern];
1020 if (qual_this > 0) {
1023 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1024 if (qual_prev > 0) {
1033 if (qual_prev >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1042 (qual_prev > qual_this) )
1043 ghost_cleared[key_wire][i_pattern] = 1;
1049 if (ghost_cleared[key_wire][i_pattern] == 1) {
1051 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1052 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1053 <<
" by wire " << key_wire-1<<
" q="<<qual_prev;
1058 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1059 if (qual_next > 0) {
1063 if (qual_next > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1072 (qual_next >= qual_this) )
1073 ghost_cleared[key_wire][i_pattern] = 1;
1076 if (ghost_cleared[key_wire][i_pattern] == 1) {
1078 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1079 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1080 <<
" by wire " << key_wire+1<<
" q="<<qual_next;
1089 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1090 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1091 if (ghost_cleared[key_wire][i_pattern] > 0) {
1092 clear(key_wire, i_pattern);
1110 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1111 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1112 ghost_cleared[key_wire][i_pattern] = 0;
1115 int qual_this =
quality[key_wire][i_pattern];
1116 if (qual_this > 0) {
1120 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1121 if (qual_prev > 0) {
1133 if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1142 (qual_prev > qual_this) )
1143 ghost_cleared[key_wire][i_pattern] = 1;
1149 if (ghost_cleared[key_wire][i_pattern] == 1) {
1151 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1152 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1153 <<
" by wire " << key_wire-1<<
" q="<<qual_prev<<
" dt="<<
dt;
1159 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1160 if (qual_next > 0) {
1167 if (qual_next >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1176 (qual_next >= qual_this) )
1177 ghost_cleared[key_wire][i_pattern] = 1;
1180 if (ghost_cleared[key_wire][i_pattern] == 1) {
1182 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1183 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1184 <<
" by wire " << key_wire+1<<
" q="<<qual_next<<
" dt="<<
dt;
1193 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1194 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1195 if (ghost_cleared[key_wire][i_pattern] > 0) {
1196 clear(key_wire, i_pattern);
1206 std::vector<CSCALCTDigi> lct_list;
1216 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1221 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1224 int qual = (
quality[i_wire][0] & 0x03);
1227 lct_list.push_back(lct_info);
1232 int qual = (
quality[i_wire][1] & 0x03);
1235 lct_list.push_back(lct_info);
1236 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" got lct_info: "<<lct_info;
1249 int n_alct_all=0, n_alct=0;
1250 for (std::vector <CSCALCTDigi>::const_iterator plct = lct_list.begin(); plct != lct_list.end(); plct++)
1251 if (plct->isValid() && plct->getBX()==6) n_alct_all++;
1252 for (std::vector <CSCALCTDigi>::const_iterator plct = fourBest.begin(); plct != fourBest.end(); plct++)
1253 if (plct->isValid() && plct->getBX()==6) n_alct++;
1256 <<
" all "<<n_alct_all<<
" found "<<n_alct;
1261 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1262 plct != fourBest.end(); plct++) {
1264 int bx = plct->getBX();
1267 <<
"+++ Bx of ALCT candidate, " << bx <<
", exceeds max allowed, "
1292 if (first_bx < MAX_ALCT_BINS) {
1329 const std::vector<CSCALCTDigi>& all_alcts) {
1335 LogTrace(
"CSCAnodeLCTProcessor") << all_alcts.size() <<
1336 " ALCTs at the input of best-track selector: ";
1337 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1338 plct != all_alcts.end(); plct++) {
1339 if (!plct->isValid())
continue;
1340 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1345 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1346 plct != all_alcts.end(); plct++) {
1347 if (!plct->isValid())
continue;
1356 int bx = (*plct).
getBX();
1357 int accel = (*plct).getAccelerator();
1358 int qual = (*plct).getQuality();
1359 int wire = (*plct).getKeyWG();
1360 bool vA = tA[bx][accel].
isValid();
1361 bool vB = tB[bx][accel].
isValid();
1366 if (!vA || qual > qA || (qual == qA && wire > wA)) {
1367 tA[bx][accel] = *plct;
1369 if (!vB || qual > qB || (qual == qB && wire < wB)) {
1370 tB[bx][accel] = *plct;
1375 for (
int accel = 0; accel <= 1; accel++) {
1377 if (tA[bx][accel].isValid()) {
1379 LogTrace(
"CSCAnodeLCTProcessor") <<
"tA: " << tA[bx][accel];
1380 LogTrace(
"CSCAnodeLCTProcessor") <<
"tB: " << tB[bx][accel];
1382 bestALCTs[bx][accel] = tA[bx][accel];
1385 if (tA[bx][accel] != tB[bx][accel] &&
1386 tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
1387 secondALCTs[bx][accel] = tB[bx][accel];
1394 for (std::vector <CSCALCTDigi>::const_iterator plct =
1395 all_alcts.begin(); plct != all_alcts.end(); plct++) {
1396 if ((*plct).isValid() &&
1397 (*plct).getAccelerator() == accel && (*plct).getBX() == bx &&
1398 (*plct).getQuality() < bestALCTs[bx][accel].
getQuality() &&
1399 (*plct).getQuality() >= secondALCTs[bx][accel].
getQuality() &&
1400 (*plct).getKeyWG() >= secondALCTs[bx][accel].
getKeyWG()) {
1401 secondALCTs[bx][accel] = *plct;
1410 std::vector<CSCALCTDigi> fourBest;
1412 for (
int i = 0;
i < 2;
i++) {
1413 if (bestALCTs[bx][
i].isValid()) fourBest.push_back(bestALCTs[bx][
i]);
1415 for (
int i = 0;
i < 2;
i++) {
1416 if (secondALCTs[bx][
i].isValid()) fourBest.push_back(secondALCTs[bx][
i]);
1421 LogTrace(
"CSCAnodeLCTProcessor") << fourBest.size() <<
" ALCTs selected: ";
1422 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1423 plct != fourBest.end(); plct++) {
1424 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1436 bool returnValue =
false;
1442 if (lhsALCT.
getBX() < rhsALCT.
getBX()) {returnValue =
true;}
1443 if (lhsALCT.
getBX() != rhsALCT.
getBX()) {
return returnValue;}
1448 if (qual1 > qual2) {returnValue =
true;}
1452 else if (qual1 == qual2 &&
1456 {returnValue =
true;}
1472 if (
quality[key_wire][1] > 0) {
1475 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1480 if (
quality[key_wire][0] > 0) {
1483 <<
"trigMode(): accelerator track " << key_wire <<
" disabled" <<
"\n";
1492 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1502 int promotionBit = 1 << 2;
1508 if (
quality[key_wire][0] > 0) {
1511 <<
"alctMode(): accelerator track " << key_wire <<
" ignored" <<
"\n";
1516 if (
quality[key_wire][1] > 0) {
1517 quality[key_wire][1] += promotionBit;
1519 <<
"alctMode(): collision track " << key_wire <<
" promoted" <<
"\n";
1524 if (
quality[key_wire][0] > 0) {
1525 quality[key_wire][0] += promotionBit;
1527 <<
"alctMode(): accelerator track " << key_wire <<
" promoted"<<
"\n";
1532 if (
quality[key_wire][1] > 0) {
1535 <<
"alctMode(): collision track " << key_wire <<
" ignored" <<
"\n";
1543 std::ostringstream strm;
1545 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1546 strm <<
"+ ALCT configuration parameters: +\n";
1547 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1548 strm <<
" fifo_tbins [total number of time bins in DAQ readout] = "
1550 strm <<
" fifo_pretrig [start time of anode raw hits in DAQ readout] = "
1552 strm <<
" drift_delay [drift delay after pre-trigger, in 25 ns bins] = "
1554 strm <<
" nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = "
1556 strm <<
" nplanes_hit_pattern [min. number of layers hit for trigger] = "
1558 strm <<
" nplanes_hit_accel_pretrig [min. number of layers hit for accel."
1560 strm <<
" nplanes_hit_accel_pattern [min. number of layers hit for accel."
1562 strm <<
" trig_mode [enabling/disabling collision/accelerator tracks] = "
1564 strm <<
" accel_mode [preference to collision/accelerator tracks] = "
1566 strm <<
" l1a_window_width [L1Accept window width, in 25 ns bins] = "
1568 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1569 LogDebug(
"CSCAnodeLCTProcessor") << strm.str();
1576 <<
"ME" << ((
theEndcap == 1) ?
"+" :
"-")
1580 std::ostringstream strstrm;
1582 if (i_wire%10 == 0) {
1583 if (i_wire < 100) strstrm << i_wire/10;
1584 else strstrm << (i_wire-100)/10;
1586 else strstrm <<
" ";
1590 strstrm << i_wire%10;
1595 if (wire[i_layer][i_wire].
size() > 0) {
1596 std::vector<int> bx_times = wire[i_layer][i_wire];
1597 strstrm << std::hex << bx_times[0] << std::dec;
1604 LogTrace(
"CSCAnodeLCTProcessor") << strstrm.str();
1610 std::vector<CSCALCTDigi> tmpV;
1615 static int lct_bins =
1620 static int ifois = 0;
1630 <<
"; in-time ALCTs are not getting read-out!!! +++" <<
"\n";
1635 <<
"+++ Allowed range of time bins, [0-" << late_tbins
1637 <<
"+++ Set late_tbins to max allowed +++\n";
1638 late_tbins = MAX_ALCT_BINS-1;
1645 std::vector<CSCALCTDigi> all_alcts =
getALCTs();
1646 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1647 plct != all_alcts.end(); plct++) {
1648 if (!plct->isValid())
continue;
1650 int bx = (*plct).getBX();
1654 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1655 <<
": found at bx " << bx <<
", whereas the earliest allowed bx is "
1661 if (bx > late_tbins) {
1663 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1664 <<
": found at bx " << bx <<
", whereas the latest allowed bx is "
1669 tmpV.push_back(*plct);
1676 std::vector<CSCALCTDigi> tmpV;
1691 std::ostringstream strstrm_header;
1693 <<
"\n" <<
"Pattern: " << i_pattern <<
" Key wire: " << key_wire;
1694 for (
int i = 1;
i <= 32;
i++) {
1695 strstrm_header << ((32-
i)%10);
1697 LogTrace(
"CSCAnodeLCTProcessor") << strstrm_header.str();
1700 std::ostringstream strstrm_pulse;
1704 for (
int i = 1;
i <= 32;
i++) {
1705 strstrm_pulse << ((pulse[this_layer][this_wire]>>(32-
i)) & 1);
1708 << strstrm_pulse.str() <<
" on layer " << this_layer;
1713 <<
"-------------------------------------------";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int ghost_cancellation_bx_depth
void showPatterns(const int key_wire)
void readWireDigis(std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
int quality[CSCConstants::MAX_NUM_WIRES][3]
unsigned int alctDriftDelay() const
CSCChamber * chamber(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned tcscid) const
Return the CSCChamber for a corresponding endcap/station/sector/subsector/trigger cscid...
void checkConfigParameters()
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
static const int time_weights[NUM_PATTERN_WIRES]
static const unsigned int def_drift_delay
static const unsigned int def_fifo_tbins
CSCALCTDigi bestALCT[MAX_ALCT_BINS]
CSCALCTDigi secondALCT[MAX_ALCT_BINS]
static const int pattern_mask_slim[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES]
bool getDigis(const CSCWireDigiCollection *wiredc)
bool isValid() const
check ALCT validity (1 - valid ALCT)
unsigned int nplanes_hit_pattern
void clear()
clear this ALCT
const unsigned theTrigChamber
unsigned int alctNplanesHitPretrig() const
void setConfigParameters(const CSCDBL1TPParameters *conf)
void trigMode(const int key_wire)
int numberOfWireGroups() const
static int ringFromTriggerLabels(int station, int triggerCSCID)
void ghostCancellationLogicSLHC()
static const unsigned int def_accel_mode
unsigned int alctL1aWindowWidth() const
int getFullBX() const
return 12-bit full BX.
void ghostCancellationLogic()
static const unsigned int def_nplanes_hit_accel_pretrig
static const unsigned int def_fifo_pretrig
static CSCTriggerGeomManager * get()
static const int pattern_mask_r1[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES]
void accelMode(const int key_wire)
Abs< T >::type abs(const T &t)
const CSCLayer * layer(CSCDetId id) const
Return the layer corresponding to the given id.
unsigned int l1a_window_width
static const unsigned int def_nplanes_hit_pattern
static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES]
unsigned int alctTrigMode() const
bool preTrigger(const int key_wire, const int start_bx)
static const int pattern_mask_open[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES]
bool pulseExtension(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES])
int getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
static const unsigned int def_l1a_window_width
bool ghost_cancellation_side_quality
int getQuality() const
return quality of a pattern
bool isBetterALCT(const CSCALCTDigi &lhsALCT, const CSCALCTDigi &rhsALCT)
unsigned int alctAccelMode() const
static const unsigned int def_trig_mode
int getAccelerator() const
static const unsigned int def_nplanes_hit_accel_pattern
unsigned int alctFifoPretrig() const
std::vector< CSCALCTDigi > readoutALCTs()
unsigned int alctNplanesHitAccelPretrig() const
void setDefaultConfigParameters()
const unsigned theStation
std::vector< CSCWireDigi >::const_iterator const_iterator
unsigned int alctNplanesHitAccelPattern() const
std::vector< CSCALCTDigi > bestTrackSelector(const std::vector< CSCALCTDigi > &all_alcts)
unsigned int fifo_pretrig
int first_bx[CSCConstants::MAX_NUM_WIRES]
void dumpConfigParams() const
std::pair< const_iterator, const_iterator > Range
void dumpDigis(const std::vector< int > wire[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]) const
void setTrknmb(const uint16_t number)
Set track number (1,2) after sorting ALCTs.
void setFullBX(const uint16_t fullbx)
Set 12-bit full BX.
const unsigned theSubsector
unsigned int pulse[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES]
unsigned int alctNplanesHitPattern() const
bool patternDetection(const int key_wire)
unsigned int nplanes_hit_accel_pattern
std::vector< CSCALCTDigi > run(const CSCWireDigiCollection *wiredc)
unsigned int pretrig_extra_deadtime
int getKeyWG() const
return key wire group
const CSCLayerGeometry * geometry() const
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
tuple size
Write out results.
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
unsigned int nplanes_hit_pretrig
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][NUM_PATTERN_WIRES]
std::vector< CSCALCTDigi > getALCTs()
static const unsigned int def_nplanes_hit_pretrig
unsigned int nplanes_hit_accel_pretrig
unsigned int alctFifoTbins() const