184 unsigned sector,
unsigned subsector,
188 theEndcap(endcap), theStation(station), theSector(sector),
189 theSubsector(subsector), theTrigChamber(chamber) {
190 static std::atomic<bool> config_dumped{
false};
197 conf.
getParameter<
unsigned int>(
"alctNplanesHitPretrig");
199 conf.
getParameter<
unsigned int>(
"alctNplanesHitPattern");
201 conf.
getParameter<
unsigned int>(
"alctNplanesHitAccelPretrig");
203 conf.
getParameter<
unsigned int>(
"alctNplanesHitAccelPattern");
243 if ((infoV > 0 || isSLHC) && !config_dumped) {
246 config_dumped =
true;
284 static std::atomic<bool> config_dumped{
false};
299 if (!config_dumped) {
302 config_dumped =
true;
351 static std::atomic<bool> config_dumped{
false};
366 if (!config_dumped) {
369 config_dumped =
true;
377 static const unsigned int max_fifo_tbins = 1 << 5;
378 static const unsigned int max_fifo_pretrig = 1 << 5;
379 static const unsigned int max_drift_delay = 1 << 2;
380 static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
381 static const unsigned int max_nplanes_hit_pattern = 1 << 3;
382 static const unsigned int max_nplanes_hit_accel_pretrig = 1 << 3;
383 static const unsigned int max_nplanes_hit_accel_pattern = 1 << 3;
384 static const unsigned int max_trig_mode = 1 << 2;
385 static const unsigned int max_accel_mode = 1 << 2;
392 <<
", exceeds max allowed, " << max_fifo_tbins-1 <<
" +++\n" 393 <<
"+++ Try to proceed with the default value, fifo_tbins=" 400 <<
", exceeds max allowed, " << max_fifo_pretrig-1 <<
" +++\n" 401 <<
"+++ Try to proceed with the default value, fifo_pretrig=" 408 <<
", exceeds max allowed, " << max_drift_delay-1 <<
" +++\n" 409 <<
"+++ Try to proceed with the default value, drift_delay=" 416 <<
", exceeds max allowed, " << max_nplanes_hit_pretrig-1 <<
" +++\n" 417 <<
"+++ Try to proceed with the default value, nplanes_hit_pretrig=" 424 <<
", exceeds max allowed, " << max_nplanes_hit_pattern-1 <<
" +++\n" 425 <<
"+++ Try to proceed with the default value, nplanes_hit_pattern=" 431 <<
"+++ Value of nplanes_hit_accel_pretrig, " 433 << max_nplanes_hit_accel_pretrig-1 <<
" +++\n" 434 <<
"+++ Try to proceed with the default value, " 440 <<
"+++ Value of nplanes_hit_accel_pattern, " 442 << max_nplanes_hit_accel_pattern-1 <<
" +++\n" 443 <<
"+++ Try to proceed with the default value, " 449 <<
"+++ Value of trig_mode, " <<
trig_mode 450 <<
", exceeds max allowed, " << max_trig_mode-1 <<
" +++\n" 451 <<
"+++ Try to proceed with the default value, trig_mode=" 458 <<
", exceeds max allowed, " << max_accel_mode-1 <<
" +++\n" 459 <<
"+++ Try to proceed with the default value, accel_mode=" 466 <<
", exceeds max allowed, " << max_l1a_window_width-1 <<
" +++\n" 467 <<
"+++ Try to proceed with the default value, l1a_window_width=" 482 if (pattern == 0)
quality[wire][0] = -999;
489 std::vector<CSCALCTDigi>
494 static std::atomic<bool> config_dumped{
false};
498 config_dumped =
true;
514 <<
" found in ME" << ((
theEndcap == 1) ?
"+" :
"-")
520 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
526 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
530 <<
" is not defined in current geometry! +++\n" 531 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
538 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
543 <<
"; ALCT emulation skipped! +++";
544 std::vector<CSCALCTDigi> emptyV;
560 const unsigned int min_layers =
568 unsigned int layersHit = 0;
571 if (!wire[i_layer][i_wire].
empty()) {layersHit++;
break;}
574 if (layersHit >= min_layers)
run(wire);
578 std::vector<CSCALCTDigi> tmpV =
getALCTs();
597 if (!chamber_empty) {
599 unsigned int start_bx = 0;
601 while (start_bx < stop_bx) {
636 digiV[i_layer].clear();
651 <<
"found " <<
digiV[i_layer].size()
652 <<
" wire digi(s) in layer " << i_layer <<
" of ME" 656 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
657 pld !=
digiV[i_layer].end(); pld++) {
658 LogTrace(
"CSCAnodeLCTProcessor") <<
" " << (*pld);
671 digiIt != rwired.second; ++digiIt) {
672 digiV[
id.layer()-1].push_back(*digiIt);
683 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
684 pld !=
digiV[i_layer].end(); pld++) {
685 int i_wire = pld->getWireGroup()-1;
686 std::vector<int> bx_times = pld->getTimeBinsOn();
691 <<
"+++ Found wire digi with wrong wire number = " << i_wire
692 <<
" (max wires = " <<
numWireGroups <<
"); skipping it... +++\n";
702 int last_time = -999;
704 wire[i_layer][i_wire].push_back(0);
705 wire[i_layer][i_wire].push_back(6);
708 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
710 if (
i > 0 && bx_times[
i] == (bx_times[
i-1]+1))
continue;
713 <<
"Digi on layer " << i_layer <<
" wire " << i_wire
714 <<
" at time " << bx_times[
i];
719 if (last_time < 0 || ((bx_times[
i]-last_time) >= 6) ) {
720 wire[i_layer][i_wire].push_back(bx_times[
i]);
721 last_time = bx_times[
i];
726 <<
"+++ Skipping wire digi: wire = " << i_wire
727 <<
" layer = " << i_layer <<
", bx = " << bx_times[
i] <<
" +++";
742 bool chamber_empty =
true;
743 int i_wire, i_layer, digi_num;
744 const unsigned int bits_in_pulse = 8*
sizeof(
pulse[0][0]);
748 pulse[i_layer][i_wire] = 0;
752 for (
int j = 0; j < 3; j++)
quality[i_wire][j] = -999;
758 if (!wire[i_layer][i_wire].
empty()) {
759 std::vector<int> bx_times = wire[i_layer][i_wire];
760 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
762 if (bx_times[
i] < 0 || bx_times[
i] +
hit_persist >= bits_in_pulse) {
764 <<
"+++ BX time of wire digi (wire = " << i_wire
765 <<
" layer = " << i_layer <<
") bx = " << bx_times[
i]
766 <<
" is not within the range (0-" << bits_in_pulse
767 <<
"] allowed for pulse extension. Skip this digi! +++\n";
772 if (chamber_empty) chamber_empty =
false;
775 for (
unsigned int bx = bx_times[
i];
777 pulse[i_layer][i_wire] =
pulse[i_layer][i_wire] | (1 << bx);
782 <<
"Wire digi: layer " << i_layer
783 <<
" digi #" << ++digi_num <<
" wire group " << i_wire
784 <<
" time " << bx_times[
i];
786 std::ostringstream strstrm;
787 for (
int i = 1;
i <= 32;
i++) {
788 strstrm << ((pulse[i_layer][i_wire]>>(32-
i)) & 1);
790 LogTrace(
"CSCAnodeLCTProcessor") <<
" Pulse: " << strstrm.str();
798 if (
infoV > 1 && !chamber_empty) {
802 return chamber_empty;
810 unsigned int layers_hit;
812 int this_layer, this_wire;
815 const unsigned int nplanes_hit_pretrig_acc =
827 for (
unsigned int bx_time = start_bx; bx_time < stop_bx; bx_time++) {
830 hit_layer[i_layer] =
false;
839 if (((
pulse[this_layer][this_wire] >> bx_time) & 1) == 1) {
841 if (hit_layer[this_layer] ==
false){
842 hit_layer[this_layer] =
true;
848 if (layers_hit >= pretrig_thresh[i_pattern]) {
852 <<
"Pretrigger was satisfied for wire: " << key_wire
853 <<
" pattern: " << i_pattern
854 <<
" bx_time: " << bx_time;
875 unsigned int temp_quality;
876 int this_layer, this_wire, delta_wire;
879 const unsigned int nplanes_hit_pattern_acc =
885 const std::string ptn_label[] = {
"Accelerator",
"CollisionA",
"CollisionB"};
890 hit_layer[i_layer] =
false;
892 double num_pattern_hits=0., times_sum=0.;
893 std::multiset<int> mset_for_median;
894 mset_for_median.clear();
900 this_wire = delta_wire + key_wire;
905 if ( ( (
pulse[this_layer][this_wire] >>
910 if (hit_layer[this_layer] ==
false){
913 hit_layer[this_layer] =
true;
916 <<
"bx_time: " <<
first_bx[key_wire]
917 <<
" pattern: " << i_pattern <<
" keywire: " << key_wire
918 <<
" layer: " << this_layer
919 <<
" quality: " << temp_quality;
923 if (
abs(delta_wire)<2) {
928 if (((
pulse[this_layer][this_wire] >> (first_bx_layer-1)) & 1) == 1) first_bx_layer--;
931 times_sum += (double)first_bx_layer;
932 num_pattern_hits += 1.;
933 mset_for_median.insert(first_bx_layer);
936 <<
" 1st bx in layer: "<<first_bx_layer
937 <<
" sum bx: "<<times_sum
938 <<
" #pat. hits: "<<num_pattern_hits;
946 const int sz = mset_for_median.size();
948 std::multiset<int>::iterator im = mset_for_median.begin();
949 if (sz > 1) std::advance(im,sz/2-1);
956 for (im = mset_for_median.begin(); im != mset_for_median.end(); im++)
957 sprintf(bxs,
"%s %d", bxs, *im);
963 if (temp_quality >= pattern_thresh[i_pattern]) {
969 temp_quality -= (pattern_thresh[i_pattern]-1);
977 else if (temp_quality > 3) Q = temp_quality - 3;
982 if (i_pattern == 0) {
984 quality[key_wire][0] = temp_quality;
988 if (static_cast<int>(temp_quality) >
quality[key_wire][1]) {
989 quality[key_wire][1] = temp_quality;
990 quality[key_wire][2] = i_pattern-1;
995 <<
"Pattern found; keywire: " << key_wire
996 <<
" type: " << ptn_label[i_pattern]
997 <<
" quality: " << temp_quality <<
"\n";
1002 if (
quality[key_wire][2] == 0)
1004 <<
"Collision Pattern A is chosen" <<
"\n";
1005 else if (
quality[key_wire][2] == 1)
1007 <<
"Collision Pattern B is chosen" <<
"\n";
1022 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1023 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1024 ghost_cleared[key_wire][i_pattern] = 0;
1027 int qual_this =
quality[key_wire][i_pattern];
1028 if (qual_this > 0) {
1031 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1032 if (qual_prev > 0) {
1041 if (qual_prev >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1050 (qual_prev > qual_this) )
1051 ghost_cleared[key_wire][i_pattern] = 1;
1057 if (ghost_cleared[key_wire][i_pattern] == 1) {
1059 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1060 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1061 <<
" by wire " << key_wire-1<<
" q="<<qual_prev;
1066 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1067 if (qual_next > 0) {
1071 if (qual_next > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1080 (qual_next >= qual_this) )
1081 ghost_cleared[key_wire][i_pattern] = 1;
1084 if (ghost_cleared[key_wire][i_pattern] == 1) {
1086 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1087 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1088 <<
" by wire " << key_wire+1<<
" q="<<qual_next;
1097 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1098 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1099 if (ghost_cleared[key_wire][i_pattern] > 0) {
1100 clear(key_wire, i_pattern);
1118 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1119 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1120 ghost_cleared[key_wire][i_pattern] = 0;
1123 int qual_this =
quality[key_wire][i_pattern];
1124 if (qual_this > 0) {
1129 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1130 if (qual_prev > 0) {
1136 if (
runME21ILT_ or runME3141ILT_) qual_prev = (qual_prev & 0x03);
1145 if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1154 (qual_prev > qual_this) )
1155 ghost_cleared[key_wire][i_pattern] = 1;
1161 if (ghost_cleared[key_wire][i_pattern] == 1) {
1163 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1164 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1165 <<
" by wire " << key_wire-1<<
" q="<<qual_prev<<
" dt="<<
dt;
1171 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1172 if (qual_next > 0) {
1179 qual_next = (qual_next & 0x03);
1182 if (qual_next >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1191 (qual_next >= qual_this) )
1192 ghost_cleared[key_wire][i_pattern] = 1;
1195 if (ghost_cleared[key_wire][i_pattern] == 1) {
1197 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1198 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1199 <<
" by wire " << key_wire+1<<
" q="<<qual_next<<
" dt="<<
dt;
1208 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1209 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1210 if (ghost_cleared[key_wire][i_pattern] > 0) {
1211 clear(key_wire, i_pattern);
1221 std::vector<CSCALCTDigi> lct_list;
1231 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1236 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1239 int qual = (
quality[i_wire][0] & 0x03);
1242 lct_list.push_back(lct_info);
1247 int qual = (
quality[i_wire][1] & 0x03);
1250 lct_list.push_back(lct_info);
1251 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" got lct_info: "<<lct_info;
1264 int n_alct_all=0, n_alct=0;
1265 for (std::vector <CSCALCTDigi>::const_iterator plct = lct_list.begin(); plct != lct_list.end(); plct++)
1266 if (plct->isValid() && plct->getBX()==6) n_alct_all++;
1267 for (std::vector <CSCALCTDigi>::const_iterator plct = fourBest.begin(); plct != fourBest.end(); plct++)
1268 if (plct->isValid() && plct->getBX()==6) n_alct++;
1271 <<
" all "<<n_alct_all<<
" found "<<n_alct;
1276 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1277 plct != fourBest.end(); plct++) {
1279 int bx = plct->getBX();
1282 <<
"+++ Bx of ALCT candidate, " << bx <<
", exceeds max allowed, " 1307 if (first_bx < CSCConstants::MAX_ALCT_TBINS) {
1344 const std::vector<CSCALCTDigi>& all_alcts) {
1350 LogTrace(
"CSCAnodeLCTProcessor") << all_alcts.size() <<
1351 " ALCTs at the input of best-track selector: ";
1352 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1353 plct != all_alcts.end(); plct++) {
1354 if (!plct->isValid())
continue;
1355 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1360 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1361 plct != all_alcts.end(); plct++) {
1362 if (!plct->isValid())
continue;
1371 int bx = (*plct).
getBX();
1372 int accel = (*plct).getAccelerator();
1373 int qual = (*plct).getQuality();
1374 int wire = (*plct).getKeyWG();
1375 bool vA = tA[bx][accel].
isValid();
1376 bool vB = tB[bx][accel].
isValid();
1381 if (!vA || qual > qA || (qual == qA && wire > wA)) {
1382 tA[bx][accel] = *plct;
1384 if (!vB || qual > qB || (qual == qB && wire < wB)) {
1385 tB[bx][accel] = *plct;
1390 for (
int accel = 0; accel <= 1; accel++) {
1392 if (tA[bx][accel].isValid()) {
1394 LogTrace(
"CSCAnodeLCTProcessor") <<
"tA: " << tA[bx][accel];
1395 LogTrace(
"CSCAnodeLCTProcessor") <<
"tB: " << tB[bx][accel];
1397 bestALCTs[bx][accel] = tA[bx][accel];
1400 if (tA[bx][accel] != tB[bx][accel] &&
1401 tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
1402 secondALCTs[bx][accel] = tB[bx][accel];
1409 for (std::vector <CSCALCTDigi>::const_iterator plct =
1410 all_alcts.begin(); plct != all_alcts.end(); plct++) {
1411 if ((*plct).isValid() &&
1412 (*plct).getAccelerator() == accel && (*plct).getBX() == bx &&
1413 (*plct).getQuality() < bestALCTs[bx][accel].
getQuality() &&
1414 (*plct).getQuality() >= secondALCTs[bx][accel].
getQuality() &&
1415 (*plct).getKeyWG() >= secondALCTs[bx][accel].
getKeyWG()) {
1416 secondALCTs[bx][accel] = *plct;
1425 std::vector<CSCALCTDigi> fourBest;
1427 for (
int i = 0;
i < 2;
i++) {
1428 if (bestALCTs[bx][
i].isValid()) fourBest.push_back(bestALCTs[bx][
i]);
1430 for (
int i = 0;
i < 2;
i++) {
1431 if (secondALCTs[bx][
i].isValid()) fourBest.push_back(secondALCTs[bx][
i]);
1436 LogTrace(
"CSCAnodeLCTProcessor") << fourBest.size() <<
" ALCTs selected: ";
1437 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1438 plct != fourBest.end(); plct++) {
1439 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1451 bool returnValue =
false;
1457 if (lhsALCT.
getBX() < rhsALCT.
getBX()) {returnValue =
true;}
1458 if (lhsALCT.
getBX() != rhsALCT.
getBX()) {
return returnValue;}
1463 if (qual1 > qual2) {returnValue =
true;}
1467 else if (qual1 == qual2 &&
1471 {returnValue =
true;}
1487 if (
quality[key_wire][1] > 0) {
1490 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1495 if (
quality[key_wire][0] > 0) {
1498 <<
"trigMode(): accelerator track " << key_wire <<
" disabled" <<
"\n";
1507 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1517 int promotionBit = 1 << 2;
1523 if (
quality[key_wire][0] > 0) {
1526 <<
"alctMode(): accelerator track " << key_wire <<
" ignored" <<
"\n";
1531 if (
quality[key_wire][1] > 0) {
1532 quality[key_wire][1] += promotionBit;
1534 <<
"alctMode(): collision track " << key_wire <<
" promoted" <<
"\n";
1539 if (
quality[key_wire][0] > 0) {
1540 quality[key_wire][0] += promotionBit;
1542 <<
"alctMode(): accelerator track " << key_wire <<
" promoted"<<
"\n";
1547 if (
quality[key_wire][1] > 0) {
1550 <<
"alctMode(): collision track " << key_wire <<
" ignored" <<
"\n";
1558 std::ostringstream strm;
1560 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1561 strm <<
"+ ALCT configuration parameters: +\n";
1562 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1563 strm <<
" fifo_tbins [total number of time bins in DAQ readout] = " 1565 strm <<
" fifo_pretrig [start time of anode raw hits in DAQ readout] = " 1567 strm <<
" drift_delay [drift delay after pre-trigger, in 25 ns bins] = " 1569 strm <<
" nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = " 1571 strm <<
" nplanes_hit_pattern [min. number of layers hit for trigger] = " 1573 strm <<
" nplanes_hit_accel_pretrig [min. number of layers hit for accel." 1575 strm <<
" nplanes_hit_accel_pattern [min. number of layers hit for accel." 1577 strm <<
" trig_mode [enabling/disabling collision/accelerator tracks] = " 1579 strm <<
" accel_mode [preference to collision/accelerator tracks] = " 1581 strm <<
" l1a_window_width [L1Accept window width, in 25 ns bins] = " 1583 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1584 LogDebug(
"CSCAnodeLCTProcessor") << strm.str();
1591 <<
"ME" << ((
theEndcap == 1) ?
"+" :
"-")
1595 std::ostringstream strstrm;
1597 if (i_wire%10 == 0) {
1598 if (i_wire < 100) strstrm << i_wire/10;
1599 else strstrm << (i_wire-100)/10;
1601 else strstrm <<
" ";
1605 strstrm << i_wire%10;
1610 if (!wire[i_layer][i_wire].
empty()) {
1611 std::vector<int> bx_times = wire[i_layer][i_wire];
1612 strstrm << std::hex << bx_times[0] <<
std::dec;
1619 LogTrace(
"CSCAnodeLCTProcessor") << strstrm.str();
1625 std::vector<CSCALCTDigi> tmpV;
1630 const int lct_bins =
1633 static std::atomic<int> late_tbins{
early_tbins + lct_bins};
1635 static std::atomic<int> ifois{0};
1645 <<
"; in-time ALCTs are not getting read-out!!! +++" <<
"\n";
1650 <<
"+++ Allowed range of time bins, [0-" << late_tbins
1652 <<
"+++ Set late_tbins to max allowed +++\n";
1653 late_tbins = CSCConstants::MAX_ALCT_TBINS-1;
1660 std::vector<CSCALCTDigi> all_alcts =
getALCTs();
1661 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1662 plct != all_alcts.end(); plct++) {
1663 if (!plct->isValid())
continue;
1665 int bx = (*plct).getBX();
1669 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1670 <<
": found at bx " << bx <<
", whereas the earliest allowed bx is " 1676 if (bx > late_tbins) {
1678 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1679 <<
": found at bx " << bx <<
", whereas the latest allowed bx is " 1684 tmpV.push_back(*plct);
1691 std::vector<CSCALCTDigi> tmpV;
1706 std::ostringstream strstrm_header;
1708 <<
"\n" <<
"Pattern: " << i_pattern <<
" Key wire: " << key_wire;
1709 for (
int i = 1;
i <= 32;
i++) {
1710 strstrm_header << ((32-
i)%10);
1712 LogTrace(
"CSCAnodeLCTProcessor") << strstrm_header.str();
1715 std::ostringstream strstrm_pulse;
1719 for (
int i = 1;
i <= 32;
i++) {
1720 strstrm_pulse << ((pulse[this_layer][this_wire]>>(32-
i)) & 1);
1723 << strstrm_pulse.str() <<
" on layer " << this_layer;
1728 <<
"-------------------------------------------";
static const int time_weights[CSCConstants::MAX_WIRES_IN_PATTERN]
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
void checkConfigParameters()
int first_bx_corrected[CSCConstants::MAX_NUM_WIRES]
static const unsigned int def_drift_delay
static const unsigned int def_fifo_tbins
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)
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.
static const int pattern_envelope[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
void ghostCancellationLogic()
static const unsigned int def_nplanes_hit_accel_pretrig
static const unsigned int def_fifo_pretrig
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void accelMode(const int key_wire)
Abs< T >::type abs(const T &t)
int pattern_mask[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
unsigned int l1a_window_width
static const unsigned int def_nplanes_hit_pattern
unsigned int alctTrigMode() const
bool preTrigger(const int key_wire, const int start_bx)
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
CSCALCTDigi secondALCT[CSCConstants::MAX_ALCT_TBINS]
static const unsigned int def_l1a_window_width
bool ghost_cancellation_side_quality
static const int pattern_mask_open[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
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()
const CSCGeometry * csc_g
unsigned int alctNplanesHitAccelPretrig() const
void setDefaultConfigParameters()
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
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
CSCALCTDigi bestALCT[CSCConstants::MAX_ALCT_TBINS]
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)
static const int pattern_mask_r1[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
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
std::vector< CSCWireDigi > digiV[CSCConstants::NUM_LAYERS]
static int chamberFromTriggerLabels(int TriggerSector, int TriggerSubSector, int station, int TriggerCSCID)
static const int pattern_mask_slim[CSCConstants::NUM_ALCT_PATTERNS][CSCConstants::MAX_WIRES_IN_PATTERN]
unsigned int nplanes_hit_pretrig
std::vector< CSCALCTDigi > getALCTs()
static const unsigned int def_nplanes_hit_pretrig
unsigned int nplanes_hit_accel_pretrig
unsigned int alctFifoTbins() const