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") :
""),
51 minCaloCompatibility_(mergeCaloMuons_ ? iConfig.getParameter<double>(
"minCaloCompatibility") : 0),
52 mergeTracks_(iConfig.existsAs<bool>(
"mergeTracks") ? iConfig.getParameter<bool>(
"mergeTracks") :
false),
53 tracks_(mergeTracks_ ? iConfig.getParameter<edm::InputTag>(
"tracks") : edm::InputTag()),
54 tracksCut_(iConfig.existsAs<std::
string>(
"tracksCut") ? iConfig.getParameter<std::
string>(
"tracksCut") :
"")
56 produces<std::vector<reco::Muon> >();
69 std::auto_ptr<std::vector<reco::Muon> >
out(
new std::vector<reco::Muon>());
70 out->reserve(muons->size() + (
mergeTracks_?tracks->size():0));
73 for (std::vector<reco::Muon>::const_iterator it = muons->begin(), ed = muons->end(); it != ed; ++it) {
82 }
else throw cms::Exception(
"Boh") <<
"Muon with track and no CaloCompatibility; pt = " << mu.
pt() <<
", eta = " << mu.
eta() <<
", type = " << mu.
type() <<
"\n";
88 for (std::vector<reco::CaloMuon>::const_iterator it = caloMuons->begin(), ed = caloMuons->end(); it != ed; ++it) {
92 double energy =
sqrt(track->p() * track->p() + 0.011163691);
94 out->push_back(
reco::Muon(track->charge(),
p4, track->vertex()));
106 for (
size_t i = 0;
i < tracks->size();
i++) {
111 for(std::vector<reco::Muon>::const_iterator
muon = muons->begin();
muon < muons->end();
muon++){
112 if(
muon->innerTrack() == track){
119 bool isCaloMuon =
false;
120 for(std::vector<reco::CaloMuon>::const_iterator
muon = caloMuons->begin();
muon < caloMuons->end();
muon++){
121 if(
muon->innerTrack() == track){
126 if(isCaloMuon)
continue;
129 double energy =
sqrt(track->p() * track->p() + 0.011163691);
131 out->push_back(
reco::Muon(track->charge(),
p4, track->vertex()));
virtual ~CaloMuonMerger()
void setType(unsigned int type)
bool isMuon(const Candidate &part)
bool isCaloCompatibilityValid() const
#define DEFINE_FWK_MODULE(type)
virtual void setInnerTrack(const TrackRef &t)
set reference to Track
virtual TrackRef track() const
reference to a Track
void setCalEnergy(const MuonEnergy &calEnergy)
set energy deposition information
StringCutObjectSelector< reco::CaloMuon, false > caloMuonsCut_
double minCaloCompatibility_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isNonnull() const
Checks for non-null.
StringCutObjectSelector< reco::TrackRef, false > tracksCut_
void setCaloCompatibility(float input)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
CaloMuonMerger(const edm::ParameterSet &iConfig)
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
StringCutObjectSelector< reco::Muon, false > muonsCut_
static const unsigned int CaloMuon
Merges reco::CaloMuons, reco::Muons and optionally reco::Tracks avoiding innerTrack duplications in a...
unsigned int type() const
const reco::PFCandidateRefVector & tracks_
virtual float pt() const GCC11_FINAL
transverse momentum
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
float caloCompatibility() const