8 : tracksTag(parset.getParameter<edm::
InputTag>(
"tracksTag")),
9 tpTag(parset.getParameter<edm::
InputTag>(
"tpTag")),
10 tpRefVector(parset.getParameter<bool>(
"tpRefVector")),
11 ignoreMissingTrackCollection(parset.getUntrackedParameter<bool>(
"ignoreMissingTrackCollection",
false)),
13 edm::LogVerbatim(
"MuonAssociatorEDProducer") <<
"constructing MuonAssociatorEDProducer";
14 produces<reco::RecoToSimCollection>();
15 produces<reco::SimToRecoCollection>();
23 LogTrace(
"MuonAssociatorEDProducer") <<
"constructing MuonAssociatorByHits" <<
parset_.
dump();
24 edm::LogVerbatim(
"MuonAssociatorEDProducer") <<
"\n MuonAssociatorByHits will associate reco::Tracks with "
30 if (recoTracksLabel ==
"seedsOfSTAmuons" || recoTracksLabel ==
"standAloneMuons" ||
31 recoTracksLabel ==
"refittedStandAloneMuons" || recoTracksLabel ==
"seedsOfDisplacedSTAmuons" ||
32 recoTracksLabel ==
"displacedStandAloneMuons" || recoTracksLabel ==
"cosmicMuons" ||
33 recoTracksLabel ==
"cosmicMuons1Leg" || recoTracksLabel ==
"hltL2Muons") {
36 <<
"\n*** WARNING : inconsistent input tracksTag = " <<
tracksTag <<
"\n with UseTracker = true"
37 <<
"\n ---> setting UseTracker = false ";
42 <<
"\n*** WARNING : inconsistent input tracksTag = " <<
tracksTag <<
"\n with UseMuon = false"
43 <<
"\n ---> setting UseMuon = true ";
48 if (recoTracksLabel ==
"generalTracks" || recoTracksLabel ==
"probeTracks" || recoTracksLabel ==
"displacedTracks" ||
49 recoTracksLabel ==
"extractGemMuons" || recoTracksLabel ==
"extractMe0Muons" ||
50 recoTracksLabel ==
"ctfWithMaterialTracksP5LHCNavigation" || recoTracksLabel ==
"ctfWithMaterialTracksP5" ||
51 recoTracksLabel ==
"hltIterL3OIMuonTrackSelectionHighPurity" || recoTracksLabel ==
"hltIterL3MuonMerged" ||
52 recoTracksLabel ==
"hltIterL3MuonAndMuonFromL1Merged") {
55 <<
"\n*** WARNING : inconsistent input tracksTag = " <<
tracksTag <<
"\n with UseMuon = true"
56 <<
"\n ---> setting UseMuon = false ";
61 <<
"\n*** WARNING : inconsistent input tracksTag = " <<
tracksTag <<
"\n with UseTracker = false"
62 <<
"\n ---> setting UseTracker = true ";
67 LogTrace(
"MuonAssociatorEDProducer") <<
"MuonAssociatorEDProducer::beginJob "
68 ": constructing MuonAssociatorByHits";
88 tmpTPptr = TPCollectionRefVector.
product();
94 for (
size_t i = 0;
i < nTP; ++
i) {
100 LogTrace(
"MuonAssociatorEDProducer") <<
"getting TrackingParticle collection - " <<
tpTag;
101 LogTrace(
"MuonAssociatorEDProducer") <<
"\t... size = " << tmpTPptr->size();
104 LogTrace(
"MuonAssociatorEDProducer") <<
"getting reco::Track collection - " <<
tracksTag;
109 LogTrace(
"MuonAssociatorEDProducer") <<
"\t... NOT FOUND.";
111 std::unique_ptr<reco::RecoToSimCollection> rts;
112 std::unique_ptr<reco::SimToRecoCollection>
str;
118 LogTrace(
"MuonAssociatorEDProducer") <<
"\n ignoring missing track collection."
126 <<
"\n >>> RecoToSim association <<< \n"
130 <<
" (size = " << tmpTPptr->size() <<
")";
135 <<
"\n >>> SimToReco association <<< \n"
137 <<
" (size = " << tmpTPptr->size() <<
") \n"
143 rts = std::make_unique<reco::RecoToSimCollection>(recSimColl);
144 str = std::make_unique<reco::SimToRecoCollection>(simRecColl);
edm::ParameterSet parset_
Log< level::Info, true > LogVerbatim
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
MuonAssociatorEDProducer(const edm::ParameterSet &)
~MuonAssociatorEDProducer() override
edm::EDGetTokenT< TrackingParticleRefVector > tpRefVectorToken_
std::string dump(unsigned int indent=0) const
void produce(edm::Event &, const edm::EventSetup &) override
MuonAssociatorByHits * associatorByHits
void addParameter(std::string const &name, T const &value)
T const * product() const
reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track >> &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event, const edm::EventSetup *setup) const
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
void push_back(const RefToBase< T > &)
virtual reco::SimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Track >> &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event, const edm::EventSetup *setup) const
Log< level::Warning, false > LogWarning
bool ignoreMissingTrackCollection
edm::Ref< TrackingParticleCollection > TrackingParticleRef