Skip to content

Commit

Permalink
Test vector fixes (cms-sw#132)
Browse files Browse the repository at this point in the history
* Made eventProcessor a member of the producer.

* Output TC tables in the reduced config.
  • Loading branch information
aehart authored Feb 15, 2022
1 parent f491b98 commit 6810714
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ class L1FPGATrackProducer : public edm::one::EDProducer<edm::one::WatchRuns> {
// settings containing various constants for the tracklet processing
trklet::Settings settings;

// event processor for the tracklet track finding
trklet::TrackletEventProcessor eventProcessor;

unsigned int nHelixPar_;
bool extended_;
bool reduced_;
Expand Down Expand Up @@ -338,15 +341,13 @@ void L1FPGATrackProducer::beginRun(const edm::Run& run, const edm::EventSetup& i

setup_ = iSetup.getData(esGetToken_);
channelAssignment_ = &iSetup.getData(esGetTokenChannelAssignment_);
// initialize the tracklet event processing (this sets all the processing & memory modules, wiring, etc)
eventProcessor.init(settings, channelAssignment_);
}

//////////
// PRODUCE
void L1FPGATrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
// event processor for the tracklet track finding
trklet::TrackletEventProcessor eventProcessor;
// initialize the tracklet event processing (this sets all the processing & memory modules, wiring, etc)
eventProcessor.init(settings, channelAssignment_);
typedef std::map<trklet::L1TStub,
edm::Ref<edmNew::DetSetVector<TTStub<Ref_Phase2TrackerDigi_>>, TTStub<Ref_Phase2TrackerDigi_>>,
L1TStubCompare>
Expand Down
7 changes: 5 additions & 2 deletions L1Trigger/TrackFindingTracklet/src/TrackletCalculator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ TrackletCalculator::TrackletCalculator(string name, Settings const& settings, Gl
<< "TrackletCalculator::TrackletCalculator phicrit approximation may be invalid! Please check.";
}

// reduced config has only one TC, so this must be the first
const bool isFirstTC = (iTC_ == 0 || settings_.reduced());

// write the drinv and invt inverse tables
if ((settings_.writeInvTable() || settings_.writeHLSInvTable() || settings_.writeTable()) && iTC_ == 0) {
if ((settings_.writeInvTable() || settings_.writeHLSInvTable() || settings_.writeTable()) && isFirstTC) {
void (*writeLUT)(const VarInv&, const string&) = nullptr;
if (settings.writeInvTable()) { // Verilog version
writeLUT = [](const VarInv& x, const string& basename) -> void {
Expand All @@ -61,7 +64,7 @@ TrackletCalculator::TrackletCalculator(string name, Settings const& settings, Gl

// write the firmware design for the calculation of the tracklet parameters
// and projections
if ((settings_.writeVerilog() || settings_.writeHLS()) && iTC_ == 0) {
if ((settings_.writeVerilog() || settings_.writeHLS()) && isFirstTC) {
void (*writeDesign)(const vector<VarBase*>&, const string&) = nullptr;
if (settings.writeVerilog()) { // Verilog version
writeDesign = [](const vector<VarBase*>& v, const string& basename) -> void {
Expand Down

0 comments on commit 6810714

Please sign in to comment.