46 : muons_(iConfig.getParameter<
edm::
InputTag>(
"muons")),
47 muonsCut_(iConfig.existsAs<
std::
string>(
"muonsCut") ? iConfig.getParameter<
std::
string>(
"muonsCut") :
""),
48 mergeCaloMuons_(iConfig.existsAs<
bool>(
"mergeCaloMuons") ? iConfig.getParameter<
bool>(
"mergeCaloMuons") :
true),
49 caloMuons_(iConfig.getParameter<
edm::
InputTag>(
"caloMuons")),
50 caloMuonsCut_(iConfig.existsAs<
std::
string>(
"caloMuonsCut") ? iConfig.getParameter<
std::
string>(
"caloMuonsCut")
52 minCaloCompatibility_(mergeCaloMuons_ ? iConfig.getParameter<double>(
"minCaloCompatibility") : 0),
53 mergeTracks_(iConfig.existsAs<
bool>(
"mergeTracks") ? iConfig.getParameter<
bool>(
"mergeTracks") :
false),
55 tracksCut_(iConfig.existsAs<
std::
string>(
"tracksCut") ? iConfig.getParameter<
std::
string>(
"tracksCut") :
"") {
59 produces<std::vector<reco::Muon>>();
73 auto out = std::make_unique<std::vector<reco::Muon>>();
77 for (std::vector<reco::Muon>::const_iterator it =
muons->begin(), ed =
muons->end(); it != ed; ++it) {
83 if (
mu.isCaloCompatibilityValid()) {
88 throw cms::Exception(
"Boh") <<
"Muon with track and no CaloCompatibility; pt = " <<
mu.pt()
89 <<
", eta = " <<
mu.eta() <<
", type = " <<
mu.type() <<
"\n";
95 for (std::vector<reco::CaloMuon>::const_iterator it =
caloMuons->begin(), ed =
caloMuons->end(); it != ed; ++it) {
105 mu.setCalEnergy(it->calEnergy());
106 mu.setCaloCompatibility(it->caloCompatibility());
114 for (
size_t i = 0;
i <
tracks->size();
i++) {
129 bool isCaloMuon =
false;
bool isMuon(const Candidate &part)
StringCutObjectSelector< reco::CaloMuon, false > caloMuonsCut_
double minCaloCompatibility_
edm::EDGetTokenT< std::vector< reco::Track > > trackToken_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
StringCutObjectSelector< reco::TrackRef, false > tracksCut_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< std::vector< reco::Muon > > muonToken_
CaloMuonMerger(const edm::ParameterSet &iConfig)
~CaloMuonMerger() override
StringCutObjectSelector< reco::Muon, false > muonsCut_
edm::EDGetTokenT< std::vector< reco::CaloMuon > > caloMuonToken_
static const unsigned int CaloMuon
Merges reco::CaloMuons, reco::Muons and optionally reco::Tracks avoiding innerTrack duplications in a...
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override