Skip to content

Commit

Permalink
Ians third comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tschuh committed Feb 4, 2022
1 parent 5f61baa commit fd554a1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
23 changes: 11 additions & 12 deletions L1Trigger/TrackFindingTracklet/test/ProducerIRin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "DataFormats/Common/interface/Handle.h"

#include "L1Trigger/TrackTrigger/interface/Setup.h"
#include "L1Trigger/TrackFindingTracklet/interface/ChannelAssignment.h"

#include <string>
#include <vector>
Expand All @@ -26,7 +27,7 @@ using namespace tt;
namespace trklet {

/*! \class trklet::ProducerIRin
* \brief Transforms TTTDCinto f/w comparable format for summer chain configuratiotn
* \brief Extracts and rearranges StreamsStub from TTDTC
* \author Thomas Schuh
* \date 2021, Oct
*/
Expand All @@ -45,14 +46,14 @@ namespace trklet {
EDPutTokenT<StreamsStub> edPutTokenStubs_;
// Setup token
ESGetToken<Setup, SetupRcd> esGetTokenSetup_;
// ChannelAssignment token
ESGetToken<ChannelAssignment, ChannelAssignmentRcd> esGetTokenChannelAssignment_;
// configuration
ParameterSet iConfig_;
// helper class to store configurations
const Setup* setup_;
// reduce l1 tracking to summer chain configuration
bool summerChain_;
// map of used tfp channels in summer chain config
vector<int> channelEncoding_;
// helper class to assign stubs to channel
const ChannelAssignment* channelAssignment_;
};

ProducerIRin::ProducerIRin(const ParameterSet& iConfig) : iConfig_(iConfig) {
Expand All @@ -65,6 +66,7 @@ namespace trklet {
esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
// initial ES products
setup_ = nullptr;
channelAssignment_ = nullptr;
}

void ProducerIRin::beginRun(const Run& iRun, const EventSetup& iSetup) {
Expand All @@ -75,10 +77,7 @@ namespace trklet {
// check process history if desired
if (iConfig_.getParameter<bool>("CheckHistory"))
setup_->checkHistory(iRun.processHistory());
// reduce l1 tracking to summer chain configuration
summerChain_ = iConfig_.getParameter<bool>("SummerChain");
// map of used tfp channels in summer chain config
channelEncoding_ = iConfig_.getParameter<vector<int>>("SummerChainChannels");
channelAssignment_ = &iSetup.getData(esGetTokenChannelAssignment_);
}

void ProducerIRin::produce(Event& iEvent, const EventSetup& iSetup) {
Expand All @@ -88,11 +87,11 @@ namespace trklet {
if (setup_->configurationSupported()) {
Handle<TTDTC> handleTTDTC;
iEvent.getByToken<TTDTC>(edGetTokenTTDTC_, handleTTDTC);
const int numChannel =
summerChain_ ? channelEncoding_.size() : handleTTDTC->tfpRegions().size() * handleTTDTC->tfpChannels().size();
const vector<int>& channelEncoding = channelAssignment_->channelEncoding();
const int numChannel = setup_->numRegions() * channelEncoding.size();
streamStubs.reserve(numChannel);
for (int tfpRegion : handleTTDTC->tfpRegions())
for (int tfpChannel : summerChain_ ? channelEncoding_ : handleTTDTC->tfpChannels())
for (int tfpChannel : channelEncoding)
streamStubs.emplace_back(handleTTDTC->stream(tfpRegion, tfpChannel));
}
// store products
Expand Down
3 changes: 2 additions & 1 deletion L1Trigger/TrackFindingTracklet/test/ProducerTBout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ using namespace tt;
namespace trklet {

/*! \class trklet::ProducerTBout
* \brief Transforms TTTracks from Tracklet pattern reco. into f/w comparable format
* \brief Transforms TTTracks, Streams Tracklet pattern reco. into StreamsTrack
* stores truncated StreamsTrack and StreamsStub into seperate branch
* \author Thomas Schuh
* \date 2021, Oct
*/
Expand Down

0 comments on commit fd554a1

Please sign in to comment.