186 unsigned sector,
unsigned subsector,
190 theEndcap(endcap), theStation(station), theSector(sector),
191 theSubsector(subsector), theTrigChamber(chamber) {
192 static bool config_dumped =
false;
199 conf.
getParameter<
unsigned int>(
"alctNplanesHitPretrig");
201 conf.
getParameter<
unsigned int>(
"alctNplanesHitPattern");
203 conf.
getParameter<
unsigned int>(
"alctNplanesHitAccelPretrig");
205 conf.
getParameter<
unsigned int>(
"alctNplanesHitAccelPattern");
229 int fpga_latency = 6;
230 if (early_tbins<0) early_tbins = fifo_pretrig - fpga_latency;
246 if ((infoV > 0 || isSLHC) && !config_dumped) {
249 config_dumped =
true;
250 if (isSLHC)
std::cout<<
"disableME1a = "<<disableME1a<<std::endl;
277 theEndcap(1), theStation(1), theSector(1),
278 theSubsector(1), theTrigChamber(1) {
280 static bool config_dumped =
false;
295 if (!config_dumped) {
298 config_dumped =
true;
347 static bool config_dumped =
false;
362 if (!config_dumped) {
365 config_dumped =
true;
373 static const unsigned int max_fifo_tbins = 1 << 5;
374 static const unsigned int max_fifo_pretrig = 1 << 5;
375 static const unsigned int max_drift_delay = 1 << 2;
376 static const unsigned int max_nplanes_hit_pretrig = 1 << 3;
377 static const unsigned int max_nplanes_hit_pattern = 1 << 3;
378 static const unsigned int max_nplanes_hit_accel_pretrig = 1 << 3;
379 static const unsigned int max_nplanes_hit_accel_pattern = 1 << 3;
380 static const unsigned int max_trig_mode = 1 << 2;
381 static const unsigned int max_accel_mode = 1 << 2;
382 static const unsigned int max_l1a_window_width =
MAX_ALCT_BINS;
388 <<
", exceeds max allowed, " << max_fifo_tbins-1 <<
" +++\n"
389 <<
"+++ Try to proceed with the default value, fifo_tbins="
396 <<
", exceeds max allowed, " << max_fifo_pretrig-1 <<
" +++\n"
397 <<
"+++ Try to proceed with the default value, fifo_pretrig="
404 <<
", exceeds max allowed, " << max_drift_delay-1 <<
" +++\n"
405 <<
"+++ Try to proceed with the default value, drift_delay="
412 <<
", exceeds max allowed, " << max_nplanes_hit_pretrig-1 <<
" +++\n"
413 <<
"+++ Try to proceed with the default value, nplanes_hit_pretrig="
420 <<
", exceeds max allowed, " << max_nplanes_hit_pattern-1 <<
" +++\n"
421 <<
"+++ Try to proceed with the default value, nplanes_hit_pattern="
427 <<
"+++ Value of nplanes_hit_accel_pretrig, "
429 << max_nplanes_hit_accel_pretrig-1 <<
" +++\n"
430 <<
"+++ Try to proceed with the default value, "
436 <<
"+++ Value of nplanes_hit_accel_pattern, "
438 << max_nplanes_hit_accel_pattern-1 <<
" +++\n"
439 <<
"+++ Try to proceed with the default value, "
445 <<
"+++ Value of trig_mode, " <<
trig_mode
446 <<
", exceeds max allowed, " << max_trig_mode-1 <<
" +++\n"
447 <<
"+++ Try to proceed with the default value, trig_mode="
454 <<
", exceeds max allowed, " << max_accel_mode-1 <<
" +++\n"
455 <<
"+++ Try to proceed with the default value, accel_mode="
462 <<
", exceeds max allowed, " << max_l1a_window_width-1 <<
" +++\n"
463 <<
"+++ Try to proceed with the default value, l1a_window_width="
478 if (pattern == 0)
quality[wire][0] = -999;
485 std::vector<CSCALCTDigi>
492 static bool config_dumped =
false;
496 config_dumped =
true;
511 <<
" found in ME" << ((
theEndcap == 1) ?
"+" :
"-")
517 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
523 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
527 <<
" is not defined in current geometry! +++\n"
528 <<
"+++ CSC geometry looks garbled; no emulation possible +++\n";
535 <<
"+++ ME" << ((
theEndcap == 1) ?
"+" :
"-")
540 <<
"; ALCT emulation skipped! +++";
541 std::vector<CSCALCTDigi> emptyV;
557 const unsigned int min_layers =
565 unsigned int layersHit = 0;
568 if (!wire[i_layer][i_wire].
empty()) {layersHit++;
break;}
571 if (layersHit >= min_layers)
run(wire);
575 std::vector<CSCALCTDigi> tmpV =
getALCTs();
585 bool trigger =
false;
594 if (!chamber_empty) {
596 unsigned int start_bx = 0;
598 while (start_bx < stop_bx) {
633 digiV[i_layer].clear();
648 <<
"found " <<
digiV[i_layer].size()
649 <<
" wire digi(s) in layer " << i_layer <<
" of ME"
653 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
654 pld !=
digiV[i_layer].end(); pld++) {
655 LogTrace(
"CSCAnodeLCTProcessor") <<
" " << (*pld);
668 digiIt != rwired.second; ++digiIt) {
669 digiV[
id.layer()-1].push_back(*digiIt);
680 for (std::vector<CSCWireDigi>::iterator pld =
digiV[i_layer].
begin();
681 pld !=
digiV[i_layer].end(); pld++) {
682 int i_wire = pld->getWireGroup()-1;
683 std::vector<int> bx_times = pld->getTimeBinsOn();
688 <<
"+++ Found wire digi with wrong wire number = " << i_wire
689 <<
" (max wires = " <<
numWireGroups <<
"); skipping it... +++\n";
699 int last_time = -999;
701 wire[i_layer][i_wire].push_back(0);
702 wire[i_layer][i_wire].push_back(6);
705 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
707 if (
i > 0 && bx_times[
i] == (bx_times[
i-1]+1))
continue;
710 <<
"Digi on layer " << i_layer <<
" wire " << i_wire
711 <<
" at time " << bx_times[
i];
716 if (last_time < 0 || ((bx_times[
i]-last_time) >= 6) ) {
717 wire[i_layer][i_wire].push_back(bx_times[
i]);
718 last_time = bx_times[
i];
723 <<
"+++ Skipping wire digi: wire = " << i_wire
724 <<
" layer = " << i_layer <<
", bx = " << bx_times[
i] <<
" +++";
739 bool chamber_empty =
true;
740 int i_wire, i_layer, digi_num;
741 static unsigned int bits_in_pulse = 8*
sizeof(
pulse[0][0]);
745 pulse[i_layer][i_wire] = 0;
749 for (
int j = 0;
j < 3;
j++)
quality[i_wire][
j] = -999;
755 if (wire[i_layer][i_wire].
size() > 0) {
756 std::vector<int> bx_times = wire[i_layer][i_wire];
757 for (
unsigned int i = 0;
i < bx_times.size();
i++) {
759 if (bx_times[
i] < 0 || bx_times[
i] +
hit_persist >= bits_in_pulse) {
761 <<
"+++ BX time of wire digi (wire = " << i_wire
762 <<
" layer = " << i_layer <<
") bx = " << bx_times[
i]
763 <<
" is not within the range (0-" << bits_in_pulse
764 <<
"] allowed for pulse extension. Skip this digi! +++\n";
769 if (chamber_empty) chamber_empty =
false;
772 for (
unsigned int bx = bx_times[
i];
774 pulse[i_layer][i_wire] =
pulse[i_layer][i_wire] | (1 << bx);
779 <<
"Wire digi: layer " << i_layer
780 <<
" digi #" << ++digi_num <<
" wire group " << i_wire
781 <<
" time " << bx_times[
i];
783 std::ostringstream strstrm;
784 for (
int i = 1;
i <= 32;
i++) {
785 strstrm << ((pulse[i_layer][i_wire]>>(32-
i)) & 1);
787 LogTrace(
"CSCAnodeLCTProcessor") <<
" Pulse: " << strstrm.str();
795 if (
infoV > 1 && !chamber_empty) {
799 return chamber_empty;
807 unsigned int layers_hit;
809 int this_layer, this_wire;
812 const unsigned int nplanes_hit_pretrig_acc =
824 for (
unsigned int bx_time = start_bx; bx_time < stop_bx; bx_time++) {
827 hit_layer[i_layer] =
false;
836 if (((
pulse[this_layer][this_wire] >> bx_time) & 1) == 1) {
838 if (hit_layer[this_layer] ==
false){
839 hit_layer[this_layer] =
true;
845 if (layers_hit >= pretrig_thresh[i_pattern]) {
849 <<
"Pretrigger was satisfied for wire: " << key_wire
850 <<
" pattern: " << i_pattern
851 <<
" bx_time: " << bx_time;
870 bool trigger =
false;
872 unsigned int temp_quality;
873 int this_layer, this_wire, delta_wire;
876 const unsigned int nplanes_hit_pattern_acc =
882 const std::string ptn_label[] = {
"Accelerator",
"CollisionA",
"CollisionB"};
887 hit_layer[i_layer] =
false;
889 double num_pattern_hits=0., times_sum=0.;
890 std::multiset<int> mset_for_median;
891 mset_for_median.clear();
897 this_wire = delta_wire + key_wire;
902 if ( ( (
pulse[this_layer][this_wire] >>
907 if (hit_layer[this_layer] ==
false){
910 hit_layer[this_layer] =
true;
913 <<
"bx_time: " <<
first_bx[key_wire]
914 <<
" pattern: " << i_pattern <<
" keywire: " << key_wire
915 <<
" layer: " << this_layer
916 <<
" quality: " << temp_quality;
920 if (
abs(delta_wire)<2) {
925 if (((
pulse[this_layer][this_wire] >> (first_bx_layer-1)) & 1) == 1) first_bx_layer--;
928 times_sum += (double)first_bx_layer;
929 num_pattern_hits += 1.;
930 mset_for_median.insert(first_bx_layer);
933 <<
" 1st bx in layer: "<<first_bx_layer
934 <<
" sum bx: "<<times_sum
935 <<
" #pat. hits: "<<num_pattern_hits;
943 const int sz = mset_for_median.size();
945 std::multiset<int>::iterator im = mset_for_median.begin();
946 if (sz > 1) std::advance(im,sz/2-1);
953 for (im = mset_for_median.begin(); im != mset_for_median.end(); im++)
954 sprintf(bxs,
"%s %d", bxs, *im);
960 if (temp_quality >= pattern_thresh[i_pattern]) {
966 temp_quality -= (pattern_thresh[i_pattern]-1);
971 if (temp_quality > 3) temp_quality -= 3;
972 else temp_quality = 0;
975 if (i_pattern == 0) {
977 quality[key_wire][0] = temp_quality;
981 if (static_cast<int>(temp_quality) >
quality[key_wire][1]) {
982 quality[key_wire][1] = temp_quality;
983 quality[key_wire][2] = i_pattern-1;
988 <<
"Pattern found; keywire: " << key_wire
989 <<
" type: " << ptn_label[i_pattern]
990 <<
" quality: " << temp_quality <<
"\n";
997 <<
"Collision Pattern A is chosen" <<
"\n";
998 else if (
quality[key_wire][2] == 1)
1000 <<
"Collision Pattern B is chosen" <<
"\n";
1015 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1016 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1017 ghost_cleared[key_wire][i_pattern] = 0;
1020 int qual_this =
quality[key_wire][i_pattern];
1021 if (qual_this > 0) {
1024 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1025 if (qual_prev > 0) {
1034 if (qual_prev >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1043 (qual_prev > qual_this) )
1044 ghost_cleared[key_wire][i_pattern] = 1;
1050 if (ghost_cleared[key_wire][i_pattern] == 1) {
1052 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1053 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1054 <<
" by wire " << key_wire-1<<
" q="<<qual_prev;
1059 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1060 if (qual_next > 0) {
1064 if (qual_next > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1073 (qual_next >= qual_this) )
1074 ghost_cleared[key_wire][i_pattern] = 1;
1077 if (ghost_cleared[key_wire][i_pattern] == 1) {
1079 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1080 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1081 <<
" by wire " << key_wire+1<<
" q="<<qual_next;
1090 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1091 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1092 if (ghost_cleared[key_wire][i_pattern] > 0) {
1093 clear(key_wire, i_pattern);
1111 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1112 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1113 ghost_cleared[key_wire][i_pattern] = 0;
1116 int qual_this =
quality[key_wire][i_pattern];
1117 if (qual_this > 0) {
1121 int qual_prev = (key_wire > 0) ?
quality[key_wire-1][i_pattern] : 0;
1122 if (qual_prev > 0) {
1134 if (qual_prev > qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1143 (qual_prev > qual_this) )
1144 ghost_cleared[key_wire][i_pattern] = 1;
1150 if (ghost_cleared[key_wire][i_pattern] == 1) {
1152 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1153 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1154 <<
" by wire " << key_wire-1<<
" q="<<qual_prev<<
" dt="<<
dt;
1160 (key_wire < numWireGroups-1) ?
quality[key_wire+1][i_pattern] : 0;
1161 if (qual_next > 0) {
1168 if (qual_next >= qual_this) ghost_cleared[key_wire][i_pattern] = 1;
1177 (qual_next >= qual_this) )
1178 ghost_cleared[key_wire][i_pattern] = 1;
1181 if (ghost_cleared[key_wire][i_pattern] == 1) {
1183 << ((i_pattern == 0) ?
"Accelerator" :
"Collision")
1184 <<
" pattern ghost cancelled on key_wire " << key_wire <<
" q="<<qual_this
1185 <<
" by wire " << key_wire+1<<
" q="<<qual_next<<
" dt="<<
dt;
1194 for (
int key_wire = 0; key_wire <
numWireGroups; key_wire++) {
1195 for (
int i_pattern = 0; i_pattern < 2; i_pattern++) {
1196 if (ghost_cleared[key_wire][i_pattern] > 0) {
1197 clear(key_wire, i_pattern);
1207 std::vector<CSCALCTDigi> lct_list;
1217 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1222 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" bx="<<bx<<
" fbx="<<fbx;
1225 int qual = (
quality[i_wire][0] & 0x03);
1228 lct_list.push_back(lct_info);
1233 int qual = (
quality[i_wire][1] & 0x03);
1236 lct_list.push_back(lct_info);
1237 if (
infoV>1)
LogTrace(
"CSCAnodeLCTProcessor")<<
" got lct_info: "<<lct_info;
1250 int n_alct_all=0, n_alct=0;
1251 for (std::vector <CSCALCTDigi>::const_iterator plct = lct_list.begin(); plct != lct_list.end(); plct++)
1252 if (plct->isValid() && plct->getBX()==6) n_alct_all++;
1253 for (std::vector <CSCALCTDigi>::const_iterator plct = fourBest.begin(); plct != fourBest.end(); plct++)
1254 if (plct->isValid() && plct->getBX()==6) n_alct++;
1257 <<
" all "<<n_alct_all<<
" found "<<n_alct;
1262 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1263 plct != fourBest.end(); plct++) {
1265 int bx = plct->getBX();
1268 <<
"+++ Bx of ALCT candidate, " << bx <<
", exceeds max allowed, "
1293 if (first_bx < MAX_ALCT_BINS) {
1330 const std::vector<CSCALCTDigi>& all_alcts) {
1336 LogTrace(
"CSCAnodeLCTProcessor") << all_alcts.size() <<
1337 " ALCTs at the input of best-track selector: ";
1338 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1339 plct != all_alcts.end(); plct++) {
1340 if (!plct->isValid())
continue;
1341 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1346 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1347 plct != all_alcts.end(); plct++) {
1348 if (!plct->isValid())
continue;
1357 int bx = (*plct).
getBX();
1358 int accel = (*plct).getAccelerator();
1359 int qual = (*plct).getQuality();
1360 int wire = (*plct).getKeyWG();
1361 bool vA = tA[bx][accel].
isValid();
1362 bool vB = tB[bx][accel].
isValid();
1367 if (!vA || qual > qA || (qual == qA && wire > wA)) {
1368 tA[bx][accel] = *plct;
1370 if (!vB || qual > qB || (qual == qB && wire < wB)) {
1371 tB[bx][accel] = *plct;
1376 for (
int accel = 0; accel <= 1; accel++) {
1378 if (tA[bx][accel].isValid()) {
1380 LogTrace(
"CSCAnodeLCTProcessor") <<
"tA: " << tA[bx][accel];
1381 LogTrace(
"CSCAnodeLCTProcessor") <<
"tB: " << tB[bx][accel];
1383 bestALCTs[bx][accel] = tA[bx][accel];
1386 if (tA[bx][accel] != tB[bx][accel] &&
1387 tA[bx][accel].getQuality() == tB[bx][accel].getQuality()) {
1388 secondALCTs[bx][accel] = tB[bx][accel];
1395 for (std::vector <CSCALCTDigi>::const_iterator plct =
1396 all_alcts.begin(); plct != all_alcts.end(); plct++) {
1397 if ((*plct).isValid() &&
1398 (*plct).getAccelerator() == accel && (*plct).getBX() == bx &&
1399 (*plct).getQuality() < bestALCTs[bx][accel].
getQuality() &&
1400 (*plct).getQuality() >= secondALCTs[bx][accel].
getQuality() &&
1401 (*plct).getKeyWG() >= secondALCTs[bx][accel].
getKeyWG()) {
1402 secondALCTs[bx][accel] = *plct;
1411 std::vector<CSCALCTDigi> fourBest;
1413 for (
int i = 0;
i < 2;
i++) {
1414 if (bestALCTs[bx][
i].isValid()) fourBest.push_back(bestALCTs[bx][
i]);
1416 for (
int i = 0;
i < 2;
i++) {
1417 if (secondALCTs[bx][
i].isValid()) fourBest.push_back(secondALCTs[bx][
i]);
1422 LogTrace(
"CSCAnodeLCTProcessor") << fourBest.size() <<
" ALCTs selected: ";
1423 for (std::vector<CSCALCTDigi>::const_iterator plct = fourBest.begin();
1424 plct != fourBest.end(); plct++) {
1425 LogTrace(
"CSCAnodeLCTProcessor") << (*plct);
1437 bool returnValue =
false;
1443 if (lhsALCT.
getBX() < rhsALCT.
getBX()) {returnValue =
true;}
1444 if (lhsALCT.
getBX() != rhsALCT.
getBX()) {
return returnValue;}
1449 if (qual1 > qual2) {returnValue =
true;}
1453 else if (qual1 == qual2 &&
1457 {returnValue =
true;}
1473 if (
quality[key_wire][1] > 0) {
1476 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1481 if (
quality[key_wire][0] > 0) {
1484 <<
"trigMode(): accelerator track " << key_wire <<
" disabled" <<
"\n";
1493 <<
"trigMode(): collision track " << key_wire <<
" disabled" <<
"\n";
1503 int promotionBit = 1 << 2;
1509 if (
quality[key_wire][0] > 0) {
1512 <<
"alctMode(): accelerator track " << key_wire <<
" ignored" <<
"\n";
1517 if (
quality[key_wire][1] > 0) {
1518 quality[key_wire][1] += promotionBit;
1520 <<
"alctMode(): collision track " << key_wire <<
" promoted" <<
"\n";
1525 if (
quality[key_wire][0] > 0) {
1526 quality[key_wire][0] += promotionBit;
1528 <<
"alctMode(): accelerator track " << key_wire <<
" promoted"<<
"\n";
1533 if (
quality[key_wire][1] > 0) {
1536 <<
"alctMode(): collision track " << key_wire <<
" ignored" <<
"\n";
1544 std::ostringstream strm;
1546 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1547 strm <<
"+ ALCT configuration parameters: +\n";
1548 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1549 strm <<
" fifo_tbins [total number of time bins in DAQ readout] = "
1551 strm <<
" fifo_pretrig [start time of anode raw hits in DAQ readout] = "
1553 strm <<
" drift_delay [drift delay after pre-trigger, in 25 ns bins] = "
1555 strm <<
" nplanes_hit_pretrig [min. number of layers hit for pre-trigger] = "
1557 strm <<
" nplanes_hit_pattern [min. number of layers hit for trigger] = "
1559 strm <<
" nplanes_hit_accel_pretrig [min. number of layers hit for accel."
1561 strm <<
" nplanes_hit_accel_pattern [min. number of layers hit for accel."
1563 strm <<
" trig_mode [enabling/disabling collision/accelerator tracks] = "
1565 strm <<
" accel_mode [preference to collision/accelerator tracks] = "
1567 strm <<
" l1a_window_width [L1Accept window width, in 25 ns bins] = "
1569 strm <<
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
1570 LogDebug(
"CSCAnodeLCTProcessor") << strm.str();
1577 <<
"ME" << ((
theEndcap == 1) ?
"+" :
"-")
1581 std::ostringstream strstrm;
1583 if (i_wire%10 == 0) {
1584 if (i_wire < 100) strstrm << i_wire/10;
1585 else strstrm << (i_wire-100)/10;
1587 else strstrm <<
" ";
1591 strstrm << i_wire%10;
1596 if (wire[i_layer][i_wire].
size() > 0) {
1597 std::vector<int> bx_times = wire[i_layer][i_wire];
1598 strstrm << std::hex << bx_times[0] << std::dec;
1605 LogTrace(
"CSCAnodeLCTProcessor") << strstrm.str();
1611 std::vector<CSCALCTDigi> tmpV;
1616 static int lct_bins =
1621 static int ifois = 0;
1631 <<
"; in-time ALCTs are not getting read-out!!! +++" <<
"\n";
1636 <<
"+++ Allowed range of time bins, [0-" << late_tbins
1638 <<
"+++ Set late_tbins to max allowed +++\n";
1639 late_tbins = MAX_ALCT_BINS-1;
1646 std::vector<CSCALCTDigi> all_alcts =
getALCTs();
1647 for (std::vector <CSCALCTDigi>::const_iterator plct = all_alcts.begin();
1648 plct != all_alcts.end(); plct++) {
1649 if (!plct->isValid())
continue;
1651 int bx = (*plct).getBX();
1655 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1656 <<
": found at bx " << bx <<
", whereas the earliest allowed bx is "
1662 if (bx > late_tbins) {
1664 <<
" Do not report ALCT on keywire " << plct->getKeyWG()
1665 <<
": found at bx " << bx <<
", whereas the latest allowed bx is "
1670 tmpV.push_back(*plct);
1677 std::vector<CSCALCTDigi> tmpV;
1692 std::ostringstream strstrm_header;
1694 <<
"\n" <<
"Pattern: " << i_pattern <<
" Key wire: " << key_wire;
1695 for (
int i = 1;
i <= 32;
i++) {
1696 strstrm_header << ((32-
i)%10);
1698 LogTrace(
"CSCAnodeLCTProcessor") << strstrm_header.str();
1701 std::ostringstream strstrm_pulse;
1705 for (
int i = 1;
i <= 32;
i++) {
1706 strstrm_pulse << ((pulse[this_layer][this_wire]>>(32-
i)) & 1);
1709 << strstrm_pulse.str() <<
" on layer " << this_layer;
1714 <<
"-------------------------------------------";
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)
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< DigiType >::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