#include <CutsIsolatorWithCorrection.h>
Public Member Functions | |
CutsIsolatorWithCorrection (const edm::ParameterSet &par) | |
virtual Result | result (const DepositContainer &deposits, const reco::Track &tk, const edm::Event *=0) const |
Compute and return the isolation variable, with vetoes and the muon. | |
virtual Result | result (const DepositContainer &deposits, const edm::Event *=0) const |
Compute and return the isolation variable. | |
virtual ResultType | resultType () const |
Private Member Functions | |
double | depSum (const DepositContainer &deposits, double dr, double corr) const |
Private Attributes | |
bool | theAndOrCuts |
bool | theCutAbsIso |
bool | theCutRelativeIso |
muonisolation::Cuts | theCuts |
muonisolation::Cuts | theCutsRel |
double | theEffAreaSFBarrel |
double | theEffAreaSFEndcap |
bool | theReturnAbsoluteSum |
bool | theReturnRelativeSum |
double | theRhoMax |
double | theRhoScaleBarrel |
double | theRhoScaleEndcap |
edm::InputTag | theRhoSrc |
bool | theUseRhoCorrection |
Definition at line 8 of file CutsIsolatorWithCorrection.h.
CutsIsolatorWithCorrection::CutsIsolatorWithCorrection | ( | const edm::ParameterSet & | par | ) |
Definition at line 8 of file CutsIsolatorWithCorrection.cc.
References Exception, theCutAbsIso, and theCutRelativeIso.
: theCuts(par.getParameter<std::vector<double> > ("EtaBounds"), par.getParameter<std::vector<double> > ("ConeSizes"), par.getParameter<std::vector<double> > ("Thresholds")), theCutsRel(par.getParameter<std::vector<double> > ("EtaBoundsRel"), par.getParameter<std::vector<double> > ("ConeSizesRel"), par.getParameter<std::vector<double> > ("ThresholdsRel")), theCutAbsIso(par.getParameter<bool>("CutAbsoluteIso")), theCutRelativeIso(par.getParameter<bool>("CutRelativeIso")), theUseRhoCorrection(par.getParameter<bool>("UseRhoCorrection")), theRhoSrc(par.getParameter<edm::InputTag>("RhoSrc")), theRhoMax(par.getParameter<double>("RhoMax")), theRhoScaleBarrel(par.getParameter<double>("RhoScaleBarrel")), theRhoScaleEndcap(par.getParameter<double>("RhoScaleEndcap")), theEffAreaSFBarrel(par.getParameter<double>("EffAreaSFBarrel")), theEffAreaSFEndcap(par.getParameter<double>("EffAreaSFEndcap")), theReturnAbsoluteSum(par.getParameter<bool>("ReturnAbsoluteSum")), theReturnRelativeSum(par.getParameter<bool>("ReturnRelativeSum")), theAndOrCuts(par.getParameter<bool>("AndOrCuts")) { if (! ( theCutAbsIso || theCutRelativeIso ) ) throw cms::Exception("BadConfiguration") << "Something has to be cut: set either CutAbsoluteIso or CutRelativeIso to true"; }
double CutsIsolatorWithCorrection::depSum | ( | const DepositContainer & | deposits, |
double | dr, | ||
double | corr | ||
) | const [private] |
Definition at line 32 of file CutsIsolatorWithCorrection.cc.
References corr, and JetCorrectorParameters::size().
Referenced by result().
{ double dephlt = -corr; unsigned int nDeps = deposits.size(); // edm::LogWarning("CutsIsolatorWithCorrection::depSumIn") // << "add nDeposit "<< nDeps<< " \t dr "<<dr<<" \t corr "<<corr; for(unsigned int iDep = 0; iDep < nDeps; ++iDep ){ double lDep = deposits[iDep].dep->depositWithin(dr); dephlt += lDep; // edm::LogWarning("CutsIsolatorWithCorrection::depSumIDep") // <<"dep "<<iDep<<" \t added "<<lDep<<" \t sumnow "<<dephlt; } return dephlt; }
virtual Result CutsIsolatorWithCorrection::result | ( | const DepositContainer & | deposits, |
const edm::Event * | = 0 |
||
) | const [inline, virtual] |
Compute and return the isolation variable.
Implements muonisolation::MuIsoBaseIsolator.
Definition at line 14 of file CutsIsolatorWithCorrection.h.
References submit::answer, muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE, and muonisolation::MuIsoBaseIsolator::Result::valBool.
{ Result answer(ISOL_BOOL_TYPE); answer.valBool = false; // fail miserably... return answer; }
MuIsoBaseIsolator::Result CutsIsolatorWithCorrection::result | ( | const DepositContainer & | deposits, |
const reco::Track & | muon, | ||
const edm::Event * | = 0 |
||
) | const [virtual] |
Compute and return the isolation variable, with vetoes and the muon.
Reimplemented from muonisolation::MuIsoBaseIsolator.
Definition at line 47 of file CutsIsolatorWithCorrection.cc.
References submit::answer, muonisolation::Cuts::CutSpec::conesize, depSum(), reco::TrackBase::eta(), edm::Event::getByLabel(), muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE, pi, edm::Handle< T >::product(), reco::TrackBase::pt(), rho, theAndOrCuts, theCutAbsIso, theCutRelativeIso, theCuts, theCutsRel, theEffAreaSFBarrel, theEffAreaSFEndcap, theReturnAbsoluteSum, theReturnRelativeSum, theRhoMax, theRhoScaleBarrel, theRhoScaleEndcap, theRhoSrc, theUseRhoCorrection, muonisolation::Cuts::CutSpec::threshold, muonisolation::MuIsoBaseIsolator::Result::valBool, and muonisolation::MuIsoBaseIsolator::Result::valFloat.
{ Result answer(ISOL_BOOL_TYPE); bool absDecision = false; bool relDecision = false; double rho = 0.0; double effAreaSF = 1.0; static const double pi = 3.14159265358979323846; // edm::LogWarning("CutsIsolatorWithCorrection::resultIn") // <<"Start tk.pt "<<tk.pt()<<" \t tk.eta "<<tk.eta()<<" \t tk.phi "<<tk.phi(); if (theUseRhoCorrection){ edm::Handle<double> rhoHandle; ev->getByLabel(theRhoSrc, rhoHandle); rho = *(rhoHandle.product()); if (rho < 0.0) rho = 0.0; double rhoScale = fabs(tk.eta()) > 1.442 ? theRhoScaleEndcap : theRhoScaleBarrel; effAreaSF = fabs(tk.eta()) > 1.442 ? theEffAreaSFEndcap : theEffAreaSFBarrel; // edm::LogWarning("CutsIsolatorWithCorrection::resultInRho") // << "got rho "<<rho<<" vs max "<<theRhoMax<<" will scale by "<<rhoScale; if (rho > theRhoMax){ rho = theRhoMax; } rho = rho*rhoScale; // edm::LogWarning("CutsIsolatorWithCorrection::resultOutRho")<<" final rho "<<rho; } if (theCutAbsIso){ muonisolation::Cuts::CutSpec cuts_here = theCuts(tk.eta()); double conesize = cuts_here.conesize; double dephlt = depSum(deposits, conesize, rho*conesize*conesize*pi*effAreaSF); if (theReturnAbsoluteSum ) answer.valFloat = (float)dephlt; if (dephlt<cuts_here.threshold) { absDecision = true; } else { absDecision = false; } // edm::LogWarning("CutsIsolatorWithCorrection::resultOutAbsIso") // <<"compared dephlt "<<dephlt<<" \t with "<<cuts_here.threshold; } else absDecision = true; if (theCutRelativeIso){ muonisolation::Cuts::CutSpec cuts_here = theCutsRel(tk.eta()); double conesize = cuts_here.conesize; double dephlt = depSum(deposits, conesize, rho*conesize*conesize*pi*effAreaSF)/tk.pt(); if (theReturnRelativeSum ) answer.valFloat = (float)dephlt; if (dephlt<cuts_here.threshold) { relDecision = true; } else { relDecision = false; } // edm::LogWarning("CutsIsolatorWithCorrection::resultOutRelIso") // <<"compared dephlt "<<dephlt<<" \t with "<<cuts_here.threshold; } else relDecision = true; if (theAndOrCuts){ answer.valBool = absDecision && relDecision; } else { answer.valBool = absDecision || relDecision; } // edm::LogWarning("CutsIsolatorWithCorrection::result") // <<"isAbsIsolated "<<absDecision<<" \t isRelIsolated "<<relDecision // <<" \t combined with AND "<<theAndOrCuts // <<" = " << answer.valBool; return answer; }
virtual ResultType CutsIsolatorWithCorrection::resultType | ( | ) | const [inline, virtual] |
Implements muonisolation::MuIsoBaseIsolator.
Definition at line 12 of file CutsIsolatorWithCorrection.h.
References muonisolation::MuIsoBaseIsolator::ISOL_BOOL_TYPE.
{return ISOL_BOOL_TYPE;}
bool CutsIsolatorWithCorrection::theAndOrCuts [private] |
Definition at line 41 of file CutsIsolatorWithCorrection.h.
Referenced by result().
bool CutsIsolatorWithCorrection::theCutAbsIso [private] |
Definition at line 30 of file CutsIsolatorWithCorrection.h.
Referenced by CutsIsolatorWithCorrection(), and result().
bool CutsIsolatorWithCorrection::theCutRelativeIso [private] |
Definition at line 31 of file CutsIsolatorWithCorrection.h.
Referenced by CutsIsolatorWithCorrection(), and result().
Definition at line 27 of file CutsIsolatorWithCorrection.h.
Referenced by result().
Definition at line 28 of file CutsIsolatorWithCorrection.h.
Referenced by result().
double CutsIsolatorWithCorrection::theEffAreaSFBarrel [private] |
Definition at line 37 of file CutsIsolatorWithCorrection.h.
Referenced by result().
double CutsIsolatorWithCorrection::theEffAreaSFEndcap [private] |
Definition at line 38 of file CutsIsolatorWithCorrection.h.
Referenced by result().
bool CutsIsolatorWithCorrection::theReturnAbsoluteSum [private] |
Definition at line 39 of file CutsIsolatorWithCorrection.h.
Referenced by result().
bool CutsIsolatorWithCorrection::theReturnRelativeSum [private] |
Definition at line 40 of file CutsIsolatorWithCorrection.h.
Referenced by result().
double CutsIsolatorWithCorrection::theRhoMax [private] |
Definition at line 34 of file CutsIsolatorWithCorrection.h.
Referenced by result().
double CutsIsolatorWithCorrection::theRhoScaleBarrel [private] |
Definition at line 35 of file CutsIsolatorWithCorrection.h.
Referenced by result().
double CutsIsolatorWithCorrection::theRhoScaleEndcap [private] |
Definition at line 36 of file CutsIsolatorWithCorrection.h.
Referenced by result().
Definition at line 33 of file CutsIsolatorWithCorrection.h.
Referenced by result().
bool CutsIsolatorWithCorrection::theUseRhoCorrection [private] |
Definition at line 32 of file CutsIsolatorWithCorrection.h.
Referenced by result().