Skip to content

Commit

Permalink
fix substructure
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-komm authored and matt-komm committed Nov 17, 2020
1 parent 17186f5 commit 739f5bb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 0 additions & 2 deletions DataFormats/interface/ElectronCandidateFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ struct ElectronCandidateFeatures {
int ndof;
float chi2;
int numberOfBrems;
float trackFbrem;
float fbrem;

// Isolation block
Expand Down Expand Up @@ -178,7 +177,6 @@ struct ElectronCandidateFeatures {
ndof(0),
chi2(0),
numberOfBrems(0),
trackFbrem(0),
fbrem(0),

// Isolation block
Expand Down
1 change: 0 additions & 1 deletion NANOProducer/plugins/NANOProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ NANOProducer::NANOProducer(const edm::ParameterSet& iConfig) :
PROPERTY(llpdnnx::ElectronCandidateFeatures, ndof, "doc"),
PROPERTY(llpdnnx::ElectronCandidateFeatures,chi2, "doc"),
PROPERTY(llpdnnx::ElectronCandidateFeatures, numberOfBrems, "doc"),
PROPERTY(llpdnnx::ElectronCandidateFeatures,trackFbrem, "doc"),
PROPERTY(llpdnnx::ElectronCandidateFeatures,fbrem, "doc"),

// Isolation block
Expand Down
2 changes: 1 addition & 1 deletion XTagInfoProducer/interface/JetSubstructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class JetSubstructure

//default values from https://cmssdt.cern.ch/lxr/source/RecoJets/JetProducers/python/nJettinessAdder_cfi.py except R=0.8 -> 0.4
double nSubjettiness(
int n,
size_t n,
const fastjet::contrib::AxesDefinition& axisDef = fastjet::contrib::OnePass_KT_Axes(),
const fastjet::contrib::MeasureDefinition& measureDef = fastjet::contrib::NormalizedMeasure(1.0, 0.4)
) const;
Expand Down
2 changes: 2 additions & 0 deletions XTagInfoProducer/plugins/XTagInfoProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ XTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
cpf_features.ptrel = constituent->pt()/uncorrectedPt;
cpf_features.deta = constituent->eta()-jet.eta();
cpf_features.dphi = reco::deltaPhi(constituent->phi(),jet.phi());
cpf_features.deltaR = reco::deltaR(*constituent,jet);

cpf_features.px = constituent->px();
cpf_features.py = constituent->py();
Expand Down Expand Up @@ -729,6 +730,7 @@ XTagInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
elec_features.elecSC_eSuperClusterOverP = electron.eSuperClusterOverP();

elec_features.neutralHadronIso = electron.neutralHadronIso()/electron.pt();
elec_features.particleIso = electron.particleIso()/electron.pt();
elec_features.photonIso = electron.photonIso()/electron.pt();
elec_features.puChargedHadronIso = electron.puChargedHadronIso()/electron.pt();

Expand Down
11 changes: 6 additions & 5 deletions XTagInfoProducer/src/JetSubstructure.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ JetSubstructure::JetSubstructure(const reco::Jet& jet)
for(unsigned int iconstituent = 0; iconstituent < jet.numberOfDaughters(); ++iconstituent)
{
const reco::Candidate* constituent = jet.daughter(iconstituent);
if((constituent->energy() < 1e-10) or (constituent->mass()<1e-10))
if((constituent->energy() < 1e-10) or (constituent->energy() > 1e5) or (constituent->mass()<0) or std::fabs(constituent->eta())>1e3)
{
continue;
}
Expand All @@ -30,7 +30,7 @@ JetSubstructure::JetSubstructure(const fastjet::PseudoJet& jet)
TLorentzVector jetVectorFromConsituents(0,0,0,0);
for(auto const& constituent: jet.constituents())
{
if((constituent.e()<1e-10) or (constituent.m()<1e-10))
if((constituent.e()<1e-10) or (constituent.e() > 1e5) or (constituent.m()<0) or std::fabs(constituent.eta())>1e3)
{
continue;
}
Expand Down Expand Up @@ -119,11 +119,12 @@ std::vector<fastjet::PseudoJet> JetSubstructure::reclusterExclusive(
}

double JetSubstructure::nSubjettiness(
int n,
size_t n,
const fastjet::contrib::AxesDefinition& axisDef,
const fastjet::contrib::MeasureDefinition& measureDef
) const
{
if (consituents_.size()<(n+1)) return 0;
fastjet::contrib::Njettiness njettiness(axisDef,measureDef);
return njettiness.getTau(n, consituents_);
}
Expand Down Expand Up @@ -217,7 +218,7 @@ double JetSubstructure::thrust(bool boostToCM) const
double JetSubstructure::relMassDropMass(ClusterType type, double r, double muCut, double yCut) const
{
if (massFromConstituents_<1e-10) return 0;
if (consituents_.size()<2) return 0;
if (consituents_.size()<3) return 0;

fastjet::ClusterSequence clusterSequence(consituents_, makeJetDefinition(type,r));
std::vector<fastjet::PseudoJet> reclusteredJets = fastjet::sorted_by_pt(
Expand All @@ -237,7 +238,7 @@ double JetSubstructure::relMassDropMass(ClusterType type, double r, double muCut
double JetSubstructure::relSoftDropMass(ClusterType type, double r, double zCut, double beta) const
{
if (massFromConstituents_<1e-10) return 0;
if (consituents_.size()<2) return 0;
if (consituents_.size()<3) return 0;

fastjet::ClusterSequence clusterSequence(consituents_, makeJetDefinition(type,r));
std::vector<fastjet::PseudoJet> reclusteredJets = fastjet::sorted_by_pt(
Expand Down

0 comments on commit 739f5bb

Please sign in to comment.