diff --git a/DataFormats/interface/ChargedCandidateFeatures.h b/DataFormats/interface/ChargedCandidateFeatures.h index 5fa2824..85add3c 100644 --- a/DataFormats/interface/ChargedCandidateFeatures.h +++ b/DataFormats/interface/ChargedCandidateFeatures.h @@ -7,7 +7,6 @@ namespace llpdnnx { struct ChargedCandidateFeatures { - int jetIdx; float ptrel; float deta; float dphi; @@ -60,7 +59,6 @@ struct ChargedCandidateFeatures float dZmin; ChargedCandidateFeatures(): - jetIdx(-1), ptrel(-1), deta(1), dphi(1), diff --git a/DataFormats/interface/ElectronCandidateFeatures.h b/DataFormats/interface/ElectronCandidateFeatures.h index 3c7745e..471c067 100644 --- a/DataFormats/interface/ElectronCandidateFeatures.h +++ b/DataFormats/interface/ElectronCandidateFeatures.h @@ -4,7 +4,6 @@ namespace llpdnnx { struct ElectronCandidateFeatures { - int jetIdx; float ptrel; float deltaR; float deta; @@ -106,7 +105,6 @@ struct ElectronCandidateFeatures { ElectronCandidateFeatures(): - jetIdx(-1), ptrel(0), deltaR(0), deta(0), diff --git a/DataFormats/interface/JetFeatures.h b/DataFormats/interface/JetFeatures.h index 1897049..dbefbdf 100644 --- a/DataFormats/interface/JetFeatures.h +++ b/DataFormats/interface/JetFeatures.h @@ -5,7 +5,6 @@ namespace llpdnnx { struct JetFeatures { - int jetIdx; float pt; float eta; float phi; @@ -56,7 +55,6 @@ struct JetFeatures int numberElectron; JetFeatures(): - jetIdx(-1), pt(-1), eta(0), phi(0), diff --git a/DataFormats/interface/LLPLabel.h b/DataFormats/interface/LLPLabel.h index f84947e..8596b26 100644 --- a/DataFormats/interface/LLPLabel.h +++ b/DataFormats/interface/LLPLabel.h @@ -73,7 +73,6 @@ class LLPLabel { TauDecay tauDecay; - int jetIdx; int partonFlavor; int hadronFlavor; int llpId; @@ -97,7 +96,6 @@ class LLPLabel { LLPLabel(): type(Type::isUndefined), tauDecay(TauDecay::NO_TAU), - jetIdx(-1), partonFlavor(0), hadronFlavor(0), llpId(0), diff --git a/DataFormats/interface/MuonCandidateFeatures.h b/DataFormats/interface/MuonCandidateFeatures.h index 8b1d333..55e38fc 100644 --- a/DataFormats/interface/MuonCandidateFeatures.h +++ b/DataFormats/interface/MuonCandidateFeatures.h @@ -5,7 +5,6 @@ namespace llpdnnx { struct MuonCandidateFeatures { - int jetIdx; int isGlobal; int isTight; int isMedium; @@ -63,7 +62,6 @@ struct MuonCandidateFeatures { MuonCandidateFeatures(): - jetIdx(-1), isGlobal(-1), isTight(-1), isMedium(-1), diff --git a/DataFormats/interface/NeutralCandidateFeatures.h b/DataFormats/interface/NeutralCandidateFeatures.h index 54e3a86..c3648eb 100644 --- a/DataFormats/interface/NeutralCandidateFeatures.h +++ b/DataFormats/interface/NeutralCandidateFeatures.h @@ -7,7 +7,6 @@ namespace llpdnnx { struct NeutralCandidateFeatures { - int jetIdx; float ptrel; float deta; float dphi; @@ -24,7 +23,6 @@ struct NeutralCandidateFeatures float relmassdrop; NeutralCandidateFeatures(): - jetIdx(-1), ptrel(0), deta(0), dphi(0), diff --git a/DataFormats/interface/SecondaryVertexFeatures.h b/DataFormats/interface/SecondaryVertexFeatures.h index 96cfb0c..f416072 100644 --- a/DataFormats/interface/SecondaryVertexFeatures.h +++ b/DataFormats/interface/SecondaryVertexFeatures.h @@ -7,8 +7,6 @@ namespace llpdnnx { struct SecondaryVertexFeatures { - - int jetIdx; float ptrel; float deta; float dphi; @@ -28,7 +26,6 @@ struct SecondaryVertexFeatures float vz; SecondaryVertexFeatures(): - jetIdx(-1), ptrel(0), deta(0), dphi(0), diff --git a/DataFormats/interface/ShallowTagInfoFeatures.h b/DataFormats/interface/ShallowTagInfoFeatures.h index e37813b..3df3fb4 100644 --- a/DataFormats/interface/ShallowTagInfoFeatures.h +++ b/DataFormats/interface/ShallowTagInfoFeatures.h @@ -6,7 +6,6 @@ namespace llpdnnx { struct ShallowTagInfoFeatures { // jet general - int jetIdx; float trackSumJetEtRatio; // ratio of track sum transverse energy over jet energy float trackSumJetDeltaR; // pseudoangular distance between jet axis and track fourvector sum int vertexCategory; // category of secondary vertex (Reco, Pseudo, No) @@ -17,6 +16,19 @@ struct ShallowTagInfoFeatures // track info int jetNTracksEtaRel; // tracks associated to jet for which trackEtaRel is calculated int jetNSelectedTracks; + + ShallowTagInfoFeatures(): + trackSumJetEtRatio(0), // ratio of track sum transverse energy over jet energy + trackSumJetDeltaR(0), // pseudoangular distance between jet axis and track fourvector sum + vertexCategory(0), // category of secondary vertex (Reco, Pseudo, No) + trackSip2dValAboveCharm(0), // track 2D signed impact parameter of first track lifting mass above charm + trackSip2dSigAboveCharm(0), // track 2D signed impact parameter significance of first track lifting mass above charm + trackSip3dValAboveCharm(0), // track 3D signed impact parameter of first track lifting mass above charm + trackSip3dSigAboveCharm(0), // track 3D signed impact parameter significance of first track lifting mass above charm + // track info + jetNTracksEtaRel(0), // tracks associated to jet for which trackEtaRel is calculated + jetNSelectedTracks(0) + {} }; diff --git a/XTagInfoProducer/plugins/XTagInfoProducer.cc b/XTagInfoProducer/plugins/XTagInfoProducer.cc index b059a8c..364cf57 100644 --- a/XTagInfoProducer/plugins/XTagInfoProducer.cc +++ b/XTagInfoProducer/plugins/XTagInfoProducer.cc @@ -828,11 +828,11 @@ XTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) features.jet_features.jetRchg = jetRchg; features.jet_features.jetR = jetR; - int beta = 0; - int frac01 = 0; - int frac02 = 0; - int frac03 = 0; - int frac04 = 0; + float beta = 0; + features.jet_features.frac01 = 0; + features.jet_features.frac02 = 0; + features.jet_features.frac03 = 0; + features.jet_features.frac04 = 0; float dR2Mean = 0; float pt2Sum = 0; @@ -842,27 +842,28 @@ XTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) beta += cpf.fromPV; dR2Mean += (cpf.ptrel*cpf.trackDeltaR) * (cpf.ptrel*cpf.trackDeltaR); pt2Sum += (cpf.ptrel) * (cpf.ptrel); - if (cpf.trackDeltaR < 0.1) frac01+=cpf.ptrel; - else if (cpf.trackDeltaR < 0.2) frac02+=cpf.ptrel; - else if (cpf.trackDeltaR < 0.3) frac03+=cpf.ptrel; - else if (cpf.trackDeltaR < 0.4) frac04+=cpf.ptrel; + if (cpf.trackDeltaR < 0.1) features.jet_features.frac01+=cpf.ptrel; + else if (cpf.trackDeltaR < 0.2) features.jet_features.frac02+=cpf.ptrel; + else if (cpf.trackDeltaR < 0.3) features.jet_features.frac03+=cpf.ptrel; + else if (cpf.trackDeltaR < 0.4) features.jet_features.frac04+=cpf.ptrel; } if (features.cpf_features.size() > 0) { - features.jet_features.beta = (float)beta/(float)features.cpf_features.size(); + features.jet_features.beta = 1.*beta/features.cpf_features.size(); } for (size_t i = 0; i < features.npf_features.size(); i++){ llpdnnx::NeutralCandidateFeatures npf = features.npf_features.at(i); dR2Mean += (npf.ptrel*npf.deltaR) * (npf.ptrel*npf.deltaR); pt2Sum += (npf.ptrel) * (npf.ptrel); - if (npf.deltaR < 0.1) frac01+=npf.ptrel; - else if (npf.deltaR < 0.2) frac02+=npf.ptrel; - else if (npf.deltaR < 0.3) frac03+=npf.ptrel; - else if (npf.deltaR < 0.4) frac04+=npf.ptrel; + if (npf.deltaR < 0.1) features.jet_features.frac01+=npf.ptrel; + else if (npf.deltaR < 0.2) features.jet_features.frac02+=npf.ptrel; + else if (npf.deltaR < 0.3) features.jet_features.frac03+=npf.ptrel; + else if (npf.deltaR < 0.4) features.jet_features.frac04+=npf.ptrel; } + features.jet_features.dR2Mean = dR2Mean/pt2Sum; features.jet_features.numberCpf = features.cpf_features.size(); features.jet_features.numberNpf = features.npf_features.size();