Skip to content

Commit

Permalink
Update jet ID to recent 2015 values
Browse files Browse the repository at this point in the history
  • Loading branch information
JoramBerger committed Sep 11, 2015
1 parent 8d97188 commit 860aa77
Showing 1 changed file with 38 additions and 11 deletions.
49 changes: 38 additions & 11 deletions KappaAnalysis/interface/Producers/ValidJetsProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class ValidJetsProducerBase: public KappaProducerBase, public ValidPhysicsObject
// first run 2 version identical to run 1 legacy version
ID73X = 3, // new run 2 version identical to ID2014 but change in cmssw 7.3.x fraction definitions
ID73Xtemp = 4, // temporary recommendation for first run 2 events due to ID problems in the forward region
ID73XnoHF = 5, // as temp but invalidate forward jets
ID2015 = 6, // new jet ID for run 2 updated on 2015-09-11
};

static ValidJetsInput ToValidJetsInput(std::string const& validJetsInput)
Expand All @@ -65,9 +67,11 @@ class ValidJetsProducerBase: public KappaProducerBase, public ValidPhysicsObject
if (jetIDVersion == "2010") return JetIDVersion::ID2010;
else if (jetIDVersion == "2014") return JetIDVersion::ID2014;
else if (jetIDVersion == "73x") return JetIDVersion::ID73X;
else if (jetIDVersion == "73xtemp") return JetIDVersion::ID73X;
else if (jetIDVersion == "73xtemp") return JetIDVersion::ID73Xtemp;
else if (jetIDVersion == "73xnohf") return JetIDVersion::ID73XnoHF;
else if (jetIDVersion == "2015") return JetIDVersion::ID2015;
else LOG(FATAL) << "Jet ID version '" << jetIDVersion << "' is not available";
return JetIDVersion::ID73X;
return JetIDVersion::ID2015;
}

ValidJetsProducerBase(std::vector<TJet>* KappaEvent::*jets,
Expand All @@ -94,18 +98,30 @@ class ValidJetsProducerBase: public KappaProducerBase, public ValidPhysicsObject
noID = (jetID == "none");
if (jetID == "medium" && jetIDVersion != JetIDVersion::ID2010)
LOG(WARNING) << "Since 2012, the medium jet ID is not supported officially any longer.";
if (!noID && jetIDVersion != JetIDVersion::ID73X)
if (!noID && (jetIDVersion == JetIDVersion::ID2010 || jetIDVersion == JetIDVersion::ID2014))
LOG(WARNING) << "This jet ID version is not valid for 73X samples.";

maxMuFraction = 1.0f;
maxCEMFraction = 0.99f;
maxFraction = 1.0f;
if (jetID == "tight")
if (jetID == "tight" || jetID == "tightlepveto")
maxFraction = 0.90f;
else if (jetID == "medium")
maxFraction = 0.95f;
else if (jetID == "loose")
maxFraction = 0.99f;
else if (!noID)
LOG(FATAL) << "Jet ID of type '" << jetID << "' not implemented!";
// special rules
if (jetIDVersion == JetIDVersion::ID2014 ||
jetIDVersion == JetIDVersion::ID73X ||
jetIDVersion == JetIDVersion::ID73Xtemp ||
jetIDVersion == JetIDVersion::ID73XnoHF ||
jetIDVersion == JetIDVersion::ID2015 && jetID == "tightlepveto")
{
maxMuFraction = 0.8f;
maxCEMFraction = maxFraction;
}

// add possible quantities for the lambda ntuples consumers
LambdaNtupleConsumer<KappaTypes>::AddIntQuantity("nJets",[](KappaEvent const& event, KappaProduct const& product) {
Expand Down Expand Up @@ -185,21 +201,30 @@ class ValidJetsProducerBase: public KappaProducerBase, public ValidPhysicsObject
validJet = validJet
&& ((*jet)->neutralHadronFraction < maxFraction)
&& ((*jet)->photonFraction + (*jet)->hfEMFraction < maxFraction)
&& ((*jet)->nConstituents > 1);
&& ((*jet)->nConstituents > 1)
&& ((*jet)->muonFraction < maxMuFraction);
if (jetIDVersion == JetIDVersion::ID2010 || jetIDVersion == JetIDVersion::ID2014) // CMSSW <7.3.X
validJet = validJet && ((*jet)->neutralHadronFraction + (*jet)->hfHadronFraction < maxFraction);
if (jetIDVersion != JetIDVersion::ID2010) // definition since 2014
validJet = validJet && ((*jet)->muonFraction < 0.8f);
// for run 2 startup: temporarily no jet ID in forward region
if (jetIDVersion == JetIDVersion::ID73Xtemp && std::abs((*jet)->p4.eta()) > 3.0f)
validJet = true;


// jets, |eta| < 2.4 (tracker)
if (std::abs((*jet)->p4.eta()) <= 2.4f)
{
validJet = validJet
&& ((*jet)->chargedHadronFraction > 0.0f)
&& ((*jet)->nCharged > 0)
&& ((*jet)->electronFraction < maxFraction); // == CEM
&& ((*jet)->electronFraction < maxCEMFraction); // == CEM
}
// for run 2 startup: temporarily no jet ID in forward region
if (jetIDVersion == JetIDVersion::ID73Xtemp && std::abs((*jet)->p4.eta()) > 3.0f)
validJet = true;
if (jetIDVersion == JetIDVersion::ID73XnoHF && std::abs((*jet)->p4.eta()) > 3.0f)
validJet = false;
// for run 2: new jet ID in forward region
if (jetIDVersion == JetIDVersion::ID2015 && std::abs((*jet)->p4.eta()) > 3.0f)
{
validJet = ((*jet)->photonFraction + (*jet)->hfEMFraction < 0.90f)
&& ((*jet)->nConstituents - (*jet)->nCharged > 10);
}
// ability to apply no jet ID
validJet = validJet || noID;
Expand Down Expand Up @@ -243,6 +268,8 @@ class ValidJetsProducerBase: public KappaProducerBase, public ValidPhysicsObject
ValidJetsInput validJetsInput;
JetIDVersion jetIDVersion;
float maxFraction;
float maxMuFraction;
float maxCEMFraction;
};


Expand Down

2 comments on commit 860aa77

@claria
Copy link
Contributor

@claria claria commented on 860aa77 Sep 15, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JoramBerger,

your commit produces the following warning when compiling Artus.

/nfs/dust/cms/user/gsieber/dijetana/ana/CMSSW_7_2_3/src/Artus/KappaAnalysis/interface/Producers/ValidJetsProducer.h:119:47: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
jetIDVersion == JetIDVersion::ID73XnoHF ||
^

@JoramBerger
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c42f519

Please sign in to comment.