47 template <
typename T1>
49 produces<TrackCollectionemb>(
instance);
52 template <
typename T1>
55 template <
typename T1>
59 std::unique_ptr<TrackCollectionemb> outTracks = std::unique_ptr<TrackCollectionemb>(
new TrackCollectionemb);
61 for (
auto akt_collection : to_merge) {
63 iEvent.getByToken(akt_collection, track_col_in);
66 for (
typename TrackCollectionemb::const_iterator it = track_col_in->begin(); it != track_col_in->end();
78 produces<reco::TrackCollection>(
instance).setBranchAlias(
alias +
"Tracks");
79 produces<reco::TrackExtraCollection>(
instance).setBranchAlias(
alias +
"TrackExtras");
80 produces<TrackingRecHitCollection>(
instance).setBranchAlias(
alias +
"RecHits");
81 produces<TrackToTrackMapnew>();
87 std::unique_ptr<reco::TrackCollection> outTracks = std::unique_ptr<reco::TrackCollection>(
new reco::TrackCollection);
88 std::unique_ptr<reco::TrackExtraCollection> outTracks_ex =
90 std::unique_ptr<TrackingRecHitCollection> outTracks_rh =
92 std::unique_ptr<TrackToTrackMapnew> outTracks_refs = std::unique_ptr<TrackToTrackMapnew>(
new TrackToTrackMapnew());
97 std::vector<reco::TrackRefVector> trackRefColl;
100 for (
auto akt_collection : to_merge) {
102 iEvent.getByToken(akt_collection, track_col_in);
104 unsigned sedref_it = 0;
105 for (reco::TrackCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end();
113 trackRefColl_helpvec.
push_back(trackRefold);
114 trackRefColl.push_back(trackRefColl_helpvec);
123 filler.insert(trackHandle, trackRefColl.begin(), trackRefColl.end());
132 produces<reco::GsfTrackCollection>(
instance).setBranchAlias(
alias +
"GsfTracks");
133 produces<reco::TrackExtraCollection>(
instance).setBranchAlias(
alias +
"TrackExtras");
134 produces<reco::GsfTrackExtraCollection>(
instance).setBranchAlias(
alias +
"GsfTrackExtras");
135 produces<TrackingRecHitCollection>(
instance).setBranchAlias(
alias +
"RecHits");
141 std::unique_ptr<reco::GsfTrackCollection> outTracks =
143 std::unique_ptr<reco::TrackExtraCollection> outTracks_ex =
145 std::unique_ptr<reco::GsfTrackExtraCollection> outTracks_exgsf =
147 std::unique_ptr<TrackingRecHitCollection> outTracks_rh =
155 for (
auto akt_collection : to_merge) {
157 iEvent.getByToken(akt_collection, track_col_in);
159 size_t sedref_it = 0;
160 for (reco::GsfTrackCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end();
180 produces<reco::MuonCollection>();
181 produces<reco::CaloMuonCollection>();
182 produces<reco::MuonTimeExtraMap>(
"combined");
183 produces<reco::MuonTimeExtraMap>(
"dt");
184 produces<reco::MuonTimeExtraMap>(
"csc");
187 produces<reco::IsoDepositMap>(
"tracker");
188 produces<reco::IsoDepositMap>(
"ecal");
189 produces<reco::IsoDepositMap>(
"hcal");
190 produces<reco::IsoDepositMap>(
"ho");
191 produces<reco::IsoDepositMap>(
"jets");
193 produces<reco::MuonToMuonMap>();
198 inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew>(
edm::InputTag(
"generalTracks"));
199 inputs_fixtrackcol_ = consumes<reco::TrackCollection>(
edm::InputTag(
"generalTracks"));
205 std::unique_ptr<reco::MuonCollection> outTracks = std::unique_ptr<reco::MuonCollection>(
new reco::MuonCollection);
206 std::unique_ptr<reco::CaloMuonCollection> calomu =
210 iEvent.getByToken(inputs_fixtrackrefs_, track_ref_map);
213 iEvent.getByToken(inputs_fixtrackcol_, track_new_col);
214 std::map<reco::TrackRef, reco::TrackRef>
215 simple_track_to_track_map;
216 for (
unsigned abc = 0; abc < track_new_col->size(); ++abc) {
218 simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
221 std::vector<reco::MuonRef> muonRefColl;
223 unsigned new_idx = 0;
224 for (
auto akt_collection : to_merge) {
226 iEvent.getByToken(akt_collection, track_col_in);
227 unsigned old_idx = 0;
228 for (reco::MuonCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end();
229 ++it, ++old_idx, ++new_idx) {
232 muonRefColl.push_back(muRefold);
235 if (it->track().isNonnull()) {
237 outTracks->back().setTrack(simple_track_to_track_map[it->track()]);
243 const int nMuons = outTracks->size();
245 std::vector<reco::MuonTimeExtra> dtTimeColl(
nMuons);
246 std::vector<reco::MuonTimeExtra> cscTimeColl(
nMuons);
247 std::vector<reco::MuonTimeExtra> combinedTimeColl(
nMuons);
248 std::vector<reco::IsoDeposit> trackDepColl(
nMuons);
249 std::vector<reco::IsoDeposit> ecalDepColl(
nMuons);
250 std::vector<reco::IsoDeposit> hcalDepColl(
nMuons);
251 std::vector<reco::IsoDeposit> hoDepColl(
nMuons);
252 std::vector<reco::IsoDeposit> jetDepColl(
nMuons);
258 std::unique_ptr<MapType> oMap(
new MapType());
260 typename MapType::Filler
filler(*oMap);
261 filler.insert(refH, vec.begin(), vec.end());
268 fillMap(muonHandle, combinedTimeColl,
iEvent,
"combined");
269 fillMap(muonHandle, dtTimeColl,
iEvent,
"dt");
270 fillMap(muonHandle, cscTimeColl,
iEvent,
"csc");
271 fillMap(muonHandle, trackDepColl,
iEvent,
"tracker");
272 fillMap(muonHandle, ecalDepColl,
iEvent,
"ecal");
273 fillMap(muonHandle, hcalDepColl,
iEvent,
"hcal");
274 fillMap(muonHandle, hoDepColl,
iEvent,
"ho");
275 fillMap(muonHandle, jetDepColl,
iEvent,
"jets");
276 fillMap(muonHandle, muonRefColl,
iEvent);
282 produces<reco::PFCandidateCollection>(
instance);
288 inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew>(
edm::InputTag(
"generalTracks"));
289 inputs_fixtrackcol_ = consumes<reco::TrackCollection>(
edm::InputTag(
"generalTracks"));
290 inputs_fixmurefs_ = consumes<reco::MuonToMuonMap>(
edm::InputTag(
"muons1stStep"));
291 inputs_fixmucol_ = consumes<reco::MuonCollection>(
edm::InputTag(
"muons1stStep"));
297 std::unique_ptr<reco::PFCandidateCollection> outTracks =
301 iEvent.getByToken(inputs_fixtrackrefs_, track_ref_map);
304 iEvent.getByToken(inputs_fixtrackcol_, track_new_col);
305 std::map<reco::TrackRef, reco::TrackRef>
306 simple_track_to_track_map;
307 for (
unsigned abc = 0; abc < track_new_col->size(); ++abc) {
309 simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
313 iEvent.getByToken(inputs_fixmurefs_, muon_ref_map);
316 iEvent.getByToken(inputs_fixmucol_, muon_new_col);
317 std::map<reco::MuonRef, reco::MuonRef>
319 for (
unsigned abc = 0; abc < muon_new_col->size(); ++abc) {
321 simple_mu_to_mu_map[(*muon_ref_map)[muRef]] = muRef;
324 for (
auto akt_collection : to_merge) {
326 iEvent.getByToken(akt_collection, track_col_in);
327 for (reco::PFCandidateCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it) {
330 if (it->trackRef().isNonnull() && outTracks->back().charge()) {
332 outTracks->back().setTrackRef(simple_track_to_track_map[it->trackRef()]);
334 if (it->muonRef().isNonnull()) {
336 outTracks->back().setMuonRef(simple_mu_to_mu_map[it->muonRef()]);