Skip to content

Commit

Permalink
apply code formats
Browse files Browse the repository at this point in the history
  • Loading branch information
skinnari committed Jul 9, 2021
1 parent db6498c commit 983a89c
Show file tree
Hide file tree
Showing 34 changed files with 703 additions and 674 deletions.
10 changes: 5 additions & 5 deletions L1Trigger/TrackFindingTMTT/interface/KFTrackletTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ namespace tmtt {
unsigned int iPhiSec,
unsigned int iEtaReg,
bool accepted = true,
bool done_bcon = false,
float qOverPt_bcon = 0.,
float d0_bcon = 0.,
float phi0_bcon = 0.,
float chi2rphi_bcon = 0.)
bool done_bcon = false,
float qOverPt_bcon = 0.,
float d0_bcon = 0.,
float phi0_bcon = 0.,
float chi2rphi_bcon = 0.)
: l1track3D_(l1track3D),
stubs_(stubs),
hitPattern_(hitPattern),
Expand Down
10 changes: 5 additions & 5 deletions L1Trigger/TrackFindingTMTT/interface/L1fittedTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ namespace tmtt {
iPhiSec(),
iEtaReg(),
accepted(),
done_bcon(),
qOverPt_bcon(),
d0_bcon(),
phi0_bcon(),
chi2rphi_bcon());
done_bcon(),
qOverPt_bcon(),
d0_bcon(),
phi0_bcon(),
chi2rphi_bcon());
return trk_;
}

