CMS 3D CMS Logo

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

Transforms format of TBout into that expected by DR input. More...

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

Public Member Functions

 ProducerDRin (const ParameterSet &)
 
 ~ProducerDRin () 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< LayerEncoding, LayerEncodingRcdesGetTokenLayerEncoding_
 
ESGetToken< Setup, SetupRcdesGetTokenSetup_
 
ParameterSet iConfig_
 
const LayerEncodinglayerEncoding_ = nullptr
 
Settings settings_
 
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

Transforms format of TBout into that expected by DR input.

Author
Thomas Schuh
Date
2023, Jan

Definition at line 40 of file ProducerDRin.cc.

Constructor & Destructor Documentation

◆ ProducerDRin()

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

Definition at line 82 of file ProducerDRin.cc.

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

82  : iConfig_(iConfig) {
83  const string& label = iConfig.getParameter<string>("LabelTBout");
84  const string& branchAcceptedStubs = iConfig.getParameter<string>("BranchAcceptedStubs");
85  const string& branchAcceptedTracks = iConfig.getParameter<string>("BranchAcceptedTracks");
86  const string& branchLostStubs = iConfig.getParameter<string>("BranchLostStubs");
87  const string& branchLostTracks = iConfig.getParameter<string>("BranchLostTracks");
88  // book in- and output ED products
89  edGetTokenTracks_ = consumes<StreamsTrack>(InputTag(label, branchAcceptedTracks));
90  edGetTokenStubs_ = consumes<StreamsStub>(InputTag(label, branchAcceptedStubs));
91  edPutTokenAcceptedStubs_ = produces<StreamsStub>(branchAcceptedStubs);
92  edPutTokenAcceptedTracks_ = produces<StreamsTrack>(branchAcceptedTracks);
93  edPutTokenLostStubs_ = produces<StreamsStub>(branchLostStubs);
94  edPutTokenLostTracks_ = produces<StreamsTrack>(branchLostTracks);
95  // book ES products
96  esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
97  esGetTokenDataFormats_ = esConsumes<DataFormats, DataFormatsRcd, Transition::BeginRun>();
98  esGetTokenLayerEncoding_ = esConsumes<LayerEncoding, LayerEncodingRcd, Transition::BeginRun>();
99  esGetTokenChannelAssignment_ = esConsumes<ChannelAssignment, ChannelAssignmentRcd, Transition::BeginRun>();
100  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerDRin.cc:59
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerDRin.cc:58
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerDRin.cc:53
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerDRin.cc:55
char const * label
ParameterSet iConfig_
Definition: ProducerDRin.cc:69
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerDRin.cc:61
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerDRin.cc:63
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
Definition: ProducerDRin.cc:67
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerDRin.cc:56
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerDRin.cc:51
ESGetToken< LayerEncoding, LayerEncodingRcd > esGetTokenLayerEncoding_
Definition: ProducerDRin.cc:65

◆ ~ProducerDRin()

trklet::ProducerDRin::~ProducerDRin ( )
inlineoverride

Definition at line 43 of file ProducerDRin.cc.

43 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 102 of file ProducerDRin.cc.

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

102  {
103  // helper class to store configurations
104  setup_ = &iSetup.getData(esGetTokenSetup_);
106  return;
107  // check process history if desired
108  if (iConfig_.getParameter<bool>("CheckHistory"))
110  // helper class to extract structured data from tt::Frames
112  // helper class to encode layer
114  // helper class to assign tracks to channel
116  }
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
ParameterSet iConfig_
Definition: ProducerDRin.cc:69
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerDRin.cc:61
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerDRin.cc:63
const ChannelAssignment * channelAssignment_
Definition: ProducerDRin.cc:77
const DataFormats * dataFormats_
Definition: ProducerDRin.cc:73
const Setup * setup_
Definition: ProducerDRin.cc:71
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
Definition: ProducerDRin.cc:67
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:242
ESGetToken< LayerEncoding, LayerEncodingRcd > esGetTokenLayerEncoding_
Definition: ProducerDRin.cc:65
const LayerEncoding * layerEncoding_
Definition: ProducerDRin.cc:75

◆ endJob()

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

Definition at line 48 of file ProducerDRin.cc.

48 {}

◆ produce()

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

Definition at line 118 of file ProducerDRin.cc.

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

118  {
119  // empty KFin products
120  const int numStreamsTracks = channelAssignment_->numNodesDR() * setup_->numRegions();
121  const int numStreamsStubs = numStreamsTracks * setup_->numLayers();
122  StreamsStub acceptedStubs(numStreamsStubs);
123  StreamsTrack acceptedTracks(numStreamsTracks);
124  StreamsStub lostStubs(numStreamsStubs);
125  StreamsTrack lostTracks(numStreamsTracks);
126  // read in TBout Product and produce KFin product
128  Handle<StreamsStub> handleStubs;
129  iEvent.getByToken<StreamsStub>(edGetTokenStubs_, handleStubs);
130  const StreamsStub& stubs = *handleStubs;
131  Handle<StreamsTrack> handleTracks;
132  iEvent.getByToken<StreamsTrack>(edGetTokenTracks_, handleTracks);
133  const StreamsTrack& tracks = *handleTracks;
134  for (int region = 0; region < setup_->numRegions(); region++) {
135  // object to reformat tracks from tracklet fromat to TMTT format in a processing region
137  // read in and organize input tracks and stubs
138  drin.consume(tracks, stubs);
139  // fill output products
140  drin.produce(acceptedStubs, acceptedTracks, lostStubs, lostTracks);
141  }
142  }
143  // store products
144  iEvent.emplace(edPutTokenAcceptedStubs_, std::move(acceptedStubs));
145  iEvent.emplace(edPutTokenAcceptedTracks_, std::move(acceptedTracks));
146  iEvent.emplace(edPutTokenLostStubs_, std::move(lostStubs));
148  }
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerDRin.cc:59
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerDRin.cc:58
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerDRin.cc:53
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerDRin.cc:55
ParameterSet iConfig_
Definition: ProducerDRin.cc:69
int iEvent
Definition: GenABIO.cc:224
const ChannelAssignment * channelAssignment_
Definition: ProducerDRin.cc:77
const DataFormats * dataFormats_
Definition: ProducerDRin.cc:73
const Setup * setup_
Definition: ProducerDRin.cc:71
bool configurationSupported() const
Definition: Setup.h:60
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerDRin.cc:56
int numLayers() const
Definition: Setup.h:215
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerDRin.cc:51
int numRegions() const
Definition: Setup.h:349
const LayerEncoding * layerEncoding_
Definition: ProducerDRin.cc:75
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ channelAssignment_

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

