CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
trklet::ProducerDR Class Reference

Emulates removal of duplicated TTTracks f/w. More...

Inheritance diagram for trklet::ProducerDR:
edm::stream::EDProducer<>

Public Member Functions

 ProducerDR (const ParameterSet &)
 
 ~ProducerDR () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void beginRun (const Run &, const EventSetup &) override
 
virtual void endJob ()
 
void produce (Event &, const EventSetup &) override
 

Private Attributes

const ChannelAssignmentchannelAssignment_ = nullptr
 
const DataFormatsdataFormats_ = nullptr
 
EDGetTokenT< StreamsStubedGetTokenStubs_
 
EDGetTokenT< StreamsTrackedGetTokenTracks_
 
EDPutTokenT< StreamsStubedPutTokenAcceptedStubs_
 
EDPutTokenT< StreamsTrackedPutTokenAcceptedTracks_
 
EDPutTokenT< StreamsStubedPutTokenLostStubs_
 
EDPutTokenT< StreamsTrackedPutTokenLostTracks_
 
ESGetToken< ChannelAssignment, ChannelAssignmentRcdesGetTokenChannelAssignment_
 
ESGetToken< DataFormats, DataFormatsRcdesGetTokenDataFormats_
 
ESGetToken< Setup, SetupRcdesGetTokenSetup_
 
ParameterSet iConfig_
 
const Setupsetup_ = nullptr
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Emulates removal of duplicated TTTracks f/w.

Author
Thomas Schuh
Date
2023, Feb

Definition at line 38 of file ProducerDR.cc.

Constructor & Destructor Documentation

◆ ProducerDR()

trklet::ProducerDR::ProducerDR ( const ParameterSet iConfig)
explicit

Definition at line 73 of file ProducerDR.cc.

References edGetTokenStubs_, edGetTokenTracks_, edPutTokenAcceptedStubs_, edPutTokenAcceptedTracks_, edPutTokenLostStubs_, edPutTokenLostTracks_, esGetTokenChannelAssignment_, esGetTokenDataFormats_, esGetTokenSetup_, edm::ParameterSet::getParameter(), ProducerED_cfi::InputTag, and label.

