CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
trackerTFP::ProducerKF Class Reference

L1TrackTrigger Kamlan Filter emulator. More...

Inheritance diagram for trackerTFP::ProducerKF:
edm::stream::EDProducer<>

Public Member Functions

 ProducerKF (const ParameterSet &)
 
 ~ProducerKF () 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
 
void endStream () override
 
void produce (Event &, const EventSetup &) override
 

Private Attributes

const DataFormatsdataFormats_ = nullptr
 
EDGetTokenT< StreamsStubedGetTokenStubs_
 
EDGetTokenT< StreamsTrackedGetTokenTracks_
 
EDPutTokenT< StreamsStubedPutTokenAcceptedStubs_
 
EDPutTokenT< StreamsTrackedPutTokenAcceptedTracks_
 
EDPutTokenT< StreamsStubedPutTokenLostStubs_
 
EDPutTokenT< StreamsTrackedPutTokenLostTracks_
 
EDPutTokenT< int > edPutTokenNumAcceptedStates_
 
EDPutTokenT< int > edPutTokenNumLostStates_
 
ESGetToken< DataFormats, DataFormatsRcdesGetTokenDataFormats_
 
ESGetToken< KalmanFilterFormats, KalmanFilterFormatsRcdesGetTokenKalmanFilterFormats_
 
ESGetToken< Setup, SetupRcdesGetTokenSetup_
 
ParameterSet iConfig_
 
KalmanFilterFormatskalmanFilterFormats_ = nullptr
 
bool printDebug_
 
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

L1TrackTrigger Kamlan Filter emulator.

Author
Thomas Schuh
Date
2020, July

Definition at line 33 of file ProducerKF.cc.

Constructor & Destructor Documentation

◆ ProducerKF()

trackerTFP::ProducerKF::ProducerKF ( const ParameterSet iConfig)
explicit

Definition at line 76 of file ProducerKF.cc.

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

76  : iConfig_(iConfig) {
77  printDebug_ = iConfig.getParameter<bool>("PrintKFDebug");
78  const string& label = iConfig.getParameter<string>("LabelKFin");
79  const string& branchAcceptedStubs = iConfig.getParameter<string>("BranchAcceptedStubs");
80  const string& branchAcceptedTracks = iConfig.getParameter<string>("BranchAcceptedTracks");
81  const string& branchLostStubs = iConfig.getParameter<string>("BranchLostStubs");
82  const string& branchLostTracks = iConfig.getParameter<string>("BranchLostTracks");
83  // book in- and output ED products
84  edGetTokenStubs_ = consumes<StreamsStub>(InputTag(label, branchAcceptedStubs));
85  edGetTokenTracks_ = consumes<StreamsTrack>(InputTag(label, branchAcceptedTracks));
86  edPutTokenAcceptedStubs_ = produces<StreamsStub>(branchAcceptedStubs);
87  edPutTokenAcceptedTracks_ = produces<StreamsTrack>(branchAcceptedTracks);
88  edPutTokenLostStubs_ = produces<StreamsStub>(branchLostStubs);
89  edPutTokenLostTracks_ = produces<StreamsTrack>(branchLostTracks);
90  edPutTokenNumAcceptedStates_ = produces<int>(branchAcceptedTracks);
91  edPutTokenNumLostStates_ = produces<int>(branchLostTracks);
92  // book ES products
93  esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
94  esGetTokenDataFormats_ = esConsumes<DataFormats, DataFormatsRcd, Transition::BeginRun>();
95  esGetTokenKalmanFilterFormats_ = esConsumes<KalmanFilterFormats, KalmanFilterFormatsRcd, Transition::BeginRun>();
96  }
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerKF.cc:54
ParameterSet iConfig_
Definition: ProducerKF.cc:65
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerKF.cc:53
ESGetToken< KalmanFilterFormats, KalmanFilterFormatsRcd > esGetTokenKalmanFilterFormats_
Definition: ProducerKF.cc:63
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerKF.cc:50
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerKF.cc:47
char const * label
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerKF.cc:51
EDPutTokenT< int > edPutTokenNumLostStates_
Definition: ProducerKF.cc:57
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerKF.cc:59
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerKF.cc:61
EDPutTokenT< int > edPutTokenNumAcceptedStates_
Definition: ProducerKF.cc:56
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerKF.cc:48

