|
|
Go to the documentation of this file.
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 > ecalRegressionWeightLabels
const GBRForest * ecalRegEndcap_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometry
std::vector< std::string > combinationRegressionWeightLabels
std::vector< Vertex > VertexCollection
collection of Vertex objects
const GBRForest * combinationReg_
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegErrorBarrel
const GBRForest * ecalRegErrorBarrel_
RegressionHelper(Configuration const &, bool useEcalReg, bool useCombinationReg, edm::ConsumesCollector &cc)
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegEndcap
const GBRForest * ecalRegBarrel_
bool combinationWeightsFromDB
void applyCombinationRegression(reco::GsfElectron &ele) const
double GetResponse(const float *vector) const
void setP4(P4Kind kind, const LorentzVector &p4, float p4Error, bool setCandidate)
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
const CaloTopology * caloTopology_
std::vector< std::string > combinationRegressionWeightFiles
math::XYZVectorF trackMomentumAtVtx() const
float correctedEcalEnergyError() const
bool combinationRegressionInitialized_
ESGetTokens(Configuration const &cfg, bool useEcalReg, bool useCombinationReg, edm::ConsumesCollector &cc)
const GBRForest * ecalRegErrorEndcap_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopology
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegErrorEndcap
const CaloGeometry * caloGeometry_
void setCorrectedEcalEnergyError(float newEnergyError)
const CaloClusterPtr & seed() const
seed BasicCluster
edm::ESGetToken< GBRForest, GBRWrapperRcd > combinationReg
void fillVec(std::vector< float > &inputVec) const
const LorentzVector & p4(P4Kind kind) const
edm::ESGetToken< GBRForest, GBRWrapperRcd > ecalRegBarrel
const ESGetTokens esGetTokens_
void checkSetup(const edm::EventSetup &)
bool getData(T &iHolder) const
float correctedEcalEnergy() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Classification classification() const
bool ecalRegressionInitialized_
bool trackerDrivenSeed() const
SuperClusterRef superCluster() const override
reference to a SuperCluster
float trackMomentumError() const
void setCorrectedEcalEnergy(float newEnergy)
void applyEcalRegression(reco::GsfElectron &electron, const reco::VertexCollection &vertices, const EcalRecHitCollection &rechitsEB, const EcalRecHitCollection &rechitsEE) const
std::vector< std::string > ecalRegressionWeightFiles
void getEcalRegression(const reco::SuperCluster &sc, const reco::VertexCollection &vertices, const EcalRecHitCollection &rechitsEB, const EcalRecHitCollection &rechitsEE, double &energyFactor, double &errorFactor) const