10 {
if (i >= 0 && i<
DIM)
return cone_dr[
i];
else return 0.; }
14 for(
int i=
DIM;
i>=1;
i--)
if (cone_dr[
i-1] < dr)
return i;
19 { 0.001, 0.02, 0.045, 0.09, 0.13, 0.17, 0.20, 0.24, 0.28, 0.32, 0.38, 0.45, 0.5, 0.6, 0.7};
22 const vector<string> & ceff,
const vector<double>&
weights) : theWeights(
weights){
24 coneForEfficiency = cones(ceff);
25 theDepThresholds = std::vector<double>(
weights.size(), -1e12);
33 coneForEfficiency = cones(ceff);
44 for (vector<string>::const_iterator is = usrVec.begin();
45 is != usrVec.end(); is++) {
47 int cone = strtol( (*is).c_str(), &evp, 10);
48 float effic = strtod(evp+1, &evp);
49 result.insert(make_pair(effic,cone));
64 if (deposits.empty()) {
65 cout <<
"IsolatorByNominalEfficiency: no deposit" << endl;
66 return Result(resultType());
75 float theEta = deposits.back().dep->eta();
80 float nominalEfficiency = 1.;
81 const float deltaeff=0.005;
82 const float mineff=deltaeff;
83 for (
float eff=.995; eff>mineff; eff-=deltaeff) {
84 int cone = bestConeForEfficiencyIndex(eff);
85 float coneSize = theConesInfo.size(cone);
87 float thres =
thresholds->thresholdValueForEfficiency(location, eff);
88 float sumDep = weightedSum(deposits,coneSize);
97 if (sumDep > thres)
break;
98 nominalEfficiency = eff;
110 if (!coneForEfficiency.empty()) {
111 best_cone = (--(coneForEfficiency.end()))->second;
114 mapNomEff_Cone::const_reverse_iterator it;
115 for (it = coneForEfficiency.rbegin();
116 it != coneForEfficiency.rend(); it++) {
117 if (eff_thr <= (*it).first) best_cone = (*it).second;
127 assert(deposits.size()==theWeights.size());
129 vector<double>::const_iterator
w = theWeights.begin();
130 vector<double>::const_iterator dThresh = theDepThresholds.begin();
131 for (DepositContainer::const_iterator dep = deposits.begin();
132 dep != deposits.end(); dep++) {
133 if (dep->vetos !=
nullptr){
134 sumDep += dep->dep->depositAndCountWithin(dRcone, *dep->vetos, *dThresh).first * (*w);
136 sumDep += dep->dep->depositAndCountWithin(dRcone,
Vetos(), *dThresh).first * (*w);
138 if (sumDep <0.) sumDep = 0.;
147 vector<double> etaBounds =
thresholds->bins();
148 vector<double> coneSizes;
149 vector<double> cutvalues;
150 for (vector<double>::const_iterator it=etaBounds.begin(),itEnd=etaBounds.end();it < itEnd;++it){
152 int icone = bestConeForEfficiencyIndex(nominalEfficiency);
153 coneSizes.push_back( theConesInfo.size(icone));
155 cutvalues.push_back(
thresholds->thresholdValueForEfficiency(location, nominalEfficiency));
157 return Cuts(etaBounds,coneSizes,cutvalues);
int index(float dr) const
MuIsoBaseIsolator::DepositContainer DepositContainer
reco::IsoDeposit::Vetos Vetos
std::multimap< float, int > mapNomEff_Cone
Result result(const DepositContainer &deposits, const edm::Event *=0) const override
Compute the deposit within the cone and return the isolation result.
~IsolatorByNominalEfficiency() override
IsolatorByNominalEfficiency(const std::string &thrFile, const std::vector< std::string > &ceff, const std::vector< double > &weights)
Constructor.
mapNomEff_Cone cones(const std::vector< std::string > &names)
static const float cone_dr[DIM]
Cuts cuts(float nominalEfficiency) const
virtual double weightedSum(const DepositContainer &deposits, float dRcone) const
int bestConeForEfficiencyIndex(float eff_thr) const
std::string fullPath() const
std::string findPath(const std::string &fileName)