◆ ~ProducerKF()

trackerTFP::ProducerKF::~ProducerKF ( )
inlineoverride

Definition at line 36 of file ProducerKF.cc.

36 {}

Member Function Documentation

◆ beginRun()

void trackerTFP::ProducerKF::beginRun ( const Run iRun,
const EventSetup iSetup 
)
overrideprivate

Definition at line 98 of file ProducerKF.cc.

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

98  {
99  // helper class to store configurations
100  setup_ = &iSetup.getData(esGetTokenSetup_);
102  return;
103  // check process history if desired
104  if (iConfig_.getParameter<bool>("CheckHistory"))
106  // helper class to extract structured data from tt::Frames
108  // helper class to
109  kalmanFilterFormats_ = const_cast<KalmanFilterFormats*>(&iSetup.getData(esGetTokenKalmanFilterFormats_));
110  }
ParameterSet iConfig_
Definition: ProducerKF.cc:65
const Setup * setup_
Definition: ProducerKF.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
ESGetToken< KalmanFilterFormats, KalmanFilterFormatsRcd > esGetTokenKalmanFilterFormats_
Definition: ProducerKF.cc:63
const DataFormats * dataFormats_
Definition: ProducerKF.cc:69
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerKF.cc:59
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:238
KalmanFilterFormats * kalmanFilterFormats_
Definition: ProducerKF.cc:71
ESGetToken< DataFormats, DataFormatsRcd > esGetTokenDataFormats_
Definition: ProducerKF.cc:61

◆ endStream()

void trackerTFP::ProducerKF::endStream ( )
inlineoverrideprivate

Definition at line 41 of file ProducerKF.cc.

41  {
42  if (printDebug_)
44  }
KalmanFilterFormats * kalmanFilterFormats_
Definition: ProducerKF.cc:71

◆ produce()

void trackerTFP::ProducerKF::produce ( Event iEvent,
const EventSetup iSetup 
)
overrideprivate

Definition at line 112 of file ProducerKF.cc.

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

112  {
113  // empty KF products
118  int numAcceptedStates(0);
119  int numLostStates(0);
120  // read in SF Product and produce KF product
122  Handle<StreamsStub> handleStubs;
123  iEvent.getByToken<StreamsStub>(edGetTokenStubs_, handleStubs);
124  const StreamsStub& stubs = *handleStubs;
125  Handle<StreamsTrack> handleTracks;
126  iEvent.getByToken<StreamsTrack>(edGetTokenTracks_, handleTracks);
127  const StreamsTrack& tracks = *handleTracks;
128  for (int region = 0; region < setup_->numRegions(); region++) {
129  // object to fit tracks in a processing region
131  // read in and organize input tracks and stubs
132  kf.consume(tracks, stubs);
133  // fill output products
134  kf.produce(acceptedStubs, acceptedTracks, lostStubs, lostTracks, numAcceptedStates, numLostStates);
135  }
136  }
137  // store products
138  iEvent.emplace(edPutTokenAcceptedStubs_, move(acceptedStubs));
139  iEvent.emplace(edPutTokenAcceptedTracks_, move(acceptedTracks));
140  iEvent.emplace(edPutTokenLostStubs_, move(lostStubs));
142  iEvent.emplace(edPutTokenNumAcceptedStates_, numAcceptedStates);
143  iEvent.emplace(edPutTokenNumLostStates_, numLostStates);
144  }
EDPutTokenT< StreamsTrack > edPutTokenLostTracks_
Definition: ProducerKF.cc:54
ParameterSet iConfig_
Definition: ProducerKF.cc:65
const Setup * setup_
Definition: ProducerKF.cc:67
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
EDPutTokenT< StreamsStub > edPutTokenLostStubs_
Definition: ProducerKF.cc:53
std::vector< StreamStub > StreamsStub
Definition: TTTypes.h:66
EDPutTokenT< StreamsStub > edPutTokenAcceptedStubs_
Definition: ProducerKF.cc:50
EDGetTokenT< StreamsStub > edGetTokenStubs_
Definition: ProducerKF.cc:47
const DataFormats * dataFormats_
Definition: ProducerKF.cc:69
int iEvent
Definition: GenABIO.cc:224
EDPutTokenT< StreamsTrack > edPutTokenAcceptedTracks_
Definition: ProducerKF.cc:51
bool configurationSupported() const
Definition: Setup.h:60
EDPutTokenT< int > edPutTokenNumLostStates_
Definition: ProducerKF.cc:57
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
KalmanFilterFormats * kalmanFilterFormats_
Definition: ProducerKF.cc:71
def move(src, dest)
Definition: eostools.py:511
EDPutTokenT< int > edPutTokenNumAcceptedStates_
Definition: ProducerKF.cc:56
EDGetTokenT< StreamsTrack > edGetTokenTracks_
Definition: ProducerKF.cc:48

