20 #include <vdt/vdtMath.h> 76 rhoToken_(
cc.consumes(conf.getParameter<
edm::
InputTag>(
"rhoTag"))),
77 useClosestToCentreSeedCrysDef_(conf.getParameter<
bool>(
"useClosestToCentreSeedCrysDef")),
78 useBuggedHOverE_(conf.getParameter<
bool>(
"useBuggedHOverE")),
79 maxRawEnergyForLowPtEBSigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEBSigma")),
80 maxRawEnergyForLowPtEESigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEESigma")) {
81 if (conf.
exists(
"eleRegs")) {
84 if (conf.
exists(
"phoRegs")) {
119 bool rescaleDependentValues = superClus->clusters().
isAvailable();
127 const float rawEnergy = superClus->rawEnergy();
128 const float rawESEnergy = superClus->preshowerEnergy();
130 const float rawEt =
rawEnergy * superClus->position().rho() / superClus->position().r();
134 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
147 const float corrEnergy = (
rawEnergy + rawESEnergy) * ecalMeanCorr;
148 const float corrEnergyErr = corrEnergy * ecalSigma;
153 std::pair<float, float> combEnergyAndErr =
eleRegs_->epComb.combine(ele);
180 const float rawEnergy = superClus->rawEnergy();
181 const float rawESEnergy = superClus->preshowerEnergy();
183 const float rawEt =
rawEnergy * superClus->position().rho() / superClus->position().r();
186 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
197 const double corrEnergy = (
rawEnergy + rawESEnergy) * ecalMeanCorr;
198 const double corrEnergyErr = corrEnergy * ecalSigma;
200 pho.
setCorrectedEnergy(reco::Photon::P4type::regression2, corrEnergy, corrEnergyErr,
true);
206 std::array<float, 32>
data;
212 const double rawEnergy = superClus->rawEnergy();
213 const double rawESEnergy = superClus->preshowerEnergy();
217 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
220 data[1] = superClus->etaWidth();
221 data[2] = superClus->phiWidth();
227 data[7] = seedClus->
eta() - superClus->position().Eta();
229 data[9] = ssFull5x5.r9;
230 data[10] = ssFull5x5.sigmaIetaIeta;
231 data[11] = ssFull5x5.sigmaIetaIphi;
232 data[12] = ssFull5x5.sigmaIphiIphi;
233 data[13] = ssFull5x5.eMax * e5x5Inverse;
234 data[14] = ssFull5x5.e2nd * e5x5Inverse;
235 data[15] = ssFull5x5.eTop * e5x5Inverse;
236 data[16] = ssFull5x5.eBottom * e5x5Inverse;
237 data[17] = ssFull5x5.eLeft * e5x5Inverse;
238 data[18] = ssFull5x5.eRight * e5x5Inverse;
239 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
240 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
241 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
242 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
243 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
250 int signIEta =
iEta > 0 ? +1 : -1;
254 data[29] = (iPhi - 1) % 2;
255 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
256 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
258 data[31] = (iPhi - 1) % 20;
271 std::array<float, 32>
data;
277 const double rawEnergy = superClus->rawEnergy();
278 const double rawESEnergy = superClus->preshowerEnergy();
282 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
285 data[1] = superClus->etaWidth();
286 data[2] = superClus->phiWidth();
293 data[7] = seedClus->
eta() - superClus->position().Eta();
296 data[10] = ssFull5x5.sigmaIetaIeta;
299 data[11] = ssFull5x5.sigmaIetaIphi;
300 data[12] = ssFull5x5.sigmaIphiIphi;
301 data[13] = ssFull5x5.maxEnergyXtal * e5x5Inverse;
302 data[14] = ssFull5x5.e2nd * e5x5Inverse;
303 data[15] = ssFull5x5.eTop * e5x5Inverse;
304 data[16] = ssFull5x5.eBottom * e5x5Inverse;
305 data[17] = ssFull5x5.eLeft * e5x5Inverse;
306 data[18] = ssFull5x5.eRight * e5x5Inverse;
307 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
308 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
309 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
310 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
311 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
320 int signIEta =
iEta > 0 ? +1 : -1;
322 data[29] = (iPhi - 1) % 2;
323 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
324 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
326 data[31] = (iPhi - 1) % 20;
354 iEtaOrX = ebId.
ieta();
355 iPhiOrY = ebId.iphi();
372 epComb.setEventContent(iSetup);
constexpr double deltaPhi(double phi1, double phi2)
Analysis-level Photon class.
float maxRawEnergyForLowPtEBSigma_
bool get(ProductID const &oid, Handle< PROD > &result) const
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
float full5x5_hcalOverEcalBc(int depth=0) const
const ShowerShape & full5x5_showerShapeVariables() const
void setEventContent(const edm::EventSetup &iSetup)
uint32_t cc[maxCellsPerHit]
EgammaRegressionContainer ecalOnlySigma
edm::EDGetTokenT< double > rhoToken_
EgammaRegressionContainer ecalOnlyMean
float trackMomentumError() const
PhoRegs(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
DetId seed() const
return DetId of seed
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
ParameterSet const & getParameterSet(std::string const &) const
float hcalOverEcalBc(const ShowerShape &ss, int depth) const
std::unique_ptr< PhoRegs > phoRegs_
EgammaRegressionContainer ecalOnlySigma
double phi() const
azimuthal angle of cluster centroid
EgammaRegressionContainer ecalOnlyMean
float nSaturatedXtals() const
std::array< float, 32 > getRegData(const reco::GsfElectron &ele) const
int ieta() const
get the crystal ieta
void modifyObject(reco::GsfElectron &) const final
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void getSeedCrysCoord(const reco::CaloCluster &clus, int &iEtaOrX, int &iPhiOrY) const
void setCorrectedEcalEnergyError(float newEnergyError)
const ShowerShape & full5x5_showerShape() const
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
void setEventContent(const edm::EventSetup &iSetup)
EGRegressionModifierV3(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
static constexpr float kDefaultValue
edm::ESHandle< CaloGeometry > caloGeomHandle_
Abs< T >::type abs(const T &t)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
EleRegs(const edm::ParameterSet &iConfig, edm::ConsumesCollector &cc)
const LorentzVector & p4(P4Kind kind) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
float hadronicOverEm(int depth=0) const
std::unique_ptr< EleRegs > eleRegs_
void setEventContent(const edm::EventSetup &) final
Analysis-level electron class.
~EGRegressionModifierV3() override
float maxRawEnergyForLowPtEESigma_
ParameterSet const & getParameterSet(ParameterSetID const &id)
void setCorrectedEcalEnergy(float newEnergy)
bool isSaturated(const Digi &digi, const int &maxADCvalue, int ifirst, int n)
char data[epos_bytes_allocation]
void setEvent(const edm::Event &) final
#define DEFINE_EDM_PLUGIN(factory, type, name)
double eta() const
pseudorapidity of cluster centroid
bool useClosestToCentreSeedCrysDef_
SuperClusterRef superCluster() const override
reference to a SuperCluster
float nSaturatedXtals() const