Skip to content

Commit

Permalink
Merge pull request #31027 from dildick/from-CMSSW_11_1_X_2020-08-03-1…
Browse files Browse the repository at this point in the history
…100-revert-29562

Revert #29562 and use only low-quality ALCTs in ME2/1
  • Loading branch information
cmsbuild committed Aug 3, 2020
2 parents cc02ea6 + 5113867 commit 4a71724
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 129 deletions.
4 changes: 2 additions & 2 deletions L1Trigger/CSCCommonTrigger/interface/CSCConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class CSCConstants {
// Maximum allowed matching window size
MAX_MATCH_WINDOW_SIZE = 15,
// Each CLCT processor can send up to 2 CLCTs to TMB per BX
MAX_CLCTS_PER_PROCESSOR = 50,
MAX_CLCTS_PER_PROCESSOR = 2,
MAX_CLCTS_READOUT = 2,
// Each ALCT processor can send up to 2 ALCTs to TMB per BX
MAX_ALCTS_PER_PROCESSOR = 50,
MAX_ALCTS_PER_PROCESSOR = 2,
MAX_ALCTS_READOUT = 2,
// Each CSC can send up to 2 LCTs to the MPC per BX
MAX_LCTS_PER_CSC = 2,
Expand Down
1 change: 1 addition & 0 deletions L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class CSCBaseboard {

// is this an ME11 chamber?
bool isME11_;
bool isME21_;

// CSCDetId for this chamber
CSCDetId cscId_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ class CSCCathodeLCTProcessor : public CSCBaseboard {
std::vector<CSCCLCTPreTriggerDigi> preTriggerDigisME1b() const;

protected:
/** LCTs in this chamber, as found by the processor. */
std::vector<std::vector<CSCCLCTDigi> > CLCTContainer_;
/** Best LCT in this chamber, as found by the processor. */
CSCCLCTDigi bestCLCT[CSCConstants::MAX_CLCT_TBINS];

/** Second best LCT in this chamber, as found by the processor. */
CSCCLCTDigi secondCLCT[CSCConstants::MAX_CLCT_TBINS];

/** Access routines to comparator digis. */
bool getDigis(const CSCComparatorDigiCollection* compdc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@

## matching to pads
maxDeltaBXPad = cms.int32(1),
maxDeltaBXCoPad = cms.int32(0),
maxDeltaBXCoPad = cms.int32(1),
maxDeltaPadL1Even = cms.int32(12),
maxDeltaPadL1Odd = cms.int32(24),
maxDeltaPadL2Even = cms.int32(12),
Expand Down Expand Up @@ -424,7 +424,7 @@

## matching to pads
maxDeltaBXPad = cms.int32(1),
maxDeltaBXCoPad = cms.int32(0),
maxDeltaBXCoPad = cms.int32(1),
maxDeltaPadL1Even = cms.int32(12),
maxDeltaPadL1Odd = cms.int32(24),
maxDeltaPadL2Even = cms.int32(12),
Expand Down Expand Up @@ -488,7 +488,7 @@
runME11Up = cms.bool(True),
runME11ILT = cms.bool(True),
useClusters = cms.bool(False),
enableAlctSLHC = cms.bool(False)),
enableAlctSLHC = cms.bool(True)),
clctSLHC = dict(clctNplanesHitPattern = 3),
me11tmbSLHCGEM = me11tmbSLHCGEM,
copadParamGE11 = copadParamGE11
Expand All @@ -500,11 +500,10 @@
commonParam = dict(runME21Up = cms.bool(True),
runME21ILT = cms.bool(True),
runME31Up = cms.bool(True),
runME41Up = cms.bool(True),
enableAlctSLHC = cms.bool(True)),
runME41Up = cms.bool(True)),
tmbSLHC = dict(ignoreAlctCrossClct = cms.bool(False)),
clctSLHC = dict(useDynamicStateMachineZone = cms.bool(True)),
alctSLHCME21 = cscTriggerPrimitiveDigis.alctParam07.clone(alctNplanesHitPattern = 3),
alctSLHCME21 = cscTriggerPrimitiveDigis.alctSLHC.clone(alctNplanesHitPattern = 3),
clctSLHCME21 = cscTriggerPrimitiveDigis.clctSLHC.clone(clctNplanesHitPattern = 3),
me21tmbSLHCGEM = me21tmbSLHCGEM,
alctSLHCME3141 = cscTriggerPrimitiveDigis.alctParam07.clone(alctNplanesHitPattern = 4),
Expand Down
41 changes: 4 additions & 37 deletions L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ void CSCAnodeLCTProcessor::checkConfigParameters() {
}

void CSCAnodeLCTProcessor::clear() {
ALCTContainer_.clear();
ALCTContainer_.resize(CSCConstants::MAX_ALCT_TBINS);
for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
bestALCT[bx].clear();
secondALCT[bx].clear();
Expand Down Expand Up @@ -324,8 +322,6 @@ void CSCAnodeLCTProcessor::run(const std::vector<int> wire[CSCConstants::NUM_LAY
CSCALCTDigi newALCT(valid, quality[i_wire][0], 1, 0, i_wire, bx);

lct_list.emplace_back(newALCT);
if (valid)
ALCTContainer_.at(bx).push_back(newALCT);
if (infoV > 1)
LogTrace("CSCAnodeLCTProcessor") << "Add one ALCT to list " << lct_list.back();
}
Expand All @@ -337,8 +333,6 @@ void CSCAnodeLCTProcessor::run(const std::vector<int> wire[CSCConstants::NUM_LAY
CSCALCTDigi newALCT(valid, quality[i_wire][1], 0, quality[i_wire][2], i_wire, bx);

lct_list.emplace_back(newALCT);
if (valid)
ALCTContainer_.at(bx).push_back(newALCT);
if (infoV > 1)
LogTrace("CSCAnodeLCTProcessor") << "Add one ALCT to list " << lct_list.back();
}
Expand Down Expand Up @@ -932,25 +926,6 @@ void CSCAnodeLCTProcessor::lctSearch() {
}
}
}

// set track number for the other ALCTs
for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
for (unsigned iALCT = 0; iALCT < ALCTContainer_.at(bx).size(); iALCT++) {
if (ALCTContainer_.at(bx).at(iALCT).isValid()) {
ALCTContainer_.at(bx).at(iALCT).setTrknmb(iALCT + 1);

// check if ALCT is valid
checkValid(ALCTContainer_.at(bx).at(iALCT));

if (infoV > 0) {
LogDebug("CSCAnodeLCTProcessor")
<< ALCTContainer_[bx][iALCT] << " found in " << theCSCName_ << " (sector " << theSector << " subsector "
<< theSubsector << " trig id. " << theTrigChamber << ")"
<< "\n";
}
}
}
}
}

