CMS 3D CMS Logo

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

Associate the TTTracks output by KF fitter with the tracks input to KF fitter. More...

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

Public Member Functions

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

Private Attributes

EDGetTokenT< StreamsTrackedGetTokenKF_
 
EDGetTokenT< TTTracksedGetTokenTT_
 
EDPutTokenT< TTTrackRefMapedPutToken_
 
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

Associate the TTTracks output by KF fitter with the tracks input to KF fitter.

Author
Thomas Schuh
Date
2020, Oct

Definition at line 29 of file ProducerAS.cc.

Constructor & Destructor Documentation

◆ ProducerAS()

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

Definition at line 53 of file ProducerAS.cc.

References MicroEventContent_cff::branch, edGetTokenKF_, edGetTokenTT_, edPutToken_, esGetTokenSetup_, edm::ParameterSet::getParameter(), ProducerED_cfi::InputTag, and DigiToRawDM_cff::labelTT.

53  : iConfig_(iConfig) {
54  const string& labelKF = iConfig.getParameter<string>("LabelKF");
55  const string& labelTT = iConfig.getParameter<string>("LabelTT");
56  const string& branch = iConfig.getParameter<string>("BranchAcceptedTracks");
57  // book in- and output ED products
58  edGetTokenKF_ = consumes<StreamsTrack>(InputTag(labelKF, branch));
59  edGetTokenTT_ = consumes<TTTracks>(InputTag(labelTT, branch));
60  edPutToken_ = produces<TTTrackRefMap>(branch);
61  // book ES products
62  esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
63  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
EDGetTokenT< TTTracks > edGetTokenTT_
Definition: ProducerAS.cc:42
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerAS.cc:46
EDGetTokenT< StreamsTrack > edGetTokenKF_
Definition: ProducerAS.cc:40
ParameterSet iConfig_
Definition: ProducerAS.cc:48
EDPutTokenT< TTTrackRefMap > edPutToken_
Definition: ProducerAS.cc:44

◆ ~ProducerAS()

trklet::ProducerAS::~ProducerAS ( )
inlineoverride

Definition at line 32 of file ProducerAS.cc.

32 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 65 of file ProducerAS.cc.

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

65  {
66  // helper class to store configurations
67  setup_ = &iSetup.getData(esGetTokenSetup_);
69  return;
70  // check process history if desired
71  if (iConfig_.getParameter<bool>("CheckHistory"))
73  }
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
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerAS.cc:46
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
const Setup * setup_
Definition: ProducerAS.cc:50
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:238
ParameterSet iConfig_
Definition: ProducerAS.cc:48

◆ endJob()

void trklet::ProducerAS::endJob ( void  )
inlineprivate

Definition at line 37 of file ProducerAS.cc.

37 {}

◆ produce()

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

Definition at line 75 of file ProducerAS.cc.

References tt::Setup::configurationSupported(), edGetTokenKF_, edGetTokenTT_, edPutToken_, mps_fire::i, iEvent, eostools::move(), edm::Handle< T >::product(), setup_, cms::cuda::stream, and HLT_2023v12_cff::streams.

75  {
76  // empty KFTTTrack product
77  TTTrackRefMap ttTrackMap;
78  // read in KF Product and produce AssociatorKF product
80  Handle<StreamsTrack> handleKF;
81  iEvent.getByToken<StreamsTrack>(edGetTokenKF_, handleKF);
82  const StreamsTrack& streams = *handleKF.product();
83  Handle<TTTracks> handleTT;
84  iEvent.getByToken<TTTracks>(edGetTokenTT_, handleTT);
85  int i(0);
86  for (const StreamTrack& stream : streams)
87  for (const FrameTrack& frame : stream)
88  if (frame.first.isNonnull())
89  ttTrackMap.emplace(TTTrackRef(handleTT, i++), frame.first);
90  }
91  // store products
92  iEvent.emplace(edPutToken_, std::move(ttTrackMap));
93  }
std::vector< StreamTrack > StreamsTrack
Definition: TTTypes.h:67
std::map< TTTrackRef, TTTrackRef > TTTrackRefMap
Definition: TTTypes.h:69
EDGetTokenT< TTTracks > edGetTokenTT_
Definition: ProducerAS.cc:42
T const * product() const
Definition: Handle.h:70
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::vector< FrameTrack > StreamTrack
Definition: TTTypes.h:64
std::pair< TTTrackRef, Frame > FrameTrack
Definition: TTTypes.h:62
int iEvent
Definition: GenABIO.cc:224
bool configurationSupported() const
Definition: Setup.h:60
EDGetTokenT< StreamsTrack > edGetTokenKF_
Definition: ProducerAS.cc:40
const Setup * setup_
Definition: ProducerAS.cc:50
std::vector< TTTrack< Ref_Phase2TrackerDigi_ > > TTTracks
Definition: TTTypes.h:70
EDPutTokenT< TTTrackRefMap > edPutToken_
Definition: ProducerAS.cc:44
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ edGetTokenKF_

EDGetTokenT<StreamsTrack> trklet::ProducerAS::edGetTokenKF_
private

Definition at line 40 of file ProducerAS.cc.

Referenced by produce(), and ProducerAS().

◆ edGetTokenTT_

EDGetTokenT<TTTracks> trklet::ProducerAS::edGetTokenTT_
private

Definition at line 42 of file ProducerAS.cc.

Referenced by produce(), and ProducerAS().

◆ edPutToken_

EDPutTokenT<TTTrackRefMap> trklet::ProducerAS::edPutToken_
private

Definition at line 44 of file ProducerAS.cc.

Referenced by produce(), and ProducerAS().

◆ esGetTokenSetup_

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

Definition at line 46 of file ProducerAS.cc.

Referenced by beginRun(), and ProducerAS().

◆ iConfig_

ParameterSet trklet::ProducerAS::iConfig_
private

Definition at line 48 of file ProducerAS.cc.

Referenced by beginRun().

◆ setup_

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