Expand Down
12 changes: 6 additions & 6 deletions L1Trigger/TrackFindingTMTT/src/KFbase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ namespace tmtt {
double chi2rphi_bcon = 0.;
TVectorD trackPars_bcon = trackParams_BeamConstr(cand, chi2rphi_bcon);

// Check scaled chi2 cut
vector<double> kfLayerVsChiSqCut = settings_->kfLayerVsChiSq5();
double chi2scaled = chi2rphi_bcon / settings_->kalmanChi2RphiScale() + fitTrk.chi2rz();
bool accepted = true;
if (chi2scaled > kfLayerVsChiSqCut[cand->nStubLayers()])
accepted = false;
// Check scaled chi2 cut
vector<double> kfLayerVsChiSqCut = settings_->kfLayerVsChiSq5();
double chi2scaled = chi2rphi_bcon / settings_->kalmanChi2RphiScale() + fitTrk.chi2rz();
bool accepted = true;
if (chi2scaled > kfLayerVsChiSqCut[cand->nStubLayers()])
accepted = false;

fitTrk.setBeamConstr(trackPars_bcon[QOVERPT], trackPars_bcon[PHI0], chi2rphi_bcon, accepted);
}
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/TrackFindingTMTT/src/Settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace tmtt {
//kalmanDebugLevel_(2), // Good for debugging
kalmanMinNumStubs_(4),
kalmanMaxNumStubs_(6),
kalmanAddBeamConstr_(false), // Apply post-fit beam-spot constraint to 5-param fit
kalmanAddBeamConstr_(false), // Apply post-fit beam-spot constraint to 5-param fit
kalmanRemove2PScut_(true),
kalmanMaxSkipLayersHard_(1), // On "hard" input tracks
kalmanMaxSkipLayersEasy_(2), // On "easy" input tracks
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTracklet/interface/MatchCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ namespace trklet {

TrackletLUT phimatchcuttable_;
TrackletLUT zmatchcuttable_;

TrackletLUT rphicutPStable_;
TrackletLUT rphicut2Stable_;
TrackletLUT rcutPStable_;
TrackletLUT rcut2Stable_;

int ialphafactinner_[N_DSS_MOD * 2];
int ialphafactouter_[N_DSS_MOD * 2];

Expand Down
3 changes: 1 addition & 2 deletions L1Trigger/TrackFindingTracklet/interface/MatchEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ namespace trklet {

bool barrel_;

unsigned int nrinv_; //number of bits for rinv in stub bend LUT
unsigned int nrinv_; //number of bits for rinv in stub bend LUT

//LUT for bend consistency
TrackletLUT luttable_;

};

}; // namespace trklet
Expand Down
14 changes: 7 additions & 7 deletions L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace trklet {
class Stub;
class L1TStub;
class TrackletLUT;

class MatchEngineUnit {
public:
MatchEngineUnit(bool barrel, unsigned int layerdisk, const TrackletLUT& luttable);
Expand All @@ -36,12 +36,12 @@ namespace trklet {
bool usesecondPlus,
bool isPSseed,
Tracklet* proj,
bool print);
bool print);

bool empty() const { return candmatches_.empty(); }

int TCID() const;

std::pair<Tracklet*, const Stub*> read() { return candmatches_.read(); }

std::pair<Tracklet*, const Stub*> peek() const { return candmatches_.peek(); }
Expand All @@ -50,11 +50,11 @@ namespace trklet {

bool idle() const { return idle_; }

bool active() const { return !idle_||goodpair_||goodpair__||!empty(); }
bool active() const { return !idle_ || goodpair_ || goodpair__ || !empty(); }

bool have_() const { return havepair_; }
bool have__() const { return havepair__; }

void reset();

unsigned int rptr() const { return candmatches_.rptr(); }
Expand Down Expand Up @@ -84,15 +84,15 @@ namespace trklet {
bool idle_;

unsigned int layerdisk_;

//LUT for bend consistency with rinv
const TrackletLUT& luttable_;

//Pipeline variables
std::pair<Tracklet*, const Stub*> tmppair_, tmppair__;
bool goodpair_, goodpair__;
bool havepair_, havepair__;

//save the candidate matches
CircularBuffer<std::pair<Tracklet*, const Stub*>> candmatches_;
};
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTracklet/interface/MatchProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace trklet {
TrackletLUT rphicut2Stable_;
TrackletLUT rcutPStable_;
TrackletLUT rcut2Stable_;

int nrbits_;
int nphiderbits_;

Expand All @@ -77,7 +77,7 @@ namespace trklet {

//LUT for bend consistency
TrackletLUT luttable_;

double phimin_;

unsigned int nMatchEngines_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace trklet {

int nrbits_;
int nphiderbits_;

//disk projectionrinv table
TrackletLUT rinvbendlut_;

Expand Down
48 changes: 24 additions & 24 deletions L1Trigger/TrackFindingTracklet/interface/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ namespace trklet {
constexpr unsigned int N_RZBITS = 3; //number of bit for the r/z bins
constexpr unsigned int N_PHIBITS = 3; //number of bit for the phi bins

constexpr unsigned int N_VMSTUBSMAX = 15; // maximum number of stubs in VM bin
constexpr unsigned int N_BITSMEMADDRESS = 7; // Number of bits for address in memories
constexpr unsigned int N_VMSTUBSMAX = 15; // maximum number of stubs in VM bin
constexpr unsigned int N_BITSMEMADDRESS = 7; // Number of bits for address in memories

constexpr double sixth = 1.0 / 6.0; //Commonly used factor
constexpr double third = 1.0 / 3.0; //Commonly used factor

constexpr double VMROUTERCUTZL2 = 50.0; //Min L2 z for inner allstub
constexpr double VMROUTERCUTZL1L3L5 = 95.0; //Max z for inner barrel layers
constexpr double VMROUTERCUTZL1 = 70.0; //Max z for L1 barrel seeding
constexpr double VMROUTERCUTRD1D3 = 55.0; //Max r for disk seeds
constexpr double VMROUTERCUTZL2 = 50.0; //Min L2 z for inner allstub
constexpr double VMROUTERCUTZL1L3L5 = 95.0; //Max z for inner barrel layers
constexpr double VMROUTERCUTZL1 = 70.0; //Max z for L1 barrel seeding
constexpr double VMROUTERCUTRD1D3 = 55.0; //Max r for disk seeds

enum Seed { L1L2 = 0, L2L3, L3L4, L5L6, D1D2, D3D4, L1D1, L2D1, L2L3L4, L4L5L6, L2L3D1, D1D2L2 };
enum LayerDisk { L1 = 0, L2, L3, L4, L5, L6, D1, D2, D3, D4, D5 };

class Settings {
public:
Settings() {
Expand Down Expand Up @@ -279,7 +279,7 @@ namespace trklet {
void setNbitsseedextended(unsigned int nbitsseed) { nbitsseedextended_ = nbitsseed; }

double dphisectorHG() const {
//These values are used in the DTC emulation code.
//These values are used in the DTC emulation code.
double rsectmin = 21.8;
double rsectmax = 112.7;
return 2 * M_PI / N_SECTOR + rinvmax() * std::max(rcrit_ - rsectmin, rsectmax - rcrit_);
Expand Down Expand Up @@ -416,13 +416,13 @@ namespace trklet {
assert(bendcut > 0.0);
return bendcut;
}

const std::vector<int>& dtcLayers(const std::string& dtcName) const {
auto iter=dtclayers_.find(dtcName);
assert(iter!=dtclayers_.end());
auto iter = dtclayers_.find(dtcName);
assert(iter != dtclayers_.end());
return iter->second;
}

double bendcutte(int ibend, int layerdisk, bool isPSmodule) const { return bendcut(ibend, layerdisk, isPSmodule); }

double bendcutme(int ibend, int layerdisk, bool isPSmodule) const {
Expand Down Expand Up @@ -478,17 +478,17 @@ namespace trklet {
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}}}};

std::map<std::string, std::vector<int> > dtclayers_{{"PS10G_1", {0, 6, 8, 10}},
{"PS10G_2", {0, 7, 9}},
{"PS10G_3", {1, 7}},
{"PS10G_4", {6, 8, 10}},
{"PS_1", {2, 7}},
{"PS_2", {2, 9}},
{"2S_1", {3, 4}},
{"2S_2", {4}},
{"2S_3", {5}},
{"2S_4", {5, 8}},
{"2S_5", {6, 9}},
{"2S_6", {7, 10}}};
{"PS10G_2", {0, 7, 9}},
{"PS10G_3", {1, 7}},
{"PS10G_4", {6, 8, 10}},
{"PS_1", {2, 7}},
{"PS_2", {2, 9}},
{"2S_1", {3, 4}},
{"2S_2", {4}},
{"2S_3", {5}},
{"2S_4", {5, 8}},
{"2S_5", {6, 9}},
{"2S_6", {7, 10}}};

double rmindiskvm_{22.5};
double rmaxdiskvm_{67.0};
Expand Down Expand Up @@ -752,7 +752,7 @@ namespace trklet {

//Number of processing steps for one event (108=18TM*240MHz/40MHz)
std::unordered_map<std::string, unsigned int> maxstep_{{"IR", 168}, //IR will run at a higher clock speed to handle
//input links running at 25 Gbits/s
//input links running at 25 Gbits/s
{"VMR", 108},
{"TE", 108},
{"TC", 108},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ namespace trklet {
//Projection router name
std::string PRName(unsigned int ilayer, unsigned int ireg);


private:
//
// Method to initialize the regions and VM in each layer
Expand Down Expand Up @@ -107,7 +106,6 @@ namespace trklet {
//
double rinv(double r1, double phi1, double r2, double phi2);


//StubPair Name
std::string SPName(unsigned int l1,
unsigned int ireg1,
Expand Down
71 changes: 42 additions & 29 deletions L1Trigger/TrackFindingTracklet/interface/TrackletLUT.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,74 +10,87 @@ namespace trklet {
class Settings;

class TrackletLUT {
public:

public:
TrackletLUT(const Settings& settings);

TrackletLUT& operator=(const TrackletLUT& other) {

name_ = other.name_;
table_ = other.table_;
nbits_ = other.nbits_;
positive_ = other.positive_;

return *this;
}

~TrackletLUT() = default;

enum MatchType { barrelphi, barrelz, disk2Sphi, disk2Sr, diskPSphi, diskPSr };

//region only used for name - should be removed
void initmatchcut(unsigned int layerdisk, MatchType type, unsigned int region);

void initTPlut(bool fillInner, unsigned int iSeed, unsigned int layerdisk1, unsigned int layerdisk2,
unsigned int nbitsfinephidiff, unsigned int iTP);

void initTPregionlut(unsigned int iSeed, unsigned int layerdisk1, unsigned int layerdisk2,
unsigned int iAllStub, unsigned int nbitsfinephidiff, unsigned int nbitsfinephi,
const TrackletLUT& tplutinner, unsigned int iTP);

void initteptlut(bool fillInner, bool fillTEMem, unsigned int iSeed, unsigned int layerdisk1, unsigned int layerdisk2,
unsigned int innerphibits, unsigned int outerphibits,
double innerphimin, double innerphimax, double outerphimin, double outerphimax,
const std::string& innermem, const std::string& outermem);
void initTPlut(bool fillInner,
unsigned int iSeed,
unsigned int layerdisk1,
unsigned int layerdisk2,
unsigned int nbitsfinephidiff,
unsigned int iTP);

void initTPregionlut(unsigned int iSeed,
unsigned int layerdisk1,
unsigned int layerdisk2,
unsigned int iAllStub,
unsigned int nbitsfinephidiff,
unsigned int nbitsfinephi,
const TrackletLUT& tplutinner,
unsigned int iTP);

void initteptlut(bool fillInner,
bool fillTEMem,
unsigned int iSeed,
unsigned int layerdisk1,
unsigned int layerdisk2,
unsigned int innerphibits,
unsigned int outerphibits,
double innerphimin,
double innerphimax,
double outerphimin,
double outerphimax,
const std::string& innermem,
const std::string& outermem);


void initProjectionBend(double k_phider, unsigned int idisk, unsigned int nrbits, unsigned int nphiderbits);

void initBendMatch(unsigned int layerdisk);

enum VMRTableType { me, disk, inner, inneroverlap, innerthird };

//region only used for name - should be removed
void initVMRTable(unsigned int layerdisk, VMRTableType type, int region=-1);
void initVMRTable(unsigned int layerdisk, VMRTableType type, int region = -1);

void initPhiCorrTable(unsigned int layerdisk, unsigned int rbits);

void writeTable() const;

int lookup(unsigned int index) const;

unsigned int size() const { return table_.size(); }

private:

int getphiCorrValue(unsigned int layerdisk, unsigned int ibend, unsigned int irbin,
double rmean, double dr, double drmax) const;
int getphiCorrValue(
unsigned int layerdisk, unsigned int ibend, unsigned int irbin, double rmean, double dr, double drmax) const;

int getVMRLookup(unsigned int layerdisk, double z, double r, double dz, double dr, int iseed = -1) const;

const Settings& settings_;

std::string name_;

std::vector<int> table_;

unsigned int nbits_;

bool positive_;

};
}; // namespace trklet
#endif
Loading

0 comments on commit 983a89c

Please sign in to comment.