80 ProducerTBout::ProducerTBout(
const ParameterSet& iConfig) : iConfig_(iConfig) {
82 const string& branchAcceptedStubs = iConfig.
getParameter<
string>(
"BranchAcceptedStubs");
83 const string& branchAcceptedTracks = iConfig.
getParameter<
string>(
"BranchAcceptedTracks");
84 const string& branchLostStubs = iConfig.
getParameter<
string>(
"BranchLostStubs");
85 const string& branchLostTracks = iConfig.
getParameter<
string>(
"BranchLostTracks");
127 vector<deque<TTTrackRef>> ttTrackRefs(numStreamsTracks);
131 for (
int i = 0;
i < (
int)handleTTTracks->size();
i++) {
134 ttTrackRefs[channelId].push_back(ttTrackRef);
140 for (
const Stream& streamTrack : *handleTracks) {
141 const int nTracks = accumulate(
142 streamTrack.begin(), streamTrack.end(), 0, [](
int sum,
const Frame&
f) {
return sum + (
f.any() ? 1 : 0); });
143 StreamTrack& accepted = streamAcceptedTracks[channelId];
145 auto limit = streamTrack.end();
151 const deque<TTTrackRef>& ttTracks = ttTrackRefs[channelId++];
152 if ((
int)ttTracks.size() !=
nTracks) {
157 <<
" tracks found but created " << ttTracks.size() <<
" TTTracks.";
158 exception.addContext(
"trklet::ProducerTBout::produce");
161 auto toFrameTrack = [&nFrame, &ttTracks](
const Frame&
frame) {
166 transform(streamTrack.begin(),
limit, back_inserter(accepted), toFrameTrack);
167 transform(
limit, streamTrack.end(), back_inserter(lost), toFrameTrack);
175 for (
const StreamStub& streamStub : streamsStub) {
176 auto limit = streamStub.end();
179 streamAcceptedStubs[channelId] =
StreamStub(streamStub.begin(),
limit);
void produce(Event &, const EventSetup &) override
EDGetTokenT< StreamsStub > edGetTokenStubs_
std::bitset< TTBV::S_ > Frame
T getParameter(std::string const &) const
std::vector< StreamTrack > StreamsTrack
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void beginRun(const Run &, const EventSetup &) override
Class to process and provide run-time constants used by Track Trigger emulators.
std::vector< StreamStub > StreamsStub
EDGetTokenT< TTTracks > edGetTokenTTTracks_
std::vector< FrameStub > StreamStub
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
int numChannelsTrack() const
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
int channelId(const TTTrackRef &ttTrackRef) const
Class to assign tracklet tracks and stubs to output channel based on their Pt or seed type as well as...
std::vector< FrameTrack > StreamTrack
std::pair< TTTrackRef, Frame > FrameTrack
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
ChannelAssignment * channelAssignment_
bool configurationSupported() const
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
#define DEFINE_FWK_MODULE(type)
ProcessHistory const & processHistory() const
void checkHistory(const edm::ProcessHistory &processHistory) const
std::vector< Frame > Stream
EDGetTokenT< Streams > edGetTokenTracks_
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
std::vector< Stream > Streams
Transforms TTTracks and Streams from Tracklet pattern reco. into StreamsTrack by adding to the digiti...
int numChannelsStub() const
const DataFormats * dataFormats_
std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTracks
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
~ProducerTBout() override