20 return !isolated_(i1, i2);
22 double cut()
const {
return isolated_.cut(); }
30 return (i1 < cut_ && i2 >=
cut_) || (i1 >=
cut_ && i2 <
cut_);
53 template<
typename Isolator>
57 isolator_(cfg.
template getParameter<double>(
"isoCut")) {
58 std::string iso = cfg.template getParameter<std::string>(
"isolationType");
63 else if(iso ==
"ecal") {
67 else if(iso ==
"hcal") {
71 else if(iso ==
"calo") {
76 <<
"Invalid isolation type: " << iso <<
". Valid types are:" 77 <<
"'track', 'ecal', 'hcal', 'calo'\n";
87 <<
"Candidate daughters have no master clone\n";
89 double iso0 = -1, iso1 = -1;
92 iso0 = ((*mu0).*(leptonIsolation_))();
96 iso0 = ((*trk0).*(trackIsolation_))();
99 <<
"Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
104 iso1 = ((*mu1).*(leptonIsolation_))();
107 if(trk1 !=
nullptr) {
108 iso1 = ((*trk1).*(trackIsolation_))();
111 <<
"Candidate daughter #1 is neither pat::Muons nor pat::GenericParticle\n";
114 bool pass = isolator_(iso0, iso1);
SingleObjectSelector< reco::CandidateView, AndSelector< ZToMuMuIsolationSelector< OneNonIsolatedSelector >, StringCutObjectSelector< reco::Candidate > > > ZToMuMuOneNonIsolatedSelector
NonIsolatedSelector(double cut)
#define DEFINE_FWK_MODULE(type)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
bool operator()(double i1, double i2) const
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
Analysis-level lepton class.
bool operator()(double i1, double i2) const
def template(fileName, svg, replaceme="REPLACEME")
OneNonIsolatedSelector(double cut)
bool operator()(double i1, double i2) const
virtual const CandidateBaseRef & masterClone() const =0
SingleObjectSelector< reco::CandidateView, AndSelector< ZToMuMuIsolationSelector< IsolatedSelector >, StringCutObjectSelector< reco::Candidate > > > ZToMuMuIsolatedSelector
LeptonIsolationType leptonIsolation_
SingleObjectSelector< reco::CandidateView, AndSelector< ZToMuMuIsolationSelector< NonIsolatedSelector >, StringCutObjectSelector< reco::Candidate > > > ZToMuMuNonIsolatedSelector
TrackIsolationType trackIsolation_
IsolatedSelector(double cut)
TwoNonIsolatedSelector(double cut)
virtual size_type numberOfDaughters() const =0
number of daughters
Analysis-level muon class.
SingleObjectSelector< reco::CandidateView, AndSelector< ZToMuMuIsolationSelector< TwoNonIsolatedSelector >, StringCutObjectSelector< reco::Candidate > > > ZToMuMuTwoNonIsolatedSelector
edm::View< Candidate > CandidateView
view of a collection containing candidates
bool operator()(double i1, double i2) const
virtual bool hasMasterClone() const =0
bool operator()(const reco::Candidate &z) const
ZToMuMuIsolationSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &iC)