49 template <
typename T1>
51 produces<TrackCollectionemb>(
instance);
54 template <
typename T1>
57 template <
typename T1>
61 std::unique_ptr<TrackCollectionemb> outTracks = std::unique_ptr<TrackCollectionemb>(
new TrackCollectionemb);
63 for (
auto akt_collection : to_merge) {
65 iEvent.getByToken(akt_collection, track_col_in);
68 for (
typename TrackCollectionemb::const_iterator it = track_col_in->begin(); it != track_col_in->end();
80 produces<reco::TrackCollection>(
instance).setBranchAlias(
alias +
"Tracks");
81 produces<reco::TrackExtraCollection>(
instance).setBranchAlias(
alias +
"TrackExtras");
82 produces<TrackingRecHitCollection>(
instance).setBranchAlias(
alias +
"RecHits");
83 produces<TrackToTrackMapnew>();
89 std::unique_ptr<reco::TrackCollection> outTracks = std::make_unique<reco::TrackCollection>();
90 std::unique_ptr<reco::TrackExtraCollection> outTracks_ex = std::make_unique<reco::TrackExtraCollection>();
91 std::unique_ptr<TrackingRecHitCollection> outTracks_rh = std::make_unique<TrackingRecHitCollection>();
92 std::unique_ptr<TrackToTrackMapnew> outTracks_refs = std::make_unique<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 = std::make_unique<reco::GsfTrackCollection>();
142 std::unique_ptr<reco::TrackExtraCollection> outTracks_ex = std::make_unique<reco::TrackExtraCollection>();
143 std::unique_ptr<reco::GsfTrackExtraCollection> outTracks_exgsf = std::make_unique<reco::GsfTrackExtraCollection>();
144 std::unique_ptr<TrackingRecHitCollection> outTracks_rh = std::make_unique<TrackingRecHitCollection>();
151 for (
auto akt_collection : to_merge) {
153 iEvent.getByToken(akt_collection, track_col_in);
155 size_t sedref_it = 0;
156 for (reco::GsfTrackCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end();
176 produces<reco::MuonCollection>();
177 produces<reco::CaloMuonCollection>();
178 produces<reco::MuonTimeExtraMap>(
"combined");
179 produces<reco::MuonTimeExtraMap>(
"dt");
180 produces<reco::MuonTimeExtraMap>(
"csc");
183 produces<reco::IsoDepositMap>(
"tracker");
184 produces<reco::IsoDepositMap>(
"ecal");
185 produces<reco::IsoDepositMap>(
"hcal");
186 produces<reco::IsoDepositMap>(
"ho");
187 produces<reco::IsoDepositMap>(
"jets");
189 produces<reco::MuonToMuonMap>();
194 inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew>(
edm::InputTag(
"generalTracks"));
195 inputs_fixtrackcol_ = consumes<reco::TrackCollection>(
edm::InputTag(
"generalTracks"));
201 std::unique_ptr<reco::MuonCollection> outTracks = std::make_unique<reco::MuonCollection>();
202 std::unique_ptr<reco::CaloMuonCollection> calomu =
203 std::make_unique<reco::CaloMuonCollection>();
206 iEvent.getByToken(inputs_fixtrackrefs_, track_ref_map);
209 iEvent.getByToken(inputs_fixtrackcol_, track_new_col);
210 std::map<reco::TrackRef, reco::TrackRef>
211 simple_track_to_track_map;
212 for (
unsigned abc = 0; abc < track_new_col->size(); ++abc) {
214 simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
217 std::vector<reco::MuonRef> muonRefColl;
219 unsigned new_idx = 0;
220 for (
auto akt_collection : to_merge) {
222 iEvent.getByToken(akt_collection, track_col_in);
223 unsigned old_idx = 0;
224 for (reco::MuonCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end();
225 ++it, ++old_idx, ++new_idx) {
228 muonRefColl.push_back(muRefold);
231 if (it->track().isNonnull()) {
233 outTracks->back().setTrack(simple_track_to_track_map[it->track()]);
239 const int nMuons = outTracks->size();
241 std::vector<reco::MuonTimeExtra> dtTimeColl(
nMuons);
242 std::vector<reco::MuonTimeExtra> cscTimeColl(
nMuons);
243 std::vector<reco::MuonTimeExtra> combinedTimeColl(
nMuons);
244 std::vector<reco::IsoDeposit> trackDepColl(
nMuons);
245 std::vector<reco::IsoDeposit> ecalDepColl(
nMuons);
246 std::vector<reco::IsoDeposit> hcalDepColl(
nMuons);
247 std::vector<reco::IsoDeposit> hoDepColl(
nMuons);
248 std::vector<reco::IsoDeposit> jetDepColl(
nMuons);
254 std::unique_ptr<MapType> oMap(
new MapType());
256 typename MapType::Filler
filler(*oMap);
257 filler.insert(refH, vec.begin(), vec.end());
264 fillMap(muonHandle, combinedTimeColl,
iEvent,
"combined");
265 fillMap(muonHandle, dtTimeColl,
iEvent,
"dt");
266 fillMap(muonHandle, cscTimeColl,
iEvent,
"csc");
267 fillMap(muonHandle, trackDepColl,
iEvent,
"tracker");
268 fillMap(muonHandle, ecalDepColl,
iEvent,
"ecal");
269 fillMap(muonHandle, hcalDepColl,
iEvent,
"hcal");
270 fillMap(muonHandle, hoDepColl,
iEvent,
"ho");
271 fillMap(muonHandle, jetDepColl,
iEvent,
"jets");
272 fillMap(muonHandle, muonRefColl,
iEvent);
278 produces<reco::PFCandidateCollection>(
instance);
284 inputs_fixtrackrefs_ = consumes<TrackToTrackMapnew>(
edm::InputTag(
"generalTracks"));
285 inputs_fixtrackcol_ = consumes<reco::TrackCollection>(
edm::InputTag(
"generalTracks"));
286 inputs_fixmurefs_ = consumes<reco::MuonToMuonMap>(
edm::InputTag(
"muons1stStep"));
287 inputs_fixmucol_ = consumes<reco::MuonCollection>(
edm::InputTag(
"muons1stStep"));
293 std::unique_ptr<reco::PFCandidateCollection> outTracks = std::make_unique<reco::PFCandidateCollection>();
296 iEvent.getByToken(inputs_fixtrackrefs_, track_ref_map);
299 iEvent.getByToken(inputs_fixtrackcol_, track_new_col);
300 std::map<reco::TrackRef, reco::TrackRef>
301 simple_track_to_track_map;
302 for (
unsigned abc = 0; abc < track_new_col->size(); ++abc) {
304 simple_track_to_track_map[((*track_ref_map)[trackRef])[0]] = trackRef;
308 iEvent.getByToken(inputs_fixmurefs_, muon_ref_map);
311 iEvent.getByToken(inputs_fixmucol_, muon_new_col);
312 std::map<reco::MuonRef, reco::MuonRef>
314 for (
unsigned abc = 0; abc < muon_new_col->size(); ++abc) {
316 simple_mu_to_mu_map[(*muon_ref_map)[muRef]] = muRef;
319 for (
auto akt_collection : to_merge) {
321 iEvent.getByToken(akt_collection, track_col_in);
322 for (reco::PFCandidateCollection::const_iterator it = track_col_in->begin(); it != track_col_in->end(); ++it) {
325 if (it->trackRef().isNonnull() && outTracks->back().charge()) {
327 outTracks->back().setTrackRef(simple_track_to_track_map[it->trackRef()]);
329 if (it->muonRef().isNonnull()) {
331 outTracks->back().setMuonRef(simple_mu_to_mu_map[it->muonRef()]);
TrackMergeremb< reco::PFCandidateCollection > PFColMerger
void willconsume(const edm::ParameterSet &iConfig)
TrackMergeremb< reco::MuonCollection > MuonColMerger
static PFTauRenderPlugin instance
#define DEFINE_FWK_MODULE(type)
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
void willproduce(std::string instance, std::string alias)
std::vector< Muon > MuonCollection
collection of Muon objects
Container::value_type value_type
TrackMergeremb< reco::GsfElectronCollection > GsfElectronColMerger
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void merg_and_put(edm::Event &, std::string, std::vector< edm::EDGetTokenT< TrackCollectionemb > > &)
Particle reconstructed by the particle flow algorithm.
TrackMergeremb< reco::PhotonCollection > PhotonColMerger
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
TrackMergeremb< reco::TrackCollection > TrackColMerger