20 #include <vdt/vdtMath.h> 71 EGRegressionModifierV3::EGRegressionModifierV3(const
edm::
ParameterSet& conf,
edm::ConsumesCollector& cc)
78 if (conf.exists(
"eleRegs")) {
79 eleRegs_ = std::make_unique<EleRegs>(conf.getParameter<
edm::ParameterSet>(
"eleRegs"));
81 if (conf.exists(
"phoRegs")) {
82 phoRegs_ = std::make_unique<PhoRegs>(conf.getParameter<
edm::ParameterSet>(
"phoRegs"));
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;
242 data[25] =
std::max(0, numberOfClusters);
247 int signIEta = iEta > 0 ? +1 : -1;
250 data[28] = (iEta - signIEta) % 5;
251 data[29] = (iPhi - 1) % 2;
252 const int iEtaCorr = iEta - (iEta > 0 ? +1 : -1);
253 const int iEtaCorr26 = iEta - (iEta > 0 ? +26 : -26);
254 data[30] =
std::abs(iEta) <= 25 ? iEtaCorr % 20 : iEtaCorr26 % 20;
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;
310 data[25] =
std::max(0, numberOfClusters);
317 int signIEta = iEta > 0 ? +1 : -1;
318 data[28] = (iEta - signIEta) % 5;
319 data[29] = (iPhi - 1) % 2;
320 const int iEtaCorr = iEta - (iEta > 0 ? +1 : -1);
321 const int iEtaCorr26 = iEta - (iEta > 0 ? +26 : -26);
322 data[30] =
std::abs(iEta) <= 25 ? iEtaCorr % 20 : iEtaCorr26 % 20;
323 data[31] = (iPhi - 1) % 20;
329 data[28] = rawESEnergy / rawEnergy;
351 iEtaOrX = ebId.
ieta();
352 iPhiOrY = ebId.iphi();
constexpr double deltaPhi(double phi1, double phi2)
void setEventContent(const edm::EventSetup &iSetup)
maxRawEnergyForLowPtEBSigma
Analysis-level Photon class.
float nSaturatedXtals() const
float maxRawEnergyForLowPtEBSigma_
float trackMomentumError() const
const LorentzVector & p4(P4Kind kind) const
void setCorrectedEnergy(P4type type, float E, float dE, bool toCand=true)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setEventContent(const edm::EventSetup &iSetup)
EgammaRegressionContainer ecalOnlySigma
edm::EDGetTokenT< double > rhoToken_
EgammaRegressionContainer ecalOnlyMean
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
useClosestToCentreSeedCrysDef
void modifyObject(reco::GsfElectron &) const final
std::unique_ptr< PhoRegs > phoRegs_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
EgammaRegressionContainer ecalOnlySigma
double eta() const
pseudorapidity of cluster centroid
EgammaRegressionContainer ecalOnlyMean
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void setCorrectedEcalEnergyError(float newEnergyError)
void getSeedCrysCoord(const reco::CaloCluster &clus, int &iEtaOrX, int &iPhiOrY) const
void setEventContent(const edm::EventSetup &iSetup)
EGRegressionModifierV3(const edm::ParameterSet &conf, edm::ConsumesCollector &cc)
EleRegs(const edm::ParameterSet &iConfig)
edm::ESHandle< CaloGeometry > caloGeomHandle_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Abs< T >::type abs(const T &t)
int ieta() const
get the crystal ieta
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
float hcalOverEcalBc() const
std::unique_ptr< EleRegs > eleRegs_
DetId seed() const
return DetId of seed
void setEventContent(const edm::EventSetup &) final
Analysis-level electron class.
~EGRegressionModifierV3() override
float maxRawEnergyForLowPtEESigma_
void setCorrectedEcalEnergy(float newEnergy)
maxRawEnergyForLowPtEESigma
bool isSaturated(const Digi &digi, const int &maxADCvalue, int ifirst, int n)
const ShowerShape & full5x5_showerShape() const
char data[epos_bytes_allocation]
const ShowerShape & full5x5_showerShapeVariables() const
void setEvent(const edm::Event &) final
SuperClusterRef superCluster() const override
reference to a SuperCluster
std::array< float, 32 > getRegData(const reco::GsfElectron &ele) const
static float kDefaultValue
#define DEFINE_EDM_PLUGIN(factory, type, name)
bool useClosestToCentreSeedCrysDef_
PhoRegs(const edm::ParameterSet &iConfig)
double phi() const
azimuthal angle of cluster centroid
float nSaturatedXtals() const