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));