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" |
32 |
|
|
33 |
< |
#include "TFile.h" |
34 |
< |
#include "TTree.h" |
32 |
< |
#include "Rtypes.h" |
33 |
> |
#include "FWCore/ServiceRegistry/interface/Service.h" |
34 |
> |
#include "PhysicsTools/UtilAlgos/interface/TFileService.h" |
35 |
|
|
36 |
|
class TtLJetsAnalyzer : public edm::EDAnalyzer { |
37 |
|
public: |
45 |
|
virtual void analyze(const edm::Event&, const edm::EventSetup&); |
46 |
|
virtual void endJob(void); |
47 |
|
|
48 |
< |
// quantities read from the config file |
49 |
< |
std::string _jetSource, _electronSource, _muonSource, _METSource; |
48 |
> |
edm::Service<TFileService> fs; |
49 |
> |
|
50 |
> |
bool first_event; |
51 |
> |
|
52 |
> |
// _____ quantities read from the config file _________________________ |
53 |
> |
std::string _jetSource, _electronSource, _muonSource, _METSource, |
54 |
> |
_beamSpotSource, _trigger_source; |
55 |
> |
bool _lepton_flavor_is_muon; |
56 |
|
std::string _outFile; |
57 |
+ |
bool _is_mc; |
58 |
|
int nCaloJets_min; |
59 |
|
int nLepton_min; |
60 |
|
double jet_pt_min ; |
68 |
|
double electron_trackIso_max ; |
69 |
|
double electron_caloIso_max ; |
70 |
|
double met_et_min ; |
71 |
+ |
double min_dr_jet_lepton ; |
72 |
|
|
73 |
|
RooGKCounter eventCounter; |
74 |
|
RooGKCounter selectedEvents; |
75 |
|
|
66 |
– |
TFile * _file; |
76 |
|
TTree * _tree; |
77 |
|
|
78 |
< |
// output tree variables |
78 |
> |
// |
79 |
> |
// _____ output tree variables ________________________________________ |
80 |
> |
// |
81 |
|
Int_t _event; |
82 |
|
Int_t _process_id; |
83 |
|
Int_t _n_jets; |
84 |
+ |
Int_t _n_removed_jets; |
85 |
|
Int_t _n_met; |
86 |
|
Int_t _n_muons; |
87 |
|
Int_t _n_electrons; |
88 |
|
Int_t _lepton_is_muon; |
89 |
+ |
// |
90 |
+ |
//_____ trigger _______________________________________________________ |
91 |
+ |
// |
92 |
+ |
std::map<std::string,bool> _hlt; |
93 |
+ |
//vector<TBranch> b_hlt; |
94 |
+ |
// |
95 |
|
Double_t _event_weight; |
96 |
+ |
Double_t _lepton_et; |
97 |
|
Double_t _lepton_pt; |
98 |
|
Double_t _lepton_eta; |
99 |
|
Double_t _lepton_phi; |
100 |
+ |
Double_t _lepton_jet_min_dr; |
101 |
+ |
Double_t _lepton_ptrel; // relative to the nearest jet |
102 |
+ |
Double_t _lepton_d0; // relative to the beam spot |
103 |
+ |
Double_t _lepton_d0_err; // relative to the beam spot |
104 |
+ |
Double_t _lepton_d0_significance; // relative to the beam spot |
105 |
|
Double_t _lepton_energy; |
106 |
+ |
Double_t _lepton_track_iso; |
107 |
+ |
Double_t _lepton_calo_iso; |
108 |
+ |
Double_t _lepton_ecal_iso; |
109 |
+ |
Double_t _lepton_hcal_iso; |
110 |
+ |
Double_t _lepton_user_iso; |
111 |
+ |
Double_t _lepton_IsoDeposit_em; |
112 |
+ |
Double_t _lepton_IsoDeposit_had; |
113 |
+ |
Int_t _muon_track_nhits; |
114 |
|
Double_t _muon_track_chi2; |
115 |
|
Double_t _muon_track_ndof; |
116 |
|
Double_t _muon_track_nChi2; |
120 |
|
Double_t _muon_globalTrack_chi2; |
121 |
|
Double_t _muon_globalTrack_ndof; |
122 |
|
Double_t _muon_globalTrack_nChi2; |
91 |
– |
Double_t _lepton_track_iso; |
92 |
– |
Double_t _lepton_calo_iso; |
93 |
– |
Double_t _lepton_ecal_iso; |
94 |
– |
Double_t _lepton_hcal_iso; |
95 |
– |
Double_t _lepton_user_iso; |
96 |
– |
Double_t _met_pt; |
123 |
|
Double_t _met_et; |
124 |
+ |
Double_t _met_pt; |
125 |
|
Double_t _met_eta; |
126 |
|
Double_t _met_phi; |
127 |
|
Double_t _met_energy; |
128 |
+ |
Double_t _jet1_et; |
129 |
|
Double_t _jet1_pt; |
130 |
|
Double_t _jet1_eta; |
131 |
|
Double_t _jet1_phi; |
132 |
|
Double_t _jet1_energy; |
133 |
+ |
Double_t _jet2_et; |
134 |
|
Double_t _jet2_pt; |
135 |
|
Double_t _jet2_eta; |
136 |
|
Double_t _jet2_phi; |
137 |
|
Double_t _jet2_energy; |
138 |
+ |
Double_t _jet3_et; |
139 |
|
Double_t _jet3_pt; |
140 |
|
Double_t _jet3_eta; |
141 |
|
Double_t _jet3_phi; |
142 |
|
Double_t _jet3_energy; |
143 |
+ |
Double_t _jet4_et; |
144 |
|
Double_t _jet4_pt; |
145 |
|
Double_t _jet4_eta; |
146 |
|
Double_t _jet4_phi; |
207 |
|
// mT |
208 |
|
Double_t _getDphiMuMet ; |
209 |
|
Double_t _getMt ; |
210 |
+ |
// |
211 |
+ |
// |
212 |
+ |
//_____ b tagging ______________________________________________ |
213 |
+ |
vector<double> * _jet_pt; |
214 |
+ |
vector<double> * _jet_pz; |
215 |
+ |
vector<double> * _jet_eta; |
216 |
+ |
vector<double> * _jet_phi; |
217 |
+ |
vector<double> * _jet_et; |
218 |
+ |
vector<double> * _jet_energy; |
219 |
+ |
vector<int> * _jet_flavor; |
220 |
+ |
// |
221 |
+ |
vector<double> * _muon_pt; |
222 |
+ |
vector<double> * _muon_pz; |
223 |
+ |
vector<double> * _muon_eta; |
224 |
+ |
vector<double> * _muon_phi; |
225 |
+ |
vector<double> * _muon_et; |
226 |
+ |
vector<double> * _muon_energy; |
227 |
+ |
vector<int> * _muon_flavor; |
228 |
+ |
// |
229 |
+ |
vector<double> * _electron_pt; |
230 |
+ |
vector<double> * _electron_pz; |
231 |
+ |
vector<double> * _electron_eta; |
232 |
+ |
vector<double> * _electron_phi; |
233 |
+ |
vector<double> * _electron_et; |
234 |
+ |
vector<double> * _electron_energy; |
235 |
+ |
vector<int> * _electron_flavor; |
236 |
+ |
/* FIXME: add vectors of these: |
237 |
+ |
Double_t _lepton_track_iso; |
238 |
+ |
Double_t _lepton_calo_iso; |
239 |
+ |
Double_t _lepton_ecal_iso; |
240 |
+ |
Double_t _lepton_hcal_iso; |
241 |
+ |
Double_t _lepton_user_iso; |
242 |
+ |
Double_t _lepton_IsoDeposit_em; |
243 |
+ |
Double_t _lepton_IsoDeposit_had; |
244 |
+ |
*/ |
245 |
+ |
TBranch * b_jet_pt; |
246 |
+ |
TBranch * b_jet_pz; |
247 |
+ |
TBranch * b_jet_eta; |
248 |
+ |
TBranch * b_jet_phi; |
249 |
+ |
TBranch * b_jet_et; |
250 |
+ |
TBranch * b_jet_energy; |
251 |
+ |
TBranch * b_jet_flavor; |
252 |
+ |
// |
253 |
+ |
TBranch * b_lepton_pt; |
254 |
+ |
TBranch * b_lepton_pz; |
255 |
+ |
TBranch * b_lepton_eta; |
256 |
+ |
TBranch * b_lepton_phi; |
257 |
+ |
TBranch * b_lepton_et; |
258 |
+ |
TBranch * b_lepton_energy; |
259 |
+ |
TBranch * b_lepton_flavor; |
260 |
+ |
TBranch * b_lepton_jet_min_dr; |
261 |
+ |
TBranch * b_lepton_ptrel; |
262 |
+ |
TBranch * b_lepton_d0; |
263 |
+ |
TBranch * b_lepton_d0_err; |
264 |
+ |
TBranch * b_lepton_d0_significance; |
265 |
+ |
// |
266 |
+ |
vector<string> * _b_tagger_label; |
267 |
+ |
vector<float> * _b_tagger_discr; |
268 |
+ |
TBranch * b_b_tagger_label; |
269 |
+ |
TBranch * b_b_tagger_discr; |
270 |
|
Int_t _n_tagged_jets_trackCounting_loose; |
271 |
|
Int_t _n_tagged_jets_trackCounting_medium; |
272 |
|
Int_t _n_tagged_jets_trackCounting_tight; |
277 |
|
// |
278 |
|
// |
279 |
|
//_____ electron quality _______________________________________ |
280 |
< |
Double_t _electron_id_robust; |
281 |
< |
Double_t _electron_id_loose; |
282 |
< |
Double_t _electron_id_tight; |
283 |
< |
Double_t _electron_tdrid_medium; |
284 |
< |
Double_t _electron_tdrid_loose; |
194 |
< |
Double_t _electron_tdrid_tight; |
280 |
> |
Float_t _eidLoose; |
281 |
> |
Float_t _eidRobustHighEnergy; |
282 |
> |
Float_t _eidRobustLoose; |
283 |
> |
Float_t _eidRobustTight; |
284 |
> |
Float_t _eidTight; |
285 |
|
Int_t _GsfElectron_classification; |
286 |
|
Double_t _GsfElectron_hadronicOverEm; |
287 |
|
Double_t _GsfElectron_caloEnergyError; |
288 |
|
Double_t _GsfElectron_trackMomentumError; |
199 |
– |
Double_t _GsfElectron_shFracInnerHits; //! measure the fraction of common hits between the GSF and CTF tracks |
289 |
|
Int_t _GsfElectron_numberOfClusters; |
290 |
|
Double_t _GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor |
291 |
|
Double_t _GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point |
295 |
|
Double_t _GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point |
296 |
|
Double_t _GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state |
297 |
|
// ____ branches |
298 |
< |
TBranch * b_electron_id_robust; |
299 |
< |
TBranch * b_electron_id_loose; |
300 |
< |
TBranch * b_electron_id_tight; |
301 |
< |
TBranch * b_electron_tdrid_medium; |
302 |
< |
TBranch * b_electron_tdrid_loose; |
214 |
< |
TBranch * b_electron_tdrid_tight; |
298 |
> |
TBranch * b_eidLoose; |
299 |
> |
TBranch * b_eidRobustHighEnergy; |
300 |
> |
TBranch * b_eidRobustLoose; |
301 |
> |
TBranch * b_eidRobustTight; |
302 |
> |
TBranch * b_eidTight; |
303 |
|
TBranch * b_GsfElectron_classification; |
304 |
|
TBranch * b_GsfElectron_hadronicOverEm; |
305 |
|
TBranch * b_GsfElectron_caloEnergyError; |
306 |
|
TBranch * b_GsfElectron_trackMomentumError; |
219 |
– |
TBranch * b_GsfElectron_shFracInnerHits; //! measure the fraction of common hits between the GSF and CTF tracks |
307 |
|
TBranch * b_GsfElectron_numberOfClusters; |
308 |
|
TBranch * b_GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor |
309 |
|
TBranch * b_GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point |
350 |
|
TBranch * b_event; |
351 |
|
TBranch * b_process_id; |
352 |
|
TBranch * b_n_jets; |
353 |
+ |
TBranch * b_n_removed_jets; |
354 |
|
TBranch * b_n_met; |
355 |
|
TBranch * b_n_muons; |
356 |
|
TBranch * b_n_electrons; |
357 |
|
TBranch * b_lepton_is_muon; |
358 |
|
TBranch * b_event_weight; |
359 |
< |
TBranch * b_lepton_pt; |
360 |
< |
TBranch * b_lepton_eta; |
361 |
< |
TBranch * b_lepton_phi; |
362 |
< |
TBranch * b_lepton_energy; |
359 |
> |
// |
360 |
> |
TBranch * b_muon_et; |
361 |
> |
TBranch * b_muon_pt; |
362 |
> |
TBranch * b_muon_pz; |
363 |
> |
TBranch * b_muon_eta; |
364 |
> |
TBranch * b_muon_phi; |
365 |
> |
TBranch * b_muon_energy; |
366 |
> |
TBranch * b_muon_flavor; |
367 |
> |
// |
368 |
> |
TBranch * b_electron_et; |
369 |
> |
TBranch * b_electron_pt; |
370 |
> |
TBranch * b_electron_pz; |
371 |
> |
TBranch * b_electron_eta; |
372 |
> |
TBranch * b_electron_phi; |
373 |
> |
TBranch * b_electron_energy; |
374 |
> |
TBranch * b_electron_flavor; |
375 |
> |
// |
376 |
|
TBranch * b_muon_track_chi2; |
377 |
|
TBranch * b_muon_track_ndof; |
378 |
|
TBranch * b_muon_track_nChi2; |
387 |
|
TBranch * b_lepton_ecal_iso; |
388 |
|
TBranch * b_lepton_hcal_iso; |
389 |
|
TBranch * b_lepton_user_iso; |
390 |
< |
TBranch * b_met_pt; |
390 |
> |
TBranch * b_lepton_IsoDeposit_em; |
391 |
> |
TBranch * b_lepton_IsoDeposit_had; |
392 |
|
TBranch * b_met_et; |
393 |
+ |
TBranch * b_met_pt; |
394 |
|
TBranch * b_met_eta; |
395 |
|
TBranch * b_met_phi; |
396 |
|
TBranch * b_met_energy; |
397 |
+ |
TBranch * b_jet1_et; |
398 |
|
TBranch * b_jet1_pt; |
399 |
|
TBranch * b_jet1_eta; |
400 |
|
TBranch * b_jet1_phi; |
401 |
|
TBranch * b_jet1_energy; |
402 |
+ |
TBranch * b_jet2_et; |
403 |
|
TBranch * b_jet2_pt; |
404 |
|
TBranch * b_jet2_eta; |
405 |
|
TBranch * b_jet2_phi; |
406 |
|
TBranch * b_jet2_energy; |
407 |
+ |
TBranch * b_jet3_et; |
408 |
|
TBranch * b_jet3_pt; |
409 |
|
TBranch * b_jet3_eta; |
410 |
|
TBranch * b_jet3_phi; |
411 |
|
TBranch * b_jet3_energy; |
412 |
+ |
TBranch * b_jet4_et; |
413 |
|
TBranch * b_jet4_pt; |
414 |
|
TBranch * b_jet4_eta; |
415 |
|
TBranch * b_jet4_phi; |