std::vector<CSCALCTDigi> CSCAnodeLCTProcessor::bestTrackSelector(const std::vector<CSCALCTDigi>& all_alcts) {
Expand Down Expand Up @@ -1369,18 +1344,10 @@ std::vector<CSCALCTDigi> CSCAnodeLCTProcessor::readoutALCTs(int nMaxALCTs) const
std::vector<CSCALCTDigi> CSCAnodeLCTProcessor::getALCTs(unsigned nMaxALCTs) const {
std::vector<CSCALCTDigi> tmpV;
for (int bx = 0; bx < CSCConstants::MAX_ALCT_TBINS; bx++) {
if (nMaxALCTs == CSCConstants::MAX_ALCTS_READOUT) {
if (bestALCT[bx].isValid())
tmpV.push_back(bestALCT[bx]);
if (secondALCT[bx].isValid())
tmpV.push_back(secondALCT[bx]);
} else {
for (unsigned iALCT = 0; iALCT < ALCTContainer_.at(bx).size(); iALCT++) {
if (iALCT < nMaxALCTs and ALCTContainer_.at(bx).at(iALCT).isValid()) {
tmpV.push_back(ALCTContainer_.at(bx).at(iALCT));
}
}
}
if (bestALCT[bx].isValid())
tmpV.push_back(bestALCT[bx]);
if (secondALCT[bx].isValid())
tmpV.push_back(secondALCT[bx]);
}
return tmpV;
}
Expand Down
1 change: 1 addition & 0 deletions L1Trigger/CSCTriggerPrimitives/src/CSCBaseboard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CSCBaseboard::CSCBaseboard(unsigned endcap,

theChamber = CSCTriggerNumbering::chamberFromTriggerLabels(theSector, theSubsector, theStation, theTrigChamber);
isME11_ = (theStation == 1 && theRing == 1);
isME21_ = (theStation == 2 && theRing == 1);

cscId_ = CSCDetId(theEndcap, theStation, theRing, theChamber, 0);

Expand Down
125 changes: 63 additions & 62 deletions L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ void CSCCathodeLCTProcessor::checkConfigParameters() {
void CSCCathodeLCTProcessor::clear() {
thePreTriggerDigis.clear();
thePreTriggerBXs.clear();
CLCTContainer_.clear();
CLCTContainer_.resize(CSCConstants::MAX_CLCT_TBINS);
for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
bestCLCT[bx].clear();
secondCLCT[bx].clear();
}
}

std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::run(const CSCComparatorDigiCollection* compdc) {
Expand Down Expand Up @@ -331,10 +333,6 @@ void CSCCathodeLCTProcessor::run(
sort(CLCTlist.begin(), CLCTlist.end(), std::greater<CSCCLCTDigi>());

for (const auto& p : CLCTlist) {
// only consider valid CLCTs
if (!p.isValid())
continue;

const int bx = p.getBX();
if (bx >= CSCConstants::MAX_CLCT_TBINS) {
if (infoV > 0)
Expand All @@ -344,25 +342,37 @@ void CSCCathodeLCTProcessor::run(
continue;
}

CLCTContainer_.at(bx).push_back(p);
if (!bestCLCT[bx].isValid()) {
bestCLCT[bx] = p;
} else if (!secondCLCT[bx].isValid()) {
secondCLCT[bx] = p;
}
}

for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
for (unsigned iCLCT = 0; iCLCT < CLCTContainer_.at(bx).size(); iCLCT++) {
// only consider valid CLCTs
if (CLCTContainer_.at(bx).at(iCLCT).isValid()) {
CLCTContainer_.at(bx).at(iCLCT).setTrknmb(iCLCT + 1);

// check if the LCT is valid
checkValid(CLCTContainer_.at(bx).at(iCLCT));

if (infoV > 0) {
LogDebug("CSCCathodeLCTProcessor")
<< CLCTContainer_.at(bx).at(iCLCT) << " found in " << theCSCName_ << " (sector " << theSector
<< " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
<< "\n";
}
}
if (bestCLCT[bx].isValid()) {
bestCLCT[bx].setTrknmb(1);

// check if the LCT is valid
checkValid(bestCLCT[bx]);

if (infoV > 0)
LogDebug("CSCCathodeLCTProcessor")
<< bestCLCT[bx] << " found in " << CSCDetId::chamberName(theEndcap, theStation, theRing, theChamber)
<< " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
<< "\n";
}
if (secondCLCT[bx].isValid()) {
secondCLCT[bx].setTrknmb(2);

// check if the LCT is valid
checkValid(secondCLCT[bx]);

if (infoV > 0)
LogDebug("CSCCathodeLCTProcessor")
<< secondCLCT[bx] << " found in " << CSCDetId::chamberName(theEndcap, theStation, theRing, theChamber)
<< " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
<< "\n";
}
}
// Now that we have our best CLCTs, they get correlated with the best
Expand Down Expand Up @@ -610,24 +620,23 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
}
}

// If 1st best CLCT is found, look for other CLCTs!
// If 1st best CLCT is found, look for the 2nd best.
if (best_halfstrip[0] >= 0) {
for (int ilct = 1; ilct < CSCConstants::MAX_CLCTS_PER_PROCESSOR; ilct++) {
// Mark keys near best CLCT as busy by setting their quality to zero, and repeat the search.
markBusyKeys(best_halfstrip[ilct - 1], best_pid[best_halfstrip[ilct - 1]], quality);
// Mark keys near best CLCT as busy by setting their quality to
// zero, and repeat the search.
markBusyKeys(best_halfstrip[0], best_pid[best_halfstrip[0]], quality);

for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
if (quality[hstrip] > best_quality[ilct]) {
best_halfstrip[ilct] = hstrip;
best_quality[ilct] = quality[hstrip];
}
if (infoV > 1 && quality[hstrip] > 0) {
LogTrace("CSCCathodeLCTProcessor")
<< "CLCT " << ilct + 1 << ": halfstrip = " << std::setw(3) << hstrip << " quality = " << std::setw(3)
<< quality[hstrip] << " nhits = " << std::setw(3) << nhits[hstrip] << " pid = " << std::setw(3)
<< best_pid[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[1]
<< " best quality = " << std::setw(3) << best_quality[1];
}
for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
if (quality[hstrip] > best_quality[1]) {
best_halfstrip[1] = hstrip;
best_quality[1] = quality[hstrip];
}
if (infoV > 1 && quality[hstrip] > 0) {
LogTrace("CSCCathodeLCTProcessor")
<< " 2nd CLCT: halfstrip = " << std::setw(3) << hstrip << " quality = " << std::setw(3)
<< quality[hstrip] << " nhits = " << std::setw(3) << nhits[hstrip] << " pid = " << std::setw(3)
<< best_pid[hstrip] << " best halfstrip = " << std::setw(3) << best_halfstrip[1]
<< " best quality = " << std::setw(3) << best_quality[1];
}
}

Expand All @@ -644,8 +653,14 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
keystrip_data[ilct][CLCT_STRIP_TYPE] = 1; // obsolete
keystrip_data[ilct][CLCT_QUALITY] = nhits[best_hs];
keystrip_data[ilct][CLCT_CFEB] = keystrip_data[ilct][CLCT_STRIP] / CSCConstants::NUM_HALF_STRIPS_PER_CFEB;
const uint16_t halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] -
CSCConstants::NUM_HALF_STRIPS_PER_CFEB * keystrip_data[ilct][CLCT_CFEB];
int halfstrip_in_cfeb = keystrip_data[ilct][CLCT_STRIP] -
CSCConstants::NUM_HALF_STRIPS_PER_CFEB * keystrip_data[ilct][CLCT_CFEB];

if (infoV > 1)
LogTrace("CSCCathodeLCTProcessor")
<< " Final selection: ilct " << ilct << " key halfstrip " << keystrip_data[ilct][CLCT_STRIP]
<< " quality " << keystrip_data[ilct][CLCT_QUALITY] << " pattern "
<< keystrip_data[ilct][CLCT_PATTERN] << " bx " << keystrip_data[ilct][CLCT_BX];

CSCCLCTDigi thisLCT(1,
keystrip_data[ilct][CLCT_QUALITY],
Expand Down Expand Up @@ -1241,11 +1256,6 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::readoutCLCTs(int nMaxCLCTs) con
tmpV.push_back(p);
}

// remove the CLCTs with an index larger than nMaxCLCTs
if (tmpV.size() > unsigned(nMaxCLCTs)) {
tmpV.erase(tmpV.begin() + nMaxCLCTs, tmpV.end());
}

// do a final check on the CLCTs in readout
for (const auto& clct : tmpV) {
checkValid(clct, nMaxCLCTs);
Expand Down Expand Up @@ -1306,11 +1316,10 @@ std::vector<CSCCLCTPreTriggerDigi> CSCCathodeLCTProcessor::preTriggerDigisME1b()
std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::getCLCTs(unsigned nMaxCLCTs) const {
std::vector<CSCCLCTDigi> tmpV;
for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
for (unsigned iCLCT = 0; iCLCT < CLCTContainer_.at(bx).size(); iCLCT++) {
if (iCLCT < nMaxCLCTs and CLCTContainer_.at(bx).at(iCLCT).isValid()) {
tmpV.push_back(CLCTContainer_.at(bx).at(iCLCT));
}
}
if (bestCLCT[bx].isValid())
tmpV.push_back(bestCLCT[bx]);
if (secondCLCT[bx].isValid())
tmpV.push_back(secondCLCT[bx]);
}
return tmpV;
}
Expand All @@ -1321,21 +1330,13 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::getCLCTs(unsigned nMaxCLCTs) co
// to make a proper comparison with ALCTs we need
// CLCT and ALCT to have the central BX in the same bin
CSCCLCTDigi CSCCathodeLCTProcessor::getBestCLCT(int bx) const {
CSCCLCTDigi lct;
// check that the container has at least one entry
if (!CLCTContainer_.at(bx).empty()) {
lct = CLCTContainer_.at(bx).at(0);
lct.setBX(lct.getBX() + alctClctOffset_);
}
CSCCLCTDigi lct = bestCLCT[bx];
lct.setBX(lct.getBX() + alctClctOffset_);
return lct;
}

CSCCLCTDigi CSCCathodeLCTProcessor::getSecondCLCT(int bx) const {
CSCCLCTDigi lct;
// check that the container has at least two entries
if (CLCTContainer_.at(bx).size() >= 2) {
lct = CLCTContainer_.at(bx).at(1);
lct.setBX(lct.getBX() + alctClctOffset_);
}
CSCCLCTDigi lct = secondCLCT[bx];
lct.setBX(lct.getBX() + alctClctOffset_);
return lct;
}

0 comments on commit 4a71724

Please sign in to comment.