1 |
+ |
#include "TriggerUtilsBits.h" |
2 |
|
#include "PassHLT.h" |
3 |
< |
#include "EWKAnaDefs.hh" |
3 |
> |
#include <assert.h> |
4 |
> |
#include <bitset> |
5 |
> |
#include <iostream> |
6 |
> |
using namespace std; |
7 |
> |
|
8 |
> |
|
9 |
> |
bool passHLTSingleMuon(std::bitset<TRIGGER_BIG_NUMBER> triggerBits) { |
10 |
> |
if ( triggerBits.test(kHLT_Mu8) || |
11 |
> |
triggerBits.test(kHLT_Mu12) || |
12 |
> |
triggerBits.test(kHLT_Mu15) || |
13 |
> |
triggerBits.test(kHLT_Mu24) || |
14 |
> |
triggerBits.test(kHLT_Mu30) ) |
15 |
> |
return true; |
16 |
> |
return false; |
17 |
> |
} |
18 |
> |
|
19 |
> |
//-------------------------------------------------------------------------- |
20 |
> |
// for sync ... |
21 |
> |
bool passHLTMC(std::bitset<TRIGGER_BIG_NUMBER> triggerBits, |
22 |
> |
unsigned runNum, |
23 |
> |
unsigned channel, |
24 |
> |
EMCYear mc_year) |
25 |
> |
//-------------------------------------------------------------------------- |
26 |
> |
{ |
27 |
|
|
28 |
< |
bool passHLT(uint64_t triggerBits, unsigned runNum, unsigned channel) { |
28 |
> |
assert(mc_year == k2011_MC || mc_year == k2012_MC); |
29 |
> |
|
30 |
> |
bool pass = false; |
31 |
> |
|
32 |
> |
if(mc_year == k2011_MC){ |
33 |
> |
|
34 |
> |
//electron trigger |
35 |
> |
if ( triggerBits.test(kHLT_Ele17_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL_Ele8_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL) ) |
36 |
> |
pass = true; |
37 |
> |
|
38 |
> |
//muon trigger |
39 |
> |
if( triggerBits.test(kHLT_Mu17_Mu8) ) |
40 |
> |
pass = true; |
41 |
> |
|
42 |
> |
//cross triggers |
43 |
> |
|
44 |
> |
} |
45 |
> |
|
46 |
> |
if(mc_year == k2012_MC){ |
47 |
> |
|
48 |
> |
//electron trigger |
49 |
> |
if ( triggerBits.test(kHLT_Ele17_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL_Ele8_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL) ) |
50 |
> |
pass = true; |
51 |
> |
|
52 |
> |
//muon trigger |
53 |
> |
if( triggerBits.test(kHLT_Mu17_Mu8) || triggerBits.test(kHLT_Mu17_TkMu8)) |
54 |
> |
pass = true; |
55 |
> |
|
56 |
> |
//cross triggers |
57 |
> |
if( triggerBits.test(kHLT_Mu8_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL) || triggerBits.test(kHLT_Mu17_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL)) |
58 |
> |
pass = true; |
59 |
> |
|
60 |
> |
} |
61 |
> |
|
62 |
> |
return pass; |
63 |
> |
} |
64 |
> |
|
65 |
> |
|
66 |
> |
//-------------------------------------------------------------------------- |
67 |
> |
bool passHLT(std::bitset<TRIGGER_BIG_NUMBER> triggerBits, |
68 |
> |
unsigned runNum, |
69 |
> |
unsigned channel) |
70 |
> |
//-------------------------------------------------------------------------- |
71 |
> |
{ |
72 |
|
|
73 |
|
bool isMC = false; |
74 |
|
bool pass = false; |
77 |
|
// Electrons |
78 |
|
// |
79 |
|
// if( channel == 0 || channel == 2 ) { |
80 |
< |
// if ( runNum >= 160404 && runNum <= 167151 ) { // may10 & PRv4 |
81 |
< |
if ( runNum >= 160404 && runNum <= 170826 ) { // may10 & PRv4 |
82 |
< |
if ( triggerBits & kHLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL) |
83 |
< |
pass = true; |
84 |
< |
} |
85 |
< |
if ( runNum > 170826) { // aug05 & PRv6 |
86 |
< |
if ( triggerBits & kHLT_Ele17_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL_Ele8_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL ) |
87 |
< |
pass = true; |
88 |
< |
} |
89 |
< |
// } |
80 |
> |
// if ( runNum >= 160404 && runNum <= 167151 ) { // may10 & PRv4 |
81 |
> |
if(runNum < 160404) { |
82 |
> |
pass = true; //punt for now, Si doesn't have the needed triggers |
83 |
> |
} |
84 |
> |
if ( runNum >= 160404 && runNum <= 170826 ) { // may10 & PRv4 |
85 |
> |
if ( triggerBits.test(kHLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL)) |
86 |
> |
pass = true; |
87 |
> |
} |
88 |
> |
if ( runNum > 170826 ) { // aug05 & PRv6 |
89 |
> |
if ( triggerBits.test(kHLT_Ele17_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL_Ele8_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL) ) |
90 |
> |
pass = true; |
91 |
> |
} |
92 |
> |
|
93 |
> |
// 58 pb-1 had a prescale issue, run range is 171050-171578 |
94 |
> |
// they allow electron evts to pass kHLT_Ele17_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_SC8_Mass30 in this period |
95 |
> |
if (runNum >= 171050 && runNum <= 171578 ) { |
96 |
> |
if( triggerBits.test(kHLT_Ele17_CaloIdVT_CaloIsoVT_TrkIdT_TrkIsoVT_SC8_Mass30) ) |
97 |
> |
pass=true; |
98 |
> |
} |
99 |
|
|
100 |
+ |
|
101 |
|
// |
102 |
|
// Muons |
103 |
|
// |
104 |
< |
// if( channel == 1 || channel == 2 ){ |
105 |
< |
if( runNum >= 136033 && runNum <= 149942 ) { // april11 (2010) |
106 |
< |
// don't have DoubleMu3 in the ntuple |
107 |
< |
// if( triggerBits & kHLT_DoubleMu3 ) pass = true; |
108 |
< |
} |
109 |
< |
if( runNum >= 160404 && runNum <= 163869 ) { // may10 |
110 |
< |
if( triggerBits & kHLT_DoubleMu7 ) |
111 |
< |
pass = true; |
112 |
< |
} |
113 |
< |
if( runNum >= 165088 ) { // PRv4 and on .... |
37 |
< |
if( triggerBits & kHLT_Mu17_Mu8 ) |
104 |
> |
// if( channel == 1 || channel == 2 ){ |
105 |
> |
if(runNum < 160404) { |
106 |
> |
pass = true; //punt for now, Si doesn't have the needed triggers |
107 |
> |
} |
108 |
> |
if( runNum >= 136033 && runNum <= 149942 ) { // april11 (2010) |
109 |
> |
// don't have DoubleMu3 in the ntuple |
110 |
> |
// if( triggerBits & kHLT_DoubleMu3 ) pass = true; |
111 |
> |
} |
112 |
> |
if( runNum >= 160404 && runNum <= 163869 ) { // may10 |
113 |
> |
if( triggerBits.test(kHLT_DoubleMu7) ) |
114 |
|
pass = true; |
115 |
< |
} |
116 |
< |
// } |
115 |
> |
} |
116 |
> |
if( runNum >= 165088 ) { // PRv4 and on .... |
117 |
> |
if( triggerBits.test(kHLT_Mu13_Mu8) ) |
118 |
> |
pass = true; |
119 |
> |
} |
120 |
> |
// } |
121 |
|
|
122 |
|
return pass; |
123 |
|
}; |
124 |
+ |
//---------------------------------------------------------------------------------------- |
125 |
+ |
bool passHLTEMU(ControlFlags &ctrl, std::bitset<TRIGGER_BIG_NUMBER> triggerBits) |
126 |
+ |
//-------------------------------------------------------------------------- |
127 |
+ |
{ |
128 |
+ |
if(ctrl.debug) cout << "testing bits for emu..." << endl; |
129 |
+ |
bool pass = false; |
130 |
+ |
// double electron dset |
131 |
+ |
if( triggerBits.test(kHLT_Ele17_CaloIdL_CaloIsoVL) ) { if(ctrl.debug) cout << "\tpasses kHLT_Ele17_CaloIdL_CaloIsoVL" << endl; pass = true; } |
132 |
+ |
if( triggerBits.test(kHLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL) ) { if(ctrl.debug) cout << "\tpasses kHLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL" << endl;pass = true; } |
133 |
+ |
// single electron dset |
134 |
+ |
if( triggerBits.test(kHLT_Ele22_CaloIdL_CaloIsoVL) ) { if(ctrl.debug) cout << "\tpasses kHLT_Ele22_CaloIdL_CaloIsoVL" << endl; pass = true; } |
135 |
+ |
if( triggerBits.test(kHLT_Ele27_WP80_PFMET_MT50) ) { if(ctrl.debug) cout << "\tpasses kHLT_Ele27_WP80_PFMET_MT50" << endl; pass = true; } |
136 |
+ |
if( triggerBits.test(kHLT_Ele27_WP80) ) { if(ctrl.debug) cout << "\tpasses kHLT_Ele27_WP80" << endl; pass = true; } |
137 |
+ |
// single mudset |
138 |
+ |
if( triggerBits.test(kHLT_Mu12) ) { if(ctrl.debug) cout << "\tpasses kHLT_Mu12" << endl; pass = true; } |
139 |
+ |
if( triggerBits.test(kHLT_Mu15_eta2p1) ) { if(ctrl.debug) cout << "\tpasses kHLT_Mu15_eta2p1" << endl; pass = true; } |
140 |
+ |
if( triggerBits.test(kHLT_Mu24_eta2p1) ) { if(ctrl.debug) cout << "\tpasses kHLT_Mu24_eta2p1" << endl; pass = true; } |
141 |
+ |
if( triggerBits.test(kHLT_Mu24) ) { if(ctrl.debug) cout << "\tpasses kHLT_Mu24" << endl; pass = true; } |
142 |
+ |
// double mu dset |
143 |
+ |
if( triggerBits.test(kHLT_Mu17) ) { if(ctrl.debug) cout << "\tpasses kHLT_Mu17" << endl; pass = true; } |
144 |
|
|
45 |
– |
|
46 |
– |
|
47 |
– |
|
48 |
– |
bool passHLTMC(uint64_t triggerBits) { |
49 |
– |
|
50 |
– |
bool pass=false; |
51 |
– |
if( triggerBits & kHLT_DoubleMu7 || |
52 |
– |
triggerBits & kHLT_DoubleMu6 || |
53 |
– |
triggerBits & kHLT_Mu5 ) { |
54 |
– |
pass = true; |
55 |
– |
} else if ( triggerBits & kHLT_Ele17_CaloIdL_CaloIsoVL_Ele8_CaloIdL_CaloIsoVL || |
56 |
– |
triggerBits & kHLT_Ele27_CaloIdVT_CaloIsoT_TrkIdT_TrkIsoT || |
57 |
– |
triggerBits & kHLT_Ele8 || |
58 |
– |
triggerBits & kHLT_Ele8_CaloIdL_CaloIsoVL || |
59 |
– |
triggerBits & kHLT_Ele17_CaloIdL_CaloIsoVL || |
60 |
– |
triggerBits & kHLT_Ele8_CaloIdT_TrkIdVL_CaloIsoVL_TrkIsoVL ) { |
61 |
– |
pass = true; |
62 |
– |
} |
145 |
|
return pass; |
146 |
< |
}; |
65 |
< |
|
66 |
< |
|
146 |
> |
} |