diff --git a/L1Trigger/TrackFindingTracklet/interface/L1TStub.h b/L1Trigger/TrackFindingTracklet/interface/L1TStub.h index ae4d3fd5f2ea0..95a85bdaf4f1a 100644 --- a/L1Trigger/TrackFindingTracklet/interface/L1TStub.h +++ b/L1Trigger/TrackFindingTracklet/interface/L1TStub.h @@ -131,7 +131,6 @@ namespace trklet { unsigned int isPSmodule_; unsigned int isFlipped_; - }; }; // namespace trklet #endif diff --git a/L1Trigger/TrackFindingTracklet/interface/Sector.h b/L1Trigger/TrackFindingTracklet/interface/Sector.h index 12d4cde2b3d6a..5bd469a34bead 100644 --- a/L1Trigger/TrackFindingTracklet/interface/Sector.h +++ b/L1Trigger/TrackFindingTracklet/interface/Sector.h @@ -128,14 +128,14 @@ namespace trklet { double phimax() const { return phimax_; } template - void addMemToVec(std::vector >& memvec, const std::string& memName, Args&... args) { + void addMemToVec(std::vector>& memvec, const std::string& memName, Args&... args) { memvec.push_back(std::make_unique(memName, std::forward(args)...)); Memories_[memName] = memvec.back().get(); MemoriesV_.push_back(memvec.back().get()); } template - void addProcToVec(std::vector >& procvec, const std::string& procName, Args&... args) { + void addProcToVec(std::vector>& procvec, const std::string& procName, Args&... args) { procvec.push_back(std::make_unique(procName, std::forward(args)...)); Processes_[procName] = procvec.back().get(); } @@ -149,39 +149,39 @@ namespace trklet { std::map Memories_; std::vector MemoriesV_; - std::vector > DL_; - std::vector > IL_; - std::vector > AS_; - std::vector > AIS_; - std::vector > VMSTE_; - std::vector > VMSME_; - std::vector > SP_; - std::vector > ST_; - std::vector > TPAR_; - std::vector > TPROJ_; - std::vector > AP_; - std::vector > VMPROJ_; - std::vector > CM_; - std::vector > FM_; - std::vector > TF_; - std::vector > CT_; + std::vector> DL_; + std::vector> IL_; + std::vector> AS_; + std::vector> AIS_; + std::vector> VMSTE_; + std::vector> VMSME_; + std::vector> SP_; + std::vector> ST_; + std::vector> TPAR_; + std::vector> TPROJ_; + std::vector> AP_; + std::vector> VMPROJ_; + std::vector> CM_; + std::vector> FM_; + std::vector> TF_; + std::vector> CT_; std::map Processes_; - std::vector > IR_; - std::vector > VMR_; - std::vector > VMRCM_; - std::vector > TE_; - std::vector > TED_; - std::vector > TRE_; - std::vector > TP_; - std::vector > TC_; - std::vector > TCD_; - std::vector > PR_; - std::vector > ME_; - std::vector > MC_; - std::vector > MP_; - std::vector > FT_; - std::vector > PD_; + std::vector> IR_; + std::vector> VMR_; + std::vector> VMRCM_; + std::vector> TE_; + std::vector> TED_; + std::vector> TRE_; + std::vector> TP_; + std::vector> TC_; + std::vector> TCD_; + std::vector> PR_; + std::vector> ME_; + std::vector> MC_; + std::vector> MP_; + std::vector> FT_; + std::vector> PD_; }; }; // namespace trklet #endif diff --git a/L1Trigger/TrackFindingTracklet/interface/StubStreamData.h b/L1Trigger/TrackFindingTracklet/interface/StubStreamData.h index f9cb373f11610..5c1b9d460aed1 100644 --- a/L1Trigger/TrackFindingTracklet/interface/StubStreamData.h +++ b/L1Trigger/TrackFindingTracklet/interface/StubStreamData.h @@ -14,24 +14,23 @@ namespace trklet { class StubStreamData { public: - StubStreamData() {} - - StubStreamData(int iSeed, const L1TStub& stub, const std::string& residuals): - iSeed_(iSeed), stub_(stub), residuals_(residuals) {} + StubStreamData() {} + + StubStreamData(int iSeed, const L1TStub& stub, const std::string& residuals) + : iSeed_(iSeed), stub_(stub), residuals_(residuals) {} ~StubStreamData() = default; - int iSeed() const {return iSeed_;} // Seed type - bool valid() const {return (iSeed_ >= 0);} // Valid stub - const L1TStub& stub() const {return stub_;} + int iSeed() const { return iSeed_; } // Seed type + bool valid() const { return (iSeed_ >= 0); } // Valid stub + const L1TStub& stub() const { return stub_; } // String containing valid bit + r coordinate + phi residual + r or z residual. - const std::string& residuals() const {return residuals_;} + const std::string& residuals() const { return residuals_; } private: int iSeed_{-1}; L1TStub stub_; std::string residuals_{""}; - }; }; // namespace trklet #endif diff --git a/L1Trigger/TrackFindingTracklet/interface/TrackletEventProcessor.h b/L1Trigger/TrackFindingTracklet/interface/TrackletEventProcessor.h index 1e130e71ef4cc..3dfe51ac554e7 100644 --- a/L1Trigger/TrackFindingTracklet/interface/TrackletEventProcessor.h +++ b/L1Trigger/TrackFindingTracklet/interface/TrackletEventProcessor.h @@ -30,12 +30,11 @@ namespace trklet { ~TrackletEventProcessor(); - void init(Settings const& theSettings, - const tt::Setup* setup = nullptr); + void init(Settings const& theSettings, const tt::Setup* setup = nullptr); void event(SLHCEvent& ev, - std::vector>& streamsTrackRaw, - std::vector>& streamsStubRaw); + std::vector>& streamsTrackRaw, + std::vector>& streamsStubRaw); void printSummary(); diff --git a/L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc b/L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc index 6091ce8bf0419..7c8e46a1d3f06 100644 --- a/L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc +++ b/L1Trigger/TrackFindingTracklet/plugins/L1FPGATrackProducer.cc @@ -612,7 +612,6 @@ void L1FPGATrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe const std::vector& tracks = eventProcessor.tracks(); - // number of track channels const unsigned int numStreamsTrack = N_SECTOR * channelAssignment_->numChannelsTrack(); // number of stub channels @@ -620,7 +619,8 @@ void L1FPGATrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe // number of stub channels if all seed types streams padded to have same number of stub channels (for coding simplicity) unsigned int maxNumProjectionLayers = 0; for (int iSeedType = 0; iSeedType < channelAssignment_->numSeedTypes(); iSeedType++) { - maxNumProjectionLayers = max(maxNumProjectionLayers, (unsigned int) channelAssignment_->numProjectionLayers(iSeedType)); + maxNumProjectionLayers = + max(maxNumProjectionLayers, (unsigned int)channelAssignment_->numProjectionLayers(iSeedType)); } const unsigned int numStreamsStubRaw = numStreamsTrack * maxNumProjectionLayers; @@ -713,35 +713,36 @@ void L1FPGATrackProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe Streams streamsTrack(numStreamsTrack); StreamsStub streamsStub(numStreamsStub); - for(unsigned int chanTrk=0; chanTrknumChannelsTrack(); // seed type + int iSeed = chanTrk % channelAssignment_->numChannelsTrack(); // seed type streamsTrack[chanTrk].emplace_back(bitsTrk); - const unsigned int chanStubOffsetIn = chanTrk*maxNumProjectionLayers; + const unsigned int chanStubOffsetIn = chanTrk * maxNumProjectionLayers; const unsigned int chanStubOffsetOut = channelAssignment_->offsetStub(chanTrk); const unsigned int numProjLayers = channelAssignment_->numProjectionLayers(iSeed); TTBV hitMap(0, numProjLayers); // remove padding from stub stream - for(unsigned int iproj=0; iprojlayerId(stubdata.iSeed(), ttStubRef, layerId)) continue; + if (!channelAssignment_->layerId(stubdata.iSeed(), ttStubRef, layerId)) + continue; hitMap.set(layerId); - streamsStub[chanStubOffsetOut+layerId].emplace_back(ttStubRef,stubdata.residuals()); + streamsStub[chanStubOffsetOut + layerId].emplace_back(ttStubRef, stubdata.residuals()); } } - for (int layerId : hitMap.ids(false)) { // invalid stubs - streamsStub[chanStubOffsetOut+layerId].emplace_back(tt::FrameStub()); + for (int layerId : hitMap.ids(false)) { // invalid stubs + streamsStub[chanStubOffsetOut + layerId].emplace_back(tt::FrameStub()); } - } + } } - + iEvent.emplace(edPutTokenTracks_, move(streamsTrack)); iEvent.emplace(edPutTokenStubs_, move(streamsStub)); diff --git a/L1Trigger/TrackFindingTracklet/src/FitTrack.cc b/L1Trigger/TrackFindingTracklet/src/FitTrack.cc index 3cd1623e98e1d..33504acc2e93e 100644 --- a/L1Trigger/TrackFindingTracklet/src/FitTrack.cc +++ b/L1Trigger/TrackFindingTracklet/src/FitTrack.cc @@ -1056,7 +1056,7 @@ void FitTrack::execute(vector& streamTrackRaw, streamTrackRaw.emplace_back(valid + seed + rinv + phi0 + z0 + t); unsigned int ihit(0); - for(unsigned int ilayer = 0 ; ilayer < N_LAYER + N_DISK ; ilayer++){ + for (unsigned int ilayer = 0; ilayer < N_LAYER + N_DISK; ilayer++) { if (bestTracklet->match(ilayer)) { const Residual& resid = bestTracklet->resid(ilayer); // create bit accurate 64 bit word @@ -1067,13 +1067,14 @@ void FitTrack::execute(vector& streamTrackRaw, const L1TStub* stub = resid.stubptr()->l1tstub(); static constexpr int widthDisk2Sidentifier = 8; bool disk2S = (stub->disk() != 0) && (stub->isPSmodule() == 0); - if (disk2S) r = string(widthDisk2Sidentifier, '0') + r; + if (disk2S) + r = string(widthDisk2Sidentifier, '0') + r; // store seed, L1TStub, and bit accurate 64 bit word in clock accurate output - streamsStubRaw[ihit++].emplace_back(StubStreamData(seedType,*stub,valid + r + phi + rz)); + streamsStubRaw[ihit++].emplace_back(StubStreamData(seedType, *stub, valid + r + phi + rz)); } } // fill all layer with no stubs with gaps - while (ihit>& streamsTrackRaw, vector>& streamsStubRaw) { const int numChannels = streamsTrackRaw.size() / N_SECTOR; - const int maxNumProjectionLayers = streamsStubRaw.size()/streamsTrackRaw.size(); + const int maxNumProjectionLayers = streamsStubRaw.size() / streamsTrackRaw.size(); const int offsetTrack = isector_ * numChannels; int channelTrack(0); diff --git a/L1Trigger/TrackFindingTracklet/src/TrackletEventProcessor.cc b/L1Trigger/TrackFindingTracklet/src/TrackletEventProcessor.cc index ec766e484c6c2..e727526061f48 100644 --- a/L1Trigger/TrackFindingTracklet/src/TrackletEventProcessor.cc +++ b/L1Trigger/TrackFindingTracklet/src/TrackletEventProcessor.cc @@ -25,8 +25,7 @@ TrackletEventProcessor::~TrackletEventProcessor() { } } -void TrackletEventProcessor::init(Settings const& theSettings, - const tt::Setup* setup) { +void TrackletEventProcessor::init(Settings const& theSettings, const tt::Setup* setup) { settings_ = &theSettings; globals_ = make_unique(*settings_); @@ -175,8 +174,8 @@ void TrackletEventProcessor::configure(istream& inwire, istream& inmem, istream& } void TrackletEventProcessor::event(SLHCEvent& ev, - vector>& streamsTrackRaw, - vector>& streamsStubRaw) { + vector>& streamsTrackRaw, + vector>& streamsStubRaw) { globals_->event() = &ev; tracks_.clear(); diff --git a/L1Trigger/TrackFindingTracklet/test/fpga.cc b/L1Trigger/TrackFindingTracklet/test/fpga.cc index 5d45e073e8503..7fe7d754ae3f0 100644 --- a/L1Trigger/TrackFindingTracklet/test/fpga.cc +++ b/L1Trigger/TrackFindingTracklet/test/fpga.cc @@ -209,8 +209,8 @@ int main(const int argc, const char **argv) { edm::LogVerbatim("Tracklet") << "Process event: " << eventnum << " with " << ev.nstubs() << " stubs and " << ev.nsimtracks() << " simtracks"; - std::vector> tracksStream(N_SECTOR*8); - std::vector> stubsStream(N_SECTOR*8*8); + std::vector> tracksStream(N_SECTOR * 8); + std::vector> stubsStream(N_SECTOR * 8 * 8); eventProcessor.event(ev, tracksStream, stubsStream);