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;
284 theEndcap(1), theStation(1), theSector(1),
285 theSubsector(1), theTrigChamber(1) {
287 static bool config_dumped =
false;
302 if (!config_dumped) {
305 config_dumped =
true;
354 static bool config_dumped =
false;
369 if (!config_dumped) {
372 config_dumped =
true;
380 static const unsigned int max_fifo_tbins = 1 << 5;
381 static const unsigned int max_fifo_pretrig = 1 << 5;
382 static const unsigned int max_drift_delay = 1 << 2;
383 static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
384 static const unsigned int max_nplanes_hit_pattern = 1 << 3;
385 static const unsigned int max_nplanes_hit_accel_pretrig = 1 << 3;
386 static const unsigned int max_nplanes_hit_accel_pattern = 1 << 3;
387 static const unsigned int max_trig_mode = 1 << 2;
388 static const unsigned int max_accel_mode = 1 << 2;
389 static const unsigned int max_l1a_window_width =
MAX_ALCT_BINS;
395 <<
", exceeds max allowed, " << max_fifo_tbins-1 <<
" +++\n"
396 <<
"+++ Try to proceed with the default value, fifo_tbins="
403 <<
", exceeds max allowed, " << max_fifo_pretrig-1 <<
" +++\n"
404 <<
"+++ Try to proceed with the default value, fifo_pretrig="
411 <<
", exceeds max allowed, " << max_drift_delay-1 <<
" +++\n"
412 <<
"+++ Try to proceed with the default value, drift_delay="
419 <<
", exceeds max allowed, " << max_nplanes_hit_pretrig-1 <<
" +++\n"
420 <<
"+++ Try to proceed with the default value, nplanes_hit_pretrig="
427 <<
", exceeds max allowed, " << max_nplanes_hit_pattern-1 <<
" +++\n"
428 <<
"+++ Try to proceed with the default value, nplanes_hit_pattern="
434 <<
"+++ Value of nplanes_hit_accel_pretrig, "
436 << max_nplanes_hit_accel_pretrig-1 <<
" +++\n"
437 <<
"+++ Try to proceed with the default value, "
443 <<
"+++ Value of nplanes_hit_accel_pattern, "
445 << max_nplanes_hit_accel_pattern-1 <<
" +++\n"
446 <<
"+++ Try to proceed with the default value, "
452 <<
"+++ Value of trig_mode, " <<
trig_mode
453 <<
", exceeds max allowed, " << max_trig_mode-1 <<
" +++\n"
454 <<
"+++ Try to proceed with the default value, trig_mode="
461 <<
", exceeds max allowed, " << max_accel_mode-1 <<
" +++\n"
462 <<
"+++ Try to proceed with the default value, accel_mode="
469 <<
", exceeds max allowed, " << max_l1a_window_width-1 <<
" +++\n"
470 <<
"+++ Try to proceed with the default value, l1a_window_width="
485 if (pattern == 0)
quality[wire][0] = -999;
492 std::vector<CSCALCTDigi>
499 static bool config_dumped =
false;
503 config_dumped =
true;
518 <<
" found in ME" << ((
theEndcap == 1) ?
"+" :
"-")
524 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
530 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
534 <<
" is not defined in current geometry! +++\n"
535 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
542 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
547 <<
"; ALCT emulation skipped! +++";
548 std::vector<CSCALCTDigi> emptyV;
564 const unsigned int min_layers =
572 unsigned int layersHit = 0;
575 if (!wire[i_layer][i_wire].
empty()) {layersHit++;
break;}
578 if (layersHit >= min_layers)
run(wire);
582 std::vector<CSCALCTDigi> tmpV =
getALCTs();
592 bool trigger =
false;
601 if (!chamber_empty) {
603 unsigned int start_bx = 0;
605 while (start_bx < stop_bx) {
640 digiV[i_layer].clear();
655 <<
"found " <<
digiV[i_layer].size()
656 <<
" wire digi(s) in layer " << i_layer <<
" of ME"
660 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
661 pld !=
digiV[i_layer].end(); pld++) {
662 LogTrace(
"CSCAnodeLCTProcessor") <<
" " << (*pld);
675 digiIt != rwired.second; ++digiIt) {
676 digiV[
id.layer()-1].push_back(*digiIt);
687 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
688 pld !=
digiV[i_layer].end(); pld++) {
689 int i_wire = pld->getWireGroup()-1;
690 std::vector<int> bx_times = pld->getTimeBinsOn();
695 <<
"+++ Found wire digi with wrong wire number = " << i_wire
696 <<
" (max wires = " <<
numWireGroups <<
"); skipping it... +++\n";
706 int last_time = -999;
708 wire[i_layer][i_wire].push_back(0);
709 wire[i_layer][i_wire].push_back(6);
712 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
714 if (
i > 0 && bx_times[
i] == (bx_times[
i-1]+1))
continue;
717 <<
"Digi on layer " << i_layer <<
" wire " << i_wire
718 <<
" at time " << bx_times[
i];
723 if (last_time < 0 || ((bx_times[
i]-last_time) >= 6) ) {
724 wire[i_layer][i_wire].push_back(bx_times[
i]);
725 last_time = bx_times[
i];
730 <<
"+++ Skipping wire digi: wire = " << i_wire
731 <<
" layer = " << i_layer <<
", bx = " << bx_times[
i] <<
" +++";
746 bool chamber_empty =
true;
747 int i_wire, i_layer, digi_num;
748 static unsigned int bits_in_pulse = 8*
sizeof(
pulse[0][0]);
752 pulse[i_layer][i_wire] = 0;
756 for (
int j = 0;
j < 3;
j++)
quality[i_wire][
j] = -999;
762 if (wire[i_layer][i_wire].
size() > 0) {
763 std::vector<int> bx_times = wire[i_layer][i_wire];
764 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
766 if (bx_times[
i] < 0 || bx_times[
i] +
hit_persist >= bits_in_pulse) {
768 <<
"+++ BX time of wire digi (wire = " << i_wire
769 <<
" layer = " << i_layer <<
") bx = " << bx_times[
i]
770 <<
" is not within the range (0-" << bits_in_pulse
771 <<
"] allowed for pulse extension. Skip this digi! +++\n";
776 if (chamber_empty) chamber_empty =
false;
779 for (
unsigned int bx = bx_times[
i];
781 pulse[i_layer][i_wire] =
pulse[i_layer][i_wire] | (1 << bx);
786 <<
"Wire digi: layer " << i_layer
787 <<
" digi #" << ++digi_num <<
" wire group " << i_wire
788 <<
" time " << bx_times[
i];
790 std::ostringstream strstrm;
791 for (
int i = 1;
i <= 32;
i++) {
792 strstrm << ((pulse[i_layer][i_wire]>>(32-
i)) & 1);
794 LogTrace(
"CSCAnodeLCTProcessor") <<
" Pulse: " << strstrm.str();
802 if (
infoV > 1 && !chamber_empty) {
806 return chamber_empty;
814 unsigned int layers_hit;
816 int this_layer, this_wire;
819 const unsigned int nplanes_hit_pretrig_acc =
831 for (
unsigned int bx_time = start_bx; bx_time < stop_bx; bx_time++) {
834 hit_layer[i_layer] =
false;
843 if (((
pulse[this_layer][this_wire] >> bx_time) & 1) == 1) {
845 if (hit_layer[this_layer] ==
false){
846 hit_layer[this_layer] =
true;
852 if (layers_hit >= pretrig_thresh[i_pattern]) {
856 <<
"Pretrigger was satisfied for wire: " << key_wire
857 <<
" pattern: " << i_pattern
858 <<
" bx_time: " << bx_time;
877 bool trigger =
false;
879 unsigned int temp_quality;
880 int this_layer, this_wire, delta_wire;
883 const unsigned int nplanes_hit_pattern_acc =
889 const std::string ptn_label[] = {
"Accelerator",
"CollisionA",
"CollisionB"};
894 hit_layer[i_layer] =
false;
896 double num_pattern_hits=0., times_sum=0.;
897 std::multiset<int> mset_for_median;
898 mset_for_median.clear();
904 this_wire = delta_wire + key_wire;
909 if ( ( (
pulse[this_layer][this_wire] >>
914 if (hit_layer[this_layer] ==
false){
917 hit_layer[this_layer] =
true;
920 <<
"bx_time: " <<
first_bx[key_wire]
921 <<
" pattern: " << i_pattern <<
" keywire: " << key_wire
922 <<
" layer: " << this_layer
923 <<
" quality: " << temp_quality;
927 if (
abs(delta_wire)<2) {
932 if (((
pulse[this_layer][this_wire] >> (first_bx_layer-1)) & 1) == 1) first_bx_layer--;
935 times_sum += (double)first_bx_layer;
936 num_pattern_hits += 1.;
937 mset_for_median.insert(first_bx_layer);
940 <<
" 1st bx in layer: "<<first_bx_layer
941 <<
" sum bx: "<<times_sum
942 <<
" #pat. hits: "<<num_pattern_hits;
950 const int sz = mset_for_median.size();
952 std::multiset<int>::iterator im = mset_for_median.begin();
953 if (sz > 1) std::advance(im,sz/2-1);
960 for (im = mset_for_median.begin(); im != mset_for_median.end(); im++)
961 sprintf(bxs,
"%s %d", bxs, *im);
967 if (temp_quality >= pattern_thresh[i_pattern]) {
973 temp_quality -= (pattern_thresh[i_pattern]-1);
981 else if (temp_quality > 3) Q = temp_quality - 3;
986 if (i_pattern == 0) {
988 quality[key_wire][0] = temp_quality;
992 if (static_cast<int>(temp_quality) >
quality[key_wire][1]) {
993 quality[key_wire][1] = temp_quality;
994 quality[key_wire][2] = i_pattern-1;
999 <<
"Pattern found; keywire: " << key_wire
1000 <<
" type: " << ptn_label[i_pattern]
1001 <<
" quality: " << temp_quality <<
"\n";
1006 if (
quality[key_wire][2] == 0)
1008 <<
"Collision Pattern A is chosen" <<
"\n";
1009 else if (
quality[key_wire][2] == 1)
1011 <<
"Collision Pattern B is chosen" <<
"\n";
1026 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1027 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1028 ghost_cleared[key_wire][i_pattern] = 0;
1031 int qual_this =
quality[key_wire][i_pattern];
1032 if (qual_this > 0) {
1035 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1036 if (qual_prev > 0) {
1045 if (qual_prev >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1054 (qual_prev > qual_this) )
1055 ghost_cleared[key_wire][i_pattern] = 1;
1061 if (ghost_cleared[key_wire][i_pattern] == 1) {
1063 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1064 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1065 <<
" by wire " << key_wire-1<<
" q="<<qual_prev;
1070 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1071 if (qual_next > 0) {
1075 if (qual_next > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1084 (qual_next >= qual_this) )
1085 ghost_cleared[key_wire][i_pattern] = 1;
1088 if (ghost_cleared[key_wire][i_pattern] == 1) {
1090 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1091 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1092 <<
" by wire " << key_wire+1<<
" q="<<qual_next;
1101 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1102 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1103 if (ghost_cleared[key_wire][i_pattern] > 0) {
1104 clear(key_wire, i_pattern);
1122 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1123 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1124 ghost_cleared[key_wire][i_pattern] = 0;
1127 int qual_this =
quality[key_wire][i_pattern];
1128 if (qual_this > 0) {
1133 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1134 if (qual_prev > 0) {
1140 if (
runME21ILT_ or runME3141ILT_) qual_prev = (qual_prev & 0x03);
1149 if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1158 (qual_prev > qual_this) )
1159 ghost_cleared[key_wire][i_pattern] = 1;
1165 if (ghost_cleared[key_wire][i_pattern] == 1) {
1167 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1168 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1169 <<
" by wire " << key_wire-1<<
" q="<<qual_prev<<
" dt="<<
dt;
1175 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1176 if (qual_next > 0) {
1183 qual_next = (qual_next & 0x03);
1186 if (qual_next >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1195 (qual_next >= qual_this) )
1196 ghost_cleared[key_wire][i_pattern] = 1;
1199 if (ghost_cleared[key_wire][i_pattern] == 1) {
1201 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1202 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1203 <<
" by wire " << key_wire+1<<
" q="<<qual_next<<
" dt="<<
dt;
1212 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1213 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1214 if (ghost_cleared[key_wire][i_pattern] > 0) {
1215 clear(key_wire, i_pattern);
1225 std::vector<CSCALCTDigi> lct_list;
1235 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1240 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1243 int qual = (
quality[i_wire][0] & 0x03);
1246 lct_list.push_back(lct_info);
1251 int qual = (
quality[i_wire][1] & 0x03);
1254 lct_list.push_back(lct_info);
1255 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" got lct_info: "<<lct_info;
1268 int n_alct_all=0, n_alct=0;
1269 for (std::vector <CSCALCTDigi>::const_iterator plct = lct_list.begin(); plct != lct_list.end(); plct++)
1270 if (plct->isValid() && plct->getBX()==6) n_alct_all++;
1271 for (std::vector <CSCALCTDigi>::const_iterator plct = fourBest.begin(); plct != fourBest.end(); plct++)
1272 if (plct->isValid() && plct->getBX()==6) n_alct++;
1275 <<
" all "<<n_alct_all<<
" found "<<n_alct;
1280 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1281 plct != fourBest.end(); plct++) {
1283 int bx = plct->getBX();
1286 <<
"+++ Bx of ALCT candidate, " << bx <<
", exceeds max allowed, "
1311 if (first_bx < MAX_ALCT_BINS) {
1348 const std::vector<CSCALCTDigi>& all_alcts) {
1354 LogTrace(
"CSCAnodeLCTProcessor") << all_alcts.size() <<
1355 " ALCTs at the input of best-track selector: ";
1356 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1357 plct != all_alcts.end(); plct++) {
1358 if (!plct->isValid())
continue;
1359 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1364 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1365 plct != all_alcts.end(); plct++) {
1366 if (!plct->isValid())
continue;
1375 int bx = (*plct).
getBX();
1376 int accel = (*plct).getAccelerator();
1377 int qual = (*plct).getQuality();
1378 int wire = (*plct).getKeyWG();
1379 bool vA = tA[bx][accel].
isValid();
1380 bool vB = tB[bx][accel].
isValid();
1385 if (!vA || qual > qA || (qual == qA && wire > wA)) {
1386 tA[bx][accel] = *plct;
1388 if (!vB || qual > qB || (qual == qB && wire < wB)) {
1389 tB[bx][accel] = *plct;
1394 for (
int accel = 0; accel <= 1; accel++) {
1396 if (tA[bx][accel].isValid()) {
1398 LogTrace(
"CSCAnodeLCTProcessor") <<
"tA: " << tA[bx][accel];
1399 LogTrace(
"CSCAnodeLCTProcessor") <<
"tB: " << tB[bx][accel];
1401 bestALCTs[bx][accel] = tA[bx][accel];
1404 if (tA[bx][accel] != tB[bx][accel] &&
1405 tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
1406 secondALCTs[bx][accel] = tB[bx][accel];
1413 for (std::vector <CSCALCTDigi>::const_iterator plct =
1414 all_alcts.begin(); plct != all_alcts.end(); plct++) {
1415 if ((*plct).isValid() &&
1416 (*plct).getAccelerator() == accel && (*plct).getBX() == bx &&
1417 (*plct).getQuality() < bestALCTs[bx][accel].
getQuality() &&
1418 (*plct).getQuality() >= secondALCTs[bx][accel].
getQuality() &&
1419 (*plct).getKeyWG() >= secondALCTs[bx][accel].
getKeyWG()) {
1420 secondALCTs[bx][accel] = *plct;
1429 std::vector<CSCALCTDigi> fourBest;
1431 for (
int i = 0;
i < 2;
i++) {
1432 if (bestALCTs[bx][
i].isValid()) fourBest.push_back(bestALCTs[bx][
i]);
1434 for (
int i = 0;
i < 2;
i++) {
1435 if (secondALCTs[bx][
i].isValid()) fourBest.push_back(secondALCTs[bx][
i]);
1440 LogTrace(
"CSCAnodeLCTProcessor") << fourBest.size() <<
" ALCTs selected: ";
1441 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1442 plct != fourBest.end(); plct++) {
1443 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1455 bool returnValue =
false;
1461 if (lhsALCT.
getBX() < rhsALCT.
getBX()) {returnValue =
true;}
1462 if (lhsALCT.
getBX() != rhsALCT.
getBX()) {
return returnValue;}
1467 if (qual1 > qual2) {returnValue =
true;}
1471 else if (qual1 == qual2 &&
1475 {returnValue =
true;}
1491 if (
quality[key_wire][1] > 0) {
1494 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1499 if (
quality[key_wire][0] > 0) {
1502 <<
"trigMode(): accelerator track " << key_wire <<
" disabled" <<
"\n";
1511 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1521 int promotionBit = 1 << 2;
1527 if (
quality[key_wire][0] > 0) {
1530 <<
"alctMode(): accelerator track " << key_wire <<
" ignored" <<
"\n";
1535 if (
quality[key_wire][1] > 0) {
1536 quality[key_wire][1] += promotionBit;
1538 <<
"alctMode(): collision track " << key_wire <<
" promoted" <<
"\n";
1543 if (
quality[key_wire][0] > 0) {
1544 quality[key_wire][0] += promotionBit;
1546 <<
"alctMode(): accelerator track " << key_wire <<
" promoted"<<
"\n";
1551 if (
quality[key_wire][1] > 0) {
1554 <<
"alctMode(): collision track " << key_wire <<
" ignored" <<
"\n";
1562 std::ostringstream strm;
1564 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1565 strm <<
"+ ALCT configuration parameters: +\n";
1566 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1567 strm <<
" fifo_tbins [total number of time bins in DAQ readout] = "
1569 strm <<
" fifo_pretrig [start time of anode raw hits in DAQ readout] = "
1571 strm <<
" drift_delay [drift delay after pre-trigger, in 25 ns bins] = "
1573 strm <<
" nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = "
1575 strm <<
" nplanes_hit_pattern [min. number of layers hit for trigger] = "
1577 strm <<
" nplanes_hit_accel_pretrig [min. number of layers hit for accel."
1579 strm <<
" nplanes_hit_accel_pattern [min. number of layers hit for accel."
1581 strm <<
" trig_mode [enabling/disabling collision/accelerator tracks] = "
1583 strm <<
" accel_mode [preference to collision/accelerator tracks] = "
1585 strm <<
" l1a_window_width [L1Accept window width, in 25 ns bins] = "
1587 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1588 LogDebug(
"CSCAnodeLCTProcessor") << strm.str();
1595 <<
"ME" << ((
theEndcap == 1) ?
"+" :
"-")
1599 std::ostringstream strstrm;
1601 if (i_wire%10 == 0) {
1602 if (i_wire < 100) strstrm << i_wire/10;
1603 else strstrm << (i_wire-100)/10;
1605 else strstrm <<
" ";
1609 strstrm << i_wire%10;
1614 if (wire[i_layer][i_wire].
size() > 0) {
1615 std::vector<int> bx_times = wire[i_layer][i_wire];
1616 strstrm << std::hex << bx_times[0] <<
std::dec;
1623 LogTrace(
"CSCAnodeLCTProcessor") << strstrm.str();
1629 std::vector<CSCALCTDigi> tmpV;
1634 static int lct_bins =
1639 static int ifois = 0;
1649 <<
"; in-time ALCTs are not getting read-out!!! +++" <<
"\n";
1654 <<
"+++ Allowed range of time bins, [0-" << late_tbins
1656 <<
"+++ Set late_tbins to max allowed +++\n";
1657 late_tbins = MAX_ALCT_BINS-1;
1664 std::vector<CSCALCTDigi> all_alcts =
getALCTs();
1665 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1666 plct != all_alcts.end(); plct++) {
1667 if (!plct->isValid())
continue;
1669 int bx = (*plct).getBX();
1673 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1674 <<
": found at bx " << bx <<
", whereas the earliest allowed bx is "
1680 if (bx > late_tbins) {
1682 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1683 <<
": found at bx " << bx <<
", whereas the latest allowed bx is "
1688 tmpV.push_back(*plct);
1695 std::vector<CSCALCTDigi> tmpV;
1710 std::ostringstream strstrm_header;
1712 <<
"\n" <<
"Pattern: " << i_pattern <<
" Key wire: " << key_wire;
1713 for (
int i = 1;
i <= 32;
i++) {
1714 strstrm_header << ((32-
i)%10);
1716 LogTrace(
"CSCAnodeLCTProcessor") << strstrm_header.str();
1719 std::ostringstream strstrm_pulse;
1723 for (
int i = 1;
i <= 32;
i++) {
1724 strstrm_pulse << ((pulse[this_layer][this_wire]>>(32-
i)) & 1);
1727 << strstrm_pulse.str() <<
" on layer " << this_layer;
1732 <<
"-------------------------------------------";
T getParameter(std::string 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])
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
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]
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
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