17 |
|
// |
18 |
|
// |
19 |
|
|
20 |
+ |
#include "DataFormats/BeamSpot/interface/BeamSpot.h" |
21 |
+ |
|
22 |
+ |
#include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h" |
23 |
+ |
|
24 |
|
#include <memory> |
25 |
|
#include <string> |
26 |
< |
|
26 |
> |
//#include "TFile.h" |
27 |
> |
#include "TTree.h" |
28 |
> |
#include "Rtypes.h" |
29 |
|
#include "FWCore/Framework/interface/Frameworkfwd.h" |
30 |
|
#include "FWCore/Framework/interface/EDAnalyzer.h" |
31 |
|
#include "FWCore/Framework/interface/Event.h" |
32 |
|
#include "FWCore/Framework/interface/MakerMacros.h" |
33 |
|
#include "FWCore/ParameterSet/interface/ParameterSet.h" |
28 |
– |
#include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h" |
34 |
|
|
35 |
< |
#include "TFile.h" |
36 |
< |
#include "TTree.h" |
37 |
< |
#include "Rtypes.h" |
35 |
> |
#include "FWCore/ServiceRegistry/interface/Service.h" |
36 |
> |
#include "PhysicsTools/UtilAlgos/interface/TFileService.h" |
37 |
> |
#include "DataFormats/Math/interface/LorentzVector.h" |
38 |
> |
#include "DataFormats/Common/interface/View.h" |
39 |
> |
#include "DataFormats/PatCandidates/interface/Electron.h" |
40 |
> |
#include "DataFormats/TrackReco/interface/Track.h" |
41 |
|
|
42 |
|
class TtLJetsAnalyzer : public edm::EDAnalyzer { |
43 |
|
public: |
51 |
|
virtual void analyze(const edm::Event&, const edm::EventSetup&); |
52 |
|
virtual void endJob(void); |
53 |
|
|
54 |
< |
// quantities read from the config file |
55 |
< |
std::string _jetSource, _electronSource, _muonSource, _METSource; |
54 |
> |
// returns pair<dist,dcot> |
55 |
> |
pair<float, float> getConversionInfo(const pat::Electron & el, |
56 |
> |
const reco::Track & track, |
57 |
> |
const reco::BeamSpot::Point _bs, |
58 |
> |
float bField); |
59 |
> |
|
60 |
> |
bool ConversionAlgo(const pat::Electron& e, edm::Handle<edm::View<reco::Track> > track_h); |
61 |
> |
double DelRTrackEle(const pat::Electron& e,const reco::Track& tk); |
62 |
> |
|
63 |
> |
edm::Service<TFileService> fs; |
64 |
> |
|
65 |
> |
bool first_event; |
66 |
> |
|
67 |
> |
// _____ quantities read from the config file _________________________ |
68 |
> |
std::string _jetSource, _electronSource, _muonSource, _METSource, |
69 |
> |
_beamSpotSource, _trigger_source, _track_source; |
70 |
> |
std::string pdfWeightTag_; |
71 |
> |
bool _lepton_flavor_is_muon; |
72 |
|
std::string _outFile; |
73 |
+ |
bool _is_mc; |
74 |
|
int nCaloJets_min; |
75 |
|
int nLepton_min; |
76 |
|
double jet_pt_min ; |
84 |
|
double electron_trackIso_max ; |
85 |
|
double electron_caloIso_max ; |
86 |
|
double met_et_min ; |
87 |
+ |
double min_dr_jet_lepton ; |
88 |
+ |
double _bfield; |
89 |
+ |
double _dist_min; |
90 |
+ |
double _dist_max; |
91 |
+ |
double _abs_dcot_max; |
92 |
+ |
double _e_track_dr; |
93 |
|
|
94 |
|
RooGKCounter eventCounter; |
95 |
|
RooGKCounter selectedEvents; |
96 |
|
|
66 |
– |
TFile * _file; |
97 |
|
TTree * _tree; |
98 |
|
|
99 |
< |
// output tree variables |
99 |
> |
// |
100 |
> |
// _____ output tree variables ________________________________________ |
101 |
> |
// |
102 |
|
Int_t _event; |
103 |
|
Int_t _process_id; |
104 |
|
Int_t _n_jets; |
105 |
+ |
Int_t _n_removed_jets; |
106 |
|
Int_t _n_met; |
107 |
|
Int_t _n_muons; |
108 |
|
Int_t _n_electrons; |
109 |
|
Int_t _lepton_is_muon; |
110 |
+ |
// |
111 |
+ |
//_____ photon conversion _____________________________________________ |
112 |
+ |
// |
113 |
+ |
vector<double> * _e_dist; |
114 |
+ |
vector<double> * _e_dcot; |
115 |
+ |
bool _is_conv; |
116 |
+ |
// |
117 |
+ |
//_____ PDF weights ___________________________________________________ |
118 |
+ |
// |
119 |
+ |
vector<double> * _pdf_weights; |
120 |
+ |
Double_t _weight_pdf_pos; |
121 |
+ |
Double_t _weight_pdf_neg; |
122 |
+ |
// |
123 |
+ |
//_____ trigger _______________________________________________________ |
124 |
+ |
// |
125 |
+ |
std::map<std::string,bool> _hlt; |
126 |
+ |
//vector<TBranch> b_hlt; |
127 |
+ |
// |
128 |
|
Double_t _event_weight; |
129 |
+ |
Double_t _lepton_et; |
130 |
|
Double_t _lepton_pt; |
131 |
|
Double_t _lepton_eta; |
132 |
|
Double_t _lepton_phi; |
133 |
+ |
Double_t _lepton_jet_min_dr; |
134 |
+ |
Double_t _lepton_ptrel; // relative to the nearest jet |
135 |
+ |
Double_t _lepton_d0; // relative to the beam spot |
136 |
+ |
Double_t _lepton_d0_err; // relative to the beam spot |
137 |
+ |
Double_t _lepton_d0_significance; // relative to the beam spot |
138 |
|
Double_t _lepton_energy; |
139 |
+ |
Double_t _lepton_track_iso; |
140 |
+ |
Double_t _lepton_calo_iso; |
141 |
+ |
Double_t _lepton_ecal_iso; |
142 |
+ |
Double_t _lepton_hcal_iso; |
143 |
+ |
Double_t _lepton_user_iso; |
144 |
+ |
Double_t _lepton_IsoDeposit_em; |
145 |
+ |
Double_t _lepton_IsoDeposit_had; |
146 |
+ |
Int_t _muon_track_nhits; |
147 |
|
Double_t _muon_track_chi2; |
148 |
|
Double_t _muon_track_ndof; |
149 |
|
Double_t _muon_track_nChi2; |
153 |
|
Double_t _muon_globalTrack_chi2; |
154 |
|
Double_t _muon_globalTrack_ndof; |
155 |
|
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; |
156 |
|
Double_t _met_et; |
157 |
+ |
Double_t _met_pt; |
158 |
|
Double_t _met_eta; |
159 |
|
Double_t _met_phi; |
160 |
|
Double_t _met_energy; |
161 |
+ |
Double_t _jet1_et; |
162 |
|
Double_t _jet1_pt; |
163 |
|
Double_t _jet1_eta; |
164 |
|
Double_t _jet1_phi; |
165 |
|
Double_t _jet1_energy; |
166 |
+ |
Double_t _jet2_et; |
167 |
|
Double_t _jet2_pt; |
168 |
|
Double_t _jet2_eta; |
169 |
|
Double_t _jet2_phi; |
170 |
|
Double_t _jet2_energy; |
171 |
+ |
Double_t _jet3_et; |
172 |
|
Double_t _jet3_pt; |
173 |
|
Double_t _jet3_eta; |
174 |
|
Double_t _jet3_phi; |
175 |
|
Double_t _jet3_energy; |
176 |
+ |
Double_t _jet4_et; |
177 |
|
Double_t _jet4_pt; |
178 |
|
Double_t _jet4_eta; |
179 |
|
Double_t _jet4_phi; |
240 |
|
// mT |
241 |
|
Double_t _getDphiMuMet ; |
242 |
|
Double_t _getMt ; |
243 |
+ |
// |
244 |
+ |
// |
245 |
+ |
//_____ b tagging ______________________________________________ |
246 |
+ |
vector<double> * _jet_pt; |
247 |
+ |
vector<double> * _jet_pz; |
248 |
+ |
vector<double> * _jet_eta; |
249 |
+ |
vector<double> * _jet_phi; |
250 |
+ |
vector<double> * _jet_et; |
251 |
+ |
vector<double> * _jet_energy; |
252 |
+ |
vector<int> * _jet_flavor; |
253 |
+ |
// |
254 |
+ |
vector<double> * _muon_pt; |
255 |
+ |
vector<double> * _muon_pz; |
256 |
+ |
vector<double> * _muon_eta; |
257 |
+ |
vector<double> * _muon_phi; |
258 |
+ |
vector<double> * _muon_et; |
259 |
+ |
vector<double> * _muon_energy; |
260 |
+ |
vector<int> * _muon_flavor; |
261 |
+ |
// |
262 |
+ |
vector<double> * _electron_pt; |
263 |
+ |
vector<double> * _electron_pz; |
264 |
+ |
vector<double> * _electron_eta; |
265 |
+ |
vector<double> * _electron_phi; |
266 |
+ |
vector<double> * _electron_et; |
267 |
+ |
vector<double> * _electron_energy; |
268 |
+ |
vector<int> * _electron_flavor; |
269 |
+ |
/* FIXME: add vectors of these: |
270 |
+ |
Double_t _lepton_track_iso; |
271 |
+ |
Double_t _lepton_calo_iso; |
272 |
+ |
Double_t _lepton_ecal_iso; |
273 |
+ |
Double_t _lepton_hcal_iso; |
274 |
+ |
Double_t _lepton_user_iso; |
275 |
+ |
Double_t _lepton_IsoDeposit_em; |
276 |
+ |
Double_t _lepton_IsoDeposit_had; |
277 |
+ |
*/ |
278 |
+ |
TBranch * b_jet_pt; |
279 |
+ |
TBranch * b_jet_pz; |
280 |
+ |
TBranch * b_jet_eta; |
281 |
+ |
TBranch * b_jet_phi; |
282 |
+ |
TBranch * b_jet_et; |
283 |
+ |
TBranch * b_jet_energy; |
284 |
+ |
TBranch * b_jet_flavor; |
285 |
+ |
// |
286 |
+ |
TBranch * b_lepton_pt; |
287 |
+ |
TBranch * b_lepton_pz; |
288 |
+ |
TBranch * b_lepton_eta; |
289 |
+ |
TBranch * b_lepton_phi; |
290 |
+ |
TBranch * b_lepton_et; |
291 |
+ |
TBranch * b_lepton_energy; |
292 |
+ |
TBranch * b_lepton_flavor; |
293 |
+ |
TBranch * b_lepton_jet_min_dr; |
294 |
+ |
TBranch * b_lepton_ptrel; |
295 |
+ |
TBranch * b_lepton_d0; |
296 |
+ |
TBranch * b_lepton_d0_err; |
297 |
+ |
TBranch * b_lepton_d0_significance; |
298 |
+ |
// |
299 |
+ |
vector<string> * _b_tagger_label; |
300 |
+ |
vector<float> * _b_tagger_discr; |
301 |
+ |
TBranch * b_b_tagger_label; |
302 |
+ |
TBranch * b_b_tagger_discr; |
303 |
|
Int_t _n_tagged_jets_trackCounting_loose; |
304 |
|
Int_t _n_tagged_jets_trackCounting_medium; |
305 |
|
Int_t _n_tagged_jets_trackCounting_tight; |
310 |
|
// |
311 |
|
// |
312 |
|
//_____ electron quality _______________________________________ |
313 |
< |
Double_t _electron_id_robust; |
314 |
< |
Double_t _electron_id_loose; |
315 |
< |
Double_t _electron_id_tight; |
316 |
< |
Double_t _electron_tdrid_medium; |
317 |
< |
Double_t _electron_tdrid_loose; |
194 |
< |
Double_t _electron_tdrid_tight; |
313 |
> |
Float_t _eidLoose; |
314 |
> |
Float_t _eidRobustHighEnergy; |
315 |
> |
Float_t _eidRobustLoose; |
316 |
> |
Float_t _eidRobustTight; |
317 |
> |
Float_t _eidTight; |
318 |
|
Int_t _GsfElectron_classification; |
319 |
|
Double_t _GsfElectron_hadronicOverEm; |
320 |
|
Double_t _GsfElectron_caloEnergyError; |
321 |
|
Double_t _GsfElectron_trackMomentumError; |
199 |
– |
Double_t _GsfElectron_shFracInnerHits; //! measure the fraction of common hits between the GSF and CTF tracks |
322 |
|
Int_t _GsfElectron_numberOfClusters; |
323 |
|
Double_t _GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor |
324 |
|
Double_t _GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point |
328 |
|
Double_t _GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point |
329 |
|
Double_t _GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state |
330 |
|
// ____ branches |
331 |
< |
TBranch * b_electron_id_robust; |
332 |
< |
TBranch * b_electron_id_loose; |
333 |
< |
TBranch * b_electron_id_tight; |
334 |
< |
TBranch * b_electron_tdrid_medium; |
335 |
< |
TBranch * b_electron_tdrid_loose; |
214 |
< |
TBranch * b_electron_tdrid_tight; |
331 |
> |
TBranch * b_eidLoose; |
332 |
> |
TBranch * b_eidRobustHighEnergy; |
333 |
> |
TBranch * b_eidRobustLoose; |
334 |
> |
TBranch * b_eidRobustTight; |
335 |
> |
TBranch * b_eidTight; |
336 |
|
TBranch * b_GsfElectron_classification; |
337 |
|
TBranch * b_GsfElectron_hadronicOverEm; |
338 |
|
TBranch * b_GsfElectron_caloEnergyError; |
339 |
|
TBranch * b_GsfElectron_trackMomentumError; |
219 |
– |
TBranch * b_GsfElectron_shFracInnerHits; //! measure the fraction of common hits between the GSF and CTF tracks |
340 |
|
TBranch * b_GsfElectron_numberOfClusters; |
341 |
|
TBranch * b_GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor |
342 |
|
TBranch * b_GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point |
383 |
|
TBranch * b_event; |
384 |
|
TBranch * b_process_id; |
385 |
|
TBranch * b_n_jets; |
386 |
+ |
TBranch * b_n_removed_jets; |
387 |
|
TBranch * b_n_met; |
388 |
|
TBranch * b_n_muons; |
389 |
|
TBranch * b_n_electrons; |
390 |
|
TBranch * b_lepton_is_muon; |
391 |
|
TBranch * b_event_weight; |
392 |
< |
TBranch * b_lepton_pt; |
393 |
< |
TBranch * b_lepton_eta; |
394 |
< |
TBranch * b_lepton_phi; |
395 |
< |
TBranch * b_lepton_energy; |
392 |
> |
// |
393 |
> |
TBranch * b_muon_et; |
394 |
> |
TBranch * b_muon_pt; |
395 |
> |
TBranch * b_muon_pz; |
396 |
> |
TBranch * b_muon_eta; |
397 |
> |
TBranch * b_muon_phi; |
398 |
> |
TBranch * b_muon_energy; |
399 |
> |
TBranch * b_muon_flavor; |
400 |
> |
// |
401 |
> |
TBranch * b_electron_et; |
402 |
> |
TBranch * b_electron_pt; |
403 |
> |
TBranch * b_electron_pz; |
404 |
> |
TBranch * b_electron_eta; |
405 |
> |
TBranch * b_electron_phi; |
406 |
> |
TBranch * b_electron_energy; |
407 |
> |
TBranch * b_electron_flavor; |
408 |
> |
// |
409 |
|
TBranch * b_muon_track_chi2; |
410 |
|
TBranch * b_muon_track_ndof; |
411 |
|
TBranch * b_muon_track_nChi2; |
420 |
|
TBranch * b_lepton_ecal_iso; |
421 |
|
TBranch * b_lepton_hcal_iso; |
422 |
|
TBranch * b_lepton_user_iso; |
423 |
< |
TBranch * b_met_pt; |
423 |
> |
TBranch * b_lepton_IsoDeposit_em; |
424 |
> |
TBranch * b_lepton_IsoDeposit_had; |
425 |
|
TBranch * b_met_et; |
426 |
+ |
TBranch * b_met_pt; |
427 |
|
TBranch * b_met_eta; |
428 |
|
TBranch * b_met_phi; |
429 |
|
TBranch * b_met_energy; |
430 |
+ |
TBranch * b_jet1_et; |
431 |
|
TBranch * b_jet1_pt; |
432 |
|
TBranch * b_jet1_eta; |
433 |
|
TBranch * b_jet1_phi; |
434 |
|
TBranch * b_jet1_energy; |
435 |
+ |
TBranch * b_jet2_et; |
436 |
|
TBranch * b_jet2_pt; |
437 |
|
TBranch * b_jet2_eta; |
438 |
|
TBranch * b_jet2_phi; |
439 |
|
TBranch * b_jet2_energy; |
440 |
+ |
TBranch * b_jet3_et; |
441 |
|
TBranch * b_jet3_pt; |
442 |
|
TBranch * b_jet3_eta; |
443 |
|
TBranch * b_jet3_phi; |
444 |
|
TBranch * b_jet3_energy; |
445 |
+ |
TBranch * b_jet4_et; |
446 |
|
TBranch * b_jet4_pt; |
447 |
|
TBranch * b_jet4_eta; |
448 |
|
TBranch * b_jet4_phi; |