34 template <
typename T1>
72 template <
typename T1>
74 : pfClusterProducerHCAL_(
76 rhoProducer_(consumes<double>(
config.getParameter<
edm::
InputTag>(
"rhoProducer"))),
77 pfClusterProducerHFEM_(
79 pfClusterProducerHFHAD_(
82 drMax_(
config.getParameter<double>(
"drMax")),
83 drVetoBarrel_(
config.getParameter<double>(
"drVetoBarrel")),
84 drVetoEndcap_(
config.getParameter<double>(
"drVetoEndcap")),
85 etaStripBarrel_(
config.getParameter<double>(
"etaStripBarrel")),
86 etaStripEndcap_(
config.getParameter<double>(
"etaStripEndcap")),
87 energyBarrel_(
config.getParameter<double>(
"energyBarrel")),
88 energyEndcap_(
config.getParameter<double>(
"energyEndcap")),
90 doRhoCorrection_(
config.getParameter<
bool>(
"doRhoCorrection")),
91 rhoMax_(
config.getParameter<double>(
"rhoMax")),
92 rhoScale_(
config.getParameter<double>(
"rhoScale")),
93 effectiveAreas_(
config.getParameter<
std::
vector<double>>(
"effectiveAreas")),
94 absEtaLowEdges_(
config.getParameter<
std::
vector<double>>(
"absEtaLowEdges")) {
97 throw cms::Exception(
"IncompatibleVects") <<
"absEtaLowEdges and effectiveAreas should be of the same size. \n";
100 throw cms::Exception(
"IncompleteCoverage") <<
"absEtaLowEdges should start from 0. \n";
104 throw cms::Exception(
"ImproperBinning") <<
"absEtaLowEdges entries should be in increasing order. \n";
108 std::string recoCandidateProducerName =
"recoCandidateProducer";
111 recoCandidateProducerName =
"recoEcalCandidateProducer";
114 produces<T1IsolationMap>();
117 template <
typename T1>
120 template <
typename T1>
122 std::string recoCandidateProducerName =
"recoCandidateProducer";
125 recoCandidateProducerName =
"recoEcalCandidateProducer";
133 "pfClusterProducerHFEM",
edm::InputTag(
"hltParticleFlowClusterHFEM"),
true) and
135 "pfClusterProducerHFHAD",
edm::InputTag(
"hltParticleFlowClusterHFHAD"),
true))
or
139 desc.add<
bool>(
"doRhoCorrection",
false);
140 desc.add<
double>(
"rhoMax", 9.9999999E7);
141 desc.add<
double>(
"rhoScale", 1.0);
142 desc.add<
double>(
"drMax", 0.3);
143 desc.add<
double>(
"drVetoBarrel", 0.0);
144 desc.add<
double>(
"drVetoEndcap", 0.0);
145 desc.add<
double>(
"etaStripBarrel", 0.0);
146 desc.add<
double>(
"etaStripEndcap", 0.0);
147 desc.add<
double>(
"energyBarrel", 0.0);
148 desc.add<
double>(
"energyEndcap", 0.0);
149 desc.add<
bool>(
"useEt",
true);
150 desc.add<std::vector<double>>(
"effectiveAreas", {0.2, 0.25});
151 desc.add<std::vector<double>>(
"absEtaLowEdges", {0.0, 1.479});
155 template <
typename T1>
161 if (doRhoCorrection_) {
162 iEvent.getByToken(rhoProducer_, rhoHandle);
173 std::vector<edm::Handle<reco::PFClusterCollection>> clusterHandles;
178 iEvent.getByToken(recoCandidateProducer_, recoCandHandle);
179 iEvent.getByToken(pfClusterProducerHCAL_, clusterHcalHandle);
181 clusterHandles.push_back(clusterHcalHandle);
184 iEvent.getByToken(pfClusterProducerHFEM_, clusterHfemHandle);
185 clusterHandles.push_back(clusterHfemHandle);
186 iEvent.getByToken(pfClusterProducerHFHAD_, clusterHfhadHandle);
187 clusterHandles.push_back(clusterHfhadHandle);
192 drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_, useEt_);
194 for (
unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
195 T1Ref candRef(recoCandHandle, iReco);
197 float sum = isoAlgo.
getSum(candRef, clusterHandles);
199 if (doRhoCorrection_) {
201 auto cEta =
std::abs(candRef->eta());
202 for (
int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
203 if (cEta > absEtaLowEdges_.at(bIt)) {
209 sum = sum -
rho * effectiveAreas_.at(iEA);
212 recoCandMap.
insert(candRef, sum);
215 iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));