ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/src/IsolationSelection.cc
Revision: 1.1
Committed: Mon Feb 13 09:35:20 2012 UTC (13 years, 3 months ago) by khahn
Content type: text/plain
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# Content
1 #include <math.h>
2
3 #include "IsolationSelection.h"
4 #include "IsolationSelectionDefs.h"
5
6 SelectionStatus passMuonIsoSelection( ControlFlags &ctrl, const mithep::TMuon * mu ) {
7
8 float reliso = mu->pfIso03/mu->pt;
9 bool isEB = (fabs(mu->eta) < 1.479 ? 1 : 0 );
10 bool failiso = false;
11 if( isEB && mu->pt > 20 && reliso > PFISO_MU_LOOSE_EB_HIGHPT ) {
12 failiso = true;
13 }
14 if( isEB && mu->pt < 20 && reliso > PFISO_MU_LOOSE_EB_LOWPT ) {
15 failiso = true;
16 }
17 if( !(isEB) && mu->pt > 20 && reliso > PFISO_MU_LOOSE_EE_HIGHPT ) {
18 failiso = true;
19 }
20 if( !(isEB) && mu->pt < 20 && reliso > PFISO_MU_LOOSE_EE_LOWPT ) {
21 failiso = true;
22 }
23
24 SelectionStatus status;
25 if( !failiso ) status.setStatus(SelectionStatus::LOOSEISO);
26 if( !failiso ) status.setStatus(SelectionStatus::TIGHTISO);
27 return status;
28
29 };
30
31
32 SelectionStatus failEleIso(ControlFlags &ctrl, const mithep::TElectron * ele) {
33
34 bool failiso=false;
35
36 float reliso = ele->pfIso04/ele->pt;
37 bool isEB = (fabs(ele->eta) < 1.479 ? 1 : 0 );
38 if( isEB && ele->pt > 20 && reliso > PFISO_ELE_LOOSE_EB_HIGHPT ) {
39 failiso = true;
40 }
41 if( isEB && ele->pt < 20 && reliso > PFISO_ELE_LOOSE_EB_LOWPT ) {
42 failiso = true;
43 }
44 if(ctrl.debug) cout << "before iso check ..." << endl;
45 if( !(isEB) && ele->pt > 20 && reliso > PFISO_ELE_LOOSE_EE_HIGHPT ) {
46 if(ctrl.debug) cout << "\tit fails ..." << endl;
47 failiso = true;
48 }
49 if( !(isEB) && ele->pt < 20 && reliso > PFISO_ELE_LOOSE_EE_LOWPT ) {
50 failiso = true;
51 }
52
53 SelectionStatus status;
54 if( !failiso ) {
55 status.setStatus(SelectionStatus::LOOSEISO);
56 status.setStatus(SelectionStatus::TIGHTISO);
57 }
58 if(ctrl.debug) cout << "returning status : " << hex << status.getStatus() << dec << endl;
59 return status;
60
61 }