CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ConversionTrackRefFix Class Reference

#include <ConversionTrackRefFix.h>

Inheritance diagram for ConversionTrackRefFix:
edm::stream::EDProducer<>

Public Member Functions

 ConversionTrackRefFix (const edm::ParameterSet &)
 
 ~ConversionTrackRefFix () 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 produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< reco::ConversionTrackCollectionconversionTracksToken
 
edm::EDGetTokenT< reco::TrackCollectionnewTracksToken
 

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

Definition at line 11 of file ConversionTrackRefFix.h.

Constructor & Destructor Documentation

◆ ConversionTrackRefFix()

ConversionTrackRefFix::ConversionTrackRefFix ( const edm::ParameterSet iConfig)
explicit

Definition at line 11 of file ConversionTrackRefFix.cc.

11  {
12  InputTag conversionTracksTag = iConfig.getParameter<InputTag>("src");
13  InputTag newTracksTag = iConfig.getParameter<InputTag>("newTrackCollection");
14 
15  produces<ConversionTrackCollection>();
16 
17  conversionTracksToken = consumes<ConversionTrackCollection>(conversionTracksTag);
18  newTracksToken = consumes<TrackCollection>(newTracksTag);
19 }

References edm::ParameterSet::getParameter().

◆ ~ConversionTrackRefFix()

ConversionTrackRefFix::~ConversionTrackRefFix ( )
override

Definition at line 21 of file ConversionTrackRefFix.cc.

21 {}

Member Function Documentation

◆ produce()

void ConversionTrackRefFix::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 23 of file ConversionTrackRefFix.cc.

23  {
24  Handle<ConversionTrackCollection> conversionTracks;
25  iEvent.getByToken(conversionTracksToken, conversionTracks);
26 
27  Handle<TrackCollection> newTracks;
28  iEvent.getByToken(newTracksToken, newTracks);
29 
30  unique_ptr<ConversionTrackCollection> output(new ConversionTrackCollection);
31 
32  for (const ConversionTrack& conversion : *(conversionTracks.product())) {
33  size_t trackIndex = conversion.trackRef().key();
34  output->push_back(ConversionTrack(TrackBaseRef(TrackRef(newTracks, trackIndex))));
35  output->back().setTrajRef(conversion.trajRef());
36  output->back().setIsTrackerOnly(conversion.isTrackerOnly());
37  output->back().setIsArbitratedEcalSeeded(conversion.isArbitratedEcalSeeded());
38  output->back().setIsArbitratedMerged(conversion.isArbitratedMerged());
39  output->back().setIsArbitratedMergedEcalGeneral(conversion.isArbitratedMergedEcalGeneral());
40  }
41 
42  iEvent.put(std::move(output));
43 }

References edm::conversion(), iEvent, eostools::move(), convertSQLitetoXML_cfg::output, and edm::Handle< T >::product().

Member Data Documentation

◆ conversionTracksToken

edm::EDGetTokenT<reco::ConversionTrackCollection> ConversionTrackRefFix::conversionTracksToken
private

Definition at line 18 of file ConversionTrackRefFix.h.

◆ newTracksToken

edm::EDGetTokenT<reco::TrackCollection> ConversionTrackRefFix::newTracksToken
private

Definition at line 19 of file ConversionTrackRefFix.h.

edm::conversion
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::ConversionTrack
Definition: ConversionTrack.h:19
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
reco::ConversionTrackCollection
std::vector< ConversionTrack > ConversionTrackCollection
collection of ConversionTracks
Definition: ConversionTrackFwd.h:6
reco::TrackBaseRef
edm::RefToBase< reco::Track > TrackBaseRef
persistent reference to a Track, using views
Definition: TrackFwd.h:35
edm::Handle
Definition: AssociativeIterator.h:50
ConversionTrackRefFix::newTracksToken
edm::EDGetTokenT< reco::TrackCollection > newTracksToken
Definition: ConversionTrackRefFix.h:19
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
ConversionTrackRefFix::conversionTracksToken
edm::EDGetTokenT< reco::ConversionTrackCollection > conversionTracksToken
Definition: ConversionTrackRefFix.h:18
iEvent
int iEvent
Definition: GenABIO.cc:224
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15