17 |
|
// |
18 |
|
// |
19 |
|
|
20 |
+ |
#include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h" |
21 |
+ |
|
22 |
|
#include <memory> |
23 |
|
#include <string> |
24 |
< |
|
24 |
> |
#include "TFile.h" |
25 |
> |
#include "TTree.h" |
26 |
> |
#include "Rtypes.h" |
27 |
|
#include "FWCore/Framework/interface/Frameworkfwd.h" |
28 |
|
#include "FWCore/Framework/interface/EDAnalyzer.h" |
29 |
|
#include "FWCore/Framework/interface/Event.h" |
30 |
|
#include "FWCore/Framework/interface/MakerMacros.h" |
31 |
|
#include "FWCore/ParameterSet/interface/ParameterSet.h" |
28 |
– |
#include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h" |
29 |
– |
|
30 |
– |
#include "TFile.h" |
31 |
– |
#include "TTree.h" |
32 |
– |
#include "Rtypes.h" |
32 |
|
|
33 |
|
class TtLJetsAnalyzer : public edm::EDAnalyzer { |
34 |
|
public: |
37 |
|
|
38 |
|
|
39 |
|
private: |
40 |
+ |
|
41 |
+ |
virtual void beginJob(const edm::EventSetup&); |
42 |
+ |
virtual void analyze(const edm::Event&, const edm::EventSetup&); |
43 |
+ |
virtual void endJob(void); |
44 |
+ |
|
45 |
+ |
// _____ quantities read from the config file _________________________ |
46 |
|
std::string _jetSource, _electronSource, _muonSource, _METSource; |
47 |
|
std::string _outFile; |
48 |
+ |
bool _is_mc; |
49 |
|
int nCaloJets_min; |
50 |
|
int nLepton_min; |
51 |
|
double jet_pt_min ; |
59 |
|
double electron_trackIso_max ; |
60 |
|
double electron_caloIso_max ; |
61 |
|
double met_et_min ; |
62 |
+ |
double min_dr_jet_lepton ; |
63 |
|
|
64 |
|
RooGKCounter eventCounter; |
65 |
|
RooGKCounter selectedEvents; |
67 |
|
TFile * _file; |
68 |
|
TTree * _tree; |
69 |
|
|
70 |
+ |
// |
71 |
+ |
// _____ output tree variables ________________________________________ |
72 |
|
Int_t _event; |
73 |
|
Int_t _process_id; |
74 |
|
Int_t _n_jets; |
75 |
+ |
Int_t _n_removed_jets; |
76 |
|
Int_t _n_met; |
77 |
|
Int_t _n_muons; |
78 |
|
Int_t _n_electrons; |
79 |
|
Int_t _lepton_is_muon; |
80 |
|
Double_t _event_weight; |
81 |
+ |
Double_t _lepton_et; |
82 |
|
Double_t _lepton_pt; |
83 |
|
Double_t _lepton_eta; |
84 |
|
Double_t _lepton_phi; |
97 |
|
Double_t _lepton_ecal_iso; |
98 |
|
Double_t _lepton_hcal_iso; |
99 |
|
Double_t _lepton_user_iso; |
100 |
< |
Double_t _met_pt; |
100 |
> |
Double_t _lepton_IsoDeposit_em; |
101 |
> |
Double_t _lepton_IsoDeposit_had; |
102 |
|
Double_t _met_et; |
103 |
+ |
Double_t _met_pt; |
104 |
|
Double_t _met_eta; |
105 |
|
Double_t _met_phi; |
106 |
|
Double_t _met_energy; |
107 |
+ |
Double_t _jet1_et; |
108 |
|
Double_t _jet1_pt; |
109 |
|
Double_t _jet1_eta; |
110 |
|
Double_t _jet1_phi; |
111 |
|
Double_t _jet1_energy; |
112 |
+ |
Double_t _jet2_et; |
113 |
|
Double_t _jet2_pt; |
114 |
|
Double_t _jet2_eta; |
115 |
|
Double_t _jet2_phi; |
116 |
|
Double_t _jet2_energy; |
117 |
+ |
Double_t _jet3_et; |
118 |
|
Double_t _jet3_pt; |
119 |
|
Double_t _jet3_eta; |
120 |
|
Double_t _jet3_phi; |
121 |
|
Double_t _jet3_energy; |
122 |
+ |
Double_t _jet4_et; |
123 |
|
Double_t _jet4_pt; |
124 |
|
Double_t _jet4_eta; |
125 |
|
Double_t _jet4_phi; |
126 |
|
Double_t _jet4_energy; |
110 |
– |
|
127 |
|
Double_t _aplanarity ; |
128 |
|
Double_t _centrality ; |
129 |
|
Double_t _sphericity ; |
145 |
|
Double_t _jet1Jet2_Pt ; |
146 |
|
Double_t _jet1Jet2W_M ; |
147 |
|
Double_t _jet1Jet2W_Pt ; |
132 |
– |
|
148 |
|
Double_t _hz ; |
149 |
|
Double_t _HT2 ; |
150 |
|
Double_t _HT2prime ; |
152 |
|
Double_t _W_M ; |
153 |
|
Double_t _W_Pt ; |
154 |
|
Double_t _DphiJMET ; |
140 |
– |
|
155 |
|
// Ht |
156 |
|
Double_t _getHt ; |
157 |
|
Double_t _getHtp ; |
175 |
|
Double_t _getEta2Sum ; |
176 |
|
Double_t _getMwRec ; |
177 |
|
Double_t _getH ; |
164 |
– |
|
178 |
|
// event topo |
179 |
|
Double_t _getSph ; |
180 |
|
Double_t _getApl ; |
181 |
|
Double_t _getAplMu ; |
169 |
– |
|
182 |
|
// Kt |
183 |
|
Double_t _getKtminp ; |
184 |
|
Double_t _getKtminpReduced ; |
185 |
|
Double_t _getDrMinJetJet ; |
174 |
– |
|
186 |
|
// mT |
187 |
|
Double_t _getDphiMuMet ; |
188 |
|
Double_t _getMt ; |
189 |
< |
|
190 |
< |
Double_t _lepton_id; |
191 |
< |
Double_t _electron_id_robust; |
192 |
< |
Double_t _electron_id_loose; |
193 |
< |
Double_t _electron_id_tight; |
194 |
< |
Double_t _electron_tdrid_medium; |
195 |
< |
Double_t _electron_tdrid_loose; |
196 |
< |
Double_t _electron_tdrid_tight; |
189 |
> |
// |
190 |
> |
// |
191 |
> |
//_____ b tagging ______________________________________________ |
192 |
> |
vector<double> * _jet_pt; |
193 |
> |
vector<double> * _jet_pz; |
194 |
> |
vector<double> * _jet_eta; |
195 |
> |
vector<double> * _jet_phi; |
196 |
> |
vector<double> * _jet_et; |
197 |
> |
vector<double> * _jet_energy; |
198 |
> |
vector<int> * _jet_flavor; |
199 |
> |
vector<double> * _lept_pt; |
200 |
> |
vector<double> * _lept_pz; |
201 |
> |
vector<double> * _lept_eta; |
202 |
> |
vector<double> * _lept_phi; |
203 |
> |
vector<double> * _lept_et; |
204 |
> |
vector<double> * _lept_energy; |
205 |
> |
vector<int> * _lept_flavor; |
206 |
> |
/* FIXME: add vectors of these: |
207 |
> |
Double_t _lepton_track_iso; |
208 |
> |
Double_t _lepton_calo_iso; |
209 |
> |
Double_t _lepton_ecal_iso; |
210 |
> |
Double_t _lepton_hcal_iso; |
211 |
> |
Double_t _lepton_user_iso; |
212 |
> |
Double_t _lepton_IsoDeposit_em; |
213 |
> |
Double_t _lepton_IsoDeposit_had; |
214 |
> |
*/ |
215 |
> |
TBranch * b_jet_pt; |
216 |
> |
TBranch * b_jet_pz; |
217 |
> |
TBranch * b_jet_eta; |
218 |
> |
TBranch * b_jet_phi; |
219 |
> |
TBranch * b_jet_et; |
220 |
> |
TBranch * b_jet_energy; |
221 |
> |
TBranch * b_jet_flavor; |
222 |
> |
TBranch * b_lept_pt; |
223 |
> |
TBranch * b_lept_pz; |
224 |
> |
TBranch * b_lept_eta; |
225 |
> |
TBranch * b_lept_phi; |
226 |
> |
TBranch * b_lept_et; |
227 |
> |
TBranch * b_lept_energy; |
228 |
> |
TBranch * b_lept_flavor; |
229 |
> |
vector<string> * _b_tagger_label; |
230 |
> |
vector<float> * _b_tagger_discr; |
231 |
> |
TBranch * b_b_tagger_label; |
232 |
> |
TBranch * b_b_tagger_discr; |
233 |
|
Int_t _n_tagged_jets_trackCounting_loose; |
234 |
|
Int_t _n_tagged_jets_trackCounting_medium; |
235 |
|
Int_t _n_tagged_jets_trackCounting_tight; |
237 |
|
Int_t _n_tagged_jets_jetProb_medium; |
238 |
|
Int_t _n_tagged_jets_jetProb_tight; |
239 |
|
|
240 |
+ |
// |
241 |
+ |
// |
242 |
+ |
//_____ electron quality _______________________________________ |
243 |
+ |
Float_t _eidLoose; |
244 |
+ |
Float_t _eidRobustHighEnergy; |
245 |
+ |
Float_t _eidRobustLoose; |
246 |
+ |
Float_t _eidRobustTight; |
247 |
+ |
Float_t _eidTight; |
248 |
+ |
Int_t _GsfElectron_classification; |
249 |
+ |
Double_t _GsfElectron_hadronicOverEm; |
250 |
+ |
Double_t _GsfElectron_caloEnergyError; |
251 |
+ |
Double_t _GsfElectron_trackMomentumError; |
252 |
+ |
Int_t _GsfElectron_numberOfClusters; |
253 |
+ |
Double_t _GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor |
254 |
+ |
Double_t _GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point |
255 |
+ |
Double_t _GsfElectron_eSeedClusterOverPout; // the seed cluster energy / track momentum at calo from outermost state |
256 |
+ |
Double_t _GsfElectron_deltaEtaSuperClusterTrackAtVtx; // the supercluster eta - track eta from helix extrapolation from impact point |
257 |
+ |
Double_t _GsfElectron_deltaEtaSeedClusterTrackAtCalo; // the seed cluster eta - track eta at calo from outermost state |
258 |
+ |
Double_t _GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point |
259 |
+ |
Double_t _GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state |
260 |
+ |
// ____ branches |
261 |
+ |
TBranch * b_eidLoose; |
262 |
+ |
TBranch * b_eidRobustHighEnergy; |
263 |
+ |
TBranch * b_eidRobustLoose; |
264 |
+ |
TBranch * b_eidRobustTight; |
265 |
+ |
TBranch * b_eidTight; |
266 |
+ |
TBranch * b_GsfElectron_classification; |
267 |
+ |
TBranch * b_GsfElectron_hadronicOverEm; |
268 |
+ |
TBranch * b_GsfElectron_caloEnergyError; |
269 |
+ |
TBranch * b_GsfElectron_trackMomentumError; |
270 |
+ |
TBranch * b_GsfElectron_numberOfClusters; |
271 |
+ |
TBranch * b_GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor |
272 |
+ |
TBranch * b_GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point |
273 |
+ |
TBranch * b_GsfElectron_eSeedClusterOverPout; // the seed cluster energy / track momentum at calo from outermost state |
274 |
+ |
TBranch * b_GsfElectron_deltaEtaSuperClusterTrackAtVtx; // the supercluster eta - track eta from helix extrapolation from impact point |
275 |
+ |
TBranch * b_GsfElectron_deltaEtaSeedClusterTrackAtCalo; // the seed cluster eta - track eta at calo from outermost state |
276 |
+ |
TBranch * b_GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point |
277 |
+ |
TBranch * b_GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state |
278 |
+ |
// |
279 |
+ |
// |
280 |
+ |
//_____ muon quality _______________________________________ |
281 |
+ |
bool _muon_isGood_All; // dummy options - always true |
282 |
+ |
bool _muon_isGood_AllGlobalMuons; // checks isGlobalMuon flag |
283 |
+ |
bool _muon_isGood_AllStandAloneMuons; // checks isStandAloneMuon flag |
284 |
+ |
bool _muon_isGood_AllTrackerMuons; // checks isTrackerMuon flag |
285 |
+ |
bool _muon_isGood_TrackerMuonArbitrated; // resolve ambiguity of sharing segments |
286 |
+ |
bool _muon_isGood_AllArbitrated; // all muons with the tracker muon arbitrated |
287 |
+ |
bool _muon_isGood_GlobalMuonPromptTight; // global muons with tighter fit requirements |
288 |
+ |
bool _muon_isGood_TMLastStationLoose; // penetration depth loose selector |
289 |
+ |
bool _muon_isGood_TMLastStationTight; // penetration depth tight selector |
290 |
+ |
bool _muon_isGood_TM2DCompatibilityLoose; // likelihood based loose selector |
291 |
+ |
bool _muon_isGood_TM2DCompatibilityTight; // likelihood based tight selector |
292 |
+ |
bool _muon_isGood_TMOneStationLoose; // require one well matched segment |
293 |
+ |
bool _muon_isGood_TMOneStationTight; // require one well matched segment |
294 |
+ |
bool _muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation |
295 |
+ |
bool _muon_isGood_TMLastStationOptimizedLowPtTight; // combination of TMLastStation and TMOneStation |
296 |
+ |
//____ branches |
297 |
+ |
TBranch * b_muon_isGood_All; // dummy options - always true |
298 |
+ |
TBranch * b_muon_isGood_AllGlobalMuons; // checks isGlobalMuon flag |
299 |
+ |
TBranch * b_muon_isGood_AllStandAloneMuons; // checks isStandAloneMuon flag |
300 |
+ |
TBranch * b_muon_isGood_AllTrackerMuons; // checks isTrackerMuon flag |
301 |
+ |
TBranch * b_muon_isGood_TrackerMuonArbitrated; // resolve ambiguity of sharing segments |
302 |
+ |
TBranch * b_muon_isGood_AllArbitrated; // all muons with the tracker muon arbitrated |
303 |
+ |
TBranch * b_muon_isGood_GlobalMuonPromptTight; // global muons with tighter fit requirements |
304 |
+ |
TBranch * b_muon_isGood_TMLastStationLoose; // penetration depth loose selector |
305 |
+ |
TBranch * b_muon_isGood_TMLastStationTight; // penetration depth tight selector |
306 |
+ |
TBranch * b_muon_isGood_TM2DCompatibilityLoose; // likelihood based loose selector |
307 |
+ |
TBranch * b_muon_isGood_TM2DCompatibilityTight; // likelihood based tight selector |
308 |
+ |
TBranch * b_muon_isGood_TMOneStationLoose; // require one well matched segment |
309 |
+ |
TBranch * b_muon_isGood_TMOneStationTight; // require one well matched segment |
310 |
+ |
TBranch * b_muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation |
311 |
+ |
TBranch * b_muon_isGood_TMLastStationOptimizedLowPtTight; // combination of TMLastStation and TMOneStation |
312 |
+ |
//____ output tree variables |
313 |
|
TBranch * b_event; |
314 |
|
TBranch * b_process_id; |
315 |
|
TBranch * b_n_jets; |
316 |
+ |
TBranch * b_n_removed_jets; |
317 |
|
TBranch * b_n_met; |
318 |
|
TBranch * b_n_muons; |
319 |
|
TBranch * b_n_electrons; |
320 |
|
TBranch * b_lepton_is_muon; |
321 |
|
TBranch * b_event_weight; |
322 |
+ |
TBranch * b_lepton_et; |
323 |
|
TBranch * b_lepton_pt; |
324 |
|
TBranch * b_lepton_eta; |
325 |
|
TBranch * b_lepton_phi; |
338 |
|
TBranch * b_lepton_ecal_iso; |
339 |
|
TBranch * b_lepton_hcal_iso; |
340 |
|
TBranch * b_lepton_user_iso; |
341 |
< |
TBranch * b_met_pt; |
341 |
> |
TBranch * b_lepton_IsoDeposit_em; |
342 |
> |
TBranch * b_lepton_IsoDeposit_had; |
343 |
|
TBranch * b_met_et; |
344 |
+ |
TBranch * b_met_pt; |
345 |
|
TBranch * b_met_eta; |
346 |
|
TBranch * b_met_phi; |
347 |
|
TBranch * b_met_energy; |
348 |
+ |
TBranch * b_jet1_et; |
349 |
|
TBranch * b_jet1_pt; |
350 |
|
TBranch * b_jet1_eta; |
351 |
|
TBranch * b_jet1_phi; |
352 |
|
TBranch * b_jet1_energy; |
353 |
+ |
TBranch * b_jet2_et; |
354 |
|
TBranch * b_jet2_pt; |
355 |
|
TBranch * b_jet2_eta; |
356 |
|
TBranch * b_jet2_phi; |
357 |
|
TBranch * b_jet2_energy; |
358 |
+ |
TBranch * b_jet3_et; |
359 |
|
TBranch * b_jet3_pt; |
360 |
|
TBranch * b_jet3_eta; |
361 |
|
TBranch * b_jet3_phi; |
362 |
|
TBranch * b_jet3_energy; |
363 |
+ |
TBranch * b_jet4_et; |
364 |
|
TBranch * b_jet4_pt; |
365 |
|
TBranch * b_jet4_eta; |
366 |
|
TBranch * b_jet4_phi; |
367 |
|
TBranch * b_jet4_energy; |
240 |
– |
TBranch * b_lepton_id; |
241 |
– |
TBranch * b_electron_id_robust; |
242 |
– |
TBranch * b_electron_id_loose; |
243 |
– |
TBranch * b_electron_id_tight; |
244 |
– |
TBranch * b_electron_tdrid_medium; |
245 |
– |
TBranch * b_electron_tdrid_loose; |
246 |
– |
TBranch * b_electron_tdrid_tight; |
368 |
|
TBranch * b_n_tagged_jets_trackCounting_loose; |
369 |
|
TBranch * b_n_tagged_jets_trackCounting_medium; |
370 |
|
TBranch * b_n_tagged_jets_trackCounting_tight; |
371 |
|
TBranch * b_n_tagged_jets_jetProb_loose; |
372 |
|
TBranch * b_n_tagged_jets_jetProb_medium; |
373 |
|
TBranch * b_n_tagged_jets_jetProb_tight; |
374 |
< |
|
374 |
> |
// ____ |
375 |
|
TBranch * b_aplanarity ; |
376 |
|
TBranch * b_centrality ; |
377 |
|
TBranch * b_sphericity ; |
393 |
|
TBranch * b_jet1Jet2_Pt ; |
394 |
|
TBranch * b_jet1Jet2W_M ; |
395 |
|
TBranch * b_jet1Jet2W_Pt ; |
275 |
– |
|
396 |
|
TBranch * b_hz ; |
397 |
< |
TBranch * b_HT2 ; |
398 |
< |
TBranch * b_HT2prime ; |
399 |
< |
TBranch * b_W_MT ; |
397 |
> |
TBranch * b_HT2; |
398 |
> |
TBranch * b_HT2prime; |
399 |
> |
TBranch * b_W_MT; |
400 |
|
TBranch * b_W_M ; |
401 |
|
TBranch * b_W_Pt ; |
402 |
|
TBranch * b_DphiJMET ; |
283 |
– |
|
403 |
|
// Ht |
404 |
|
TBranch * b_getHt ; |
405 |
|
TBranch * b_getHtp ; |
423 |
|
TBranch * b_getEta2Sum ; |
424 |
|
TBranch * b_getMwRec ; |
425 |
|
TBranch * b_getH ; |
307 |
– |
|
426 |
|
// event topo |
427 |
|
TBranch * b_getSph ; |
428 |
|
TBranch * b_getApl ; |
429 |
|
TBranch * b_getAplMu ; |
312 |
– |
|
430 |
|
// Kt |
431 |
|
TBranch * b_getKtminp ; |
432 |
|
TBranch * b_getKtminpReduced ; |
433 |
|
TBranch * b_getDrMinJetJet ; |
317 |
– |
|
434 |
|
// mT |
435 |
|
TBranch * b_getDphiMuMet ; |
436 |
|
TBranch * b_getMt ; |
437 |
|
|
438 |
< |
virtual void beginJob(const edm::EventSetup&) ; |
323 |
< |
virtual void analyze(const edm::Event&, const edm::EventSetup&); |
324 |
< |
virtual void endJob() ; |
438 |
> |
|
439 |
|
}; |