Member Data Documentation

◆ dataFormats_

const DataFormats* trackerTFP::ProducerKF::dataFormats_ = nullptr
private

Definition at line 69 of file ProducerKF.cc.

Referenced by beginRun(), and produce().

◆ edGetTokenStubs_

EDGetTokenT<StreamsStub> trackerTFP::ProducerKF::edGetTokenStubs_
private

Definition at line 47 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edGetTokenTracks_

EDGetTokenT<StreamsTrack> trackerTFP::ProducerKF::edGetTokenTracks_
private

Definition at line 48 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edPutTokenAcceptedStubs_

EDPutTokenT<StreamsStub> trackerTFP::ProducerKF::edPutTokenAcceptedStubs_
private

Definition at line 50 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edPutTokenAcceptedTracks_

EDPutTokenT<StreamsTrack> trackerTFP::ProducerKF::edPutTokenAcceptedTracks_
private

Definition at line 51 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edPutTokenLostStubs_

EDPutTokenT<StreamsStub> trackerTFP::ProducerKF::edPutTokenLostStubs_
private

Definition at line 53 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edPutTokenLostTracks_

EDPutTokenT<StreamsTrack> trackerTFP::ProducerKF::edPutTokenLostTracks_
private

Definition at line 54 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edPutTokenNumAcceptedStates_

EDPutTokenT<int> trackerTFP::ProducerKF::edPutTokenNumAcceptedStates_
private

Definition at line 56 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ edPutTokenNumLostStates_

EDPutTokenT<int> trackerTFP::ProducerKF::edPutTokenNumLostStates_
private

Definition at line 57 of file ProducerKF.cc.

Referenced by produce(), and ProducerKF().

◆ esGetTokenDataFormats_

ESGetToken<DataFormats, DataFormatsRcd> trackerTFP::ProducerKF::esGetTokenDataFormats_
private

Definition at line 61 of file ProducerKF.cc.

Referenced by beginRun(), and ProducerKF().

◆ esGetTokenKalmanFilterFormats_

ESGetToken<KalmanFilterFormats, KalmanFilterFormatsRcd> trackerTFP::ProducerKF::esGetTokenKalmanFilterFormats_
private

Definition at line 63 of file ProducerKF.cc.

Referenced by beginRun(), and ProducerKF().

◆ esGetTokenSetup_

ESGetToken<Setup, SetupRcd> trackerTFP::ProducerKF::esGetTokenSetup_
private

Definition at line 59 of file ProducerKF.cc.

Referenced by beginRun(), and ProducerKF().

◆ iConfig_

ParameterSet trackerTFP::ProducerKF::iConfig_
private

Definition at line 65 of file ProducerKF.cc.

Referenced by beginRun(), and produce().

◆ kalmanFilterFormats_

KalmanFilterFormats* trackerTFP::ProducerKF::kalmanFilterFormats_ = nullptr
private

Definition at line 71 of file ProducerKF.cc.

Referenced by beginRun(), and produce().

◆ printDebug_

bool trackerTFP::ProducerKF::printDebug_
private

Definition at line 73 of file ProducerKF.cc.

Referenced by ProducerKF().

◆ setup_

const Setup* trackerTFP::ProducerKF::setup_ = nullptr
private