ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/src/VBTFElectronSelection.cc
Revision: 1.2
Committed: Sun May 27 23:17:30 2012 UTC (12 years, 11 months ago) by khahn
Content type: text/plain
Branch: MAIN
CVS Tags: compiled, synced_FSR_2, synced_FSR, synched2, HEAD
Changes since 1.1: +10 -10 lines
Log Message:
ported to bambu

File Contents

# Content
1 #include <iostream>
2 #include <math.h>
3 #include "VBTFElectronSelection.h"
4
5 using namespace std;
6
7 VBTFStruct eidVBTF;
8
9 void initVBTFSelection() {
10 #include "VBTFElectronSelection.i"
11 };
12
13
14 VBTFStruct getVBTFCuts() {return eidVBTF;};
15
16 // not cutting on isolation ATM
17 unsigned failsVBTFSelection( ControlFlags &ctrl, const mithep::Electron * ele, VBTFStruct &cuts, unsigned vbtfeff,
18 string kinematics) {
19
20 int level=0;
21 unsigned failmask=0x0;
22
23 float scEt = ele->SCluster()->Et();
24 float scEta = ele->SCluster()->Eta();
25
26 float deta = fabs(ele->DeltaEtaSuperClusterTrackAtVtx());
27 float dphi = fabs(ele->DeltaPhiSuperClusterTrackAtVtx());
28 float sigieie = ele->CoviEtaiEta();
29 float HoE =ele->HadronicOverEm();
30
31 // float dist = (ele->partnerDist == -9999.? 9999:ele->partnerDist);
32 // float dcot = (ele->partnerDeltaCot == -9999.? 9999:ele->partnerDeltaCot);
33
34 if( ctrl.debug ) cout << "--> scEt : " << scEt << endl;
35
36 double etcut=0;
37 if ( kinematics == "loose" ) etcut = 5;
38 else if ( kinematics == "tight" ) etcut = 7;
39 else { cout << "kinematics not defined!" << endl; assert(0); }
40 if ( scEt < etcut ) {
41 failmask |= (1<<level);
42 // cout << "failing scET ... " << endl;
43 return failmask;
44 }
45
46 level++;
47 if ( fabs(scEta) > 2.5 ) {
48 failmask |= (1<<level);
49 // cout << "failing scEta ... " << endl;
50 return failmask;
51 }
52
53 float max_deta, max_dphi, max_HoE, max_sigieie, max_missHits, max_dist, max_dcot;
54
55 if( ele->IsEB() ) {
56 max_deta = cuts.cutdeta_eb[vbtfeff];
57 max_dphi = cuts.cutdphi_eb[vbtfeff];
58 max_HoE = cuts.cuthoe_eb[vbtfeff];
59 max_sigieie = cuts.cutsigieie_eb[vbtfeff];
60 // max_missHits = cuts.cutmisshits_eb[vbtfeff];
61 // max_dist = cuts.cutconvdist_eb[vbtfeff];
62 // max_dcot = cuts.cutconvdcot_eb[vbtfeff];
63 } else {
64 max_deta = cuts.cutdeta_ee[vbtfeff];
65 max_dphi = cuts.cutdphi_ee[vbtfeff];
66 max_HoE = cuts.cuthoe_ee[vbtfeff];
67 max_sigieie = cuts.cutsigieie_ee[vbtfeff];
68 // max_missHits = cuts.cutmisshits_ee[vbtfeff];
69 // max_dist = cuts.cutconvdist_ee[vbtfeff];
70 // max_dcot = cuts.cutconvdcot_ee[vbtfeff];
71 }
72 level++;
73 if( deta > max_deta ) {
74 failmask |= (1<<level);
75 if( ctrl.debug ) cout << "failing deta ... " << deta << ">" << max_deta << endl;
76 }
77 level++;
78 if( dphi > max_dphi ) {
79 failmask |= (1<<level);
80 // cout << "failing dphi ... " << endl;
81 }
82 level++;
83 if( sigieie > max_sigieie ) {
84 failmask |= (1<<level);
85 // cout << "failing sigieie ... " << endl;
86 }
87 level++;
88 if( HoE > max_HoE ) {
89 failmask |= (1<<level);
90 if( ctrl.debug ) cout << "failing hoe ... " << HoE << ">" << max_HoE << endl;
91 }
92 /*
93 level++;
94 if( ele->nExpHitsInner > max_missHits ) {
95 // || dcotdistcomb > max_conv
96 failmask |= (1<<level);
97 // cout << "failing misshits ... " << endl;
98 }
99 level++;
100 if( dist > max_dist ) {
101 failmask |= (1<<level);
102 if( ctrl.debug ) cout << "failing dist ... " << dist << ">" << max_dist << endl;
103 }
104 level++;
105 if( dcot > max_dcot ) {
106 failmask |= (1<<level);
107 if( ctrl.debug ) cout << "failing dcot ... " << dcot << ">" << max_dcot << endl;
108 }
109 */
110
111
112 return failmask;
113 };
114