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(), totem::nt2::vfat::channelId(), tt::Setup::configurationSupported(), HLT_2022v15_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(), push_back(), HLT_2022v15_cff::region, setup_, and HcalDetIdTransform::transform().
127 vector<deque<TTTrackRef>> ttTrackRefs(numStreamsTracks);
131 for (
int i = 0;
i < (
int)handleTTTracks->size();
i++) {
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; });
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();
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_
std::vector< FrameTrack > StreamTrack
bool channelId(const TTTrackRef &ttTrackRef, int &channelId)
std::pair< TTTrackRef, Frame > FrameTrack
ChannelAssignment * channelAssignment_
bool configurationSupported() const
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
std::vector< Frame > Stream
uint8_t channelId(const VFATFrame &frame)
retrieve this channel identifier
EDGetTokenT< Streams > edGetTokenTracks_
std::vector< Stream > Streams
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
int numChannelsStub() const
std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTracks
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_