ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/interface/TtLJetsAnalyzer.h
Revision: 1.11
Committed: Tue Apr 7 08:43:48 2009 UTC (16 years, 1 month ago) by kukartse
Content type: text/plain
Branch: MAIN
CVS Tags: V00-01-12, V00-01-11
Changes since 1.10: +7 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 kukartse 1.1 // -*- C++ -*-
2     //
3     // Package: TtLJetsAnalyzer
4     // Class: TtLJetsAnalyzer
5     //
6     /**\class TtLJetsAnalyzer TtLJetsAnalyzer.cc RecoBTag/TtLJetsAnalyzer/src/TtLJetsAnalyzer.cc
7    
8     Description: Likelihood variables for ttbar events
9    
10     Implementation:
11     Ttbar cross section without b tagging. Likelihood quantities.
12     */
13     //
14     // Original Author: Gena Kukartsev, kukarzev@fnal.gov
15     // Created: Fri Jun 20 06:19:59 CDT 2008
16 kukartse 1.11 // $Id: TtLJetsAnalyzer.h,v 1.10 2009/04/06 18:22:33 kukartse Exp $
17 kukartse 1.1 //
18     //
19    
20 kukartse 1.8 #include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h"
21    
22 kukartse 1.1 #include <memory>
23     #include <string>
24 kukartse 1.10 //#include "TFile.h"
25 kukartse 1.8 #include "TTree.h"
26     #include "Rtypes.h"
27 kukartse 1.1 #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"
32    
33 kukartse 1.10 #include "FWCore/ServiceRegistry/interface/Service.h"
34     #include "PhysicsTools/UtilAlgos/interface/TFileService.h"
35    
36 kukartse 1.1 class TtLJetsAnalyzer : public edm::EDAnalyzer {
37     public:
38     explicit TtLJetsAnalyzer(const edm::ParameterSet&);
39     ~TtLJetsAnalyzer();
40    
41    
42     private:
43 kukartse 1.4
44     virtual void beginJob(const edm::EventSetup&);
45     virtual void analyze(const edm::Event&, const edm::EventSetup&);
46     virtual void endJob(void);
47    
48 kukartse 1.10 edm::Service<TFileService> fs;
49    
50 kukartse 1.5 // _____ quantities read from the config file _________________________
51 kukartse 1.10 std::string _jetSource, _electronSource, _muonSource, _METSource, _beamSpotSource;
52     bool _lepton_flavor_is_muon;
53 kukartse 1.1 std::string _outFile;
54 kukartse 1.8 bool _is_mc;
55 kukartse 1.1 int nCaloJets_min;
56     int nLepton_min;
57 jindal 1.6 double jet_pt_min ;
58 kukartse 1.1 double jet_eta_max ;
59     double muon_pt_min ;
60     double muon_eta_max ;
61     double muon_trackIso_max ;
62     double muon_caloIso_max ;
63     double electron_pt_min ;
64     double electron_eta_max ;
65     double electron_trackIso_max ;
66     double electron_caloIso_max ;
67     double met_et_min ;
68 kukartse 1.7 double min_dr_jet_lepton ;
69 kukartse 1.1
70     RooGKCounter eventCounter;
71     RooGKCounter selectedEvents;
72    
73     TTree * _tree;
74    
75 kukartse 1.5 //
76     // _____ output tree variables ________________________________________
77 kukartse 1.1 Int_t _event;
78     Int_t _process_id;
79     Int_t _n_jets;
80 kukartse 1.7 Int_t _n_removed_jets;
81 kukartse 1.1 Int_t _n_met;
82     Int_t _n_muons;
83     Int_t _n_electrons;
84     Int_t _lepton_is_muon;
85     Double_t _event_weight;
86 kukartse 1.5 Double_t _lepton_et;
87 kukartse 1.1 Double_t _lepton_pt;
88     Double_t _lepton_eta;
89     Double_t _lepton_phi;
90 kukartse 1.11 Double_t _lepton_jet_min_dr;
91 kukartse 1.10 Double_t _lepton_ptrel; // relative to the nearest jet
92     Double_t _lepton_d0; // relative to the beam spot
93     Double_t _lepton_d0_err; // relative to the beam spot
94     Double_t _lepton_d0_significance; // relative to the beam spot
95 kukartse 1.1 Double_t _lepton_energy;
96 kukartse 1.10 Double_t _lepton_track_iso;
97     Double_t _lepton_calo_iso;
98     Double_t _lepton_ecal_iso;
99     Double_t _lepton_hcal_iso;
100     Double_t _lepton_user_iso;
101     Double_t _lepton_IsoDeposit_em;
102     Double_t _lepton_IsoDeposit_had;
103 kukartse 1.3 Double_t _muon_track_chi2;
104     Double_t _muon_track_ndof;
105     Double_t _muon_track_nChi2;
106     Double_t _muon_outerTrack_chi2;
107     Double_t _muon_outerTrack_ndof;
108     Double_t _muon_outerTrack_nChi2;
109     Double_t _muon_globalTrack_chi2;
110     Double_t _muon_globalTrack_ndof;
111     Double_t _muon_globalTrack_nChi2;
112 kukartse 1.5 Double_t _met_et;
113 kukartse 1.1 Double_t _met_pt;
114     Double_t _met_eta;
115     Double_t _met_phi;
116     Double_t _met_energy;
117 kukartse 1.5 Double_t _jet1_et;
118 kukartse 1.1 Double_t _jet1_pt;
119     Double_t _jet1_eta;
120     Double_t _jet1_phi;
121     Double_t _jet1_energy;
122 kukartse 1.5 Double_t _jet2_et;
123 kukartse 1.1 Double_t _jet2_pt;
124     Double_t _jet2_eta;
125     Double_t _jet2_phi;
126     Double_t _jet2_energy;
127 kukartse 1.5 Double_t _jet3_et;
128 kukartse 1.1 Double_t _jet3_pt;
129     Double_t _jet3_eta;
130     Double_t _jet3_phi;
131     Double_t _jet3_energy;
132 kukartse 1.5 Double_t _jet4_et;
133 kukartse 1.1 Double_t _jet4_pt;
134     Double_t _jet4_eta;
135     Double_t _jet4_phi;
136     Double_t _jet4_energy;
137     Double_t _aplanarity ;
138     Double_t _centrality ;
139     Double_t _sphericity ;
140     Double_t _ht ;
141     Double_t _htPlusLepton ;
142     Double_t _metHtPlusLepton ;
143     Double_t _h ;
144     Double_t _ktMinPrime ;
145     Double_t _dPhiLMet ;
146     Double_t _minDijetMass ;
147     Double_t _maxJetEta ;
148     Double_t _et3 ;
149     Double_t _minDiJetDeltaR ;
150     Double_t _leptonJetDeltaR ;
151     Double_t _ht2p ;
152     Double_t _jet1Jet2DeltaR ;
153     Double_t _jet1Jet2DeltaPhi ;
154     Double_t _jet1Jet2_M ;
155     Double_t _jet1Jet2_Pt ;
156     Double_t _jet1Jet2W_M ;
157     Double_t _jet1Jet2W_Pt ;
158     Double_t _hz ;
159     Double_t _HT2 ;
160     Double_t _HT2prime ;
161     Double_t _W_MT ;
162     Double_t _W_M ;
163     Double_t _W_Pt ;
164     Double_t _DphiJMET ;
165     // Ht
166     Double_t _getHt ;
167     Double_t _getHtp ;
168     Double_t _getHtpp ;
169     Double_t _getHt2 ;
170     Double_t _getHt2p ;
171     Double_t _getHt2pp ;
172     Double_t _getHt3 ;
173     Double_t _getHt3p ;
174     Double_t _getHt3pp ;
175     Double_t _getCen ;
176     Double_t _getNJW ;
177     Double_t _getJetEtaMax ;
178     Double_t _getMdijetMin ;
179     Double_t _getMtjets ;
180     Double_t _getSqrtsT ;
181     Double_t _getMtAurelio ;
182     Double_t _getPzOverHT ;
183     Double_t _getMevent ;
184     Double_t _getM123inv ;
185     Double_t _getEta2Sum ;
186     Double_t _getMwRec ;
187     Double_t _getH ;
188     // event topo
189     Double_t _getSph ;
190     Double_t _getApl ;
191     Double_t _getAplMu ;
192     // Kt
193     Double_t _getKtminp ;
194     Double_t _getKtminpReduced ;
195     Double_t _getDrMinJetJet ;
196     // mT
197     Double_t _getDphiMuMet ;
198     Double_t _getMt ;
199 kukartse 1.5 //
200     //
201     //_____ b tagging ______________________________________________
202 kukartse 1.8 vector<double> * _jet_pt;
203     vector<double> * _jet_pz;
204     vector<double> * _jet_eta;
205     vector<double> * _jet_phi;
206     vector<double> * _jet_et;
207     vector<double> * _jet_energy;
208     vector<int> * _jet_flavor;
209 kukartse 1.9 //
210     vector<double> * _muon_pt;
211     vector<double> * _muon_pz;
212     vector<double> * _muon_eta;
213     vector<double> * _muon_phi;
214     vector<double> * _muon_et;
215     vector<double> * _muon_energy;
216     vector<int> * _muon_flavor;
217     //
218     vector<double> * _electron_pt;
219     vector<double> * _electron_pz;
220     vector<double> * _electron_eta;
221     vector<double> * _electron_phi;
222     vector<double> * _electron_et;
223     vector<double> * _electron_energy;
224     vector<int> * _electron_flavor;
225 kukartse 1.8 /* FIXME: add vectors of these:
226     Double_t _lepton_track_iso;
227     Double_t _lepton_calo_iso;
228     Double_t _lepton_ecal_iso;
229     Double_t _lepton_hcal_iso;
230     Double_t _lepton_user_iso;
231     Double_t _lepton_IsoDeposit_em;
232     Double_t _lepton_IsoDeposit_had;
233     */
234     TBranch * b_jet_pt;
235     TBranch * b_jet_pz;
236     TBranch * b_jet_eta;
237     TBranch * b_jet_phi;
238     TBranch * b_jet_et;
239     TBranch * b_jet_energy;
240     TBranch * b_jet_flavor;
241 kukartse 1.9 //
242     TBranch * b_lepton_pt;
243     TBranch * b_lepton_pz;
244     TBranch * b_lepton_eta;
245     TBranch * b_lepton_phi;
246     TBranch * b_lepton_et;
247     TBranch * b_lepton_energy;
248     TBranch * b_lepton_flavor;
249 kukartse 1.11 TBranch * b_lepton_jet_min_dr;
250     TBranch * b_lepton_ptrel;
251     TBranch * b_lepton_d0;
252     TBranch * b_lepton_d0_err;
253     TBranch * b_lepton_d0_significance;
254 kukartse 1.9 //
255 kukartse 1.5 vector<string> * _b_tagger_label;
256     vector<float> * _b_tagger_discr;
257     TBranch * b_b_tagger_label;
258     TBranch * b_b_tagger_discr;
259 kukartse 1.4 Int_t _n_tagged_jets_trackCounting_loose;
260     Int_t _n_tagged_jets_trackCounting_medium;
261     Int_t _n_tagged_jets_trackCounting_tight;
262     Int_t _n_tagged_jets_jetProb_loose;
263     Int_t _n_tagged_jets_jetProb_medium;
264     Int_t _n_tagged_jets_jetProb_tight;
265 kukartse 1.1
266 kukartse 1.4 //
267     //
268     //_____ electron quality _______________________________________
269 kukartse 1.5 Float_t _eidLoose;
270     Float_t _eidRobustHighEnergy;
271     Float_t _eidRobustLoose;
272     Float_t _eidRobustTight;
273     Float_t _eidTight;
274 kukartse 1.4 Int_t _GsfElectron_classification;
275     Double_t _GsfElectron_hadronicOverEm;
276     Double_t _GsfElectron_caloEnergyError;
277     Double_t _GsfElectron_trackMomentumError;
278     Int_t _GsfElectron_numberOfClusters;
279     Double_t _GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor
280     Double_t _GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point
281     Double_t _GsfElectron_eSeedClusterOverPout; // the seed cluster energy / track momentum at calo from outermost state
282     Double_t _GsfElectron_deltaEtaSuperClusterTrackAtVtx; // the supercluster eta - track eta from helix extrapolation from impact point
283     Double_t _GsfElectron_deltaEtaSeedClusterTrackAtCalo; // the seed cluster eta - track eta at calo from outermost state
284     Double_t _GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point
285     Double_t _GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state
286     // ____ branches
287 kukartse 1.5 TBranch * b_eidLoose;
288     TBranch * b_eidRobustHighEnergy;
289     TBranch * b_eidRobustLoose;
290     TBranch * b_eidRobustTight;
291     TBranch * b_eidTight;
292 kukartse 1.4 TBranch * b_GsfElectron_classification;
293     TBranch * b_GsfElectron_hadronicOverEm;
294     TBranch * b_GsfElectron_caloEnergyError;
295     TBranch * b_GsfElectron_trackMomentumError;
296     TBranch * b_GsfElectron_numberOfClusters;
297     TBranch * b_GsfElectron_caloEnergy; // the super cluster energy corrected by EnergyScaleFactor
298     TBranch * b_GsfElectron_eSuperClusterOverP; // the supercluster energy / track momentum at impact point
299     TBranch * b_GsfElectron_eSeedClusterOverPout; // the seed cluster energy / track momentum at calo from outermost state
300     TBranch * b_GsfElectron_deltaEtaSuperClusterTrackAtVtx; // the supercluster eta - track eta from helix extrapolation from impact point
301     TBranch * b_GsfElectron_deltaEtaSeedClusterTrackAtCalo; // the seed cluster eta - track eta at calo from outermost state
302     TBranch * b_GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point
303     TBranch * b_GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state
304     //
305     //
306     //_____ muon quality _______________________________________
307     bool _muon_isGood_All; // dummy options - always true
308     bool _muon_isGood_AllGlobalMuons; // checks isGlobalMuon flag
309     bool _muon_isGood_AllStandAloneMuons; // checks isStandAloneMuon flag
310     bool _muon_isGood_AllTrackerMuons; // checks isTrackerMuon flag
311     bool _muon_isGood_TrackerMuonArbitrated; // resolve ambiguity of sharing segments
312     bool _muon_isGood_AllArbitrated; // all muons with the tracker muon arbitrated
313     bool _muon_isGood_GlobalMuonPromptTight; // global muons with tighter fit requirements
314     bool _muon_isGood_TMLastStationLoose; // penetration depth loose selector
315     bool _muon_isGood_TMLastStationTight; // penetration depth tight selector
316     bool _muon_isGood_TM2DCompatibilityLoose; // likelihood based loose selector
317     bool _muon_isGood_TM2DCompatibilityTight; // likelihood based tight selector
318     bool _muon_isGood_TMOneStationLoose; // require one well matched segment
319     bool _muon_isGood_TMOneStationTight; // require one well matched segment
320     bool _muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
321     bool _muon_isGood_TMLastStationOptimizedLowPtTight; // combination of TMLastStation and TMOneStation
322     //____ branches
323     TBranch * b_muon_isGood_All; // dummy options - always true
324     TBranch * b_muon_isGood_AllGlobalMuons; // checks isGlobalMuon flag
325     TBranch * b_muon_isGood_AllStandAloneMuons; // checks isStandAloneMuon flag
326     TBranch * b_muon_isGood_AllTrackerMuons; // checks isTrackerMuon flag
327     TBranch * b_muon_isGood_TrackerMuonArbitrated; // resolve ambiguity of sharing segments
328     TBranch * b_muon_isGood_AllArbitrated; // all muons with the tracker muon arbitrated
329     TBranch * b_muon_isGood_GlobalMuonPromptTight; // global muons with tighter fit requirements
330     TBranch * b_muon_isGood_TMLastStationLoose; // penetration depth loose selector
331     TBranch * b_muon_isGood_TMLastStationTight; // penetration depth tight selector
332     TBranch * b_muon_isGood_TM2DCompatibilityLoose; // likelihood based loose selector
333     TBranch * b_muon_isGood_TM2DCompatibilityTight; // likelihood based tight selector
334     TBranch * b_muon_isGood_TMOneStationLoose; // require one well matched segment
335     TBranch * b_muon_isGood_TMOneStationTight; // require one well matched segment
336     TBranch * b_muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
337     TBranch * b_muon_isGood_TMLastStationOptimizedLowPtTight; // combination of TMLastStation and TMOneStation
338     //____ output tree variables
339 kukartse 1.1 TBranch * b_event;
340     TBranch * b_process_id;
341     TBranch * b_n_jets;
342 kukartse 1.8 TBranch * b_n_removed_jets;
343 kukartse 1.1 TBranch * b_n_met;
344     TBranch * b_n_muons;
345     TBranch * b_n_electrons;
346     TBranch * b_lepton_is_muon;
347     TBranch * b_event_weight;
348 kukartse 1.9 //
349     TBranch * b_muon_et;
350     TBranch * b_muon_pt;
351     TBranch * b_muon_pz;
352     TBranch * b_muon_eta;
353     TBranch * b_muon_phi;
354     TBranch * b_muon_energy;
355     TBranch * b_muon_flavor;
356     //
357     TBranch * b_electron_et;
358     TBranch * b_electron_pt;
359     TBranch * b_electron_pz;
360     TBranch * b_electron_eta;
361     TBranch * b_electron_phi;
362     TBranch * b_electron_energy;
363     TBranch * b_electron_flavor;
364     //
365 kukartse 1.3 TBranch * b_muon_track_chi2;
366     TBranch * b_muon_track_ndof;
367     TBranch * b_muon_track_nChi2;
368     TBranch * b_muon_outerTrack_chi2;
369     TBranch * b_muon_outerTrack_ndof;
370     TBranch * b_muon_outerTrack_nChi2;
371     TBranch * b_muon_globalTrack_chi2;
372     TBranch * b_muon_globalTrack_ndof;
373     TBranch * b_muon_globalTrack_nChi2;
374 kukartse 1.1 TBranch * b_lepton_track_iso;
375     TBranch * b_lepton_calo_iso;
376 kukartse 1.2 TBranch * b_lepton_ecal_iso;
377     TBranch * b_lepton_hcal_iso;
378     TBranch * b_lepton_user_iso;
379 kukartse 1.8 TBranch * b_lepton_IsoDeposit_em;
380     TBranch * b_lepton_IsoDeposit_had;
381 kukartse 1.5 TBranch * b_met_et;
382 kukartse 1.1 TBranch * b_met_pt;
383     TBranch * b_met_eta;
384     TBranch * b_met_phi;
385     TBranch * b_met_energy;
386 kukartse 1.5 TBranch * b_jet1_et;
387 kukartse 1.1 TBranch * b_jet1_pt;
388     TBranch * b_jet1_eta;
389     TBranch * b_jet1_phi;
390     TBranch * b_jet1_energy;
391 kukartse 1.5 TBranch * b_jet2_et;
392 kukartse 1.1 TBranch * b_jet2_pt;
393     TBranch * b_jet2_eta;
394     TBranch * b_jet2_phi;
395     TBranch * b_jet2_energy;
396 kukartse 1.5 TBranch * b_jet3_et;
397 kukartse 1.1 TBranch * b_jet3_pt;
398     TBranch * b_jet3_eta;
399     TBranch * b_jet3_phi;
400     TBranch * b_jet3_energy;
401 kukartse 1.5 TBranch * b_jet4_et;
402 kukartse 1.1 TBranch * b_jet4_pt;
403     TBranch * b_jet4_eta;
404     TBranch * b_jet4_phi;
405     TBranch * b_jet4_energy;
406     TBranch * b_n_tagged_jets_trackCounting_loose;
407     TBranch * b_n_tagged_jets_trackCounting_medium;
408     TBranch * b_n_tagged_jets_trackCounting_tight;
409     TBranch * b_n_tagged_jets_jetProb_loose;
410     TBranch * b_n_tagged_jets_jetProb_medium;
411     TBranch * b_n_tagged_jets_jetProb_tight;
412 kukartse 1.4 // ____
413 kukartse 1.1 TBranch * b_aplanarity ;
414     TBranch * b_centrality ;
415     TBranch * b_sphericity ;
416     TBranch * b_ht ;
417     TBranch * b_htPlusLepton ;
418     TBranch * b_metHtPlusLepton ;
419     TBranch * b_h ;
420     TBranch * b_ktMinPrime ;
421     TBranch * b_dPhiLMet ;
422     TBranch * b_minDijetMass ;
423     TBranch * b_maxJetEta ;
424     TBranch * b_et3 ;
425     TBranch * b_minDiJetDeltaR ;
426     TBranch * b_leptonJetDeltaR ;
427     TBranch * b_ht2p ;
428     TBranch * b_jet1Jet2DeltaR ;
429     TBranch * b_jet1Jet2DeltaPhi ;
430     TBranch * b_jet1Jet2_M ;
431     TBranch * b_jet1Jet2_Pt ;
432     TBranch * b_jet1Jet2W_M ;
433     TBranch * b_jet1Jet2W_Pt ;
434     TBranch * b_hz ;
435 kukartse 1.4 TBranch * b_HT2;
436     TBranch * b_HT2prime;
437     TBranch * b_W_MT;
438 kukartse 1.1 TBranch * b_W_M ;
439     TBranch * b_W_Pt ;
440     TBranch * b_DphiJMET ;
441     // Ht
442     TBranch * b_getHt ;
443     TBranch * b_getHtp ;
444     TBranch * b_getHtpp ;
445     TBranch * b_getHt2 ;
446     TBranch * b_getHt2p ;
447     TBranch * b_getHt2pp ;
448     TBranch * b_getHt3 ;
449     TBranch * b_getHt3p ;
450     TBranch * b_getHt3pp ;
451     TBranch * b_getCen ;
452     TBranch * b_getNJW ;
453     TBranch * b_getJetEtaMax ;
454     TBranch * b_getMdijetMin ;
455     TBranch * b_getMtjets ;
456     TBranch * b_getSqrtsT ;
457     TBranch * b_getMtAurelio ;
458     TBranch * b_getPzOverHT ;
459     TBranch * b_getMevent ;
460     TBranch * b_getM123inv ;
461     TBranch * b_getEta2Sum ;
462     TBranch * b_getMwRec ;
463     TBranch * b_getH ;
464     // event topo
465     TBranch * b_getSph ;
466     TBranch * b_getApl ;
467     TBranch * b_getAplMu ;
468     // Kt
469     TBranch * b_getKtminp ;
470     TBranch * b_getKtminpReduced ;
471     TBranch * b_getDrMinJetJet ;
472     // mT
473     TBranch * b_getDphiMuMet ;
474     TBranch * b_getMt ;
475    
476 kukartse 1.4
477 kukartse 1.1 };