42 template <
typename T1>
77 template <
typename T1>
80 rhoProducer_(consumes<double>(
config.getParameter<
edm::
InputTag>(
"rhoProducer"))),
81 drMax_(
config.getParameter<double>(
"drMax")),
82 drVetoBarrel_(
config.getParameter<double>(
"drVetoBarrel")),
83 drVetoEndcap_(
config.getParameter<double>(
"drVetoEndcap")),
84 etaStripBarrel_(
config.getParameter<double>(
"etaStripBarrel")),
85 etaStripEndcap_(
config.getParameter<double>(
"etaStripEndcap")),
86 energyBarrel_(
config.getParameter<double>(
"energyBarrel")),
87 energyEndcap_(
config.getParameter<double>(
"energyEndcap")),
88 doRhoCorrection_(
config.getParameter<
bool>(
"doRhoCorrection")),
89 rhoMax_(
config.getParameter<double>(
"rhoMax")),
90 rhoScale_(
config.getParameter<double>(
"rhoScale")),
91 effectiveAreas_(
config.getParameter<
std::
vector<double>>(
"effectiveAreas")),
92 absEtaLowEdges_(
config.getParameter<
std::
vector<double>>(
"absEtaLowEdges")) {
95 throw cms::Exception(
"IncompatibleVects") <<
"absEtaLowEdges and effectiveAreas should be of the same size. \n";
98 throw cms::Exception(
"IncompleteCoverage") <<
"absEtaLowEdges should start from 0. \n";
102 throw cms::Exception(
"ImproperBinning") <<
"absEtaLowEdges entries should be in increasing order. \n";
106 std::string recoCandidateProducerName =
"recoCandidateProducer";
109 recoCandidateProducerName =
"recoEcalCandidateProducer";
112 produces<T1IsolationMap>();
115 template <
typename T1>
118 template <
typename T1>
120 std::string recoCandidateProducerName =
"recoCandidateProducer";
123 recoCandidateProducerName =
"recoEcalCandidateProducer";
129 desc.add<
bool>(
"doRhoCorrection",
false);
130 desc.add<
double>(
"rhoMax", 9.9999999E7);
131 desc.add<
double>(
"rhoScale", 1.0);
132 desc.add<
double>(
"drMax", 0.3);
133 desc.add<
double>(
"drVetoBarrel", 0.0);
134 desc.add<
double>(
"drVetoEndcap", 0.0);
135 desc.add<
double>(
"etaStripBarrel", 0.0);
136 desc.add<
double>(
"etaStripEndcap", 0.0);
137 desc.add<
double>(
"energyBarrel", 0.0);
138 desc.add<
double>(
"energyEndcap", 0.0);
139 desc.add<std::vector<double>>(
"effectiveAreas", {0.29, 0.21});
140 desc.add<std::vector<double>>(
"absEtaLowEdges", {0.0, 1.479});
144 template <
typename T1>
148 if (doRhoCorrection_) {
149 iEvent.getByToken(rhoProducer_, rhoHandle);
161 iEvent.getByToken(recoCandidateProducer_, recoCandHandle);
162 iEvent.getByToken(pfClusterProducer_, clusterHandle);
165 drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_);
168 for (
unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
169 T1Ref candRef(recoCandHandle, iReco);
171 float sum = isoAlgo.
getSum(candRef, clusterHandle);
173 if (doRhoCorrection_) {
175 auto cEta =
std::abs(candRef->eta());
176 for (
int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
177 if (cEta > absEtaLowEdges_.at(bIt)) {
183 sum = sum -
rho * effectiveAreas_.at(iEA);
186 recoCandMap.
insert(candRef, sum);
189 iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));
const double energyEndcap_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
const double etaStripEndcap_
double getSum(T1, edm::Handle< std::vector< reco::PFCluster > >)
const edm::EDGetTokenT< double > rhoProducer_
const double drVetoEndcap_
const double etaStripBarrel_
#define DEFINE_FWK_MODULE(type)
T const * product() const
const double drVetoBarrel_
std::string defaultModuleLabel()
bool computedRVeto(T1Ref candRef, reco::PFClusterRef pfclu)
const std::vector< double > absEtaLowEdges_
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
void produce(edm::Event &, const edm::EventSetup &) override
HLTEcalPFClusterIsolationProducer< reco::RecoChargedCandidate > MuonHLTEcalPFClusterIsolationProducer
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTEcalPFClusterIsolationProducer(const edm::ParameterSet &)
Abs< T >::type abs(const T &t)
std::vector< T1 > T1Collection
~HLTEcalPFClusterIsolationProducer() override
std::vector< l1t::PFCluster > PFClusterCollection
void insert(const key_type &k, const data_type &v)
insert an association
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const double energyBarrel_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_
HLTEcalPFClusterIsolationProducer< reco::RecoEcalCandidate > EgammaHLTEcalPFClusterIsolationProducer
edm::Ref< T1Collection > T1Ref
const bool doRhoCorrection_
const std::vector< double > effectiveAreas_