19 mayConsume<reco::GsfElectronCollection>(
cfg.getParameter<
edm::InputTag>(
"inputElectronsTag"));
32 debug_ =
cfg.getUntrackedParameter<
bool>(
"debug");
39 <<
" *** Inconsistent configuration : if you read GsfElectrons, you should set useRecHitCollections to true " 40 "and provide the correcte values to recHitCollectionEB and recHitCollectionEE (most probably " 41 "reducedEcalRecHitsEB and reducedEcalRecHitsEE )" 47 <<
" You are running on GsfElectrons and the producer is not configured to produce ValueMaps with the results. " 48 "In that case, it does not nothing !! ";
54 produces<pat::ElectronCollection>();
57 <<
" inputCollectionType should be either 0 (GsfElectrons) or 1 (pat::Electrons) ";
84 edm::LogPrint(
"RegressionEnergyPatElectronProducer") <<
" Finished initialization ";
106 for (reco::VertexCollection::const_iterator inV = inVertices.begin(); inV != inVertices.end(); ++inV) {
108 if (inV->ndof() >= 4 && inV->position().Rho() <= 2.0 && fabs(inV->z()) <= 24.0) {
119 rho = (*hRhoKt6PFJets);
154 std::vector<double> energyValues;
155 std::vector<double> energyErrorValues;
159 for (
unsigned iele = 0; iele <
nElectrons_; ++iele) {
163 <<
"***********************************************************************\n";
165 <<
"Run Lumi Event: " <<
event.id().run() <<
" " <<
event.luminosityBlock() <<
" " <<
event.id().event()
168 <<
"Pat Electron : " << ele->
pt() <<
" " << ele->
eta() <<
" " << ele->
phi() <<
"\n";
180 recHits = (*patCollectionH)[iele].recHits();
191 Double_t FinalMomentum = 0;
192 Double_t FinalMomentumError = 0;
193 Double_t RegressionMomentum = 0;
194 Double_t RegressionMomentumError = 0;
232 RegressionMomentumError =
273 energyValues.push_back(RegressionMomentum);
274 energyErrorValues.push_back(RegressionMomentumError);
344 RegressionMomentumError =
417 energyValues.push_back(RegressionMomentum);
418 energyErrorValues.push_back(RegressionMomentumError);
505 FinalMomentum = RegressionMomentum;
506 FinalMomentumError = RegressionMomentumError;
509 oldMomentum.y() * FinalMomentum / oldMomentum.t(),
510 oldMomentum.z() * FinalMomentum / oldMomentum.t(),
516 energyValues.push_back(RegressionMomentum);
517 energyErrorValues.push_back(RegressionMomentumError);
527 delete myPatElectron;
540 energyFiller.
insert(gsfCollectionH, energyValues.begin(), energyValues.end());
541 energyErrorFiller.
insert(gsfCollectionH, energyErrorValues.begin(), energyErrorValues.end());
543 energyFiller.
insert(patCollectionH, energyValues.begin(), energyValues.end());
544 energyErrorFiller.
insert(patCollectionH, energyErrorValues.begin(), energyErrorValues.end());
548 energyErrorFiller.
fill();
float subClusterPhi(unsigned i) const
RegressionEnergyPatElectronProducer(const edm::ParameterSet &)
float subClusterEnergy(unsigned i) const
float preshowerEnergy() const
double pt() const final
transverse momentum
bool ecalDrivenSeed() const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopoToken_
std::string nameEnergyReg_
float trackMomentumError() const
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
T const * product() const
void insert(const H &h, I begin, I end)
uint32_t inputCollectionType_
std::vector< Vertex > VertexCollection
collection of Vertex objects
double regressionValueWithTrkVar(double electronP, double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double pt, double GsfTrackPIn, double fbrem, double Charge, double EoP, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
double regressionUncertaintyNoTrkVar(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
~RegressionEnergyPatElectronProducer() override
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEBToken_
double regressionValueWithSubClusters(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, double isEcalDriven, double isEtaGap, double isPhiGap, double isDeeGap, double ESubs, double ESub1, double EtaSub1, double PhiSub1, double EMaxSub1, double E3x3Sub1, double ESub2, double EtaSub2, double PhiSub2, double EMaxSub2, double E3x3Sub2, double ESub3, double EtaSub3, double PhiSub3, double EMaxSub3, double E3x3Sub3, double NPshwClusters, double EPshwSubs, double EPshwSub1, double EtaPshwSub1, double PhiPshwSub1, double EPshwSub2, double EtaPshwSub2, double PhiPshwSub2, double EPshwSub3, double EtaPshwSub3, double PhiPshwSub3, bool isEB, bool printDebug=false)
const CaloTopology * ecalTopology_
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEEToken_
float sigmaIetaIeta() const
float eSuperClusterOverP() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
float hadronicOverEm() const
std::string regressionInputFile_
float esClusterPhi(unsigned i) const
double p() const final
magnitude of momentum vector
std::vector< Electron > ElectronCollection
edm::EDGetTokenT< reco::VertexCollection > verticesInputToken_
double regressionValueNoTrkVar(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
float nPreshowerClusters() const
float esClusterEnergy(unsigned i) const
void initialize(std::string weightsFile, ElectronEnergyRegressionEvaluate::ElectronEnergyRegressionType type)
math::XYZVectorF trackMomentumAtVtx() const
#define DEFINE_FWK_MODULE(type)
float preshowerEnergyOverRaw() const
const LorentzVector & p4(P4Kind kind) const
Log< level::Warning, true > LogPrint
bool isInitialized() const
float esClusterEta(unsigned i) const
void correctEcalEnergy(float newEnergy, float newEnergyError, bool corrEovP=true)
ElectronEnergyRegressionType
ElectronEnergyRegressionEvaluate * regressionEvaluator_
float clustersSize() const
float eSubClusters() const
double regressionUncertaintyWithTrkVar(double electronP, double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double pt, double GsfTrackPIn, double fbrem, double Charge, double EoP, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
const CaloGeometry * caloGeometry_
Analysis-level electron class.
uint32_t energyRegressionType_
std::string nameEnergyErrorReg_
float eESClusters() const
float subClusterE3x3(unsigned i) const
edm::EDGetTokenT< reco::GsfElectronCollection > inputGsfElectronsToken_
edm::EDGetTokenT< double > rhoInputToken_
void produce(edm::Event &, const edm::EventSetup &) override
double regressionUncertaintyWithSubClusters(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, double isEcalDriven, double isEtaGap, double isPhiGap, double isDeeGap, double ESubs, double ESub1, double EtaSub1, double PhiSub1, double EMaxSub1, double E3x3Sub1, double ESub2, double EtaSub2, double PhiSub2, double EMaxSub2, double E3x3Sub2, double ESub3, double EtaSub3, double PhiSub3, double EMaxSub3, double E3x3Sub3, double NPshwClusters, double EPshwSubs, double EPshwSub1, double EtaPshwSub1, double PhiPshwSub1, double EPshwSub2, double EtaPshwSub2, double PhiPshwSub2, double EPshwSub3, double EtaPshwSub3, double PhiPshwSub3, bool isEB, bool printDebug=false)
double phi() const final
momentum azimuthal angle
void setEcalRegressionEnergy(double val, double err)
set regression1
edm::EDGetTokenT< pat::ElectronCollection > inputPatElectronsToken_
float subClusterEmax(unsigned i) const
int charge() const final
electric charge
float subClusterEta(unsigned i) const
double eta() const final
momentum pseudorapidity