73  : iConfig_(iConfig) {
74  const string& label = iConfig.getParameter<string>("LabelDRin");
75  const string& branchAcceptedStubs = iConfig.getParameter<string>("BranchAcceptedStubs");
76  const string& branchAcceptedTracks = iConfig.getParameter<string>("BranchAcceptedTracks");
77  const string& branchLostStubs = iConfig.getParameter<string>("BranchLostStubs");
78  const string& branchLostTracks = iConfig.getParameter<string>("BranchLostTracks");
79  // book in- and output ED products
80  edGetTokenTracks_ = consumes<StreamsTrack>(InputTag(label, branchAcceptedTracks));
81  edGetTokenStubs_ = consumes<StreamsStub>(InputTag(label, branchAcceptedStubs));
82  edPutTokenAcceptedStubs_ = produces<StreamsStub>(branchAcceptedStubs);
83  edPutTokenAcceptedTracks_ = produces<StreamsTrack>(branchAcceptedTracks);
84  edPutTokenLostStubs_ = produces<StreamsStub>(branchLostStubs);
85  edPutTokenLostTracks_ = produces<StreamsTrack>(branchLostTracks);
86  // book ES products
87  esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
88  esGetTokenDataFormats_ = esConsumes<DataFormats, DataFormatsRcd, Transition::BeginRun>();
89  esGetTokenChannelAssignment_ = esConsumes<ChannelAssignment, ChannelAssignmentRcd, Transition::BeginRun>();
90  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerDR.cc:48
char const * label
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerDR.cc:60
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerDR.cc:53
ParameterSet iConfig_
Definition: ProducerDR.cc:64
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
Definition: ProducerDR.cc:62
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerDR.cc:55
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerDR.cc:50
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerDR.cc:52
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerDR.cc:58
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerDR.cc:56

◆ ~ProducerDR()

trklet::ProducerDR::~ProducerDR ( )
inlineoverride

Definition at line 41 of file ProducerDR.cc.

41 {}

Member Function Documentation

◆ beginRun()

void trklet::ProducerDR::beginRun ( const Run iRun,
const EventSetup iSetup 
)
overrideprivate

Definition at line 92 of file ProducerDR.cc.

References channelAssignment_, tt::Setup::checkHistory(), tt::Setup::configurationSupported(), dataFormats_, esGetTokenChannelAssignment_, esGetTokenDataFormats_, esGetTokenSetup_, edm::EventSetup::getData(), edm::ParameterSet::getParameter(), iConfig_, edm::Run::processHistory(), and setup_.

92  {
93  // helper class to store configurations
94  setup_ = &iSetup.getData(esGetTokenSetup_);
96  return;
97  // check process history if desired
98  if (iConfig_.getParameter<bool>("CheckHistory"))
100  // helper class to extract structured data from tt::Frames
102  // helper class to assign tracks to channel
104  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const DataFormats * dataFormats_
Definition: ProducerDR.cc:68
const ChannelAssignment * channelAssignment_
Definition: ProducerDR.cc:70
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerDR.cc:60
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
ParameterSet iConfig_
Definition: ProducerDR.cc:64
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:242
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
Definition: ProducerDR.cc:62
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerDR.cc:58
const Setup * setup_
Definition: ProducerDR.cc:66

◆ endJob()

virtual void trklet::ProducerDR::endJob ( void  )
inlineprivatevirtual

Definition at line 46 of file ProducerDR.cc.

46 {}

◆ produce()

void trklet::ProducerDR::produce ( Event iEvent,
const EventSetup iSetup 
)
overrideprivate

Definition at line 106 of file ProducerDR.cc.

References channelAssignment_, tt::Setup::configurationSupported(), dataFormats_, edGetTokenStubs_, edGetTokenTracks_, edPutTokenAcceptedStubs_, edPutTokenAcceptedTracks_, edPutTokenLostStubs_, edPutTokenLostTracks_, iConfig_, iEvent, isotracks_cff::lostTracks, eostools::move(), tt::Setup::numLayers(), trklet::ChannelAssignment::numNodesDR(), tt::Setup::numRegions(), nano_mu_digi_cff::region, setup_, and DiMuonV_cfg::tracks.

106  {
107  // empty DR products
108  const int numStreamsTracks = channelAssignment_->numNodesDR() * setup_->numRegions();
109  const int numStreamsStubs = numStreamsTracks * setup_->numLayers();
110  StreamsStub acceptedStubs(numStreamsStubs);
111  StreamsTrack acceptedTracks(numStreamsTracks);
112  StreamsStub lostStubs(numStreamsStubs);
113  StreamsTrack lostTracks(numStreamsTracks);
114  // read in TBout Product and produce KFin product
116  Handle<StreamsStub> handleStubs;
117  iEvent.getByToken<StreamsStub>(edGetTokenStubs_, handleStubs);
118  const StreamsStub& stubs = *handleStubs;
119  Handle<StreamsTrack> handleTracks;
120  iEvent.getByToken<StreamsTrack>(edGetTokenTracks_, handleTracks);
121  const StreamsTrack& tracks = *handleTracks;
122  for (int region = 0; region < setup_->numRegions(); region++) {
123  // object to remove duplicated tracks in a processing region
125  // read in and organize input tracks and stubs
126  dr.consume(tracks, stubs);
127  // fill output products
128  dr.produce(acceptedStubs, acceptedTracks, lostStubs, lostTracks);
129  }
130  }
131  // store products
132  iEvent.emplace(edPutTokenAcceptedStubs_, std::move(acceptedStubs));
133  iEvent.emplace(edPutTokenAcceptedTracks_, std::move(acceptedTracks));
134  iEvent.emplace(edPutTokenLostStubs_, std::move(lostStubs));
136  }
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
const DataFormats * dataFormats_
Definition: ProducerDR.cc:68
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerDR.cc:48
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
const ChannelAssignment * channelAssignment_
Definition: ProducerDR.cc:70
int iEvent
Definition: GenABIO.cc:224
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerDR.cc:53
bool configurationSupported() const
Definition: Setup.h:60
ParameterSet iConfig_
Definition: ProducerDR.cc:64
int numLayers() const
Definition: Setup.h:215
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerDR.cc:55
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerDR.cc:50
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerDR.cc:52
int numRegions() const
Definition: Setup.h:349
const Setup * setup_
Definition: ProducerDR.cc:66
def move(src, dest)
Definition: eostools.py:511
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerDR.cc:56

Member Data Documentation

◆ channelAssignment_

const ChannelAssignment* trklet::ProducerDR::channelAssignment_ = nullptr
private

Definition at line 70 of file ProducerDR.cc.

Referenced by beginRun(), and produce().

◆ dataFormats_

const DataFormats* trklet::ProducerDR::dataFormats_ = nullptr
private

Definition at line 68 of file ProducerDR.cc.

Referenced by beginRun(), and produce().

◆ edGetTokenStubs_

EDGetTokenT<StreamsStub> trklet::ProducerDR::edGetTokenStubs_
private

Definition at line 50 of file ProducerDR.cc.

Referenced by produce(), and ProducerDR().

◆ edGetTokenTracks_

EDGetTokenT<StreamsTrack> trklet::ProducerDR::edGetTokenTracks_
private

Definition at line 48 of file ProducerDR.cc.

Referenced by produce(), and ProducerDR().

◆ edPutTokenAcceptedStubs_

EDPutTokenT<StreamsStub> trklet::ProducerDR::edPutTokenAcceptedStubs_
private

Definition at line 52 of file ProducerDR.cc.

Referenced by produce(), and ProducerDR().

◆ edPutTokenAcceptedTracks_

EDPutTokenT<StreamsTrack> trklet::ProducerDR::edPutTokenAcceptedTracks_
private

Definition at line 55 of file ProducerDR.cc.

Referenced by produce(), and ProducerDR().

◆ edPutTokenLostStubs_

EDPutTokenT<StreamsStub> trklet::ProducerDR::edPutTokenLostStubs_
private

Definition at line 53 of file ProducerDR.cc.

Referenced by produce(), and ProducerDR().

◆ edPutTokenLostTracks_

EDPutTokenT<StreamsTrack> trklet::ProducerDR::edPutTokenLostTracks_
private

Definition at line 56 of file ProducerDR.cc.

Referenced by produce(), and ProducerDR().

◆ esGetTokenChannelAssignment_

ESGetToken<ChannelAssignment, ChannelAssignmentRcd> trklet::ProducerDR::esGetTokenChannelAssignment_
private

Definition at line 62 of file ProducerDR.cc.

Referenced by beginRun(), and ProducerDR().

◆ esGetTokenDataFormats_

ESGetToken<DataFormats, DataFormatsRcd> trklet::ProducerDR::esGetTokenDataFormats_
private

Definition at line 60 of file ProducerDR.cc.

Referenced by beginRun(), and ProducerDR().

◆ esGetTokenSetup_

ESGetToken<Setup, SetupRcd> trklet::ProducerDR::esGetTokenSetup_
private

Definition at line 58 of file ProducerDR.cc.

Referenced by beginRun(), and ProducerDR().

◆ iConfig_

ParameterSet trklet::ProducerDR::iConfig_
private

Definition at line 64 of file ProducerDR.cc.

Referenced by beginRun(), and produce().

◆ setup_

const Setup* trklet::ProducerDR::setup_ = nullptr
private