CMS 3D CMS Logo

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

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

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

Public Member Functions

 ProducerKFin (const ParameterSet &)
 
 ~ProducerKFin () 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 KF input.

Author
Thomas Schuh
Date
2020, Oct; updated 2021, Dec

Definition at line 40 of file ProducerKFin.cc.

Constructor & Destructor Documentation

◆ ProducerKFin()

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

Definition at line 82 of file ProducerKFin.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  }
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
Definition: ProducerKFin.cc:67
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerKFin.cc:56
ESGetToken< LayerEncoding, LayerEncodingRcd > esGetTokenLayerEncoding_
Definition: ProducerKFin.cc:65
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerKFin.cc:58
char const * label
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerKFin.cc:51
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerKFin.cc:55
ParameterSet iConfig_
Definition: ProducerKFin.cc:69
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerKFin.cc:63
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerKFin.cc:61
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerKFin.cc:59
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerKFin.cc:53

◆ ~ProducerKFin()

trklet::ProducerKFin::~ProducerKFin ( )
inlineoverride

Definition at line 43 of file ProducerKFin.cc.

43 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 102 of file ProducerKFin.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  }
ESGetToken< ChannelAssignment, ChannelAssignmentRcd > esGetTokenChannelAssignment_
Definition: ProducerKFin.cc:67
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const Setup * setup_
Definition: ProducerKFin.cc:71
ESGetToken< LayerEncoding, LayerEncodingRcd > esGetTokenLayerEncoding_
Definition: ProducerKFin.cc:65
const DataFormats * dataFormats_
Definition: ProducerKFin.cc:73
const LayerEncoding * layerEncoding_
Definition: ProducerKFin.cc:75
const ChannelAssignment * channelAssignment_
Definition: ProducerKFin.cc:77
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
ParameterSet iConfig_
Definition: ProducerKFin.cc:69
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerKFin.cc:63
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:238
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerKFin.cc:61

◆ endJob()

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

Definition at line 48 of file ProducerKFin.cc.

48 {}

◆ produce()

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

Definition at line 118 of file ProducerKFin.cc.

References channelAssignment_, tt::Setup::configurationSupported(), dataFormats_, edGetTokenStubs_, edGetTokenTracks_, edPutTokenAcceptedStubs_, edPutTokenAcceptedTracks_, edPutTokenLostStubs_, edPutTokenLostTracks_, iConfig_, iEvent, trackerTFP::kfin, layerEncoding_, isotracks_cff::lostTracks, eostools::move(), tt::Setup::numRegions(), trackerTFP::DataFormats::numStreamsStubs(), trackerTFP::DataFormats::numStreamsTracks(), HLT_2023v12_cff::region, settings_, setup_, and pwdgSkimBPark_cfi::tracks.

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

Member Data Documentation

◆ channelAssignment_

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

Definition at line 77 of file ProducerKFin.cc.

Referenced by beginRun(), and produce().

◆ dataFormats_

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

Definition at line 73 of file ProducerKFin.cc.

Referenced by beginRun(), and produce().

◆ edGetTokenStubs_

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

Definition at line 53 of file ProducerKFin.cc.

Referenced by produce(), and ProducerKFin().

◆ edGetTokenTracks_

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

Definition at line 51 of file ProducerKFin.cc.

Referenced by produce(), and ProducerKFin().

◆ edPutTokenAcceptedStubs_

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

Definition at line 55 of file ProducerKFin.cc.

Referenced by produce(), and ProducerKFin().

◆ edPutTokenAcceptedTracks_

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

Definition at line 58 of file ProducerKFin.cc.

Referenced by produce(), and ProducerKFin().

◆ edPutTokenLostStubs_

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

Definition at line 56 of file ProducerKFin.cc.

Referenced by produce(), and ProducerKFin().

◆ edPutTokenLostTracks_

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

Definition at line 59 of file ProducerKFin.cc.

Referenced by produce(), and ProducerKFin().

◆ esGetTokenChannelAssignment_

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

Definition at line 67 of file ProducerKFin.cc.

Referenced by beginRun(), and ProducerKFin().

◆ esGetTokenDataFormats_

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

Definition at line 63 of file ProducerKFin.cc.

Referenced by beginRun(), and ProducerKFin().

◆ esGetTokenLayerEncoding_

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

Definition at line 65 of file ProducerKFin.cc.

Referenced by beginRun(), and ProducerKFin().

◆ esGetTokenSetup_

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

Definition at line 61 of file ProducerKFin.cc.

Referenced by beginRun(), and ProducerKFin().

◆ iConfig_

ParameterSet trklet::ProducerKFin::iConfig_
private

Definition at line 69 of file ProducerKFin.cc.

Referenced by beginRun(), and produce().

◆ layerEncoding_

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

Definition at line 75 of file ProducerKFin.cc.

Referenced by beginRun(), and produce().

◆ settings_

Settings trklet::ProducerKFin::settings_
private

Definition at line 79 of file ProducerKFin.cc.

Referenced by produce().

◆ setup_

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