Definition at line 77 of file ProducerDRin.cc.

Referenced by beginRun(), and produce().

◆ dataFormats_

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

Definition at line 73 of file ProducerDRin.cc.

Referenced by beginRun(), and produce().

◆ edGetTokenStubs_

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

Definition at line 53 of file ProducerDRin.cc.

Referenced by produce(), and ProducerDRin().

◆ edGetTokenTracks_

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

Definition at line 51 of file ProducerDRin.cc.

Referenced by produce(), and ProducerDRin().

◆ edPutTokenAcceptedStubs_

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

Definition at line 55 of file ProducerDRin.cc.

Referenced by produce(), and ProducerDRin().

◆ edPutTokenAcceptedTracks_

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

Definition at line 58 of file ProducerDRin.cc.

Referenced by produce(), and ProducerDRin().

◆ edPutTokenLostStubs_

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

Definition at line 56 of file ProducerDRin.cc.

Referenced by produce(), and ProducerDRin().

◆ edPutTokenLostTracks_

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

Definition at line 59 of file ProducerDRin.cc.

Referenced by produce(), and ProducerDRin().

◆ esGetTokenChannelAssignment_

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

Definition at line 67 of file ProducerDRin.cc.

Referenced by beginRun(), and ProducerDRin().

◆ esGetTokenDataFormats_

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

Definition at line 63 of file ProducerDRin.cc.

Referenced by beginRun(), and ProducerDRin().

◆ esGetTokenLayerEncoding_

ESGetToken<LayerEncoding, LayerEncodingRcd> trklet::ProducerDRin::esGetTokenLayerEncoding_
private

Definition at line 65 of file ProducerDRin.cc.

Referenced by beginRun(), and ProducerDRin().

◆ esGetTokenSetup_

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

Definition at line 61 of file ProducerDRin.cc.

Referenced by beginRun(), and ProducerDRin().

◆ iConfig_

ParameterSet trklet::ProducerDRin::iConfig_
private

Definition at line 69 of file ProducerDRin.cc.

Referenced by beginRun(), and produce().

◆ layerEncoding_

const LayerEncoding* trklet::ProducerDRin::layerEncoding_ = nullptr
private

Definition at line 75 of file ProducerDRin.cc.

Referenced by beginRun(), and produce().

◆ settings_

Settings trklet::ProducerDRin::settings_
private

Definition at line 79 of file ProducerDRin.cc.

Referenced by produce().

◆ setup_

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