221 if (!recoEcalCandHandle.isValid())
223 else if (!pixelSeedsHandle.isValid()) {
224 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
225 for (
unsigned int candNr = 0; candNr < recoEcalCandHandle->size(); candNr++) {
227 s2Map->insert(candRef, 0);
233 auto dPhi1BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
234 auto dPhi2BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
235 auto dzBestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
236 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
238 auto nrClusMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
239 auto seedClusEFracMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
240 auto phiWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
241 auto etaWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
243 std::vector<PixelData> pixelData;
244 for (
size_t hitNr = 0; hitNr <
nrHits_; hitNr++) {
249 for (
unsigned int candNr = 0; candNr < recoEcalCandHandle->size(); candNr++) {
257 for (
auto&
seed : *pixelSeedsHandle) {
260 if (&(*candSCRef) == &(*pixelSCRef)) {
261 std::array<float, 4> s2Data =
calS2(
seed, -1);
262 std::array<float, 4> s2DataPos =
calS2(
seed, +1);
263 if (s2Data[0] < bestS2[0])
265 if (s2DataPos[0] < bestS2[0])
269 for (
auto& pixelDatum : pixelData) {
270 pixelDatum.fill(
seed);
276 s2Map->insert(candRef, bestS2[0]);
278 dPhi1BestS2Map->insert(candRef, bestS2[1]);
279 dPhi2BestS2Map->insert(candRef, bestS2[2]);
280 dzBestS2Map->insert(candRef, bestS2[3]);
283 nrClusMap->insert(candRef, candSCRef->clustersSize());
284 float seedClusEFrac = candSCRef->rawEnergy() > 0 ? candSCRef->seed()->energy() / candSCRef->rawEnergy() : 0.;
287 seedClusEFracMap->insert(candRef, seedClusEFrac);
288 float phiWidth = candSCRef->phiWidth();
289 float etaWidth = candSCRef->etaWidth();
290 phiWidthMap->insert(candRef,
phiWidth);
291 etaWidthMap->insert(candRef,
etaWidth);
293 for (
auto& pixelDatum : pixelData) {
294 pixelDatum.fill(candRef);
306 for (
auto& pixelDatum : pixelData) {
307 pixelDatum.putInto(
iEvent);
std::array< float, 4 > calS2(const reco::ElectronSeed &seed, int charge) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
float dPhiBest(size_t hitNr) const
const edm::EDGetTokenT< reco::ElectronSeedCollection > pixelSeedsToken_
float dRZBest(size_t hitNr) const