Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jet pileup ID variables #136

Open
wants to merge 1 commit into
base: 10_6_X
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions interface/JetInfoBranches.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ class JetInfoBranches {
int Jet_nLastSE[nMaxJets_];
int Jet_looseID[nMaxJets_];
int Jet_tightID[nMaxJets_];
int Jet_pileup_looseID[nMaxJets_];
int Jet_pileup_mediumID[nMaxJets_];
int Jet_pileup_tightID[nMaxJets_];
int Jet_FatJetIdx[nMaxJets_];
float Jet_ptSoftDrop[nMaxJets_];
float Jet_etaSoftDrop[nMaxJets_];
Expand Down Expand Up @@ -711,6 +714,9 @@ class JetInfoBranches {

if(variableParser.isToBeStored(name+"Jet_looseID")) tree->Branch((name+"Jet_looseID").c_str(), Jet_looseID ,(name+"Jet_looseID["+name+"nJet]/I").c_str());
if(variableParser.isToBeStored(name+"Jet_tightID")) tree->Branch((name+"Jet_tightID").c_str(), Jet_tightID ,(name+"Jet_tightID["+name+"nJet]/I").c_str());
if(variableParser.isToBeStored(name+"Jet_pileup_looseID")) tree->Branch((name+"Jet_pileup_looseID").c_str(), Jet_pileup_looseID ,(name+"Jet_pileup_looseID["+name+"nJet]/I").c_str());
if(variableParser.isToBeStored(name+"Jet_pileup_mediumID")) tree->Branch((name+"Jet_pileup_mediumID").c_str(), Jet_pileup_mediumID ,(name+"Jet_pileup_mediumID["+name+"nJet]/I").c_str());
if(variableParser.isToBeStored(name+"Jet_pileup_tightID")) tree->Branch((name+"Jet_pileup_tightID").c_str(), Jet_pileup_tightID ,(name+"Jet_pileup_tightID["+name+"nJet]/I").c_str());

//test variables for AK4 jets: clean up in the future
if(variableParser.isToBeStored(name+"Jet_trackSip2dSig_AboveBottom_0")) tree->Branch((name+"Jet_trackSip2dSig_AboveBottom_0").c_str(), Jet_trackSip2dSig_AboveBottom_0 ,(name+"Jet_trackSip2dSig_AboveBottom_0["+name+"nJet]/F").c_str() );
Expand Down Expand Up @@ -1377,6 +1383,9 @@ class JetInfoBranches {

if(variableParser.isToBeStored(name+"Jet_looseID")) tree->SetBranchAddress((name+"Jet_looseID").c_str(), Jet_looseID );
if(variableParser.isToBeStored(name+"Jet_tightID")) tree->SetBranchAddress((name+"Jet_tightID").c_str(), Jet_tightID );
if(variableParser.isToBeStored(name+"Jet_pileup_looseID")) tree->SetBranchAddress((name+"Jet_pileup_looseID").c_str(), Jet_pileup_looseID );
if(variableParser.isToBeStored(name+"Jet_pileup_mediumID")) tree->SetBranchAddress((name+"Jet_pileup_mediumID").c_str(), Jet_pileup_mediumID );
if(variableParser.isToBeStored(name+"Jet_pileup_tightID")) tree->SetBranchAddress((name+"Jet_pileup_tightID").c_str(), Jet_pileup_tightID );

//test variables for AK4 jets: clean up in the future
if(variableParser.isToBeStored(name+"Jet_trackSip2dSig_AboveBottom_0")) tree->SetBranchAddress((name+"Jet_trackSip2dSig_AboveBottom_0").c_str(), Jet_trackSip2dSig_AboveBottom_0 );
Expand Down
5 changes: 5 additions & 0 deletions plugins/BTagAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1889,6 +1889,11 @@ void BTagAnalyzerT<IPTI,VTX>::processJets(const edm::Handle<PatJetCollection>& j
retpf.set(false);
JetInfo[iJetColl].Jet_tightID[JetInfo[iJetColl].nJet] = ( ( nJECSets>0 && pjet->isPFJet() ) ? ( pfjetIDTight_( *pjet, retpf ) ? 1 : 0 ) : 0 );

// PF pileup Jet ID
JetInfo[iJetColl].Jet_pileup_tightID[JetInfo[iJetColl].nJet] = (pjet->userInt("pileupJetId:fullId")& (1 << 0)) or (pjet->pt()>50);
JetInfo[iJetColl].Jet_pileup_mediumID[JetInfo[iJetColl].nJet] = (pjet->userInt("pileupJetId:fullId")& (1 << 1)) or (pjet->pt()>50);
JetInfo[iJetColl].Jet_pileup_looseID[JetInfo[iJetColl].nJet] = (pjet->userInt("pileupJetId:fullId")& (1 << 2)) or (pjet->pt()>50);

JetInfo[iJetColl].Jet_jes[JetInfo[iJetColl].nJet] = ( nJECSets>0 ? pjet->pt()/pjet->correctedJet("Uncorrected").pt() : 1. );
JetInfo[iJetColl].Jet_residual[JetInfo[iJetColl].nJet] = ( nJECSets>0 ? pjet->pt()/pjet->correctedJet("L3Absolute").pt() : 1. );
JetInfo[iJetColl].Jet_uncorrpt[JetInfo[iJetColl].nJet] = ( nJECSets>0 ? pjet->correctedJet("Uncorrected").pt() : pjet->pt());
Expand Down
26 changes: 25 additions & 1 deletion python/variables_cfi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

#Only variables that are present in this list, can be stored in the output ntuple.
#Prefixes do not have to be given here, theses will be handled automatically
#Prefixes do not have to be given here, these will be handled automatically
#Suffixes have to be introduced by inserting an additional PSet. See for example Jet_nSubJets and Jet_nSubJets_SoftDropPuppi

#To obtain an overview (alphabetically sorted by name) of the included variables, run the print_vars.py script in the same directory
Expand Down Expand Up @@ -2350,6 +2350,30 @@
requires = cms.vstring("nJet"),
runOptions = cms.vstring("runJetVariables"),
),
cms.PSet(
variable = cms.string("Jet_pileup_looseID"),
store = cms.bool(False),
mconly = cms.bool(False),
description = cms.string("Jet_pileup_looseID"),
requires = cms.vstring("nJet"),
runOptions = cms.vstring("runJetVariables"),
),
cms.PSet(
variable = cms.string("Jet_pileup_mediumID"),
store = cms.bool(False),
mconly = cms.bool(False),
description = cms.string("Jet_pileup_mediumID"),
requires = cms.vstring("nJet"),
runOptions = cms.vstring("runJetVariables"),
),
cms.PSet(
variable = cms.string("Jet_pileup_tightID"),
store = cms.bool(False),
mconly = cms.bool(False),
description = cms.string("Jet_pileup_tightID"),
requires = cms.vstring("nJet"),
runOptions = cms.vstring("runJetVariables"),
),
cms.PSet(
variable = cms.string("Jet_FatJetIdx"),
store = cms.bool(False),
Expand Down