Skip to content

Commit

Permalink
Merge pull request #28 from robervalwalsh/develop
Browse files Browse the repository at this point in the history
example for jet trigger efficiency with tag and probe
  • Loading branch information
robervalwalsh authored Feb 1, 2021
2 parents e2347a6 + 760c2f6 commit f226614
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<use name="Analysis/Tools" />
<use name="Analysis/Trigger" />


<bin name="JetTriggerEffTandP" file="JetTriggerEffTandP.cc">
<flags LDFLAGS="-lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lz -pthread -lm -ldl -rdynamic"/>
</bin>



<bin name="OnlineBtagExperience" file="OnlineBtagExperience.cc">
<flags LDFLAGS="-lCore -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -lz -pthread -lm -ldl -rdynamic"/>
</bin>
Expand Down
59 changes: 59 additions & 0 deletions bin/JetTriggerEffTandP.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#include "Analysis/Tools/interface/Analyser.h"

using namespace analysis;
using namespace analysis::tools;

int main(int argc, char ** argv)
{
TH1::SetDefaultSumw2(); // proper treatment of errors when scaling histograms

// construct your analyser
Analyser analyser(argc,argv);

analyser.jetHistograms("tandp_selection");
analyser.jetHistograms("tandp_probe_matched");


for ( int i = 0 ; i < analyser.nEvents() ; ++i )
{
if ( ! analyser.event(i) ) continue; // read event, run selection/json
if ( ! analyser.triggerSelection () ) continue; // trigger
if ( ! analyser.preselection() ) continue; // preselection - particle id's
if ( ! analyser.jetCorrections() ) continue; // jet corrections

// select events according to # jets criteria in the config file
if ( ! analyser.selectionNJets() ) continue;
// select events according to criteria for the leading and pr2nd leading jets kinematics
if ( ! analyser.selectionJet(1) ) continue;
if ( ! analyser.selectionJet(2) ) continue;
// select events according to delta_phi criteria in the config file
if ( ! analyser.selectionJetDphi(1,2) ) continue;

///////////////////////////////////
// TO DO: veto events with a third jet
///////////////////////////////////

// Assuming the tag to be the leading jet,
// select events according to matching the leading jet to online objects defined in the config file
if ( ! analyser.onlineJetMatching(1) ) continue;

// Fill predefined histograms for the event selection
// In the directory 'selection', the histograms for jet 2 correspond probe jets
analyser.fillJetHistograms("tandp_selection");

// select events where the 2nd jet has a match to the online objects defined in the configuration
if ( ! analyser.onlineJetMatching(2) ) continue;
// Fill predefined histograms for the event selection after the probe jets are matched to online objects
// In the directory 'selection_probe_matched', the histograms for jet 2 are those for the probe jets after matching to online
analyser.fillJetHistograms("tandp_probe_matched");



//

}
} // end main




56 changes: 56 additions & 0 deletions test/jet_trigger_eff_tp.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[Info]
process = MssmHbb
eventsMax = 500000

# # == Monte Carlo ==
# ntuplesList = tools:mssmhbb-2017-v4/mc/SUSYGluGluToBBHToBB_M-200_rootFileList.txt
# isMC = true
# output = histograms_semilep_MH-200_2017-v4_test.root
# nloMC = true
# signalRegion = true

# == Data ==
ntuplesList = tools:mssmhbb-2017-v4/data/JetHT_Run2017C_rootFileList.txt
isMC = false
output = histograms_online_jet_eff.root
signalRegion = false
json = tools:2017/certified/Cert_294927-306462_13TeV_EOY2017ReReco_Collisions17_JSON.txt


[Trigger]
results = TriggerResults
hltPath = HLT_PFJet60_v

[Trigger.Objects]
directory = slimmedPatTrigger
Jets.L1 = hltL1sSingleJet35
Jets.Calo = hltSingleCaloJet40
Jets.PF = hltSinglePFJet60
#
#

[Jets]
jets = updatedPatJets
nMin = 2
id = tight
puId = loose
ptMin = 60
ptMax = -1
ptMin = 60
ptMax = 120
etaMax = 2.2
etaMax = 2.2
dPhiMin = 2.1


[Generator]
genParticles = prunedGenParticles
genJets = slimmedGenJets

### 2017
[Corrections]
Jets.jerPtRes = tools:2017/jer/Fall17_V3_MC_PtResolution_AK4PFchs.txt
Jets.jerSF = tools:2017/jer/Fall17_V3_MC_SF_AK4PFchs.txt
Pileup.reweight = tools:2017/pileup/PileupWeight_Run2017_Mix_2017.root


0 comments on commit f226614

Please sign in to comment.