CMS 3D CMS Logo

ConversionTrackRefFix.cc
Go to the documentation of this file.
2 
6 
7 using namespace std;
8 using namespace reco;
9 using namespace edm;
10 
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 }
20 
22 
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 }
44 
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:32
edm
HLT enums.
Definition: AlignableModifier.h:19
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
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
ConversionTrackRefFix::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ConversionTrackRefFix.cc:23
MakerMacros.h
Track.h
ConversionTrack.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
ConversionTrackRefFix::~ConversionTrackRefFix
~ConversionTrackRefFix() override
Definition: ConversionTrackRefFix.cc:21
ConversionTrackRefFix
Definition: ConversionTrackRefFix.h:11
edm::ParameterSet
Definition: ParameterSet.h:36
iEvent
int iEvent
Definition: GenABIO.cc:224
ConversionTrackRefFix.h
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ParameterSet.h
edm::Event
Definition: Event.h:73
ConversionTrackRefFix::ConversionTrackRefFix
ConversionTrackRefFix(const edm::ParameterSet &)
Definition: ConversionTrackRefFix.cc:11
edm::InputTag
Definition: InputTag.h:15