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) ";
73 if (produceValueMaps_) {
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";
176 recHits = pEBRecHits.
product();
178 recHits = pEERecHits.
product();
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);
524 patElectrons->push_back(*myPatElectron);
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();
T getUntrackedParameter(std::string const &, T const &) const
RegressionEnergyPatElectronProducer(const edm::ParameterSet &)
float trackMomentumError() const
float eESClusters() const
double pt() const final
transverse momentum
const LorentzVector & p4(P4Kind kind) const
float eSuperClusterOverP() const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopoToken_
std::string nameEnergyReg_
float esClusterEnergy(unsigned i) const
float sigmaIetaIeta() const
#define DEFINE_FWK_MODULE(type)
float subClusterE3x3(unsigned i) const
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
math::XYZVectorF trackMomentumAtVtx() 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)
float eSubClusters() const
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)
bool isInitialized() const
~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_
bool getData(T &iHolder) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
float esClusterEta(unsigned i) const
std::string regressionInputFile_
float subClusterEnergy(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 preshowerEnergyOverRaw() const
void initialize(std::string weightsFile, ElectronEnergyRegressionEvaluate::ElectronEnergyRegressionType type)
Log< level::Warning, true > LogPrint
float preshowerEnergy() const
float hadronicOverEm() const
void correctEcalEnergy(float newEnergy, float newEnergyError, bool corrEovP=true)
float subClusterEmax(unsigned i) const
ElectronEnergyRegressionType
ElectronEnergyRegressionEvaluate * regressionEvaluator_
float esClusterPhi(unsigned i) const
float subClusterPhi(unsigned i) const
T const * product() 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)
T getParameter(std::string const &) const
const CaloGeometry * caloGeometry_
Analysis-level electron class.
uint32_t energyRegressionType_
std::string nameEnergyErrorReg_
edm::EDGetTokenT< reco::GsfElectronCollection > inputGsfElectronsToken_
float nPreshowerClusters() const
edm::EDGetTokenT< double > rhoInputToken_
void produce(edm::Event &, const edm::EventSetup &) override
float clustersSize() const
float subClusterEta(unsigned i) const
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_
int charge() const final
electric charge
bool ecalDrivenSeed() const
double eta() const final
momentum pseudorapidity