55 template <
typename T1>
58 produces<TrackCollectionemb>(
instance);
61 template <
typename T1>
67 template <
typename T1>
71 std::unique_ptr<TrackCollectionemb> outTracks = std::unique_ptr<TrackCollectionemb>(
new TrackCollectionemb);
73 for (
auto akt_collection : to_merge){
75 iEvent.
getByToken(akt_collection, track_col_in);
78 for (
typename TrackCollectionemb::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it, ++sedref_it) {
93 produces<reco::TrackCollection>(
instance).setBranchAlias( alias +
"Tracks" );
94 produces<reco::TrackExtraCollection>(
instance).setBranchAlias( alias +
"TrackExtras" );
95 produces<TrackingRecHitCollection>(
instance).setBranchAlias( alias +
"RecHits" );
96 produces<TrackToTrackMapnew>();
104 std::unique_ptr<reco::TrackCollection> outTracks = std::unique_ptr<reco::TrackCollection>(
new reco::TrackCollection);
105 std::unique_ptr<reco::TrackExtraCollection> outTracks_ex = std::unique_ptr<reco::TrackExtraCollection>(
new reco::TrackExtraCollection());
106 std::unique_ptr<TrackingRecHitCollection> outTracks_rh = std::unique_ptr<TrackingRecHitCollection>(
new TrackingRecHitCollection());
107 std::unique_ptr<TrackToTrackMapnew> outTracks_refs = std::unique_ptr<TrackToTrackMapnew>(
new TrackToTrackMapnew());
112 std::vector<reco::TrackRefVector> trackRefColl;
115 for (
auto akt_collection : to_merge){
117 iEvent.
getByToken(akt_collection, track_col_in);
119 unsigned sedref_it = 0;
120 for (reco::TrackCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it, ++sedref_it) {
123 outTracks->back().setExtra(
reco::TrackExtraRef( rTrackExtras, outTracks_ex->size() - 1) );
127 trackRefColl_helpvec.
push_back(trackRefold);
128 trackRefColl.push_back(trackRefColl_helpvec);
139 filler.
insert(trackHandle, trackRefColl.begin(), trackRefColl.end() );
152 produces<reco::GsfTrackCollection>(
instance).setBranchAlias( alias +
"GsfTracks" );
153 produces<reco::TrackExtraCollection>(
instance).setBranchAlias( alias +
"TrackExtras" );
154 produces<reco::GsfTrackExtraCollection>(
instance).setBranchAlias( alias +
"GsfTrackExtras" );
155 produces<TrackingRecHitCollection>(
instance).setBranchAlias( alias +
"RecHits" );
161 std::unique_ptr<reco::GsfTrackCollection> outTracks = std::unique_ptr<reco::GsfTrackCollection>(
new reco::GsfTrackCollection);
162 std::unique_ptr<reco::TrackExtraCollection> outTracks_ex = std::unique_ptr<reco::TrackExtraCollection>(
new reco::TrackExtraCollection());
163 std::unique_ptr<reco::GsfTrackExtraCollection> outTracks_exgsf = std::unique_ptr<reco::GsfTrackExtraCollection>(
new reco::GsfTrackExtraCollection());
164 std::unique_ptr<TrackingRecHitCollection> outTracks_rh = std::unique_ptr<TrackingRecHitCollection>(
new TrackingRecHitCollection());
172 for (
auto akt_collection : to_merge){
174 iEvent.
getByToken(akt_collection, track_col_in);
176 size_t sedref_it = 0;
177 for (reco::GsfTrackCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it, ++sedref_it) {
182 outTracks->back().setExtra(
reco::TrackExtraRef( rTrackExtras, outTracks_ex->size() - 1) );
201 produces<reco::MuonCollection>();
202 produces<reco::CaloMuonCollection>();
203 produces<reco::MuonTimeExtraMap>(
"combined");
204 produces<reco::MuonTimeExtraMap>(
"dt");
205 produces<reco::MuonTimeExtraMap>(
"csc");
208 produces<reco::IsoDepositMap>(
"tracker");
209 produces<reco::IsoDepositMap>(
"ecal");
210 produces<reco::IsoDepositMap>(
"hcal");
211 produces<reco::IsoDepositMap>(
"ho");
212 produces<reco::IsoDepositMap>(
"jets");
214 produces<reco::MuonToMuonMap>();
223 inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew >(
edm::InputTag(
"generalTracks") );
224 inputs_fixtrackcol_ = consumes<reco::TrackCollection >(
edm::InputTag(
"generalTracks") );
234 std::unique_ptr<reco::MuonCollection> outTracks = std::unique_ptr<reco::MuonCollection>(
new reco::MuonCollection);
235 std::unique_ptr<reco::CaloMuonCollection> calomu = std::unique_ptr<reco::CaloMuonCollection>(
new reco::CaloMuonCollection);
238 iEvent.
getByToken(inputs_fixtrackrefs_, track_ref_map);
241 iEvent.
getByToken(inputs_fixtrackcol_, track_new_col);
242 std::map<reco::TrackRef , reco::TrackRef > simple_track_to_track_map;
243 for (
unsigned abc =0; abc < track_new_col->size(); ++abc) {
245 simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
248 std::vector<reco::MuonRef> muonRefColl;
251 for (
auto akt_collection : to_merge){
253 iEvent.
getByToken(akt_collection, track_col_in);
255 for (reco::MuonCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it, ++old_idx, ++new_idx) {
258 muonRefColl.push_back(muRefold);
261 if (it->track().isNonnull()){
263 outTracks->back().setTrack( simple_track_to_track_map[it->track()] );
269 const int nMuons=outTracks->size();
271 std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
272 std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
273 std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
274 std::vector<reco::IsoDeposit> trackDepColl(nMuons);
275 std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
276 std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
277 std::vector<reco::IsoDeposit> hoDepColl(nMuons);
278 std::vector<reco::IsoDeposit> jetDepColl(nMuons);
284 std::unique_ptr<MapType > oMap(
new MapType());
286 typename MapType::Filler
filler(*oMap);
287 filler.insert(refH, vec.begin(), vec.end());
294 fillMap(muonHandle, combinedTimeColl, iEvent,
"combined");
295 fillMap(muonHandle, dtTimeColl, iEvent,
"dt");
296 fillMap(muonHandle, cscTimeColl, iEvent,
"csc");
297 fillMap(muonHandle, trackDepColl, iEvent,
"tracker");
298 fillMap(muonHandle, ecalDepColl, iEvent,
"ecal");
299 fillMap(muonHandle, hcalDepColl, iEvent,
"hcal");
300 fillMap(muonHandle, hoDepColl, iEvent,
"ho");
301 fillMap(muonHandle, jetDepColl, iEvent,
"jets");
302 fillMap(muonHandle, muonRefColl, iEvent);
313 produces<reco::PFCandidateCollection>(
instance);
323 inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew >(
edm::InputTag(
"generalTracks") );
324 inputs_fixtrackcol_ = consumes<reco::TrackCollection >(
edm::InputTag(
"generalTracks") );
325 inputs_fixmurefs_ = consumes<reco::MuonToMuonMap >(
edm::InputTag(
"muons1stStep") );
326 inputs_fixmucol_ = consumes<reco::MuonCollection >(
edm::InputTag(
"muons1stStep") );
336 std::unique_ptr<reco::PFCandidateCollection> outTracks = std::unique_ptr<reco::PFCandidateCollection>(
new reco::PFCandidateCollection);
339 iEvent.
getByToken(inputs_fixtrackrefs_, track_ref_map);
342 iEvent.
getByToken(inputs_fixtrackcol_, track_new_col);
343 std::map<reco::TrackRef , reco::TrackRef > simple_track_to_track_map;
344 for (
unsigned abc =0; abc < track_new_col->size(); ++abc) {
346 simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
351 iEvent.
getByToken(inputs_fixmurefs_, muon_ref_map);
354 iEvent.
getByToken(inputs_fixmucol_, muon_new_col);
355 std::map<reco::MuonRef , reco::MuonRef > simple_mu_to_mu_map;
356 for (
unsigned abc =0; abc < muon_new_col->size(); ++abc) {
358 simple_mu_to_mu_map[(*muon_ref_map)[muRef]] = muRef;
363 for (
auto akt_collection : to_merge){
365 iEvent.
getByToken(akt_collection, track_col_in);
366 for (reco::PFCandidateCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it) {
369 if (it->trackRef().isNonnull() && outTracks->back().charge()){
371 outTracks->back().setTrackRef( simple_track_to_track_map[it->trackRef()] );
373 if (it->muonRef().isNonnull()){
375 outTracks->back().setMuonRef( simple_mu_to_mu_map[it->muonRef()] );
void willconsume(const edm::ParameterSet &iConfig)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
std::vector< Track > TrackCollection
collection of Tracks
std::vector< CaloMuon > CaloMuonCollection
collection of Muon objects
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
TrackMergeremb< reco::PFCandidateCollection > PFColMerger
void willproduce(std::string instance, std::string alias)
std::vector< Muon > MuonCollection
collection of Muon objects
Container::value_type value_type
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
TrackMergeremb< reco::PhotonCollection > PhotonColMerger
RefProd< PROD > getRefBeforePut()
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
void merg_and_put(edm::Event &, std::string, std::vector< edm::EDGetTokenT< TrackCollectionemb > > &)
TrackMergeremb< reco::GsfElectronCollection > GsfElectronColMerger
Particle reconstructed by the particle flow algorithm.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
TrackMergeremb< reco::MuonCollection > MuonColMerger
TrackMergeremb< reco::TrackCollection > TrackColMerger