20 #include <vdt/vdtMath.h> 75 rhoToken_(
cc.consumes(conf.getParameter<
edm::
InputTag>(
"rhoTag"))),
76 useClosestToCentreSeedCrysDef_(conf.getParameter<
bool>(
"useClosestToCentreSeedCrysDef")),
77 maxRawEnergyForLowPtEBSigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEBSigma")),
78 maxRawEnergyForLowPtEESigma_(conf.getParameter<double>(
"maxRawEnergyForLowPtEESigma")) {
79 if (conf.
exists(
"eleRegs")) {
82 if (conf.
exists(
"phoRegs")) {
117 bool rescaleDependentValues = superClus->clusters().
isAvailable();
125 const float rawEnergy = superClus->rawEnergy();
126 const float rawESEnergy = superClus->preshowerEnergy();
128 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
132 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
145 const float corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
146 const float corrEnergyErr = corrEnergy * ecalSigma;
151 std::pair<float, float> combEnergyAndErr =
eleRegs_->epComb.combine(ele);
178 const float rawEnergy = superClus->rawEnergy();
179 const float rawESEnergy = superClus->preshowerEnergy();
181 const float rawEt = rawEnergy * superClus->position().rho() / superClus->position().r();
184 const float ecalMeanCorr = ecalMean > 0. ? ecalMean : 1.0;
195 const double corrEnergy = (rawEnergy + rawESEnergy) * ecalMeanCorr;
196 const double corrEnergyErr = corrEnergy * ecalSigma;
198 pho.
setCorrectedEnergy(reco::Photon::P4type::regression2, corrEnergy, corrEnergyErr,
true);
204 std::array<float, 32>
data;
209 const bool isEB = ele.
isEB();
210 const double rawEnergy = superClus->rawEnergy();
211 const double rawESEnergy = superClus->preshowerEnergy();
212 const int numberOfClusters = superClus->clusters().size();
215 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
218 data[1] = superClus->etaWidth();
219 data[2] = superClus->phiWidth();
220 data[3] = superClus->seed()->energy() / rawEnergy;
221 data[4] = ssFull5x5.e5x5 / rawEnergy;
224 data[7] = seedClus->
eta() - superClus->position().Eta();
226 data[9] = ssFull5x5.r9;
227 data[10] = ssFull5x5.sigmaIetaIeta;
228 data[11] = ssFull5x5.sigmaIetaIphi;
229 data[12] = ssFull5x5.sigmaIphiIphi;
230 data[13] = ssFull5x5.eMax * e5x5Inverse;
231 data[14] = ssFull5x5.e2nd * e5x5Inverse;
232 data[15] = ssFull5x5.eTop * e5x5Inverse;
233 data[16] = ssFull5x5.eBottom * e5x5Inverse;
234 data[17] = ssFull5x5.eLeft * e5x5Inverse;
235 data[18] = ssFull5x5.eRight * e5x5Inverse;
236 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
237 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
238 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
239 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
240 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
247 int signIEta =
iEta > 0 ? +1 : -1;
251 data[29] = (iPhi - 1) % 2;
252 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
253 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
255 data[31] = (iPhi - 1) % 20;
261 data[28] = rawESEnergy / rawEnergy;
268 std::array<float, 32>
data;
273 const bool isEB = pho.
isEB();
274 const double rawEnergy = superClus->rawEnergy();
275 const double rawESEnergy = superClus->preshowerEnergy();
276 const int numberOfClusters = superClus->clusters().size();
279 float e5x5Inverse = ssFull5x5.
e5x5 != 0. ? vdt::fast_inv(ssFull5x5.e5x5) : 0.;
282 data[1] = superClus->etaWidth();
283 data[2] = superClus->phiWidth();
284 data[3] = superClus->seed()->energy() / rawEnergy;
285 data[4] = ssFull5x5.e5x5 / rawEnergy;
290 data[7] = seedClus->
eta() - superClus->position().Eta();
293 data[10] = ssFull5x5.sigmaIetaIeta;
296 data[11] = ssFull5x5.sigmaIetaIphi;
297 data[12] = ssFull5x5.sigmaIphiIphi;
298 data[13] = ssFull5x5.maxEnergyXtal * e5x5Inverse;
299 data[14] = ssFull5x5.e2nd * e5x5Inverse;
300 data[15] = ssFull5x5.eTop * e5x5Inverse;
301 data[16] = ssFull5x5.eBottom * e5x5Inverse;
302 data[17] = ssFull5x5.eLeft * e5x5Inverse;
303 data[18] = ssFull5x5.eRight * e5x5Inverse;
304 data[19] = ssFull5x5.e2x5Max * e5x5Inverse;
305 data[20] = ssFull5x5.e2x5Left * e5x5Inverse;
306 data[21] = ssFull5x5.e2x5Right * e5x5Inverse;
307 data[22] = ssFull5x5.e2x5Top * e5x5Inverse;
308 data[23] = ssFull5x5.e2x5Bottom * e5x5Inverse;
317 int signIEta =
iEta > 0 ? +1 : -1;
319 data[29] = (iPhi - 1) % 2;
320 const int iEtaCorr =
iEta - (
iEta > 0 ? +1 : -1);
321 const int iEtaCorr26 =
iEta - (
iEta > 0 ? +26 : -26);
323 data[31] = (iPhi - 1) % 20;
329 data[28] = rawESEnergy / rawEnergy;
351 iEtaOrX = ebId.
ieta();
352 iPhiOrY = ebId.iphi();
369 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)
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