Skip to content

Commit

Permalink
Ran scram build code-format
Browse files Browse the repository at this point in the history
  • Loading branch information
aryd committed Oct 22, 2021
1 parent bc3edf7 commit ba4a685
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 32 deletions.
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTracklet/interface/MemoryBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace trklet {

//Format index position in hex
static std::string hexstr(unsigned int index);

protected:
std::string name_;
unsigned int iSector_;
Expand Down
3 changes: 1 addition & 2 deletions L1Trigger/TrackFindingTracklet/interface/Util.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ namespace trklet {
}

inline double rinv(double phi1, double phi2, double r1, double r2) {

assert(r1<r2); //Can not form tracklet should not call function with r2<=r1
assert(r1 < r2); //Can not form tracklet should not call function with r2<=r1

double dphi = phi2 - phi1;
double dr = r2 - r1;
Expand Down
18 changes: 9 additions & 9 deletions L1Trigger/TrackFindingTracklet/src/MatchEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,18 @@ void MatchEngine::execute(unsigned int iSector) {

int stubfinerz = vmstub.finerz().value();

bool isPSmodule=false;
bool isPSmodule = false;

if (barrel_) {
isPSmodule = layerdisk_ < N_PSLAYER;
isPSmodule = layerdisk_ < N_PSLAYER;
} else {
if (layerdisk_<N_LAYER+2) {
isPSmodule = ((rzbin&7)<3) || ((rzbin&7)==3 && stubfinerz<=3);
} else {
isPSmodule = ((rzbin&7)<3) || ((rzbin&7)==3 && stubfinerz<=2);
}
if (layerdisk_ < N_LAYER + 2) {
isPSmodule = ((rzbin & 7) < 3) || ((rzbin & 7) == 3 && stubfinerz <= 3);
} else {
isPSmodule = ((rzbin & 7) < 3) || ((rzbin & 7) == 3 && stubfinerz <= 2);
}
}

assert(isPSmodule == vmstub.isPSmodule());

int nbits = isPSmodule ? N_BENDBITS_PS : N_BENDBITS_2S;
Expand All @@ -245,7 +245,7 @@ void MatchEngine::execute(unsigned int iSector) {
constexpr int mindeltaphicut = 3;
constexpr int maxdeltaphicut = 5;
bool passphi = (std::abs(deltaphi) < mindeltaphicut) || (std::abs(deltaphi) > maxdeltaphicut);

unsigned int index = (projrinv << nbits) + vmstub.bend().value();
if (!barrel_ && isPSmodule) {
index += (1 << (nrinv_ + N_BENDBITS_2S));
Expand Down
8 changes: 4 additions & 4 deletions L1Trigger/TrackFindingTracklet/src/MatchEngineUnit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void MatchEngineUnit::init(VMStubsMEMemory* vmstubsmemory,
//This should be fixed to be done more cleanly - but require synchronizaton
//with the HLS code
if (goodpair_) {
if (print)
if (print)
std::cout << "Init have pair" << std::endl;
candmatches_.store(tmppair_);
}
Expand All @@ -69,11 +69,11 @@ void MatchEngineUnit::init(VMStubsMEMemory* vmstubsmemory,
goodpair_ = false;
}

void MatchEngineUnit::step(bool print ) {
void MatchEngineUnit::step(bool print) {
bool almostfull = candmatches_.nearfull();

if (goodpair_) {
if (print)
if (print)
std::cout << "Step have pair" << std::endl;
assert(havepair_);
candmatches_.store(tmppair_);
Expand Down Expand Up @@ -176,7 +176,7 @@ int MatchEngineUnit::TCID() const {
return peek().first->TCID();
}

if (idle_ && !havepair_ ) {
if (idle_ && !havepair_) {
return 16383;
}

Expand Down
10 changes: 4 additions & 6 deletions L1Trigger/TrackFindingTracklet/src/MatchProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,9 @@ void MatchProcessor::execute(unsigned int iSector, double phimin) {
(proj->proj(layerdisk_).fpgarzproj().nbits() - nrbits_)) &
((1 << nrbits_) - 1);

int phiprojder = proj->proj(layerdisk_).fpgaphiprojder().value();

int phiderindex = (phiprojder >>
(proj->proj(layerdisk_).fpgaphiprojder().nbits() - nphiderbits_)) &
int phiprojder = proj->proj(layerdisk_).fpgaphiprojder().value();

int phiderindex = (phiprojder >> (proj->proj(layerdisk_).fpgaphiprojder().nbits() - nphiderbits_)) &
((1 << nphiderbits_) - 1);

int signindex = proj->proj(layerdisk_).fpgarzprojder().value() < 0;
Expand Down Expand Up @@ -431,7 +430,7 @@ void MatchProcessor::execute(unsigned int iSector, double phimin) {
}
}

bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, bool print , unsigned int istep) {
bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, bool print, unsigned int istep) {
const L1TStub* stub = fpgastub->l1tstub();

if (layerdisk_ < N_LAYER) {
Expand Down Expand Up @@ -510,7 +509,6 @@ bool MatchProcessor::matchCalculator(Tracklet* tracklet, const Stub* fpgastub, b
bool imatch = (std::abs(ideltaphi) <= phimatchcuttable_.lookup(seedindex)) &&
(std::abs(ideltaz << dzshift_) <= zmatchcuttable_.lookup(seedindex));


if (settings_.debugTracklet()) {
edm::LogVerbatim("Tracklet") << getName() << " imatch = " << imatch << " ideltaphi cut " << ideltaphi << " "
<< phimatchcuttable_.lookup(seedindex) << " ideltaz<<dzshift cut "
Expand Down
4 changes: 1 addition & 3 deletions L1Trigger/TrackFindingTracklet/src/MemoryBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ size_t MemoryBase::find_nth(const string& haystack, size_t pos, const string& ne
return find_nth(haystack, found_pos + 1, needle, nth - 1);
}

std::string MemoryBase::hexstr(unsigned int index){

std::string MemoryBase::hexstr(unsigned int index) {
std::ostringstream oss;
oss << "0x" << std::setfill('0') << std::setw(2) << hex << index << dec;
return oss.str();

}
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTracklet/src/StubPairsMemory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ void StubPairsMemory::writeSP(bool first, unsigned int iSector) {
for (unsigned int j = 0; j < stubs_.size(); j++) {
string stub1index = stubs_[j].first.stub()->stubindex().str();
string stub2index = stubs_[j].second.stub()->stubindex().str();
out_ << hexstr(j) << " " << stub1index << "|" << stub2index << " "
<< trklet::hexFormat(stub1index + stub2index) << endl;
out_ << hexstr(j) << " " << stub1index << "|" << stub2index << " " << trklet::hexFormat(stub1index + stub2index)
<< endl;
}
out_.close();

Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTracklet/src/TrackFitMemory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void TrackFitMemory::writeTF(bool first, unsigned int iSector) {
out_ << "BX = " << (bitset<3>)bx_ << " Event : " << event_ << endl;

for (unsigned int j = 0; j < tracks_.size(); j++) {
out_ << hexstr(j) << " " <<tracks_[j]->trackfitstr() << " " << trklet::hexFormat(tracks_[j]->trackfitstr());
out_ << hexstr(j) << " " << tracks_[j]->trackfitstr() << " " << trklet::hexFormat(tracks_[j]->trackfitstr());
out_ << "\n";
}
out_.close();
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/TrackFindingTracklet/src/TrackletLUT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void TrackletLUT::initTPlut(bool fillInner,
}

int nbinsfinephidiff = (1 << nbitsfinephidiff);

for (int iphibin = 0; iphibin < nbinsfinephidiff; iphibin++) {
int iphidiff = iphibin;
if (iphibin >= nbinsfinephidiff / 2) {
Expand Down Expand Up @@ -124,7 +124,7 @@ void TrackletLUT::initTPlut(bool fillInner,
} else {
rinner = settings_.rmean(layerdisk1);
}
double rinv1 = (rinner<router[i3]) ? rinv(0.0, -dphi[i2], rinner, router[i3]) : 20.0;
double rinv1 = (rinner < router[i3]) ? rinv(0.0, -dphi[i2], rinner, router[i3]) : 20.0;
double pitchinner = (rinner < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
double pitchouter =
(router[i3] < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
Expand Down Expand Up @@ -312,7 +312,7 @@ void TrackletLUT::initteptlut(bool fillInner,
} else {
rinner = settings_.rmean(layerdisk1);
}
double rinv1 = (rinner<router[i3]) ? -rinv(phiinner[i1], phiouter[i2], rinner, router[i3]) : -20.0;
double rinv1 = (rinner < router[i3]) ? -rinv(phiinner[i1], phiouter[i2], rinner, router[i3]) : -20.0;
double pitchinner =
(rinner < settings_.rcrit()) ? settings_.stripPitch(true) : settings_.stripPitch(false);
double pitchouter =
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTracklet/src/VMRouterCM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void VMRouterCM::execute(unsigned int iSector) {

//bool print = getName() == "VMR_D1PHIB" && iSector == 3;
//print = false;

//Loop over the input stubs
for (auto& stubinput : stubinputs_) {
for (unsigned int i = 0; i < stubinput->nStubs(); i++) {
Expand Down

0 comments on commit ba4a685

Please sign in to comment.