25 for (
unsigned iC(0); iC != newCores->size(); ++iC) {
27 auto&& oldSCRef(scMap[newCore]);
28 if (oldSCRef.isNonnull() && oldSCRef == oldPho.
superCluster())
37 energyCorrector_(config, consumesCollector())
51 produces<reco::PhotonCollection>();
53 produces<PhotonRefMap>();
80 auto& inputPhotons(*inputPhotonsHandle);
92 std::vector<reco::PhotonRef> oldPhotons;
95 for (
auto& inPhoton : inputPhotons) {
96 auto&& refToBase(inputPhotons.refAt(iP++));
97 oldPhotons.emplace_back(refToBase.id(), &inPhoton, refToBase.key());
99 auto&& newCore(getNewCore(inPhoton, newCoresHandle, newCoresToOldSCMap));
101 auto& oldSC(*inPhoton.photonCore()->superCluster());
102 auto& newSC(*newCore->superCluster());
105 auto&& caloPosition(newSC.position());
108 auto&& direction((caloPosition - inPhoton.vertex()).
unit());
111 pOutput->emplace_back(p4, caloPosition, newCore, inPhoton.vertex());
112 auto& outPhoton(pOutput->back());
115 fflags.
isEB = inPhoton.isEB();
116 fflags.isEE = inPhoton.isEE();
117 fflags.isEBEtaGap = inPhoton.isEBEtaGap();
118 fflags.isEBPhiGap = inPhoton.isEBPhiGap();
119 fflags.isEERingGap = inPhoton.isEERingGap();
120 fflags.isEEDeeGap = inPhoton.isEEDeeGap();
121 fflags.isEBEEGap = inPhoton.isEBEEGap();
123 outPhoton.setFiducialVolumeFlags(fflags);
151 outPhoton.setIsolationVariables(iso04, iso03);
153 auto& newSeed(*newSC.seed());
156 auto&& locCov(EcalClusterTools::localCovariances(newSeed, &ebHits,
topology_));
160 auto& oldSS(inPhoton.showerShapeVariables());
163 newSS.
e1x5 = EcalClusterTools::e1x5(newSeed, &ebHits,
topology_);
164 newSS.e2x5 = EcalClusterTools::e2x5Max(newSeed, &ebHits,
topology_);
165 newSS.e3x3 = EcalClusterTools::e3x3(newSeed, &ebHits,
topology_);
166 newSS.e5x5 = EcalClusterTools::e5x5(newSeed, &ebHits,
topology_);
167 newSS.maxEnergyXtal = EcalClusterTools::eMax(newSeed, &ebHits);
169 newSS.sigmaIetaIeta =
std::sqrt(locCov[0]);
170 newSS.hcalDepth1OverEcal = oldSS.hcalDepth1OverEcal * oldSC.energy() / newSC.energy();
171 newSS.hcalDepth2OverEcal = oldSS.hcalDepth2OverEcal * oldSC.energy() / newSC.energy();
172 newSS.hcalDepth1OverEcalBc = oldSS.hcalDepth1OverEcalBc * oldSC.energy() / newSC.energy();
173 newSS.hcalDepth2OverEcalBc = oldSS.hcalDepth2OverEcalBc * oldSC.energy() / newSC.energy();
174 newSS.hcalTowersBehindClusters = oldSS.hcalTowersBehindClusters;
175 newSS.sigmaIetaIphi = locCov[1];
177 newSS.e2nd = EcalClusterTools::e2nd(newSeed, &ebHits);
178 newSS.eTop = EcalClusterTools::eTop(newSeed, &ebHits,
topology_);
179 newSS.eLeft = EcalClusterTools::eLeft(newSeed, &ebHits,
topology_);
180 newSS.eRight = EcalClusterTools::eRight(newSeed, &ebHits,
topology_);
181 newSS.eBottom = EcalClusterTools::eBottom(newSeed, &ebHits,
topology_);
182 newSS.e1x3 = EcalClusterTools::e1x3(newSeed, &ebHits,
topology_);
183 newSS.e2x2 = EcalClusterTools::e2x2(newSeed, &ebHits,
topology_);
184 newSS.e2x5Max = EcalClusterTools::e2x5Max(newSeed, &ebHits,
topology_);
185 newSS.e2x5Left = EcalClusterTools::e2x5Left(newSeed, &ebHits,
topology_);
186 newSS.e2x5Right = EcalClusterTools::e2x5Right(newSeed, &ebHits,
topology_);
187 newSS.e2x5Top = EcalClusterTools::e2x5Top(newSeed, &ebHits,
topology_);
188 newSS.e2x5Bottom = EcalClusterTools::e2x5Bottom(newSeed, &ebHits,
topology_);
189 newSS.effSigmaRR = oldSS.effSigmaRR;
191 outPhoton.setShowerShapeVariables(newSS);
217 outPhoton.full5x5_setShowerShapeVariables(new55SS);
220 mipVars.
mipChi2 = inPhoton.mipChi2();
222 mipVars.
mipSlope = inPhoton.mipSlope();
225 mipVars.
mipIsHalo = inPhoton.mipIsHalo();
227 outPhoton.setMIPVariables(mipVars);
229 outPhoton.setPflowIsolationVariables(inPhoton.getPflowIsolationVariables());
234 pfid.
mva = inPhoton.pfMVA();
236 outPhoton.setPflowIDVariables(pfid);
240 outPhoton.setP4(outPhoton.p4(inPhoton.getCandidateP4type()));
241 outPhoton.setCandidateP4type(inPhoton.getCandidateP4type());
244 pOutput->emplace_back(inPhoton);
245 auto& outPhoton(pOutput->back());
246 outPhoton.setPhotonCore(newCore);
254 refMapFiller.
insert(newPhotonsHandle, oldPhotons.begin(), oldPhotons.end());
CaloGeometry const * geometry_
float hcalDepth1TowerSumEtBc
float hcalDepth1TowerSumEt
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
void produce(edm::Event &, const edm::EventSetup &) override
PhotonEnergyCorrector energyCorrector_
void insert(const H &h, I begin, I end)
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
float hcalDepth2TowerSumEt
std::unique_ptr< ModifyObjectValueBase > & gedRegression()
edm::EDGetTokenT< EcalRecHitCollection > ebHitsToken_
GEDPhotonGSCrysFixer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void init(const edm::EventSetup &theEventSetup)
float hcalDepth2TowerSumEtBc
void getToken(edm::EDGetTokenT< T > &token, edm::ParameterSet const &pset, std::string const &label, std::string const &instance="")
edm::Handle< T > getHandle(edm::Event const &iEvent, edm::EDGetTokenT< T > const &token, std::string const &name)
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
edm::ValueMap< reco::PhotonRef > PhotonRefMap
std::vector< Photon > PhotonCollection
collectin of Photon objects
T const * product() const
void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
CaloTopology const * topology_
edm::EDGetTokenT< SCRefMap > newCoresToOldSCMapToken_
edm::EDGetTokenT< PhotonView > inputPhotonsToken_
int nClusterOutsideMustache
edm::EDGetTokenT< reco::PhotonCoreCollection > newCoresToken_
edm::Ref< PhotonCoreCollection > PhotonCoreRef
reference to an object in a collection of PhotonCore objects