ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/interface/TtLJetsAnalyzer.h
Revision: 1.12
Committed: Tue May 12 19:35:58 2009 UTC (15 years, 11 months ago) by kukartse
Content type: text/plain
Branch: MAIN
CVS Tags: V00-01-13
Changes since 1.11: +13 -2 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.12 // $Id: TtLJetsAnalyzer.h,v 1.11 2009/04/07 08:43:48 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.12 bool first_event;
51    
52 kukartse 1.5 // _____ quantities read from the config file _________________________
53 kukartse 1.12 std::string _jetSource, _electronSource, _muonSource, _METSource,
54     _beamSpotSource, _trigger_source;
55 kukartse 1.10 bool _lepton_flavor_is_muon;
56 kukartse 1.1 std::string _outFile;
57 kukartse 1.8 bool _is_mc;
58 kukartse 1.1 int nCaloJets_min;
59     int nLepton_min;
60 jindal 1.6 double jet_pt_min ;
61 kukartse 1.1 double jet_eta_max ;
62     double muon_pt_min ;
63     double muon_eta_max ;
64     double muon_trackIso_max ;
65     double muon_caloIso_max ;
66     double electron_pt_min ;
67     double electron_eta_max ;
68     double electron_trackIso_max ;
69     double electron_caloIso_max ;
70     double met_et_min ;
71 kukartse 1.7 double min_dr_jet_lepton ;
72 kukartse 1.1
73     RooGKCounter eventCounter;
74     RooGKCounter selectedEvents;
75    
76     TTree * _tree;
77    
78 kukartse 1.5 //
79     // _____ output tree variables ________________________________________
80 kukartse 1.12 //
81 kukartse 1.1 Int_t _event;
82     Int_t _process_id;
83     Int_t _n_jets;
84 kukartse 1.7 Int_t _n_removed_jets;
85 kukartse 1.1 Int_t _n_met;
86     Int_t _n_muons;
87     Int_t _n_electrons;
88     Int_t _lepton_is_muon;
89 kukartse 1.12 //
90     //_____ trigger _______________________________________________________
91     //
92     std::map<std::string,bool> _hlt;
93     //vector<TBranch> b_hlt;
94     //
95 kukartse 1.1 Double_t _event_weight;
96 kukartse 1.5 Double_t _lepton_et;
97 kukartse 1.1 Double_t _lepton_pt;
98     Double_t _lepton_eta;
99     Double_t _lepton_phi;
100 kukartse 1.11 Double_t _lepton_jet_min_dr;
101 kukartse 1.10 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 kukartse 1.1 Double_t _lepton_energy;
106 kukartse 1.10 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 kukartse 1.12 Int_t _muon_track_nhits;
114 kukartse 1.3 Double_t _muon_track_chi2;
115     Double_t _muon_track_ndof;
116     Double_t _muon_track_nChi2;
117     Double_t _muon_outerTrack_chi2;
118     Double_t _muon_outerTrack_ndof;
119     Double_t _muon_outerTrack_nChi2;
120     Double_t _muon_globalTrack_chi2;
121     Double_t _muon_globalTrack_ndof;
122     Double_t _muon_globalTrack_nChi2;
123 kukartse 1.5 Double_t _met_et;
124 kukartse 1.1 Double_t _met_pt;
125     Double_t _met_eta;
126     Double_t _met_phi;
127     Double_t _met_energy;
128 kukartse 1.5 Double_t _jet1_et;
129 kukartse 1.1 Double_t _jet1_pt;
130     Double_t _jet1_eta;
131     Double_t _jet1_phi;
132     Double_t _jet1_energy;
133 kukartse 1.5 Double_t _jet2_et;
134 kukartse 1.1 Double_t _jet2_pt;
135     Double_t _jet2_eta;
136     Double_t _jet2_phi;
137     Double_t _jet2_energy;
138 kukartse 1.5 Double_t _jet3_et;
139 kukartse 1.1 Double_t _jet3_pt;
140     Double_t _jet3_eta;
141     Double_t _jet3_phi;
142     Double_t _jet3_energy;
143 kukartse 1.5 Double_t _jet4_et;
144 kukartse 1.1 Double_t _jet4_pt;
145     Double_t _jet4_eta;
146     Double_t _jet4_phi;
147     Double_t _jet4_energy;
148     Double_t _aplanarity ;
149     Double_t _centrality ;
150     Double_t _sphericity ;
151     Double_t _ht ;
152     Double_t _htPlusLepton ;
153     Double_t _metHtPlusLepton ;
154     Double_t _h ;
155     Double_t _ktMinPrime ;
156     Double_t _dPhiLMet ;
157     Double_t _minDijetMass ;
158     Double_t _maxJetEta ;
159     Double_t _et3 ;
160     Double_t _minDiJetDeltaR ;
161     Double_t _leptonJetDeltaR ;
162     Double_t _ht2p ;
163     Double_t _jet1Jet2DeltaR ;
164     Double_t _jet1Jet2DeltaPhi ;
165     Double_t _jet1Jet2_M ;
166     Double_t _jet1Jet2_Pt ;
167     Double_t _jet1Jet2W_M ;
168     Double_t _jet1Jet2W_Pt ;
169     Double_t _hz ;
170     Double_t _HT2 ;
171     Double_t _HT2prime ;
172     Double_t _W_MT ;
173     Double_t _W_M ;
174     Double_t _W_Pt ;
175     Double_t _DphiJMET ;
176     // Ht
177     Double_t _getHt ;
178     Double_t _getHtp ;
179     Double_t _getHtpp ;
180     Double_t _getHt2 ;
181     Double_t _getHt2p ;
182     Double_t _getHt2pp ;
183     Double_t _getHt3 ;
184     Double_t _getHt3p ;
185     Double_t _getHt3pp ;
186     Double_t _getCen ;
187     Double_t _getNJW ;
188     Double_t _getJetEtaMax ;
189     Double_t _getMdijetMin ;
190     Double_t _getMtjets ;
191     Double_t _getSqrtsT ;
192     Double_t _getMtAurelio ;
193     Double_t _getPzOverHT ;
194     Double_t _getMevent ;
195     Double_t _getM123inv ;
196     Double_t _getEta2Sum ;
197     Double_t _getMwRec ;
198     Double_t _getH ;
199     // event topo
200     Double_t _getSph ;
201     Double_t _getApl ;
202     Double_t _getAplMu ;
203     // Kt
204     Double_t _getKtminp ;
205     Double_t _getKtminpReduced ;
206     Double_t _getDrMinJetJet ;
207     // mT
208     Double_t _getDphiMuMet ;
209     Double_t _getMt ;
210 kukartse 1.5 //
211     //
212     //_____ b tagging ______________________________________________
213 kukartse 1.8 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 kukartse 1.9 //
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 kukartse 1.8 /* 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 kukartse 1.9 //
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 kukartse 1.11 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 kukartse 1.9 //
266 kukartse 1.5 vector<string> * _b_tagger_label;
267     vector<float> * _b_tagger_discr;
268     TBranch * b_b_tagger_label;
269     TBranch * b_b_tagger_discr;
270 kukartse 1.4 Int_t _n_tagged_jets_trackCounting_loose;
271     Int_t _n_tagged_jets_trackCounting_medium;
272     Int_t _n_tagged_jets_trackCounting_tight;
273     Int_t _n_tagged_jets_jetProb_loose;
274     Int_t _n_tagged_jets_jetProb_medium;
275     Int_t _n_tagged_jets_jetProb_tight;
276 kukartse 1.1
277 kukartse 1.4 //
278     //
279     //_____ electron quality _______________________________________
280 kukartse 1.5 Float_t _eidLoose;
281     Float_t _eidRobustHighEnergy;
282     Float_t _eidRobustLoose;
283     Float_t _eidRobustTight;
284     Float_t _eidTight;
285 kukartse 1.4 Int_t _GsfElectron_classification;
286     Double_t _GsfElectron_hadronicOverEm;
287     Double_t _GsfElectron_caloEnergyError;
288     Double_t _GsfElectron_trackMomentumError;
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
292     Double_t _GsfElectron_eSeedClusterOverPout; // the seed cluster energy / track momentum at calo from outermost state
293     Double_t _GsfElectron_deltaEtaSuperClusterTrackAtVtx; // the supercluster eta - track eta from helix extrapolation from impact point
294     Double_t _GsfElectron_deltaEtaSeedClusterTrackAtCalo; // the seed cluster eta - track eta at calo from outermost state
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 kukartse 1.5 TBranch * b_eidLoose;
299     TBranch * b_eidRobustHighEnergy;
300     TBranch * b_eidRobustLoose;
301     TBranch * b_eidRobustTight;
302     TBranch * b_eidTight;
303 kukartse 1.4 TBranch * b_GsfElectron_classification;
304     TBranch * b_GsfElectron_hadronicOverEm;
305     TBranch * b_GsfElectron_caloEnergyError;
306     TBranch * b_GsfElectron_trackMomentumError;
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
310     TBranch * b_GsfElectron_eSeedClusterOverPout; // the seed cluster energy / track momentum at calo from outermost state
311     TBranch * b_GsfElectron_deltaEtaSuperClusterTrackAtVtx; // the supercluster eta - track eta from helix extrapolation from impact point
312     TBranch * b_GsfElectron_deltaEtaSeedClusterTrackAtCalo; // the seed cluster eta - track eta at calo from outermost state
313     TBranch * b_GsfElectron_deltaPhiSuperClusterTrackAtVtx; // the supercluster phi - track phi from helix extrapolation from impact point
314     TBranch * b_GsfElectron_deltaPhiSeedClusterTrackAtCalo; // the seed cluster phi - track phi at calo from outermost state
315     //
316     //
317     //_____ muon quality _______________________________________
318     bool _muon_isGood_All; // dummy options - always true
319     bool _muon_isGood_AllGlobalMuons; // checks isGlobalMuon flag
320     bool _muon_isGood_AllStandAloneMuons; // checks isStandAloneMuon flag
321     bool _muon_isGood_AllTrackerMuons; // checks isTrackerMuon flag
322     bool _muon_isGood_TrackerMuonArbitrated; // resolve ambiguity of sharing segments
323     bool _muon_isGood_AllArbitrated; // all muons with the tracker muon arbitrated
324     bool _muon_isGood_GlobalMuonPromptTight; // global muons with tighter fit requirements
325     bool _muon_isGood_TMLastStationLoose; // penetration depth loose selector
326     bool _muon_isGood_TMLastStationTight; // penetration depth tight selector
327     bool _muon_isGood_TM2DCompatibilityLoose; // likelihood based loose selector
328     bool _muon_isGood_TM2DCompatibilityTight; // likelihood based tight selector
329     bool _muon_isGood_TMOneStationLoose; // require one well matched segment
330     bool _muon_isGood_TMOneStationTight; // require one well matched segment
331     bool _muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
332     bool _muon_isGood_TMLastStationOptimizedLowPtTight; // combination of TMLastStation and TMOneStation
333     //____ branches
334     TBranch * b_muon_isGood_All; // dummy options - always true
335     TBranch * b_muon_isGood_AllGlobalMuons; // checks isGlobalMuon flag
336     TBranch * b_muon_isGood_AllStandAloneMuons; // checks isStandAloneMuon flag
337     TBranch * b_muon_isGood_AllTrackerMuons; // checks isTrackerMuon flag
338     TBranch * b_muon_isGood_TrackerMuonArbitrated; // resolve ambiguity of sharing segments
339     TBranch * b_muon_isGood_AllArbitrated; // all muons with the tracker muon arbitrated
340     TBranch * b_muon_isGood_GlobalMuonPromptTight; // global muons with tighter fit requirements
341     TBranch * b_muon_isGood_TMLastStationLoose; // penetration depth loose selector
342     TBranch * b_muon_isGood_TMLastStationTight; // penetration depth tight selector
343     TBranch * b_muon_isGood_TM2DCompatibilityLoose; // likelihood based loose selector
344     TBranch * b_muon_isGood_TM2DCompatibilityTight; // likelihood based tight selector
345     TBranch * b_muon_isGood_TMOneStationLoose; // require one well matched segment
346     TBranch * b_muon_isGood_TMOneStationTight; // require one well matched segment
347     TBranch * b_muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
348     TBranch * b_muon_isGood_TMLastStationOptimizedLowPtTight; // combination of TMLastStation and TMOneStation
349     //____ output tree variables
350 kukartse 1.1 TBranch * b_event;
351     TBranch * b_process_id;
352     TBranch * b_n_jets;
353 kukartse 1.8 TBranch * b_n_removed_jets;
354 kukartse 1.1 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 kukartse 1.9 //
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 kukartse 1.3 TBranch * b_muon_track_chi2;
377     TBranch * b_muon_track_ndof;
378     TBranch * b_muon_track_nChi2;
379     TBranch * b_muon_outerTrack_chi2;
380     TBranch * b_muon_outerTrack_ndof;
381     TBranch * b_muon_outerTrack_nChi2;
382     TBranch * b_muon_globalTrack_chi2;
383     TBranch * b_muon_globalTrack_ndof;
384     TBranch * b_muon_globalTrack_nChi2;
385 kukartse 1.1 TBranch * b_lepton_track_iso;
386     TBranch * b_lepton_calo_iso;
387 kukartse 1.2 TBranch * b_lepton_ecal_iso;
388     TBranch * b_lepton_hcal_iso;
389     TBranch * b_lepton_user_iso;
390 kukartse 1.8 TBranch * b_lepton_IsoDeposit_em;
391     TBranch * b_lepton_IsoDeposit_had;
392 kukartse 1.5 TBranch * b_met_et;
393 kukartse 1.1 TBranch * b_met_pt;
394     TBranch * b_met_eta;
395     TBranch * b_met_phi;
396     TBranch * b_met_energy;
397 kukartse 1.5 TBranch * b_jet1_et;
398 kukartse 1.1 TBranch * b_jet1_pt;
399     TBranch * b_jet1_eta;
400     TBranch * b_jet1_phi;
401     TBranch * b_jet1_energy;
402 kukartse 1.5 TBranch * b_jet2_et;
403 kukartse 1.1 TBranch * b_jet2_pt;
404     TBranch * b_jet2_eta;
405     TBranch * b_jet2_phi;
406     TBranch * b_jet2_energy;
407 kukartse 1.5 TBranch * b_jet3_et;
408 kukartse 1.1 TBranch * b_jet3_pt;
409     TBranch * b_jet3_eta;
410     TBranch * b_jet3_phi;
411     TBranch * b_jet3_energy;
412 kukartse 1.5 TBranch * b_jet4_et;
413 kukartse 1.1 TBranch * b_jet4_pt;
414     TBranch * b_jet4_eta;
415     TBranch * b_jet4_phi;
416     TBranch * b_jet4_energy;
417     TBranch * b_n_tagged_jets_trackCounting_loose;
418     TBranch * b_n_tagged_jets_trackCounting_medium;
419     TBranch * b_n_tagged_jets_trackCounting_tight;
420     TBranch * b_n_tagged_jets_jetProb_loose;
421     TBranch * b_n_tagged_jets_jetProb_medium;
422     TBranch * b_n_tagged_jets_jetProb_tight;
423 kukartse 1.4 // ____
424 kukartse 1.1 TBranch * b_aplanarity ;
425     TBranch * b_centrality ;
426     TBranch * b_sphericity ;
427     TBranch * b_ht ;
428     TBranch * b_htPlusLepton ;
429     TBranch * b_metHtPlusLepton ;
430     TBranch * b_h ;
431     TBranch * b_ktMinPrime ;
432     TBranch * b_dPhiLMet ;
433     TBranch * b_minDijetMass ;
434     TBranch * b_maxJetEta ;
435     TBranch * b_et3 ;
436     TBranch * b_minDiJetDeltaR ;
437     TBranch * b_leptonJetDeltaR ;
438     TBranch * b_ht2p ;
439     TBranch * b_jet1Jet2DeltaR ;
440     TBranch * b_jet1Jet2DeltaPhi ;
441     TBranch * b_jet1Jet2_M ;
442     TBranch * b_jet1Jet2_Pt ;
443     TBranch * b_jet1Jet2W_M ;
444     TBranch * b_jet1Jet2W_Pt ;
445     TBranch * b_hz ;
446 kukartse 1.4 TBranch * b_HT2;
447     TBranch * b_HT2prime;
448     TBranch * b_W_MT;
449 kukartse 1.1 TBranch * b_W_M ;
450     TBranch * b_W_Pt ;
451     TBranch * b_DphiJMET ;
452     // Ht
453     TBranch * b_getHt ;
454     TBranch * b_getHtp ;
455     TBranch * b_getHtpp ;
456     TBranch * b_getHt2 ;
457     TBranch * b_getHt2p ;
458     TBranch * b_getHt2pp ;
459     TBranch * b_getHt3 ;
460     TBranch * b_getHt3p ;
461     TBranch * b_getHt3pp ;
462     TBranch * b_getCen ;
463     TBranch * b_getNJW ;
464     TBranch * b_getJetEtaMax ;
465     TBranch * b_getMdijetMin ;
466     TBranch * b_getMtjets ;
467     TBranch * b_getSqrtsT ;
468     TBranch * b_getMtAurelio ;
469     TBranch * b_getPzOverHT ;
470     TBranch * b_getMevent ;
471     TBranch * b_getM123inv ;
472     TBranch * b_getEta2Sum ;
473     TBranch * b_getMwRec ;
474     TBranch * b_getH ;
475     // event topo
476     TBranch * b_getSph ;
477     TBranch * b_getApl ;
478     TBranch * b_getAplMu ;
479     // Kt
480     TBranch * b_getKtminp ;
481     TBranch * b_getKtminpReduced ;
482     TBranch * b_getDrMinJetJet ;
483     // mT
484     TBranch * b_getDphiMuMet ;
485     TBranch * b_getMt ;
486    
487 kukartse 1.4
488 kukartse 1.1 };