Skip to content

Commit

Permalink
Code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Dildick committed Apr 26, 2020
1 parent 2c3fe73 commit b53147a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
29 changes: 14 additions & 15 deletions L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,13 @@ void CSCCathodeLCTProcessor::run(
for (int bx = 0; bx < CSCConstants::MAX_CLCT_TBINS; bx++) {
for (int iCLCT = 0; iCLCT < CSCConstants::MAX_CLCTS_PER_PROCESSOR; iCLCT++) {
if (CLCTContainer_[bx][iCLCT].isValid()) {
CLCTContainer_[bx][iCLCT].setTrknmb(iCLCT+1);
CLCTContainer_[bx][iCLCT].setTrknmb(iCLCT + 1);
if (infoV > 0) {
LogDebug("CSCCathodeLCTProcessor")
<< CLCTContainer_[bx][iCLCT] << " found in " << CSCDetId::chamberName(theEndcap, theStation, theRing, theChamber)
<< " (sector " << theSector << " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
<< "\n";
<< CLCTContainer_[bx][iCLCT] << " found in "
<< CSCDetId::chamberName(theEndcap, theStation, theRing, theChamber) << " (sector " << theSector
<< " subsector " << theSubsector << " trig id. " << theTrigChamber << ")"
<< "\n";
}
}
}
Expand Down Expand Up @@ -615,10 +616,9 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(

// If 1st best CLCT is found, look for other CLCTs!
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);
markBusyKeys(best_halfstrip[ilct - 1], best_pid[best_halfstrip[ilct - 1]], quality);

for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
if (quality[hstrip] > best_quality[ilct]) {
Expand All @@ -627,10 +627,10 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
}
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];
<< "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];
}
}
}
Expand All @@ -649,7 +649,7 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
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];
CSCConstants::NUM_HALF_STRIPS_PER_CFEB * keystrip_data[ilct][CLCT_CFEB];

