1 |
|
#include <iostream> |
2 |
|
#include <math.h> |
3 |
|
#include "HZZCiCElectronSelection.h" |
4 |
+ |
#include "ParseArgs.h" |
5 |
+ |
#include "SelectionStatus.h" |
6 |
|
|
7 |
|
using namespace std; |
8 |
|
|
71 |
|
return 0xDEADDEAD; |
72 |
|
}; |
73 |
|
|
74 |
+ |
SelectionStatus electronPreSelectionCic(ControlFlags &ctrl, const mithep::TElectron *electron) { |
75 |
+ |
|
76 |
+ |
bool ret=true; |
77 |
+ |
|
78 |
+ |
// |
79 |
+ |
// this is baseline |
80 |
+ |
// |
81 |
+ |
/* |
82 |
+ |
ret &= ( fabs(electron->ip3dSig) < 4 ); |
83 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after IPsig: " << ret << endl; |
84 |
+ |
ret &= ( electron->pt > 7 ); |
85 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after scPt: " << ret << endl; |
86 |
+ |
ret &= ( fabs(electron->scEta) < 2.5 ); |
87 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after scEta: " << ret << endl; |
88 |
+ |
*/ |
89 |
+ |
|
90 |
+ |
// |
91 |
+ |
// this is for UF Z->4l |
92 |
+ |
// |
93 |
+ |
ret &= ( electron->pt > 7 ); |
94 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after scPt: " << ret << endl; |
95 |
+ |
ret &= ( fabs(electron->scEta) < 2.5 ); |
96 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after scEta: " << ret << endl; |
97 |
+ |
ret &= ( electron->corrNExpHitsInner < 2 ); |
98 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after nexp: " << ret << endl; |
99 |
+ |
ret &= ( !electron->isConv ); |
100 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after isconv: " << ret << endl; |
101 |
+ |
ret &= ( fabs(electron->ip3dSig) < 100 ); |
102 |
+ |
if( ctrl.debug ) cout << "elepresel : ret after IPsig: " << ret << endl; |
103 |
+ |
|
104 |
+ |
SelectionStatus status; |
105 |
+ |
if( ret ) status.setStatus(SelectionStatus::PRESELECTION); |
106 |
+ |
return status; |
107 |
+ |
} |
108 |
+ |
|
109 |
+ |
|
110 |
+ |
SelectionStatus failsCicSelection( ControlFlags &ctrl, const mithep::TElectron * ele, CICStruct &cuts ) { |
111 |
|
|
73 |
– |
unsigned failsCicSelection( ControlFlags &ctrl, const mithep::TElectron * ele, CICStruct &cuts, |
74 |
– |
string kinematics) { |
112 |
|
int level=0; |
113 |
|
unsigned failmask=0x0; |
114 |
|
unsigned category = cicCategory(ele); |
135 |
|
|
136 |
|
if( ctrl.debug ) cout << "--> scEt : " << scEt << endl; |
137 |
|
|
101 |
– |
double etcut=0; |
102 |
– |
if ( kinematics == "loose" ) etcut = 5; |
103 |
– |
else if ( kinematics == "tight" ) etcut = 7; |
104 |
– |
else { cout << "kinematics not defined!" << endl; assert(0); } |
105 |
– |
if ( scEt < etcut ) { |
106 |
– |
failmask |= (1<<level); |
107 |
– |
// cout << "failing scET ... " << endl; |
108 |
– |
return failmask; |
109 |
– |
} |
110 |
– |
|
111 |
– |
level++; |
112 |
– |
if ( fabs(scEta) > 2.5 ) { |
113 |
– |
failmask |= (1<<level); |
114 |
– |
// cout << "failing scEta ... " << endl; |
115 |
– |
return failmask; |
116 |
– |
} |
117 |
– |
|
138 |
|
float max_deta, max_dphi, max_HoE, max_sigieie, max_missHits, max_conv; |
139 |
|
float max_IP; |
140 |
|
float min_EoP; // this is a min cut ... maxn_EoP |
222 |
|
// failmask |= (1<<level); |
223 |
|
// } |
224 |
|
|
225 |
< |
return failmask; |
225 |
> |
|
226 |
> |
SelectionStatus ret; |
227 |
> |
|
228 |
> |
if( failmask ) { ret.setStatus(SelectionStatus::FAIL); return ret; } |
229 |
> |
|
230 |
> |
if(ctrl.debug) { |
231 |
> |
cout << "going to return a positive cicID ... " << endl; |
232 |
> |
cout << "\tscheme: " << cuts.scheme << endl; |
233 |
> |
} |
234 |
> |
if( cuts.scheme == CICLoose ) ret.setStatus(SelectionStatus::LOOSEID); |
235 |
> |
// if( cuts.scheme == CiCMedium ) ret.setStatus(SelectionStatus::TIGHTID); |
236 |
> |
else if( cuts.scheme == CICTight ) ret.setStatus(SelectionStatus::TIGHTID); |
237 |
> |
else { |
238 |
> |
cout << "returning undefined " << endl; |
239 |
> |
ret.setStatus(SelectionStatus::UNDEFINED); |
240 |
> |
} |
241 |
> |
|
242 |
> |
|
243 |
> |
return ret; |
244 |
|
}; |
245 |
|
|