12 template<
typename VMType,
typename HandleType>
16 auto vMap = std::make_unique<edm::ValueMap<VMType> >();
18 mapFiller.insert(handle,values.begin(),values.end());
27 event.getByToken(token,handle);
46 for(
const auto& idLabel : preidLabel_){
47 produces<reco::PreIdCollection>(idLabel);
48 produces<edm::ValueMap<reco::PreIdRef> >(idLabel);
55 for(
const auto& idTag: idsTag_){
56 idsToken_.emplace_back(consumes<reco::PreIdCollection >(idTag));
76 auto oSeeds = std::make_unique<reco::ElectronSeedCollection>();
77 for(
unsigned int s = 0;
s<iSeeds->size();++
s){
78 oSeeds->push_back(iSeeds->at(
s));
79 reco::TrackRef newTrackRef(newTracks,oSeeds->back().ctfTrack().index());
80 oSeeds->back().setCtfTrack(newTrackRef);
84 for(
size_t idNr = 0; idNr <
idsTag_.size(); idNr++){
85 auto iIds = getHandle(iEvent,
idsToken_[idNr]);
86 auto oIds = std::make_unique<reco::PreIdCollection>();
87 for(
unsigned int i = 0;
i<iIds->size();++
i){
88 oIds->push_back(iIds->at(
i));
89 reco::TrackRef newTrackRef(newTracks,oIds->back().trackRef().index());
90 oIds->back().setTrack(newTrackRef);
95 std::vector<reco::PreIdRef>
values;
96 for(
size_t trkNr = 0;trkNr<newTracks->size();++trkNr){
98 if(trkNr < oldTracks->
size() && iIdMap.isValid()){
100 values.push_back(
reco::PreIdRef(preIdProd,(*(iIdMap.product()))[oldTrackRef].index()));
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::Event &, const edm::EventSetup &) override
edm::InputTag newTracksTag_
#define DEFINE_FWK_MODULE(type)
std::vector< std::string > preidLabel_
edm::InputTag oldTracksTag_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ElectronSeedTrackRefFix(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > newTracksToken_
void addDefault(ParameterSetDescription const &psetDescription)
std::string preidgsfLabel_
~ElectronSeedTrackRefFix() override
edm::EDGetTokenT< reco::ElectronSeedCollection > seedsToken_
edm::EDGetTokenT< reco::TrackCollection > oldTracksToken_
std::vector< edm::EDGetTokenT< edm::ValueMap< reco::PreIdRef > > > idMapToken_
std::vector< edm::InputTag > idsTag_
std::vector< edm::EDGetTokenT< reco::PreIdCollection > > idsToken_