From c4e94458ab1506c54a71be0a404bda81db6a034e Mon Sep 17 00:00:00 2001 From: daiktas Date: Wed, 11 Mar 2020 18:02:16 +0100 Subject: [PATCH] electrons fix --- .../interface/ElectronCandidateFeatures.h | 37 +++++++++++-------- NANOProducer/plugins/NANOProducer.cc | 20 ++++++---- NANOProducer/test/produceNANO.py | 3 +- XTagInfoProducer/plugins/XTagInfoProducer.cc | 26 ++++++++----- 4 files changed, 51 insertions(+), 35 deletions(-) diff --git a/DataFormats/interface/ElectronCandidateFeatures.h b/DataFormats/interface/ElectronCandidateFeatures.h index 24fe2d1..ca9e459 100644 --- a/DataFormats/interface/ElectronCandidateFeatures.h +++ b/DataFormats/interface/ElectronCandidateFeatures.h @@ -28,15 +28,12 @@ class ElectronCandidateFeatures { float elec_3dIP; float elec_3dIPSig; - // superCluster block float elecSC_energy; float elecSC_deta; float elecSC_dphi; float elecSC_et; float elecSC_eSuperClusterOverP; float elec_scPixCharge; - float elec_scSigmaEtaEta; - float elec_scSigmaIEtaIEta; float elec_superClusterFbrem; float elec_eSeedClusterOverP; @@ -44,6 +41,20 @@ class ElectronCandidateFeatures { float elec_eSuperClusterOverP; float elec_eTopOvere5x5; + // shower shape + float elec_sigmaEtaEta; + float elec_sigmaIetaIeta; + float elec_sigmaIphiIphi; + float elec_e5x5; + float elec_e5x5Rel; + float elec_e1x5Overe5x5; + float elec_e2x5MaxOvere5x5; + float elec_r9; + float elec_hcalOverEcal; + float elec_hcalDepth1OverEcal; + float elec_hcalDepth2OverEcal; + + // Track-Cluster Matching Attributes float elec_deltaEtaEleClusterTrackAtCalo; float elec_deltaEtaSeedClusterTrackAtCalo; float elec_deltaPhiSeedClusterTrackAtCalo; @@ -51,6 +62,7 @@ class ElectronCandidateFeatures { float elec_deltaEtaSuperClusterTrackAtVtx; float elec_deltaPhiEleClusterTrackAtCalo; float elec_deltaPhiSuperClusterTrackAtVtx; + float elec_sCseedEta; // electron gsf variables. @@ -64,10 +76,6 @@ class ElectronCandidateFeatures { int elec_numberOfBrems; float elec_trackFbrem; float elec_fbrem; - float elec_e5x5; - float elec_e5x5Rel; - float elec_e1x5Overe5x5; - float elec_e2x5MaxOvere5x5; // Isolation block float elec_neutralHadronIso; @@ -75,10 +83,14 @@ class ElectronCandidateFeatures { float elec_photonIso; float elec_puChargedHadronIso; float elec_trackIso; - float elec_hcalDepth1OverEcal; - float elec_hcalDepth2OverEcal; float elec_ecalPFClusterIso; float elec_hcalPFClusterIso; + + float elec_pfSumPhotonEt; + float elec_pfSumChargedHadronPt; + float elec_pfSumNeutralHadronEt; + float elec_pfSumPUPt; + float elec_dr03TkSumPt; @@ -87,13 +99,6 @@ class ElectronCandidateFeatures { float elec_dr03HcalDepth1TowerSumEtBc; float elec_dr03HcalDepth2TowerSumEt; float elec_dr03HcalDepth2TowerSumEtBc; - - - float elec_pfSumPhotonEt; - float elec_pfSumChargedHadronPt; - float elec_pfSumNeutralHadronEt; - float elec_pfSumPUPt; - float elec_dr04EcalRecHitSumEt; float elec_dr04HcalDepth1TowerSumEt; float elec_dr04HcalDepth1TowerSumEtBc; diff --git a/NANOProducer/plugins/NANOProducer.cc b/NANOProducer/plugins/NANOProducer.cc index 23768e6..97fff47 100644 --- a/NANOProducer/plugins/NANOProducer.cc +++ b/NANOProducer/plugins/NANOProducer.cc @@ -279,8 +279,10 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector elecSC_et; std::vector elecSC_eSuperClusterOverP; std::vector elec_scPixCharge; - std::vector elec_scSigmaEtaEta; - std::vector elec_scSigmaIEtaIEta; + std::vector elec_sigmaEtaEta; + std::vector elec_sigmaIetaIeta; + std::vector elec_sigmaIphiIphi; + std::vector elec_r9; std::vector elec_superClusterFbrem; std::vector elec_2dIP; @@ -300,7 +302,7 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector elec_deltaPhiEleClusterTrackAtCalo; std::vector elec_deltaPhiSuperClusterTrackAtVtx; std::vector elec_sCseedEta; - /////// + std::vector elec_EtaRel; std::vector elec_dxy; std::vector elec_dz; @@ -625,8 +627,10 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) elecSC_eSuperClusterOverP.push_back(elec_features.elecSC_eSuperClusterOverP ); elec_scPixCharge.push_back(elec_features.elec_scPixCharge ); - elec_scSigmaEtaEta.push_back(elec_features.elec_scSigmaEtaEta ); - elec_scSigmaIEtaIEta.push_back(elec_features.elec_scSigmaIEtaIEta ); + elec_sigmaEtaEta.push_back(elec_features.elec_sigmaEtaEta ); + elec_sigmaIetaIeta.push_back(elec_features.elec_sigmaIetaIeta ); + elec_sigmaIphiIphi.push_back(elec_features.elec_sigmaIphiIphi ); + elec_r9.push_back(elec_features.elec_r9 ); elec_superClusterFbrem.push_back(elec_features.elec_superClusterFbrem ); elec_2dIP.push_back(elec_features.elec_2dIP ); @@ -879,8 +883,10 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) electronTable->addColumn("SC_et",elecSC_et,"electron supercluster transverse energy normalized against the electron pt",nanoaod::FlatTable::FloatColumn); electronTable->addColumn("SC_eSuperClusterOverP",elecSC_eSuperClusterOverP,"the electron supercluster energy / track momentum at the PCA to the beam spot",nanoaod::FlatTable::FloatColumn); electronTable->addColumn("scPixCharge",elec_scPixCharge,"electron supercluster pixel charge",nanoaod::FlatTable::FloatColumn); - electronTable->addColumn("scSigmaEtaEta",elec_scSigmaEtaEta,"electron supercluster Sigma Eta Eta variable (quite unintuitive)",nanoaod::FlatTable::FloatColumn); - electronTable->addColumn("scSigmaIEtaIEta",elec_scSigmaIEtaIEta,"electron supercluster Sigma iEta iEta variable (improved variable against Sigma Eta Eta to resolv issues in cracks)",nanoaod::FlatTable::FloatColumn); + electronTable->addColumn("sigmaEtaEta",elec_sigmaEtaEta,"electron supercluster Sigma Eta Eta variable (quite unintuitive)",nanoaod::FlatTable::FloatColumn); + electronTable->addColumn("sigmaIetaIeta",elec_sigmaIetaIeta,"electron supercluster Sigma iEta iEta variable (improved variable against Sigma Eta Eta to resolv issues in cracks)",nanoaod::FlatTable::FloatColumn); + electronTable->addColumn("sigmaIphiIphi",elec_sigmaIphiIphi,"electron supercluster Sigma iphi iphi variable",nanoaod::FlatTable::FloatColumn); + electronTable->addColumn("r9",elec_r9,"electron supercluster r9 variable",nanoaod::FlatTable::FloatColumn); electronTable->addColumn("superClusterFbrem",elec_superClusterFbrem,"the brem fraction from supercluster: (supercluster energy - electron cluster energy) / supercluster energy",nanoaod::FlatTable::FloatColumn); electronTable->addColumn("2dIP",elec_2dIP,"electron inner track transverse impact parameter relative to the primary vertex in transverse plane (2D), absolute value",nanoaod::FlatTable::FloatColumn); diff --git a/NANOProducer/test/produceNANO.py b/NANOProducer/test/produceNANO.py index 71959ee..0f598cf 100644 --- a/NANOProducer/test/produceNANO.py +++ b/NANOProducer/test/produceNANO.py @@ -79,8 +79,7 @@ files = { 'test': { - "mc": "https://cernbox.cern.ch/index.php/s/SQjHHNCKjSfFXwU/download", - #"mc": "https://github.com/LLPDNNX/test-files/raw/master/miniaod/Moriond17_aug2018_miniAODv3_HNL.root", + "mc": "https://github.com/LLPDNNX/test-files/raw/master/miniaod/Moriond17_aug2018_miniAODv3_HNL.root", }, '2016': { #mean displacement = 5 cm "mc": "root://maite.iihe.ac.be///store/user/tomc/heavyNeutrinoMiniAOD/Moriond17_aug2018_miniAODv3/displaced/HeavyNeutrino_lljj_M-2_V-0.0137840487521_mu_Dirac_massiveAndCKM_LO/heavyNeutrino_70.root", diff --git a/XTagInfoProducer/plugins/XTagInfoProducer.cc b/XTagInfoProducer/plugins/XTagInfoProducer.cc index 0733d5c..d4143b3 100644 --- a/XTagInfoProducer/plugins/XTagInfoProducer.cc +++ b/XTagInfoProducer/plugins/XTagInfoProducer.cc @@ -555,10 +555,6 @@ XTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) elec_features.elec_sCseedEta = electron.superCluster()->seed()->eta(); - elec_features.elec_e5x5 = electron.e5x5(); - elec_features.elec_e5x5Rel = electron.e5x5()/jet.pt(); - elec_features.elec_e1x5Overe5x5 = electron.e1x5()/electron.e5x5(); - elec_features.elec_e2x5MaxOvere5x5 = electron.e2x5Max()/electron.e5x5(); elec_features.elec_eSeedClusterOverP = electron.eSeedClusterOverP(); elec_features.elec_eSeedClusterOverPout = electron.eSeedClusterOverPout(); @@ -598,20 +594,30 @@ XTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) elec_features.elec_numberOfBrems = electron.numberOfBrems(); - if(electron.pt() >= 5. ){ + if(electron.pt() >= 5.){ elec_features.elec_fbrem = electron.fbrem(); - elec_features.elec_scSigmaEtaEta = electron.scSigmaEtaEta(); - elec_features.elec_scSigmaIEtaIEta = electron.scSigmaIEtaIEta(); + elec_features.elec_sigmaEtaEta = electron.sigmaEtaEta(); + elec_features.elec_sigmaIetaIeta = electron.sigmaIetaIeta(); + elec_features.elec_sigmaIphiIphi = electron.sigmaIphiIphi(); + elec_features.elec_r9 = electron.r9(); elec_features.elec_superClusterFbrem = electron.superClusterFbrem(); + } else { elec_features.elec_fbrem = -1.; - elec_features.elec_scSigmaEtaEta = -1.; - elec_features.elec_scSigmaIEtaIEta = -1.; + elec_features.elec_sigmaEtaEta = -1.; + elec_features.elec_sigmaIetaIeta = -1.; + elec_features.elec_sigmaIphiIphi = -1; elec_features.elec_superClusterFbrem = -1.; } - + elec_features.elec_e5x5 = electron.e5x5(); + elec_features.elec_e5x5Rel = electron.e5x5()/jet.pt(); + elec_features.elec_e1x5Overe5x5 = electron.e1x5()/electron.e5x5(); + elec_features.elec_e2x5MaxOvere5x5 = electron.e2x5Max()/electron.e5x5(); + elec_features.elec_hcalOverEcal = electron.hcalOverEcal(); + elec_features.elec_hcalDepth1OverEcal = electron.hcalDepth1OverEcal(); + elec_features.elec_hcalDepth2OverEcal = electron.hcalDepth2OverEcal(); elec_features.elecSC_eSuperClusterOverP = electron.eSuperClusterOverP();