214 if(!recoEcalCandHandle.
isValid())
return;
215 else if(!pixelSeedsHandle.
isValid()){
216 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
217 for(
unsigned int candNr = 0; candNr<recoEcalCandHandle->size(); candNr++) {
219 s2Map->insert(candRef,0);
228 auto dPhi1BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
229 auto dPhi2BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
230 auto dzBestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
231 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
233 auto nrClusMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
234 auto seedClusEFracMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
235 auto phiWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
236 auto etaWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
238 std::vector<PixelData> pixelData;
239 for(
size_t hitNr=0;hitNr<
nrHits_;hitNr++){
244 for(
unsigned int candNr = 0; candNr<recoEcalCandHandle->size(); candNr++) {
250 for(
auto &
seed : *pixelSeedsHandle){
253 if(&(*candSCRef) == &(*pixelSCRef)){
255 std::array<float,4> s2Data =
calS2(
seed,-1);
256 std::array<float,4> s2DataPos =
calS2(
seed,+1);
257 if(s2Data[0]<bestS2[0]) bestS2=s2Data;
258 if(s2DataPos[0]<bestS2[0]) bestS2=s2DataPos;
261 for(
auto& pixelDatum : pixelData){
262 pixelDatum.fill(
seed);
269 s2Map->insert(candRef,bestS2[0]);
271 dPhi1BestS2Map->insert(candRef,bestS2[1]);
272 dPhi2BestS2Map->insert(candRef,bestS2[2]);
273 dzBestS2Map->insert(candRef,bestS2[3]);
276 nrClusMap->insert(candRef,candSCRef->clustersSize());
277 float seedClusEFrac = candSCRef->rawEnergy()>0 ? candSCRef->seed()->energy() / candSCRef->rawEnergy() : 0.;
280 seedClusEFracMap->insert(candRef,seedClusEFrac);
281 float phiWidth = candSCRef->phiWidth();
282 float etaWidth = candSCRef->etaWidth();
283 phiWidthMap->insert(candRef,phiWidth);
284 etaWidthMap->insert(candRef,etaWidth);
286 for(
auto& pixelDatum : pixelData){
287 pixelDatum.fill(candRef);
299 for(
auto& pixelDatum : pixelData){
300 pixelDatum.putInto(iEvent);
303 iEvent.
put(
std::move(seedClusEFracMap),
"seedClusEFrac");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
float dPhiBest(size_t hitNr) const
std::array< float, 4 > calS2(const reco::ElectronSeed &seed, int charge) const
float dRZBest(size_t hitNr) const
const edm::EDGetTokenT< reco::ElectronSeedCollection > pixelSeedsToken_