10 if (i >= 0 && i <
DIM)
17 for (
int i =
DIM;
i >= 1;
i--)
18 if (cone_dr[
i - 1] < dr)
24 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};
27 const vector<string>& ceff,
31 coneForEfficiency = cones(ceff);
32 theDepThresholds = std::vector<double>(
weights.size(), -1e12);
36 const vector<string>& ceff,
38 const vector<double>&
thresh)
41 coneForEfficiency = cones(ceff);
48 for (vector<string>::const_iterator is = usrVec.begin(); is != usrVec.end(); is++) {
50 int cone = strtol((*is).c_str(), &evp, 10);
51 float effic = strtod(evp + 1, &evp);
52 result.insert(make_pair(effic, cone));
65 if (deposits.empty()) {
66 cout <<
"IsolatorByNominalEfficiency: no deposit" << endl;
67 return Result(resultType());
76 float theEta = deposits.back().dep->eta();
81 float nominalEfficiency = 1.;
82 const float deltaeff = 0.005;
83 const float mineff = deltaeff;
84 for (
float eff = .995; eff > mineff; eff -= deltaeff) {
85 int cone = bestConeForEfficiencyIndex(eff);
86 float coneSize = theConesInfo.size(cone);
88 float thres =
thresholds->thresholdValueForEfficiency(location, eff);
89 float sumDep = weightedSum(deposits, coneSize);
100 nominalEfficiency = eff;
110 if (!coneForEfficiency.empty()) {
111 best_cone = (--(coneForEfficiency.end()))->second;
115 mapNomEff_Cone::const_reverse_iterator it;
116 for (it = coneForEfficiency.rbegin(); it != coneForEfficiency.rend(); it++) {
117 if (eff_thr <= (*it).first)
118 best_cone = (*it).second;
126 assert(deposits.size() == theWeights.size());
128 vector<double>::const_iterator
w = theWeights.begin();
129 vector<double>::const_iterator dThresh = theDepThresholds.begin();
130 for (DepositContainer::const_iterator dep = deposits.begin(); dep != deposits.end(); dep++) {
131 if (dep->vetos !=
nullptr) {
132 sumDep += dep->dep->depositAndCountWithin(dRcone, *dep->vetos, *dThresh).first * (*w);
134 sumDep += dep->dep->depositAndCountWithin(dRcone,
Vetos(), *dThresh).first * (*w);
145 vector<double> etaBounds =
thresholds->bins();
146 vector<double> coneSizes;
147 vector<double> cutvalues;
148 for (vector<double>::const_iterator it = etaBounds.begin(), itEnd = etaBounds.end(); it < itEnd; ++it) {
150 int icone = bestConeForEfficiencyIndex(nominalEfficiency);
151 coneSizes.push_back(theConesInfo.size(icone));
153 cutvalues.push_back(
thresholds->thresholdValueForEfficiency(location, nominalEfficiency));
155 return Cuts(etaBounds, coneSizes, cutvalues);
int index(float dr) const
MuIsoBaseIsolator::DepositContainer DepositContainer
reco::IsoDeposit::Vetos Vetos
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::multimap< float, int > mapNomEff_Cone
std::string findPath(const std::string &fileName)