ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitHzz4l/LeptonSelection/interface/IsolationSelection.h
(Generate patch)

Comparing UserCode/MitHzz4l/LeptonSelection/interface/IsolationSelection.h (file contents):
Revision 1.10 by khahn, Mon May 14 17:27:29 2012 UTC vs.
Revision 1.17 by dkralph, Tue Oct 23 10:21:54 2012 UTC

# Line 1 | Line 1
1 + #include "Array.h"
2   #include "Electron.h"
3   #include "Muon.h"
4   #include "Vertex.h"
# Line 5 | Line 6
6   #include "PFCandidateCol.h"
7   #include "PileupEnergyDensity.h"
8  
9 + #include "TLorentzVector.h"
10 +
11   #include "MuonTools.h"
12   #include "ElectronTools.h"
13  
# Line 12 | Line 15
15   #include "SelectionStatus.h"
16   #include "SimpleLepton.h"
17  
18 + using namespace std;
19 + using namespace mithep;
20 +
21   #define MUON_ISOMVA_CUT_BIN0  -0.615
22   #define MUON_ISOMVA_CUT_BIN1   0.235
23   #define MUON_ISOMVA_CUT_BIN2  -0.825
# Line 54 | Line 60
60   #define ELECTRON_TIGHT_ISOMVA_CUT_BIN4  0.531
61   #define ELECTRON_TIGHT_ISOMVA_CUT_BIN5  0.493
62  
63 < #define ELECTRON_REFERENCE_PFISO_CUT  0.25
64 < #define MUON_REFERENCE_PFISO_CUT      0.25
63 >
64 > //
65 > // optimization test
66 > //
67 > #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN0  0.385
68 > #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN1  -0.083
69 > #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN2  -0.573
70 > #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN3  0.413
71 > #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN4  0.271
72 > #define ELECTRON_LOOSE_ISOMVA_CUT_OPT_BIN5  0.135
73 >
74 > #ifdef   MUONISO_WP0
75 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  0.03735
76 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.86195
77 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.15025
78 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.87945
79 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.88455
80 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.90835
81 > #elif MUONISO_WP1
82 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.19505
83 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.77445
84 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.46945
85 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.64635
86 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.93635
87 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.96505
88 > #elif MUONISO_WP2
89 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.33995
90 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.60785
91 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.52125
92 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.54135
93 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.97765
94 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.97485
95 > #elif MUONISO_WP3
96 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.42045
97 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.37195
98 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.59335
99 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.41045
100 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.98465
101 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.98185
102 > #elif MUONISO_WP4
103 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.48065
104 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.26765
105 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.64095
106 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.14865
107 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.98675
108 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.98815
109 > #elif MUONISO_WP5
110 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.52195
111 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.12905
112 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.68715
113 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.00305
114 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.99165
115 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.99235
116 > #elif MUONISO_WP6
117 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.60315
118 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  -0.13415
119 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.75855
120 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  -0.18805
121 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.99235
122 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.99445
123 > #elif MUONISO_WP7
124 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.65565
125 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  -0.34345
126 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.79985
127 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  -0.31475
128 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.99445
129 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.99655
130 > #elif MUONISO_WP8
131 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.70535
132 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  -0.39945
133 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.82645
134 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  -0.64865
135 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.99515
136 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.99795
137 > #elif MUONISO_WP9
138 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.79145
139 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  -0.74245
140 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.89085
141 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  -0.78585
142 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.99725
143 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.99865
144 > #else
145 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN0  -0.5934
146 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN1  0.3374
147 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN2  -0.7666
148 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN3  0.4102
149 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN4  -0.989
150 > #define MUON_ISOMVA_LOOSE_FORPFID_CUT_OPT_BIN5  -0.9946
151 > #endif
152 >
153 > /* #define ELECTRON_REFERENCE_PFISO_CUT  0.25 */
154 > /* #define MUON_REFERENCE_PFISO_CUT      0.25 */
155 > #define ELECTRON_REFERENCE_PFISO_CUT  0.4  
156 > #define MUON_REFERENCE_PFISO_CUT      0.4  
157  
158   Float_t computePFMuonIso(const mithep::Muon *muon,
159 <                         const mithep::Vertex & vtx,
159 >                         const mithep::Vertex * vtx,
160                           const mithep::Array<mithep::PFCandidate> * fPFCandidates,
161                           const Double_t dRMax);
162  
163   Float_t computePFEleIso(const mithep::Electron *electron,
164 <                        const mithep::Vertex & fVertex,
164 >                        const mithep::Vertex * fVertex,
165                          const mithep::Array<mithep::PFCandidate> * fPFCandidates,
166                          const Double_t dRMax);
167  
168   SelectionStatus electronIsoSelection(ControlFlags &, const mithep::Electron *, const mithep::Vertex &, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol   );
169 < SelectionStatus muonIsoSelection(ControlFlags &, const mithep::Muon *, const mithep::Vertex &, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol   );
72 < bool pairwiseIsoSelection( ControlFlags &, vector<SimpleLepton> &, float rho );
169 > SelectionStatus muonIsoSelection(ControlFlags &, const mithep::Muon *, const mithep::Vertex *, const mithep::Array<mithep::PFCandidate> * fPFCandidateCol   );
170   bool noIso(ControlFlags &, vector<SimpleLepton> &, float rho);
171  
172   void initMuonIsoMVA();
173   SelectionStatus muonIsoMVASelection(ControlFlags &ctrl,
174                                      const mithep::Muon * mu,
175 <                                    const mithep::Vertex & vtx,
175 >                                    const mithep::Vertex * vtx,
176                                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
177                                      const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
178                                      mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 84 | Line 181 | SelectionStatus muonIsoMVASelection(Cont
181   //hacked version
182   SelectionStatus muonIsoMVASelection(ControlFlags &ctrl,
183                                      const mithep::Muon * mu,
184 <                                    const mithep::Vertex & vtx,
184 >                                    const mithep::Vertex * vtx,
185                                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
186                                      float rho,
187                                      mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
# Line 92 | Line 189 | SelectionStatus muonIsoMVASelection(Cont
189                                      vector<const mithep::Electron*> electronsToVeto);
190   double muonPFIso04(ControlFlags &ctrl,
191                     const mithep::Muon * mu,
192 <                   const mithep::Vertex & vtx,
192 >                   const mithep::Vertex * vtx,
193                     const mithep::Array<mithep::PFCandidate> * fPFCandidates,
194                     const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
195                     mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
196 <                   vector<const mithep::Muon*> muonsToVeto,
197 <                   vector<const mithep::Electron*> electronsToVeto);
101 < // hacked version
102 < double muonPFIso04(ControlFlags &ctrl,
103 <                   const mithep::Muon * mu,
104 <                   const mithep::Vertex & vtx,
105 <                   const mithep::Array<mithep::PFCandidate> * fPFCandidates,
106 <                   float rho,  // the hack
107 <                   mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
108 <                   vector<const mithep::Muon*> muonsToVeto,
109 <                   vector<const mithep::Electron*> electronsToVeto);
110 < //
196 >                   vector<const mithep::PFCandidate*> photonsToVeto);
197 >
198   SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
199                                            const mithep::Muon * mu,
200 <                                          const mithep::Vertex & vtx,
200 >                                          const mithep::Vertex * vtx,
201                                            const mithep::Array<mithep::PFCandidate> * fPFCandidates,
202                                            const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
203                                            mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
204 <                                          vector<const mithep::Muon*> muonsToVeto,
118 <                                          vector<const mithep::Electron*> electronsToVeto);
119 < // hacked version
120 < SelectionStatus muonReferenceIsoSelection(ControlFlags &ctrl,
121 <                                          const mithep::Muon * mu,
122 <                                          const mithep::Vertex & vtx,
123 <                                          const mithep::Array<mithep::PFCandidate> * fPFCandidates,
124 <                                          float,
125 <                                          mithep::MuonTools::EMuonEffectiveAreaTarget EffectiveAreaVersion,
126 <                                          vector<const mithep::Muon*> muonsToVeto,
127 <                                          vector<const mithep::Electron*> electronsToVeto);
204 >                                          vector<const mithep::PFCandidate*> photonsToVeto);
205  
206   void initElectronIsoMVA();
207   SelectionStatus electronIsoMVASelection(ControlFlags &ctrl,
208                                      const mithep::Electron * ele,
209 <                                    const mithep::Vertex & vtx,
209 >                                    const mithep::Vertex * vtx,
210                                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
211                                      const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
212                                      mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
# Line 138 | Line 215 | SelectionStatus electronIsoMVASelection(
215   //hacked version
216   SelectionStatus electronIsoMVASelection(ControlFlags &ctrl,
217                                      const mithep::Electron * ele,
218 <                                    const mithep::Vertex & vtx,
218 >                                    const mithep::Vertex * vtx,
219                                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
220                                          float rho,
221                                      mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
# Line 150 | Line 227 | float electronPFIso04(ControlFlags &ctrl
227                        const mithep::Array<mithep::PFCandidate> * fPFCandidates,
228                        const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
229                        mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
230 <                      vector<const mithep::Muon*> muonsToVeto,
231 <                      vector<const mithep::Electron*> electronsToVeto) ;
155 < // hacked version
156 < float electronPFIso04(ControlFlags &ctrl,
157 <                      const mithep::Electron * ele,
158 <                      const mithep::Vertex & vtx,
159 <                      const mithep::Array<mithep::PFCandidate> * fPFCandidates,
160 <                      float rho, // the hack
161 <                      mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
162 <                      vector<const mithep::Muon*> muonsToVeto,
163 <                      vector<const mithep::Electron*> electronsToVeto) ;
164 < //
230 >                      vector<const mithep::PFCandidate*> photonsToVeto);                
231 >
232   SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
233                                                const mithep::Electron * ele,
234 <                                              const mithep::Vertex & vtx,
234 >                                              const mithep::Vertex * vtx,
235                                                const mithep::Array<mithep::PFCandidate> * fPFCandidates,
236                                                const mithep::Array<mithep::PileupEnergyDensity> * fPUEnergyDensity,
237                                                mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
238 <                                              vector<const mithep::Muon*> muonsToVeto,
239 <                                              vector<const mithep::Electron*> electronsToVeto);
240 < // hacked version
241 < SelectionStatus electronReferenceIsoSelection(ControlFlags &ctrl,
242 <                                              const mithep::Electron * ele,
243 <                                              const mithep::Vertex & vtx,
244 <                                              const mithep::Array<mithep::PFCandidate> * fPFCandidates,
245 <                                              float,
246 <                                              mithep::ElectronTools::EElectronEffectiveAreaTarget EffectiveAreaVersion,
247 <                                              vector<const mithep::Muon*> muonsToVeto,
248 <                                              vector<const mithep::Electron*> electronsToVeto);
238 >                                              vector<const mithep::PFCandidate*> photonsToVeto);
239 >
240 > double  dbetaCorrectedIsoDr03(ControlFlags & ctrl,
241 >                              const mithep::PFCandidate * photon,
242 >                              const mithep::Muon * mu, // need to veto          
243 >                              const mithep::Array<mithep::PFCandidate> * fPFCandidates);
244 >
245 > double  dbetaCorrectedIsoDr03(ControlFlags & ctrl,
246 >                              const mithep::PFCandidate * photon,
247 >                              const mithep::Electron * el, // need to veto              
248 >                              const mithep::Array<mithep::PFCandidate> * fPFCandidates);
249 >
250 > double  nonCorrectedIsoDr03(ControlFlags & ctrl,
251 >                            const mithep::PFCandidate * photon,
252 >                            const mithep::Muon * mu, // need to veto            
253 >                            const mithep::Array<mithep::PFCandidate> * fPFCandidates);
254 >
255 > double  nonCorrectedIsoDr03(ControlFlags & ctrl,
256 >                            const mithep::PFCandidate * photon,
257 >                            const mithep::Electron * el, // need to veto                
258 >                            const mithep::Array<mithep::PFCandidate> * fPFCandidates);
259 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines