Skip to content

Commit

Permalink
Tracklet Processor Displaced (#159)
Browse files Browse the repository at this point in the history
* Tracklet Processor Displaced

* code-format

* code-format again

* remove unnecessary comments and add explanation for header file

* implement more comments

* remove more magic numbers
  • Loading branch information
hardikroutray authored May 30, 2022
1 parent a0bc07d commit d49136e
Show file tree
Hide file tree
Showing 12 changed files with 12,841 additions and 6 deletions.
5,441 changes: 5,441 additions & 0 deletions L1Trigger/TrackFindingTracklet/data/memorymodules_hourglassExtended.dat

Large diffs are not rendered by default.

1,155 changes: 1,155 additions & 0 deletions L1Trigger/TrackFindingTracklet/data/processingmodules_hourglassExtended.dat

Large diffs are not rendered by default.

5,441 changes: 5,441 additions & 0 deletions L1Trigger/TrackFindingTracklet/data/wires_hourglassExtended.dat

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions L1Trigger/TrackFindingTracklet/interface/Sector.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace trklet {
class TripletEngine;
class TrackletCalculator;
class TrackletProcessor;
class TrackletProcessorDisplaced;
class TrackletCalculatorDisplaced;
class ProjectionRouter;
class MatchEngine;
Expand Down Expand Up @@ -109,6 +110,7 @@ namespace trklet {
void executeTED();
void executeTRE();
void executeTP();
void executeTPD();
void executeTC();
void executeTCD();
void executePR();
Expand Down Expand Up @@ -174,6 +176,7 @@ namespace trklet {
std::vector<std::unique_ptr<TrackletEngineDisplaced>> TED_;
std::vector<std::unique_ptr<TripletEngine>> TRE_;
std::vector<std::unique_ptr<TrackletProcessor>> TP_;
std::vector<std::unique_ptr<TrackletProcessorDisplaced>> TPD_;
std::vector<std::unique_ptr<TrackletCalculator>> TC_;
std::vector<std::unique_ptr<TrackletCalculatorDisplaced>> TCD_;
std::vector<std::unique_ptr<ProjectionRouter>> PR_;
Expand Down
15 changes: 12 additions & 3 deletions L1Trigger/TrackFindingTracklet/interface/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,23 @@ namespace trklet {
{{5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4}}, //outer
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4}}}}; //outermost (triplets only)

// These are the number of bits to represent lutval for VM memories in TE
std::array<std::array<unsigned int, N_SEED>, 3> lutwidthtab_{{{{10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 11, 0}},
{{6, 6, 6, 6, 10, 10, 10, 10, 0, 0, 6, 0}},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6}}}};

// These are the number of bits to represent lutval for VM memories in TED
// TO DO: tune lutwidthtabextended_ values

/* std::array<std::array<unsigned int, N_SEED>, 3> lutwidthtabextended_{ */
/* {{{11, 11, 21, 21, 21, 21, 11, 11, 0, 0, 21, 0}}, */
/* {{6, 6, 6, 6, 10, 10, 10, 10, 0, 0, 6, 0}}, */
/* {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6}}}}; */

std::array<std::array<unsigned int, N_SEED>, 3> lutwidthtabextended_{
{{{11, 11, 21, 21, 21, 21, 11, 11, 0, 0, 21, 0}},
{{6, 6, 6, 6, 10, 10, 10, 10, 0, 0, 6, 0}},
{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6}}}};
{{{21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}},
{{21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}},
{{21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21}}}};

//layers/disks used by each seed
std::array<std::array<int, 3>, N_SEED> seedlayers_{{{{0, 1, -1}}, //L1L2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ namespace trklet {
double phiderdisk[5],
double rderdisk[5]);

private:
protected:
int TCIndex_;
int layer_;
int disk_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ namespace trklet {
Timer TEDTimer_;
Timer TRETimer_;
Timer TPTimer_;
Timer TPDTimer_;
Timer TCTimer_;
Timer TCDTimer_;
Timer PRTimer_;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// TrackletProcessorDisplaced: This class performs the tasks of the TrackletEngineDisplaced+TripletEngine+TrackletCalculatorDisplaced.
#ifndef L1Trigger_TrackFindingTracklet_interface_TrackletProcessorDisplaced_h
#define L1Trigger_TrackFindingTracklet_interface_TrackletProcessorDisplaced_h

#include "L1Trigger/TrackFindingTracklet/interface/TrackletCalculatorBase.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletCalculatorDisplaced.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletLUT.h"
#include "L1Trigger/TrackFindingTracklet/interface/CircularBuffer.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletEngineUnit.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletParametersMemory.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletProjectionsMemory.h"

#include <vector>
#include <tuple>
#include <map>

namespace trklet {

class Settings;
class Globals;
class MemoryBase;
class AllStubsMemory;
class AllInnerStubsMemory;
class VMStubsTEMemory;
class StubPairsMemory;

class TrackletProcessorDisplaced : public TrackletCalculatorDisplaced {
public:
TrackletProcessorDisplaced(std::string name, Settings const& settings, Globals* globals);

~TrackletProcessorDisplaced() override = default;

void addOutputProjection(TrackletProjectionsMemory*& outputProj, MemoryBase* memory);

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

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

void execute(unsigned int iSector, double phimin, double phimax);

private:
int iTC_;
int iAllStub_;
unsigned int maxStep_;
int count_;
unsigned int layerdisk_;

int layer1_;
int layer2_;
int layer3_;
int disk1_;
int disk2_;
int disk3_;

int firstphibits_;
int secondphibits_;
int thirdphibits_;

int nbitszfinebintable_;
int nbitsrfinebintable_;

TrackletLUT innerTable_; //projection to next layer/disk
TrackletLUT innerOverlapTable_; //projection to disk from layer
TrackletLUT innerThirdTable_; //projection to disk1 for extended - iseed=10

std::vector<StubPairsMemory*> stubpairs_;
/* std::vector<StubTripletsMemory*> stubtriplets_; */
std::vector<VMStubsTEMemory*> innervmstubs_;
std::vector<VMStubsTEMemory*> outervmstubs_;

StubTripletsMemory* stubtriplets_;

std::map<std::string, std::vector<std::vector<std::string> > > tmpSPTable_;
std::map<std::string, std::vector<std::map<std::string, unsigned> > > spTable_;
std::vector<bool> table_;
};

}; // namespace trklet
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ L1FPGATrackProducer::L1FPGATrackProducer(edm::ParameterSet const& iConfig)
//FIXME: The TED and TRE tables are currently disabled by default, so we
//need to allow for the additional tracklets that will eventually be
//removed by these tables, once they are finalized
settings_.setNbitstrackletindex(10);
settings_.setNbitstrackletindex(15);
}

eventnum = 0;
Expand Down
9 changes: 9 additions & 0 deletions L1Trigger/TrackFindingTracklet/src/Sector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "L1Trigger/TrackFindingTracklet/interface/TripletEngine.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletCalculator.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletProcessor.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletProcessorDisplaced.h"
#include "L1Trigger/TrackFindingTracklet/interface/TrackletCalculatorDisplaced.h"
#include "L1Trigger/TrackFindingTracklet/interface/ProjectionRouter.h"
#include "L1Trigger/TrackFindingTracklet/interface/MatchEngine.h"
Expand Down Expand Up @@ -158,6 +159,8 @@ void Sector::addProc(string procType, string procName) {
addProcToVec(TC_, procName, settings_, globals_);
} else if (procType == "TrackletProcessor:") {
addProcToVec(TP_, procName, settings_, globals_);
} else if (procType == "TrackletProcessorDisplaced:") {
addProcToVec(TPD_, procName, settings_, globals_);
} else if (procType == "TrackletCalculatorDisplaced:") {
addProcToVec(TCD_, procName, settings_, globals_);
} else if (procType == "ProjectionRouter:") {
Expand Down Expand Up @@ -370,6 +373,12 @@ void Sector::executeTP() {
}
}

void Sector::executeTPD() {
for (auto& i : TPD_) {
i->execute(isector_, phimin_, phimax_);
}
}

void Sector::executeTC() {
for (auto& i : TC_) {
i->execute(isector_, phimin_, phimax_);
Expand Down
11 changes: 10 additions & 1 deletion L1Trigger/TrackFindingTracklet/src/TrackletEventProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,11 @@ void TrackletEventProcessor::event(SLHCEvent& ev,
sector_->executeTCD();
TCDTimer_.stop();

// tracklet processor displaced
TPDTimer_.start();
sector_->executeTPD();
TPDTimer_.stop();

if (settings_->writeMem() && k == settings_->writememsect()) {
sector_->writeTPAR(first);
sector_->writeTPROJ(first);
Expand Down Expand Up @@ -422,7 +427,11 @@ void TrackletEventProcessor::printSummary() {
<< TRETimer_.tottime() << "\n"
<< "TrackletCalculatorDisplaced" << setw(10) << TCDTimer_.ntimes() << setw(20)
<< setprecision(3) << TCDTimer_.avgtime() * 1000.0 << setw(20) << setprecision(3)
<< TCDTimer_.tottime();
<< TCDTimer_.tottime() << "\n"
<< TCDTimer_.tottime() << "\n"
<< "TrackletProcessorDisplaced" << setw(10) << TPDTimer_.ntimes() << setw(20)
<< setprecision(3) << TPDTimer_.avgtime() * 1000.0 << setw(20) << setprecision(3)
<< TPDTimer_.tottime();
}
edm::LogVerbatim("Tracklet") << "TrackletCalculator " << setw(10) << TCTimer_.ntimes() << setw(20)
<< setprecision(3) << TCTimer_.avgtime() * 1000.0 << setw(20) << setprecision(3)
Expand Down
Loading

0 comments on commit d49136e

Please sign in to comment.