CSCCLCTDigi thisLCT(1,
keystrip_data[ilct][CLCT_QUALITY],
Expand All @@ -671,8 +671,7 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(

// useful debugging
if (infoV > 1) {
LogTrace("CSCCathodeLCTProcessor")
<< " Final selection: ilct " << ilct << " " << thisLCT << std::endl;
LogTrace("CSCCathodeLCTProcessor") << " Final selection: ilct " << ilct << " " << thisLCT << std::endl;
}

// put the CLCT into the collection
Expand Down Expand Up @@ -1106,13 +1105,13 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::readoutCLCTs(int nMaxCLCTs) con
int bx_readout = -1;
const std::vector<CSCCLCTDigi>& all_lcts = getCLCTs();
for (const auto& p : all_lcts) {

// only consider valid CLCTs
if (!p.isValid())
continue;

//ignore the CLCTs with an index larger than nMaxCLCTs
if (p.getTrknmb() > nMaxCLCTs) break;
if (p.getTrknmb() > nMaxCLCTs)
break;

const int bx = p.getBX();
// Skip CLCTs found too early relative to L1Accept.
Expand Down
15 changes: 10 additions & 5 deletions L1Trigger/CSCTriggerPrimitives/src/CSCTriggerPrimitivesBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ void CSCTriggerPrimitivesBuilder::build(const CSCBadChambers* badChambers,
const std::vector<CSCALCTDigi>& alctV = tmb11->alctProc->readoutALCTs();
const std::vector<CSCALCTDigi>& alctV_all = tmb11->alctProc->getALCTs();
const std::vector<CSCCLCTDigi>& clctV = tmb11->clctProc->readoutCLCTsME1b();
const std::vector<CSCCLCTDigi>& clctV_all = tmb11->clctProc->readoutCLCTsME1b(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<CSCCLCTDigi>& clctV_all =
tmb11->clctProc->readoutCLCTsME1b(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<int>& preTriggerBXs = tmb11->clctProc->preTriggerBXs();
const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb11->clctProc->preTriggerDigisME1b();
const std::vector<CSCCLCTDigi>& clctV1a = tmb11->clctProc->readoutCLCTsME1a();
Expand Down Expand Up @@ -246,7 +247,8 @@ void CSCTriggerPrimitivesBuilder::build(const CSCBadChambers* badChambers,
const std::vector<CSCALCTDigi>& alctV = tmb11GEM->alctProc->readoutALCTs();
const std::vector<CSCALCTDigi>& alctV_all = tmb11GEM->alctProc->getALCTs();
const std::vector<CSCCLCTDigi>& clctV = tmb11GEM->clctProc->readoutCLCTsME1b();
const std::vector<CSCCLCTDigi>& clctV_all = tmb11GEM->clctProc->readoutCLCTsME1b(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<CSCCLCTDigi>& clctV_all =
tmb11GEM->clctProc->readoutCLCTsME1b(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<int>& preTriggerBXs = tmb11GEM->clctProc->preTriggerBXs();
const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb11GEM->clctProc->preTriggerDigisME1b();
const std::vector<CSCCLCTDigi>& clctV1a = tmb11GEM->clctProc->readoutCLCTsME1a();
Expand Down Expand Up @@ -307,7 +309,8 @@ void CSCTriggerPrimitivesBuilder::build(const CSCBadChambers* badChambers,
const std::vector<CSCALCTDigi>& alctV = tmb21GEM->alctProc->readoutALCTs();
const std::vector<CSCALCTDigi>& alctV_all = tmb21GEM->alctProc->getALCTs();
const std::vector<CSCCLCTDigi>& clctV = tmb21GEM->clctProc->readoutCLCTs();
const std::vector<CSCCLCTDigi>& clctV_all = tmb21GEM->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<CSCCLCTDigi>& clctV_all =
tmb21GEM->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<int>& preTriggerBXs = tmb21GEM->clctProc->preTriggerBXs();
const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb21GEM->clctProc->preTriggerDigis();
const std::vector<GEMCoPadDigi>& copads = tmb21GEM->coPadProcessor->readoutCoPads();
Expand Down Expand Up @@ -340,7 +343,8 @@ void CSCTriggerPrimitivesBuilder::build(const CSCBadChambers* badChambers,
const std::vector<CSCALCTDigi>& alctV = utmb->alctProc->readoutALCTs();
const std::vector<CSCALCTDigi>& alctV_all = utmb->alctProc->getALCTs();
const std::vector<CSCCLCTDigi>& clctV = utmb->clctProc->readoutCLCTs();
const std::vector<CSCCLCTDigi>& clctV_all = utmb->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<CSCCLCTDigi>& clctV_all =
utmb->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<int>& preTriggerBXs = utmb->clctProc->preTriggerBXs();
const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = utmb->clctProc->preTriggerDigis();
const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = utmb->alctProc->preTriggerDigis();
Expand Down Expand Up @@ -370,7 +374,8 @@ void CSCTriggerPrimitivesBuilder::build(const CSCBadChambers* badChambers,
const std::vector<CSCALCTDigi>& alctV = tmb->alctProc->readoutALCTs();
const std::vector<CSCALCTDigi>& alctV_all = tmb->alctProc->getALCTs();
const std::vector<CSCCLCTDigi>& clctV = tmb->clctProc->readoutCLCTs();
const std::vector<CSCCLCTDigi>& clctV_all = tmb->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<CSCCLCTDigi>& clctV_all =
tmb->clctProc->readoutCLCTs(CSCConstants::MAX_CLCTS_PER_PROCESSOR);
const std::vector<int>& preTriggerBXs = tmb->clctProc->preTriggerBXs();
const std::vector<CSCCLCTPreTriggerDigi>& pretriggerV = tmb->clctProc->preTriggerDigis();
const std::vector<CSCALCTPreTriggerDigi>& alctpretriggerV = tmb->alctProc->preTriggerDigis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,21 +272,20 @@ std::vector<CSCCLCTDigi> CSCUpgradeCathodeLCTProcessor::findLCTs(

// 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);
markBusyKeys(best_halfstrip[ilct - 1], best_pid[best_halfstrip[ilct - 1]], quality);

for (int hstrip = stagger[CSCConstants::KEY_CLCT_LAYER - 1]; hstrip < maxHalfStrips; hstrip++) {
if (quality[hstrip] > best_quality[ilct] && pretrig_zone[hstrip] && !busyMap[hstrip][first_bx]) {
best_halfstrip[ilct] = hstrip;
best_quality[ilct] = quality[hstrip];
if (infoV > 1) {
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[ilct]
<< " best quality = " << std::setw(3) << best_quality[ilct];
<< "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[ilct] << " best quality = " << std::setw(3) << best_quality[ilct];
}
}
}
Expand Down Expand Up @@ -325,8 +324,7 @@ std::vector<CSCCLCTDigi> CSCUpgradeCathodeLCTProcessor::findLCTs(
keystrip_data[ilct][CLCT_CFEB],
keystrip_data[ilct][CLCT_BX]);
if (infoV > 1) {
LogTrace("CSCCathodeLCTProcessor")
<< " Final selection: ilct " << ilct << " " << thisLCT << std::endl;
LogTrace("CSCCathodeLCTProcessor") << " Final selection: ilct " << ilct << " " << thisLCT << std::endl;
}
thisLCT.setFullBX(fbx);

Expand Down

0 comments on commit b53147a

Please sign in to comment.