CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SimpleCutsIsolator Class Reference

#include <SimpleCutsIsolator.h>

Inheritance diagram for SimpleCutsIsolator:
muonisolation::MuIsoBaseIsolator

Public Member Functions

Result result (const DepositContainer &deposits, const edm::Event *=nullptr) const override
 Compute and return the isolation variable. More...
 
Result result (const DepositContainer &deposits, const reco::Track &tk, const edm::Event *=nullptr) const override
 Compute and return the isolation variable, with vetoes and the muon. More...
 
ResultType resultType () const override
 
 SimpleCutsIsolator (const edm::ParameterSet &par, edm::ConsumesCollector &&iC)
 
- Public Member Functions inherited from muonisolation::MuIsoBaseIsolator
virtual Result result (const DepositContainer &deposits, const reco::Candidate &muon, const edm::Event *=nullptr) const
 Compute and return the isolation variable, with vetoes and the muon. More...
 
virtual ~MuIsoBaseIsolator ()
 

Private Attributes

muonisolation::Cuts theCuts
 

Additional Inherited Members

- Public Types inherited from muonisolation::MuIsoBaseIsolator
typedef std::vector< DepositAndVetosDepositContainer
 
enum  ResultType { ISOL_INT_TYPE = 0, ISOL_FLOAT_TYPE, ISOL_BOOL_TYPE, ISOL_INVALID_TYPE }
 
typedef reco::IsoDeposit::Veto Veto
 
typedef reco::IsoDeposit::Vetos Vetos
 

Detailed Description

Definition at line 10 of file SimpleCutsIsolator.h.

Constructor & Destructor Documentation

◆ SimpleCutsIsolator()

SimpleCutsIsolator::SimpleCutsIsolator ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)
inline

Definition at line 12 of file SimpleCutsIsolator.h.

13  : theCuts(par.getParameter<std::vector<double> >("EtaBounds"),
14  par.getParameter<std::vector<double> >("ConeSizes"),
15  par.getParameter<std::vector<double> >("Thresholds")) {}

Member Function Documentation

◆ result() [1/2]

Result SimpleCutsIsolator::result ( const DepositContainer deposits,
const edm::Event = nullptr 
) const
inlineoverridevirtual

Compute and return the isolation variable.

Implements muonisolation::MuIsoBaseIsolator.

Definition at line 19 of file SimpleCutsIsolator.h.

19  {
20  Result answer(ISOL_BOOL_TYPE);
21  answer.valBool = false;
22  // fail miserably...
23  return answer;
24  }

References submit::answer, and muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE.

◆ result() [2/2]

Result SimpleCutsIsolator::result ( const DepositContainer deposits,
const reco::Track muon,
const edm::Event = nullptr 
) const
inlineoverridevirtual

Compute and return the isolation variable, with vetoes and the muon.

Reimplemented from muonisolation::MuIsoBaseIsolator.

Definition at line 26 of file SimpleCutsIsolator.h.

26  {
27  Result answer(ISOL_BOOL_TYPE);
28 
29  muonisolation::Cuts::CutSpec cuts_here = theCuts(tk.eta());
30 
31  double conesize = cuts_here.conesize;
32  double dephlt = 0;
33  unsigned int nDeps = deposits.size();
34  for (unsigned int iDep = 0; iDep < nDeps; ++iDep) {
35  dephlt += deposits[iDep].dep->depositWithin(conesize);
36  }
37  answer.valFloat = dephlt;
38  if (dephlt < cuts_here.threshold) {
39  answer.valBool = true;
40  } else {
41  answer.valBool = false;
42  }
43  return answer;
44  }

References submit::answer, muonisolation::Cuts::CutSpec::conesize, CandIsolatorFromDeposits_cfi::deposits, reco::TrackBase::eta(), muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE, theCuts, and muonisolation::Cuts::CutSpec::threshold.

◆ resultType()

ResultType SimpleCutsIsolator::resultType ( ) const
inlineoverridevirtual

Member Data Documentation

◆ theCuts

muonisolation::Cuts SimpleCutsIsolator::theCuts
private

Definition at line 48 of file SimpleCutsIsolator.h.

Referenced by result().

muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE
Definition: MuIsoBaseIsolator.h:25
SimpleCutsIsolator::theCuts
muonisolation::Cuts theCuts
Definition: SimpleCutsIsolator.h:48
submit.answer
answer
Definition: submit.py:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
muonisolation::Cuts::CutSpec::conesize
double conesize
Definition: Cuts.h:18
muonisolation::Cuts::CutSpec::threshold
double threshold
Definition: Cuts.h:19
muonisolation::Cuts::CutSpec
Definition: Cuts.h:16
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4