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