|
|
Go to the documentation of this file.
19 mayConsume<reco::GsfElectronCollection>(
cfg.getParameter<
edm::InputTag>(
"inputElectronsTag"));
30 debug_ =
cfg.getUntrackedParameter<
bool>(
"debug");
37 <<
" *** Inconsistent configuration : if you read GsfElectrons, you should set useRecHitCollections to true "
38 "and provide the correcte values to recHitCollectionEB and recHitCollectionEE (most probably "
39 "reducedEcalRecHitsEB and reducedEcalRecHitsEE )"
44 std::cout <<
" You are running on GsfElectrons and the producer is not configured to produce ValueMaps with the "
45 "results. In that case, it does not nothing !! "
52 produces<pat::ElectronCollection>();
55 <<
" inputCollectionType should be either 0 (GsfElectrons) or 1 (pat::Electrons) " << std::endl;
82 std::cout <<
" Finished initialization " << std::endl;
109 for (reco::VertexCollection::const_iterator inV = inVertices.begin(); inV != inVertices.end(); ++inV) {
111 if (inV->ndof() >= 4 && inV->position().Rho() <= 2.0 && fabs(inV->z()) <= 24.0) {
122 rho = (*hRhoKt6PFJets);
157 std::vector<double> energyValues;
158 std::vector<double> energyErrorValues;
162 for (
unsigned iele = 0; iele <
nElectrons_; ++iele) {
165 std::cout <<
"***********************************************************************\n";
166 std::cout <<
"Run Lumi Event: " <<
event.id().run() <<
" " <<
event.luminosityBlock() <<
" " <<
event.id().event()
168 std::cout <<
"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);
526 delete myPatElectron;
539 energyFiller.
insert(gsfCollectionH, energyValues.begin(), energyValues.end());
540 energyErrorFiller.
insert(gsfCollectionH, energyErrorValues.begin(), energyErrorValues.end());
542 energyFiller.
insert(patCollectionH, energyValues.begin(), energyValues.end());
543 energyErrorFiller.
insert(patCollectionH, energyErrorValues.begin(), energyErrorValues.end());
547 energyErrorFiller.
fill();
float sigmaIetaIeta() const
bool isInitialized() const
void insert(const H &h, I begin, I end)
std::string nameEnergyReg_
uint32_t inputCollectionType_
T const * product() const
float subClusterE3x3(unsigned i) const
edm::EDGetTokenT< pat::ElectronCollection > inputPatElectronsToken_
std::vector< Electron > ElectronCollection
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEBToken_
float hadronicOverEm() const
const CaloTopology * ecalTopology_
std::vector< Vertex > VertexCollection
collection of Vertex objects
float esClusterPhi(unsigned i) const
RegressionEnergyPatElectronProducer(const edm::ParameterSet &)
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)
double pt() const final
transverse momentum
float nPreshowerClusters() const
float subClusterEnergy(unsigned i) const
~RegressionEnergyPatElectronProducer() override
float eESClusters() const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::VertexCollection > verticesInputToken_
float clustersSize() const
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)
math::XYZVectorF trackMomentumAtVtx() const
bool ecalDrivenSeed() const
ElectronEnergyRegressionType
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEEToken_
float esClusterEta(unsigned i) const
ElectronEnergyRegressionEvaluate * regressionEvaluator_
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)
float eSubClusters() const
std::string regressionInputFile_
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 eta() const final
momentum pseudorapidity
void correctEcalEnergy(float newEnergy, float newEnergyError, bool corrEovP=true)
float preshowerEnergyOverRaw() const
std::string nameEnergyErrorReg_
float esClusterEnergy(unsigned i) const
void setEcalRegressionEnergy(double val, double err)
set regression1
float preshowerEnergy() const
int charge() const final
electric charge
edm::EDGetTokenT< reco::GsfElectronCollection > inputGsfElectronsToken_
const CaloGeometry * caloGeometry_
const LorentzVector & p4(P4Kind kind) const
void produce(edm::Event &, const edm::EventSetup &) override
double phi() const final
momentum azimuthal angle
float subClusterEmax(unsigned i) const
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)
float subClusterPhi(unsigned i) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
double p() const final
magnitude of momentum vector
float eSuperClusterOverP() const
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 trackMomentumError() const
Analysis-level electron class.
edm::EDGetTokenT< double > rhoInputToken_
float subClusterEta(unsigned i) const
uint32_t energyRegressionType_
void initialize(std::string weightsFile, ElectronEnergyRegressionEvaluate::ElectronEnergyRegressionType type)