Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aryd committed Jan 3, 2025
1 parent 8b12344 commit 4a0885d
Show file tree
Hide file tree
Showing 30 changed files with 908 additions and 921 deletions.
3 changes: 2 additions & 1 deletion L1Trigger/TrackFindingTracklet/interface/CircularBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ namespace trklet {

//near full if writer ptr incremented by 1, 2, or 3 is same as read ptr
bool nearfull4() const {
return (((wptr_ + 1) % size_) == rptr_) || (((wptr_ + 2) % size_) == rptr_) || (((wptr_ + 3) % size_) == rptr_) || (((wptr_ + 4) % size_) == rptr_);
return (((wptr_ + 1) % size_) == rptr_) || (((wptr_ + 2) % size_) == rptr_) || (((wptr_ + 3) % size_) == rptr_) ||
(((wptr_ + 4) % size_) == rptr_);
}

//Empty buffer is write ptr is same as read ptr
Expand Down
3 changes: 2 additions & 1 deletion L1Trigger/TrackFindingTracklet/interface/MatchEngineUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ namespace trklet {
bool usesecondMinus,
bool usesecondPlus,
bool isPSseed,
Tracklet* proj, bool print);
Tracklet* proj,
bool print);

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

Expand Down
20 changes: 9 additions & 11 deletions L1Trigger/TrackFindingTracklet/interface/MatchProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ namespace trklet {

bool matchCalculator(Tracklet* tracklet, const Stub* fpgastub, bool print, unsigned int istep);

void read_input_mems(bool &read_is_valid,
std::vector<bool>& mem_hasdata,
std::vector<int>& nentries,
int &read_addr,
const std::vector<int>& iMem,
const std::vector<int>& iPage,
unsigned int &imem,
unsigned int &ipage);


void read_input_mems(bool& read_is_valid,
std::vector<bool>& mem_hasdata,
std::vector<int>& nentries,
int& read_addr,
const std::vector<int>& iMem,
const std::vector<int>& iPage,
unsigned int& imem,
unsigned int& ipage);

private:
unsigned int layerdisk_;
bool barrel_;
Expand Down Expand Up @@ -86,7 +85,6 @@ namespace trklet {
const Stub* fpgastub_;
Tracklet* tracklet_;


AllStubsMemory* allstubs_;
std::vector<VMStubsMEMemory*> vmstubs_;
std::vector<TrackletProjectionsMemory*> inputprojs_;
Expand Down
21 changes: 10 additions & 11 deletions L1Trigger/TrackFindingTracklet/interface/ProjectionCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ namespace trklet {

class ProjectionCalculator : public ProcessBase {
public:
ProjectionCalculator(std::string name, Settings const& settings, Globals* global);
ProjectionCalculator(std::string name, Settings const &settings, Globals *global);

~ProjectionCalculator() override = default;

void addOutput(MemoryBase* memory, std::string output) override;
void addInput(MemoryBase* memory, std::string input) override;
void addOutput(MemoryBase *memory, std::string output) override;
void addInput(MemoryBase *memory, std::string input) override;

void execute();

void projLayer(int ir, int irinv, int iphi0, int it,int iz0, int &iz, int &iphi);
void projLayer(int ir, int irinv, int iphi0, int it, int iz0, int &iz, int &iphi);

void projDisk(int iz, int irinv, int iphi0, int it,int iz0, int &ir, int &iphi, int &iderphi, int &iderr);
void projDisk(int iz, int irinv, int iphi0, int it, int iz0, int &ir, int &iphi, int &iderphi, int &iderr);

private:
std::vector<std::vector<std::vector<TrackletProjectionsMemory *> > >
outputproj_; // projs now stored by layer/disk & phi region

std::vector<std::vector<std::vector<TrackletProjectionsMemory*> > > outputproj_; // projs now stored by layer/disk & phi region

std::vector<TrackletParametersMemory*> inputpars_;
std::vector<TrackletParametersMemory*> outputpars_;
std::vector<std::string > projnames_;
std::vector<TrackletParametersMemory *> inputpars_;
std::vector<TrackletParametersMemory *> outputpars_;
std::vector<std::string> projnames_;

//Constants for coordinates and track parameter definitions
int n_phi_;
Expand All @@ -61,7 +61,6 @@ namespace trklet {
double phiHG_;

std::vector<int> LUT_itinv_;

};

}; // namespace trklet
Expand Down
14 changes: 6 additions & 8 deletions L1Trigger/TrackFindingTracklet/interface/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ namespace trklet {
unsigned int nbendbitsmedisk() const { return nbendbitsmedisk_; }

bool useSeed(unsigned int iSeed) const { return useseeding_.find(iSeed) != useseeding_.end(); }
unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const {
return nbitsvmtecm_[inner][iSeed];
}
unsigned int nbitsvmte(unsigned int inner, unsigned int iSeed) const { return nbitsvmtecm_[inner][iSeed]; }
unsigned int nvmte(unsigned int inner, unsigned int iSeed) const { return (1 << nbitsvmte(inner, iSeed)); }

unsigned int nbitsvmme(unsigned int layerdisk) const { return nbitsvmme_[layerdisk]; }
Expand Down Expand Up @@ -139,9 +137,7 @@ namespace trklet {
double half2SmoduleWidth() const { return half2SmoduleWidth_; }

int nfinephi(unsigned int inner, unsigned int iSeed) const { return nfinephi_[inner][iSeed]; }
double nphireg(unsigned int inner, unsigned int iSeed) const {
return nphiregcm_[inner][iSeed];
}
double nphireg(unsigned int inner, unsigned int iSeed) const { return nphiregcm_[inner][iSeed]; }
double lutwidthtab(unsigned int inner, unsigned int iSeed) const { return lutwidthtab_[inner][iSeed]; }
double lutwidthtabextended(unsigned int inner, unsigned int iSeed) const {
return lutwidthtabextended_[inner][iSeed];
Expand Down Expand Up @@ -546,7 +542,8 @@ namespace trklet {

std::array<unsigned int, N_LAYER + N_DISK> nbitsallstubs_{{3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}};
std::array<unsigned int, N_LAYER + N_DISK> nbitsvmme_{{2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2}};
std::array<std::array<unsigned int, N_SEED>, 3> nbitsvmte_{ //FIXME unused?
std::array<std::array<unsigned int, N_SEED>, 3> nbitsvmte_{
//FIXME unused?
{{{2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 3, 2}}, // (3 = #stubs/triplet, only row 1+2 used for tracklet)
{{3, 2, 3, 3, 2, 2, 2, 2, 3, 3, 2, 2}},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1}}}};
Expand Down Expand Up @@ -680,7 +677,8 @@ namespace trklet {

//These are the number of bits used for the VM regions in the TE by seedindex
//FIXME not independed nbitsvmte
std::array<std::array<unsigned int, N_SEED>, 3> nphireg_{ //FIXME unused?
std::array<std::array<unsigned int, N_SEED>, 3> nphireg_{
//FIXME unused?
{{{5, 4, 4, 4, 4, 4, 4, 3, 4, 4, 5, 4}}, //inner
{{5, 4, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4}}, //outer
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4}}}}; //outermost (triplets only)
Expand Down
43 changes: 26 additions & 17 deletions L1Trigger/TrackFindingTracklet/interface/TrackletCalculatorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,27 @@ namespace trklet {
double& phider,
double& rder);


void projlayer(int ir, int irinv, int iphi0, int it,int iz0, int &iz, int &iphi); // lower case to differentiate from ProjectionCalculator functions

void projdisk(int iz, int irinv, int iphi0, int it,int iz0, int &ir, int &iphi, int &iderphi, int &iderr);

void calcPars(unsigned int idr, int iphi1, int ir1, int iz1, int iphi2, int ir2, int iz2,
int &irinv_new, int &iphi0_new, int &iz0_new, int &it_new);
void projlayer(int ir,
int irinv,
int iphi0,
int it,
int iz0,
int& iz,
int& iphi); // lower case to differentiate from ProjectionCalculator functions

void projdisk(int iz, int irinv, int iphi0, int it, int iz0, int& ir, int& iphi, int& iderphi, int& iderr);

void calcPars(unsigned int idr,
int iphi1,
int ir1,
int iz1,
int iphi2,
int ir2,
int iz2,
int& irinv_new,
int& iphi0_new,
int& iz0_new,
int& it_new);

void addDiskProj(Tracklet* tracklet, int disk);
bool addLayerProj(Tracklet* tracklet, int layer);
Expand All @@ -129,13 +143,12 @@ namespace trklet {
const L1TStub* innerStub,
const Stub* outerFPGAStub,
const L1TStub* outerStub,
bool print = false);
bool print = false);
bool overlapSeeding(const Stub* innerFPGAStub,
const L1TStub* innerStub,
const Stub* outerFPGAStub,
const L1TStub* outerStub,
bool print = false);

bool print = false);

protected:
unsigned int iSeed_;
Expand All @@ -148,8 +161,6 @@ namespace trklet {
double phimin_, phimax_;
double phiHG_;



TrackletParametersMemory* trackletpars_;

//First index is layer/disk second is phi region
Expand All @@ -165,7 +176,7 @@ namespace trklet {
int n_t_;
int n_phidisk_;
int n_rdisk_;

//Constants used for tracklet parameter calculations
int n_Deltar_;
int n_delta0_;
Expand All @@ -177,7 +188,7 @@ namespace trklet {
int n_r6_;
int n_delta02_;
int n_x6_;
int n_HG_;
int n_HG_;

//Constants used for projectison to layers
int n_s_;
Expand All @@ -188,11 +199,9 @@ namespace trklet {
int n_y_;
int n_x_;
int n_xx6_;

std::vector<int> LUT_itinv_;
std::vector<int> LUT_idrinv_;


};

}; // namespace trklet
Expand Down
10 changes: 4 additions & 6 deletions L1Trigger/TrackFindingTracklet/interface/TrackletConfigBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ namespace trklet {
unsigned int NSector_; //Number of sectors
double rcrit_; //critical radius that defines the sector

bool duplicateMPs_; //if true write configuration with MPs duplicated for L3,L4
bool duplicateMPs_; //if true write configuration with MPs duplicated for L3,L4

bool extended_; //if true write configuration for extended configuration

Expand Down Expand Up @@ -272,7 +272,7 @@ namespace trklet {

//The projections to each layer/disk from a seed and TC
std::vector<std::vector<std::pair<unsigned int, unsigned int> > > projections_[N_LAYER + N_DISK];

//Which matches are used for each seeding layer
// L1 L2 L3 L4 L5 L6 D1 D2 D3 D4 D5
int matchport_[N_SEED_PROMPT][N_LAYER + N_DISK] = {{-1, -1, 1, 2, 3, 4, 4, 3, 2, 1, -1}, //L1L2
Expand All @@ -285,10 +285,8 @@ namespace trklet {
{1, -1, -1, -1, -1, -1, -1, 2, 3, 4, -1}}; //L2D1

//Which seeds handled by each TB
int tbseed_[N_TB][4] = {{0, 1, 3, 7},
{2, 4, 5, 6}};


int tbseed_[N_TB][4] = {{0, 1, 3, 7}, {2, 4, 5, 6}};

struct DTCinfo {
std::string name;
int layer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace trklet {

~TrackletParametersMemory() override = default;

void addTracklet(Tracklet *tracklet,unsigned int page = 0) { tracklets_[page].push_back(tracklet); }
void addTracklet(Tracklet *tracklet, unsigned int page = 0) { tracklets_[page].push_back(tracklet); }

unsigned int nTracklets(unsigned int page = 0) const { return tracklets_[page].size(); }

Expand All @@ -33,10 +33,8 @@ namespace trklet {
void writeTPAR(bool first, unsigned int iSector);

private:

std::vector<std::vector<Tracklet *> > tracklets_;
unsigned int npage_;

};

}; // namespace trklet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ namespace trklet {
unsigned int nTracklets(unsigned int page = 0) const { return tracklets_[page].size(); }

Tracklet* getTracklet(unsigned int i, unsigned int page = 0) { return tracklets_[page][i]; }

unsigned int nPage() const { return npage_; }

void clean() override;

void writeTPROJ(bool first, unsigned int iSector);
Expand All @@ -38,7 +38,7 @@ namespace trklet {
int disk() const { return disk_; }

private:
std::vector< std::vector<Tracklet*> > tracklets_;
std::vector<std::vector<Tracklet*> > tracklets_;

bool hasProj_;
int layer_;
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/TrackFindingTracklet/interface/VMRouterCM.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ namespace trklet {
//two VMs. nextrabits_ is the number of bits beyond the bits for the phivm that is used by overlapbits_
unsigned int overlapbits_;
unsigned int nextrabits_;

int nbitszfinebintable_;
int nbitsrfinebintable_;

unsigned int nvmmebins_; //number of long z/r bins in VM

TrackletLUT meTable_; //used for ME and outer TE barrel
TrackletLUT diskTable_; //outer disk used by D1, D2, and D4

Expand Down
1 change: 0 additions & 1 deletion L1Trigger/TrackFindingTracklet/interface/VMStubMERouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ namespace trklet {
}; // namespace trklet

#endif

Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,7 @@ L1FPGATrackProducer::~L1FPGATrackProducer() {

///////END RUN
//
void L1FPGATrackProducer::endRun(const edm::Run& run, const edm::EventSetup& iSetup) {
eventProcessor.printSummary();
}
void L1FPGATrackProducer::endRun(const edm::Run& run, const edm::EventSetup& iSetup) { eventProcessor.printSummary(); }

////////////
// BEGIN JOB
Expand Down
Loading

0 comments on commit 4a0885d

Please sign in to comment.