10 bool useCombinationReg,
12 : caloTopology{cc.
esConsumes()}, caloGeometry{cc.esConsumes()} {
13 if (useEcalReg &&
cfg.ecalWeightsFromDB) {
21 if (useCombinationReg &&
cfg.combinationWeightsFromDB) {
29 bool useCombinationReg,
94 double& errorFactor)
const {
98 std::vector<float> rInputs;
102 if (sc.
seed()->hitsAndFractions()[0].first.subdetId() ==
EcalBarrel) {
105 }
else if (sc.
seed()->hitsAndFractions()[0].first.subdetId() ==
EcalEndcap) {
109 throw cms::Exception(
"RegressionHelper::calculateRegressedEnergy")
110 <<
"Supercluster seed is either EB nor EE!" << std::endl;
143 bool isEB = ele.
isEB();
146 float energyRelError = energyError /
energy;
147 float momentumRelError = momentumError / momentum;
148 float errorRatio = energyRelError / momentumRelError;
152 float eOverPerror =
eOverP * std::hypot(energyRelError, momentumRelError);
155 std::vector<float> regressionInputs;
156 regressionInputs.resize(11, 0.);
158 regressionInputs[0] =
energy;
159 regressionInputs[1] = energyRelError;
160 regressionInputs[2] = momentum;
161 regressionInputs[3] = momentumRelError;
162 regressionInputs[4] = errorRatio;
163 regressionInputs[5] =
eOverP;
164 regressionInputs[6] = eOverPerror;
165 regressionInputs[7] =
static_cast<float>(isEcalDriven);
166 regressionInputs[8] =
static_cast<float>(isTrackerDriven);
167 regressionInputs[9] =
static_cast<float>(elClass);
168 regressionInputs[10] =
static_cast<float>(isEB);
173 fabs(momentum -
energy) < 15. *
sqrt(momentumError * momentumError +
174 energyError * energyError))
184 float combinedMomentumError =
189 if (momentumError != 999. ||
weight == 0.) {
192 oldMomentum.y() * combinedMomentum / oldMomentum.t(),
193 oldMomentum.z() * combinedMomentum / oldMomentum.t(),
std::vector< std::string > ecalRegressionWeightFiles
void applyCombinationRegression(reco::GsfElectron &ele) const
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
std::vector< std::string > combinationRegressionWeightLabels
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegErrorBarrel
RegressionHelper(Configuration const &, bool useEcalReg, bool useCombinationReg, edm::ConsumesCollector &cc)
const GBRForest * ecalRegEndcap_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry
void setMass(double m) final
set particle mass
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegEndcap
std::vector< std::string > ecalRegressionWeightLabels
bool trackerDrivenSeed() const
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
float trackMomentumError() const
bool combinationWeightsFromDB
std::vector< Vertex > VertexCollection
collection of Vertex objects
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopology
Classification classification() const
const CaloTopology * caloTopology_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
const GBRForest * ecalRegBarrel_
const GBRForest * ecalRegErrorBarrel_
void setCorrectedEcalEnergyError(float newEnergyError)
const ESGetTokens esGetTokens_
float correctedEcalEnergy() const
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegBarrel
edm::ESGetToken< GBRForest, GBRWrapperRcd > combinationReg
ESGetTokens(Configuration const &cfg, bool useEcalReg, bool useCombinationReg, edm::ConsumesCollector &cc)
math::XYZVectorF trackMomentumAtVtx() const
bool getData(T &iHolder) const
const LorentzVector & p4(P4Kind kind) const
std::vector< std::string > combinationRegressionWeightFiles
void fillVec(std::vector< float > &inputVec) const
void applyEcalRegression(reco::GsfElectron &electron, const reco::VertexCollection &vertices, const EcalRecHitCollection &rechitsEB, const EcalRecHitCollection &rechitsEE) const
bool ecalRegressionInitialized_
const GBRForest * ecalRegErrorEndcap_
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegErrorEndcap
double GetResponse(const float *vector) const
void setCorrectedEcalEnergy(float newEnergy)
const CaloClusterPtr & seed() const
seed BasicCluster
float correctedEcalEnergyError() const
bool combinationRegressionInitialized_
void getEcalRegression(const reco::SuperCluster &sc, const reco::VertexCollection &vertices, const EcalRecHitCollection &rechitsEB, const EcalRecHitCollection &rechitsEE, double &energyFactor, double &errorFactor) const
void checkSetup(const edm::EventSetup &)
SuperClusterRef superCluster() const override
reference to a SuperCluster
const CaloGeometry * caloGeometry_
const GBRForest * combinationReg_