Skip to content

Commit

Permalink
Update KBasicJet
Browse files Browse the repository at this point in the history
Two energy fractions are removed as they are redundant:
neutralEMFraction = photonFraction + HFEMFraction
chargedEMFraction = electronFraction
Use floats as the reco format also uses floats.
  • Loading branch information
JoramBerger committed Nov 30, 2014
1 parent 93d17b3 commit ab8740d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 22 deletions.
10 changes: 5 additions & 5 deletions DataFormats/interface/KJetMET.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ typedef std::vector<KCaloJet> KCaloJets;

struct KBasicJet : public KLV
{
double area;
float neutralEMFraction, chargedEMFraction;
float neutralHadFraction, chargedHadFraction;
float area;

float neutralHadronFraction, chargedHadronFraction;
float muonFraction, photonFraction, electronFraction;
float HFHadFraction, HFEMFraction;
float hfHadronFraction, hfEMFraction;

int nConst, nCharged;
int nConstituents, nCharged;
};
typedef std::vector<KBasicJet> KBasicJets;

Expand Down
7 changes: 4 additions & 3 deletions DataFormats/test/KDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ std::ostream &operator<<(std::ostream &os, const KCaloJet &jet)
std::ostream &operator<<(std::ostream &os, const KBasicJet &jet)
{
os << static_cast<const KLV>(jet) << std::endl;
os << "\tCharged (em,had): " << jet.chargedEMFraction << ", " << jet.chargedHadFraction << std::endl;
os << "\tNeutral (em,had): " << jet.neutralEMFraction << ", " << jet.neutralHadFraction << std::endl;
return os << "\t#Const=" << jet.nConst << " #Charged=" << jet.nCharged << " area=" << jet.area;
os << "\tCHF=" << jet.chargedHadronFraction << " NHF=" << jet.neutralHadronFraction << std::endl;
os << "\teF=" << jet.electronFraction << " photF=" << jet.photonFraction << " muF=" << jet.muonFraction << std::endl;
os << "\tHFHadF=" << jet.hfHadronFraction << " HFEMF=" << jet.hfEMFraction << std::endl;
return os << "\tnConst=" << jet.nConstituents << " nCharged=" << jet.nCharged << " area=" << jet.area;
}

std::ostream &operator<<(std::ostream &os, const KJet &jet)
Expand Down
12 changes: 5 additions & 7 deletions Producers/interface/KBasicJetProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ class KBasicJetProducer : public KBaseMultiLVProducer<reco::PFJetCollection, std
copyP4(in, out.p4);

out.area = in.jetArea();
out.nConst = in.nConstituents();
out.nConstituents = in.nConstituents();
out.nCharged = in.chargedMultiplicity();
out.neutralEMFraction = in.neutralEmEnergyFraction();
out.chargedEMFraction = in.chargedEmEnergyFraction();
out.neutralHadFraction = in.neutralHadronEnergyFraction();
out.chargedHadFraction = in.chargedHadronEnergyFraction();
out.neutralHadronFraction = in.neutralHadronEnergyFraction();
out.chargedHadronFraction = in.chargedHadronEnergyFraction();
out.muonFraction = in.muonEnergyFraction();
out.photonFraction = in.photonEnergyFraction();
out.electronFraction = in.electronEnergyFraction();
out.HFHadFraction = in.HFHadronEnergyFraction();
out.HFEMFraction = in.HFEMEnergyFraction();
out.hfHadronFraction = in.HFHadronEnergyFraction();
out.hfEMFraction = in.HFEMEnergyFraction();
}
};

Expand Down
12 changes: 5 additions & 7 deletions Producers/interface/KJetProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,15 @@ class KJetProducer : public KBaseMultiLVProducer<reco::PFJetCollection, KJets>
copyP4(in, out.p4);

out.area = in.jetArea();
out.nConst = in.nConstituents();
out.nConstituents = in.nConstituents();
out.nCharged = in.chargedMultiplicity();
out.neutralEMFraction = in.neutralEmEnergyFraction();
out.chargedEMFraction = in.chargedEmEnergyFraction();
out.neutralHadFraction = in.neutralHadronEnergyFraction();
out.chargedHadFraction = in.chargedHadronEnergyFraction();
out.neutralHadronFraction = in.neutralHadronEnergyFraction();
out.chargedHadronFraction = in.chargedHadronEnergyFraction();
out.muonFraction = in.muonEnergyFraction();
out.photonFraction = in.photonEnergyFraction();
out.electronFraction = in.electronEnergyFraction();
out.HFHadFraction = in.HFHadronEnergyFraction();
out.HFEMFraction = in.HFEMEnergyFraction();
out.hfHadronFraction = in.HFHadronEnergyFraction();
out.hfEMFraction = in.HFEMEnergyFraction();
}

private:
Expand Down

0 comments on commit ab8740d

Please sign in to comment.