59 <<
"reco::Track collection --- size = " << tC.size();
63 <<
"TrackingParticle collection --- size = " << tPC.size();
65 for (TrackingParticleCollection::const_iterator ITER = tPC.begin(); ITER != tPC.end(); ITER++,
j++) {
67 <<
"TrackingParticle " <<
j <<
", q = " << ITER->charge() <<
", p = " << ITER->p() <<
", pT = " << ITER->pt()
68 <<
", eta = " << ITER->eta() <<
", phi = " << ITER->phi();
71 <<
"\t pdg code = " << ITER->pdgId() <<
", made of " << ITER->numberOfHits() <<
" PSimHit" 72 <<
" (in " << ITER->numberOfTrackerLayers() <<
" layers)" 73 <<
" from " << ITER->g4Tracks().size() <<
" SimTrack:";
75 edm::LogVerbatim(
"MuonAssociatorByHits") <<
"\t\t Id:" << g4T->trackId() <<
"/Evt:(" << g4T->eventId().event()
76 <<
"," << g4T->eventId().bunchCrossing() <<
")";
81 const auto &cf_simtracks =
event.getHandle(simtracksXFToken_);
85 <<
"CrossingFrame<SimTrack> collection with InputTag = " <<
simtracksXFTag <<
" has size = " << SimTk->size();
89 <<
"SimTrack " <<
k <<
" - Id:" << ITER->trackId() <<
"/Evt:(" << ITER->eventId().event() <<
"," 90 << ITER->eventId().bunchCrossing() <<
")" 91 <<
" pdgId = " << ITER->type() <<
", q = " << ITER->charge() <<
", p = " << ITER->momentum().P()
92 <<
", pT = " << ITER->momentum().Pt() <<
", eta = " << ITER->momentum().Eta()
93 <<
", phi = " << ITER->momentum().Phi() <<
"\n * " << *ITER << endl;
95 const auto &cf_simvertices =
event.getHandle(simvertexXFToken_);
99 <<
"CrossingFrame<SimVertex> collection with InputTag = " <<
simtracksXFTag 100 <<
" has size = " << SimVtx->size();
103 edm::LogVerbatim(
"MuonAssociatorByHits") <<
"SimVertex " << kv <<
" : " << *VITER << endl;
110 <<
"SimTrack collection with InputTag = " <<
simtracksTag <<
" has size = " << simTC.size() << endl;
112 for (edm::SimTrackContainer::const_iterator ITER = simTC.begin(); ITER != simTC.end(); ITER++,
k++) {
114 <<
"SimTrack " <<
k <<
" - Id:" << ITER->trackId() <<
"/Evt:(" << ITER->eventId().event() <<
"," 115 << ITER->eventId().bunchCrossing() <<
")" 116 <<
" pdgId = " << ITER->type() <<
", q = " << ITER->charge() <<
", p = " << ITER->momentum().P()
117 <<
", pT = " << ITER->momentum().Pt() <<
", eta = " << ITER->momentum().Eta()
118 <<
", phi = " << ITER->momentum().Phi() <<
"\n * " << *ITER << endl;
123 <<
"SimVertex collection with InputTag = " 125 <<
" has size = " << simVC.size() << endl;
127 for (edm::SimVertexContainer::const_iterator VITER = simVC.begin(); VITER != simVC.end(); VITER++, kv++) {
128 edm::LogVerbatim(
"MuonAssociatorByHits") <<
"SimVertex " << kv <<
" : " << *VITER << endl;
137 trackerHitAssociatorConfig_(conf,
std::
move(iC)),
138 gemHitAssociatorConfig_(conf, iC),
139 rpcHitAssociatorConfig_(conf, iC),
140 cscHitAssociatorConfig_(conf, iC),
141 dtHitAssociatorConfig_(conf, iC),
159 for (
auto it = tC.
begin(), ed = tC.
end(); it != ed; ++it) {
160 tH.push_back(std::make_pair((*it)->recHitsBegin(), (*it)->recHitsEnd()));
179 tTopo, &trackertruth, &csctruth, &dttruth, &rpctruth, &gemtruth, {}};
188 for (
auto it = bareAssoc.begin(), ed = bareAssoc.end(); it != ed; ++it) {
189 for (
auto itma = it->second.begin(), edma = it->second.end(); itma != edma; ++itma) {
190 outputCollection.insert(tC[it->first], std::make_pair(TPCollectionH[itma->idx], itma->quality));
194 outputCollection.post_insert();
195 return outputCollection;
205 for (
auto it = tC.
begin(), ed = tC.
end(); it != ed; ++it) {
206 tH.push_back(std::make_pair((*it)->recHitsBegin(), (*it)->recHitsEnd()));
217 bool printRtS =
false;
225 tTopo, &trackertruth, &csctruth, &dttruth, &rpctruth, &gemtruth, {}};
228 for (
auto it = bareAssoc.begin(), ed = bareAssoc.end(); it != ed; ++it) {
229 for (
auto itma = it->second.begin(), edma = it->second.end(); itma != edma; ++itma) {
230 outputCollection.insert(TPCollectionH[it->first], std::make_pair(tC[itma->idx], itma->quality));
234 outputCollection.post_insert();
235 return outputCollection;
Log< level::Info, true > LogVerbatim
reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track >> &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event, const edm::EventSetup *setup) const
MuonAssociatorByHits(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
IndexAssociation associateRecoToSimIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
GEMHitAssociator::Config gemHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
virtual ~MuonAssociatorByHits()
virtual reco::SimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Track >> &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event, const edm::EventSetup *setup) const
std::unique_ptr< muonAssociatorByHitsDiagnostics::InputDumper > diagnostics_
T getUntrackedParameter(std::string const &, T const &) const
const_iterator begin() const
std::vector< std::pair< trackingRecHit_iterator, trackingRecHit_iterator > > TrackHitsCollection
const_iterator end() const
IndexAssociation associateSimToRecoIndices(const TrackHitsCollection &, const edm::RefVector< TrackingParticleCollection > &, Resources const &) const
CSCHitAssociator::Config cscHitAssociatorConfig_
MuonAssociatorByHitsHelper::TrackHitsCollection TrackHitsCollection
RPCHitAssociator::Config rpcHitAssociatorConfig_
std::vector< SimTrack >::const_iterator g4t_iterator
std::vector< SimVertex > SimVertexContainer
MuonAssociatorByHitsHelper helper_
std::vector< TrackingParticle > TrackingParticleCollection
std::vector< SimTrack > SimTrackContainer
DTHitAssociator::Config dtHitAssociatorConfig_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_