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;