Skip to content

Commit

Permalink
electrons fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vcepaitis committed Mar 11, 2020
1 parent 38c3880 commit c4e9445
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 35 deletions.
37 changes: 21 additions & 16 deletions DataFormats/interface/ElectronCandidateFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,41 @@ 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;
float elec_eSeedClusterOverPout;
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;
float elec_deltaEtaSeedClusterTrackAtVtx;
float elec_deltaEtaSuperClusterTrackAtVtx;
float elec_deltaPhiEleClusterTrackAtCalo;
float elec_deltaPhiSuperClusterTrackAtVtx;

float elec_sCseedEta;

// electron gsf variables.
Expand All @@ -64,21 +76,21 @@ 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;
float elec_particleIso;
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;


Expand All @@ -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;
Expand Down
20 changes: 13 additions & 7 deletions NANOProducer/plugins/NANOProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,10 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
std::vector<float> elecSC_et;
std::vector<float> elecSC_eSuperClusterOverP;
std::vector<float> elec_scPixCharge;
std::vector<float> elec_scSigmaEtaEta;
std::vector<float> elec_scSigmaIEtaIEta;
std::vector<float> elec_sigmaEtaEta;
std::vector<float> elec_sigmaIetaIeta;
std::vector<float> elec_sigmaIphiIphi;
std::vector<float> elec_r9;
std::vector<float> elec_superClusterFbrem;

std::vector<float> elec_2dIP;
Expand All @@ -300,7 +302,7 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
std::vector<float> elec_deltaPhiEleClusterTrackAtCalo;
std::vector<float> elec_deltaPhiSuperClusterTrackAtVtx;
std::vector<float> elec_sCseedEta;
///////

std::vector<float> elec_EtaRel;
std::vector<float> elec_dxy;
std::vector<float> elec_dz;
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -879,8 +883,10 @@ NANOProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
electronTable->addColumn<float>("SC_et",elecSC_et,"electron supercluster transverse energy normalized against the electron pt",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("SC_eSuperClusterOverP",elecSC_eSuperClusterOverP,"the electron supercluster energy / track momentum at the PCA to the beam spot",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("scPixCharge",elec_scPixCharge,"electron supercluster pixel charge",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("scSigmaEtaEta",elec_scSigmaEtaEta,"electron supercluster Sigma Eta Eta variable (quite unintuitive)",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("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<float>("sigmaEtaEta",elec_sigmaEtaEta,"electron supercluster Sigma Eta Eta variable (quite unintuitive)",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("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<float>("sigmaIphiIphi",elec_sigmaIphiIphi,"electron supercluster Sigma iphi iphi variable",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("r9",elec_r9,"electron supercluster r9 variable",nanoaod::FlatTable::FloatColumn);
electronTable->addColumn<float>("superClusterFbrem",elec_superClusterFbrem,"the brem fraction from supercluster: (supercluster energy - electron cluster energy) / supercluster energy",nanoaod::FlatTable::FloatColumn);

electronTable->addColumn<float>("2dIP",elec_2dIP,"electron inner track transverse impact parameter relative to the primary vertex in transverse plane (2D), absolute value",nanoaod::FlatTable::FloatColumn);
Expand Down
3 changes: 1 addition & 2 deletions NANOProducer/test/produceNANO.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
26 changes: 16 additions & 10 deletions XTagInfoProducer/plugins/XTagInfoProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit c4e9445

Please sign in to comment.