-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAnalyserSimpleExample.cc
77 lines (61 loc) · 2.7 KB
/
AnalyserSimpleExample.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "Analysis/Tools/interface/Analyser.h"
// this example is a dijet analysis in which the leading jet
// is required to have a muon, and both of the leading
// jets are btagged
using namespace std;
using namespace analysis;
using namespace analysis::tools;
int main(int argc, char ** argv)
{
TH1::SetDefaultSumw2(); // proper treatment of errors when scaling histograms
Analyser analyser(argc,argv);
// HISTOGRAMS
// create some predefined jet histograms
analyser.jetHistograms(2,"initial");
analyser.jetHistograms(2,"final");
// create some predefined muon histograms
// muon histograms still not available
for ( int i = 0 ; i < analyser.nEvents() ; ++i )
{
if ( ! analyser.event(i) ) continue;
// MUONS pre-selection
// muon identification selection
if ( ! analyser.selectionMuonId() ) continue;
if ( ! analyser.selectionNMuons() ) continue;
// JETS pre-selection
// jet identification selection
if ( ! analyser.selectionJetId() ) continue;
if ( ! analyser.selectionJetPileupId() ) continue;
if ( ! analyser.selectionNJets() ) continue;
analyser.fillJetHistograms("initial");
// CORRECTIONS
// b energy regression
if ( analyser.config()->bRegression() ) analyser.actionApplyBjetRegression();
// Jet energy resolution smearing
analyser.actionApplyJER();
// MAIN SELECTION
// JETS
// 1st and 2nd jet kinematic selection, pt and eta
if ( ! analyser.selectionJet(1) ) continue;
if ( ! analyser.selectionJet(2) ) continue;
// delta R jet selection
if ( ! analyser.selectionJetDr(1,2) ) continue;
// btag of two leading jets
if ( ! analyser.selectionBJet(1) ) continue; analyser.actionApplyBtagSF(1);
if ( ! analyser.selectionBJet(2) ) continue; analyser.actionApplyBtagSF(2);
// MUON
// muon kinematic selection
if ( ! analyser.selectionMuons() ) continue;
// TRIGGER selection
if ( ! analyser.selectionL1 () ) continue; // to be used mainly in case of "OR" of seeds
if ( ! analyser.selectionHLT() ) continue;
// jets 1 and 2 matching to online jets and btag
if ( ! analyser.onlineJetMatching(1) ) continue;
if ( ! analyser.onlineJetMatching(2) ) continue;
if ( ! analyser.onlineBJetMatching({1,2,3},2)) continue;
// muon trigger matching
if ( ! analyser.onlineMuonMatching() ) continue;
// HISTOGRAMS
analyser.fillJetHistograms("final");
} //end event loop
} // end main