Transforms TTTracks and Streams from Tracklet pattern reco. into StreamsTrack by adding to the digitised track stream a reference to the corresponding TTTrack. (Could not be done in previous L1TrackFPGAProducer, as single EDProducer can't produce output containing both an EDProduct and refs to that product). Writes Tracks & stubs rejected/kept after truncation to separate StreamsTrack & StreamsStub branches.
- Author
- Thomas Schuh
- Date
- 2021, Oct
Definition at line 40 of file ProducerTBout.cc.
void trklet::ProducerTBout::produce |
( |
Event & |
iEvent, |
|
|
const EventSetup & |
iSetup |
|
) |
| |
|
overrideprivate |
Definition at line 116 of file ProducerTBout.cc.
References channelAssignment_, trklet::ChannelAssignment::channelId(), tt::Setup::configurationSupported(), HLT_2023v12_cff::distance, edGetTokenStubs_, edGetTokenTracks_, edGetTokenTTTracks_, edPutTokenAcceptedStubs_, edPutTokenAcceptedTracks_, edPutTokenLostStubs_, edPutTokenLostTracks_, enableTruncation_, cppFunctionSkipper::exception, f, amptDefault_cfi::frame, mps_fire::i, iEvent, createfilelist::int, remoteMonitoring_LASER_era2018_cfg::limit, eostools::move(), GetRecoTauVFromDQM_MC_cff::next, beamSpotPI::nTracks, trklet::ChannelAssignment::numChannelsStub(), trklet::ChannelAssignment::numChannelsTrack(), tt::Setup::numFrames(), tt::Setup::numRegions(), nano_mu_digi_cff::region, setup_, and HcalDetIdTransform::transform().
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);
EDGetTokenT< StreamsStub > edGetTokenStubs_
std::bitset< TTBV::S_ > Frame
std::vector< StreamTrack > StreamsTrack
std::vector< StreamStub > StreamsStub
EDGetTokenT< TTTracks > edGetTokenTTTracks_
std::vector< FrameStub > StreamStub
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
int numChannelsTrack() const
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
int channelId(const TTTrackRef &ttTrackRef) const
std::vector< FrameTrack > StreamTrack
std::pair< TTTrackRef, Frame > FrameTrack
ChannelAssignment * channelAssignment_
bool configurationSupported() const
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
std::vector< Frame > Stream
EDGetTokenT< Streams > edGetTokenTracks_
std::vector< Stream > Streams
int numChannelsStub() const
std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTracks
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_