ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/src/TtLJetsAnalyzer.cc
Revision: 1.9
Committed: Tue Jan 27 20:50:17 2009 UTC (16 years, 3 months ago) by jindal
Content type: text/plain
Branch: MAIN
CVS Tags: gak022309, gak021209, gak040209, gak012809, V00-01-09
Changes since 1.8: +3 -3 lines
Log Message:
changing selection cut from jet_et to jet_pt

File Contents

# User Rev Content
1 kukartse 1.1 // -*- C++ -*-
2    
3     #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
4     #include "DataFormats/PatCandidates/interface/Jet.h"
5     #include "DataFormats/PatCandidates/interface/Electron.h"
6     #include "DataFormats/PatCandidates/interface/Muon.h"
7     #include "DataFormats/PatCandidates/interface/MET.h"
8     #include "LJMet/MultivariateAnalysis/interface/TtLJetsAnalyzer.h"
9    
10     #include "LJMet/MultivariateAnalysis/interface/TopTopologicalVariables.h"
11     #include "LJMet/MultivariateAnalysis/interface/LJetsTopoVars.h"
12    
13     using namespace std;
14     using namespace top_cafe;
15    
16     TtLJetsAnalyzer::TtLJetsAnalyzer(const edm::ParameterSet& iConfig)
17     {
18 kukartse 1.8 //
19     // _____ some default values __________________________________________
20     //_jetSource =
21     //_electronSource =
22     //_muonSource =
23     //_METSource =
24     //_outFile =
25     nCaloJets_min = 2;
26     nLepton_min = 1;
27 jindal 1.9 jet_pt_min = 25.0;
28 kukartse 1.8 jet_eta_max = 2.4;
29     muon_pt_min = 20.0;
30     muon_eta_max = 2.1;
31     muon_trackIso_max = 100.0;
32     muon_caloIso_max = 100.0;
33     electron_pt_min = 20.0;
34     electron_eta_max = 2.1;
35     electron_trackIso_max = 100.0;
36     electron_caloIso_max = 100.0;
37     met_et_min = 0.0;
38    
39    
40 kukartse 1.6 _outFile = iConfig.getParameter<string>("outFile");
41     _jetSource = iConfig.getParameter<string>("jetSource");
42     _electronSource = iConfig.getParameter<string>("electronSource");
43     _muonSource = iConfig.getParameter<string>("muonSource");
44     _METSource = iConfig.getParameter<string>("METSource");
45    
46     //
47     // Optional cuts (better use the official PAT selection filters)
48     //
49     if (iConfig.exists("nCaloJets_min")) nCaloJets_min = iConfig.getParameter<int>("nCaloJets_min");
50 kukartse 1.7 if (iConfig.exists("nLepton_min")) nLepton_min = iConfig.getParameter<int>("nLepton_min");
51 jindal 1.9 if (iConfig.exists("jet_pt_min")) jet_pt_min = iConfig.getParameter<double>("jet_pt_min");
52 kukartse 1.7 if (iConfig.exists("jet_eta_max")) jet_eta_max = iConfig.getParameter<double>("jet_eta_max");
53     if (iConfig.exists("muon_pt_min")) muon_pt_min = iConfig.getParameter<double>("muon_pt_min");
54     if (iConfig.exists("muon_eta_max")) muon_eta_max = iConfig.getParameter<double>("muon_eta_max");
55     if (iConfig.exists("muon_trackIso_max")) muon_trackIso_max = iConfig.getParameter<double>("muon_trackIso_max");
56     if (iConfig.exists("muon_caloIso_max")) muon_caloIso_max = iConfig.getParameter<double>("muon_caloIso_max");
57     if (iConfig.exists("electron_pt_min")) electron_pt_min = iConfig.getParameter<double>("electron_pt_min");
58     if (iConfig.exists("electron_eta_max")) electron_eta_max = iConfig.getParameter<double>("electron_eta_max");
59     if (iConfig.exists("electron_trackIso_max")) electron_trackIso_max = iConfig.getParameter<double>("electron_trackIso_max");
60     if (iConfig.exists("electron_caloIso_max")) electron_caloIso_max = iConfig.getParameter<double>("electron_caloIso_max");
61     if (iConfig.exists("met_et_min")) met_et_min = iConfig.getParameter<double>("met_et_min");
62 kukartse 1.1 }
63    
64    
65     TtLJetsAnalyzer::~TtLJetsAnalyzer()
66     {
67    
68     }
69    
70    
71     void TtLJetsAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
72     {
73     using namespace edm;
74     using namespace reco;
75     using namespace std;
76    
77     Handle< vector< pat::Jet > > jets;
78     Handle< vector< pat::Electron > > electrons;
79     Handle< vector< pat::Muon > > muons;
80     Handle< vector< pat::MET > > METs;
81    
82     iEvent . getByLabel( _jetSource, jets );
83     iEvent . getByLabel( _electronSource, electrons );
84     iEvent . getByLabel( _muonSource, muons );
85     iEvent . getByLabel( _METSource, METs );
86    
87 kukartse 1.2 double weight = 1.0;
88     // FIXME: obsolete, from CSA07
89     /*
90 kukartse 1.1 Handle< int> prId;
91     iEvent . getByLabel( "csa07ProcessId" , "", prId );
92     Handle< double> weightHandle;
93     try{
94     iEvent.getByLabel ("csa07EventWeightProducer","weight", weightHandle);
95     weight = * weightHandle;
96     }
97     catch( edm::Exception ) {
98     cout << "Warning: csa07 soup weight is not available... continuing with weight=1.0" << endl;
99     }
100 kukartse 1.2 */
101 kukartse 1.1
102     vector<int> good_jet_key;
103     vector<int> good_electron_key;
104     vector<int> good_muon_key;
105    
106     eventCounter . count();
107     eventCounter . incrementDouble( weight );
108    
109     //cout << "TtLJetAnalyzer::analyze(): number of jets = " << jets -> size() << endl;
110    
111     //__________ Initialization of ntuple variables_______________________
112 kukartse 1.7 _lepton_et = -1.0;
113 kukartse 1.1 _lepton_pt = -1.0;
114     _lepton_eta = -1.0;
115     _lepton_phi = -1.0;
116     _lepton_energy = -1.0;
117 kukartse 1.4 _muon_track_chi2 = -10.0;
118     _muon_track_ndof = -10.0;
119     _muon_track_nChi2 = -10.0;
120     _muon_outerTrack_chi2 = -10.0;
121     _muon_outerTrack_ndof = -10.0;
122     _muon_outerTrack_nChi2 = -10.0;
123     _muon_globalTrack_chi2 = -10.0;
124     _muon_globalTrack_ndof = -10.0;
125     _muon_globalTrack_nChi2 = -10.0;
126 kukartse 1.1 _lepton_track_iso = -1.0;
127     _lepton_calo_iso = -1.0;
128 kukartse 1.3 _lepton_ecal_iso = -1.0;
129     _lepton_hcal_iso = -1.0;
130     _lepton_user_iso = -1.0;
131 kukartse 1.7 _eidLoose = -10.0;
132     _eidRobustHighEnergy = -10.0;
133     _eidRobustLoose = -10.0;
134     _eidRobustTight = -10.0;
135     _eidTight = -10.0;
136     _GsfElectron_classification = -100;
137     _GsfElectron_hadronicOverEm = -100.0;
138     _GsfElectron_caloEnergyError = -100.0;
139     _GsfElectron_trackMomentumError = -100.0;
140     _GsfElectron_numberOfClusters = -100;
141     _GsfElectron_caloEnergy = -100.0;
142     _GsfElectron_eSuperClusterOverP = -100.0;
143     _GsfElectron_eSeedClusterOverPout = -100.0;
144     _GsfElectron_deltaEtaSuperClusterTrackAtVtx = -100.0;
145     _GsfElectron_deltaEtaSeedClusterTrackAtCalo = -100.0;
146     _GsfElectron_deltaPhiSuperClusterTrackAtVtx = -100.0;
147     _GsfElectron_deltaPhiSeedClusterTrackAtCalo = -100.0;
148     _met_et = -1.0;
149 kukartse 1.1 _met_pt = -1.0;
150     _met_eta = -1.0;
151     _met_phi = -1.0;
152     _met_energy = -1.0;
153 kukartse 1.7 _jet1_et = -1.0;
154 kukartse 1.1 _jet1_pt = -1.0;
155     _jet1_eta = -1.0;
156     _jet1_phi = -1.0;
157     _jet1_energy = -1.0;
158 kukartse 1.7 _jet2_et = -1.0;
159 kukartse 1.1 _jet2_pt = -1.0;
160     _jet2_eta = -1.0;
161     _jet2_phi = -1.0;
162     _jet2_energy = -1.0;
163 kukartse 1.7 _jet3_et = -1.0;
164 kukartse 1.1 _jet3_pt = -1.0;
165     _jet3_eta = -1.0;
166     _jet3_phi = -1.0;
167     _jet3_energy = -1.0;
168 kukartse 1.7 _jet4_et = -1.0;
169 kukartse 1.1 _jet4_pt = -1.0;
170     _jet4_eta = -1.0;
171     _jet4_phi = -1.0;
172     _jet4_energy = -1.0;
173 kukartse 1.7 //
174     //
175     // _____ b tagging ___________________________________________________
176     _b_tagger_label->clear();
177     _b_tagger_discr->clear();
178 kukartse 1.1 _n_tagged_jets_trackCounting_loose = -10;
179     _n_tagged_jets_trackCounting_medium = -10;
180     _n_tagged_jets_trackCounting_tight = -10;
181     _n_tagged_jets_jetProb_loose = -10;
182     _n_tagged_jets_jetProb_medium = -10;
183     _n_tagged_jets_jetProb_tight = -10;
184     //____________________________________________________________________
185    
186     // loop over jets
187     RooGKCounter nOfGoodJets;
188     RooGKCounter n_trackCounting_loose;
189     RooGKCounter n_trackCounting_medium;
190     RooGKCounter n_trackCounting_tight;
191     RooGKCounter n_jetProb_loose;
192     RooGKCounter n_jetProb_medium;
193     RooGKCounter n_jetProb_tight;
194     int jet_ind=0;
195     for ( vector<pat::Jet>::const_iterator jet = jets -> begin(); jet != jets -> end(); jet++ ){
196     if (
197     ( fabs( (*jet) . eta() ) < jet_eta_max ) &&
198 jindal 1.9 ( (*jet) . et() > jet_pt_min )
199 kukartse 1.1 )
200     {
201     good_jet_key . push_back( jet_ind );
202     nOfGoodJets . count();
203 kukartse 1.7 double jetBDiscr_track_count_high_eff = jet -> bDiscriminator( "trackCountingHighEffBJetTags" );
204     double jetBDiscr_track_count_high_pur = jet -> bDiscriminator( "trackCountingHighPurBJetTags" );
205     double jetBDiscr_jet_prob = jet -> bDiscriminator( "jetProbabilityBJetTags" );
206 kukartse 1.1 if (jetBDiscr_track_count_high_eff > 2.0) n_trackCounting_loose.count();
207     if (jetBDiscr_track_count_high_eff > 4.6) n_trackCounting_medium.count();
208     if (jetBDiscr_track_count_high_pur > 4.7) n_trackCounting_tight.count();
209     if (jetBDiscr_jet_prob > 0.26) n_jetProb_loose.count();
210     if (jetBDiscr_jet_prob > 0.50) n_jetProb_medium.count();
211     if (jetBDiscr_jet_prob > 0.76) n_jetProb_tight.count();
212 kukartse 1.7
213     //
214     // dump all tagger labels and discriminator values
215     // _______________________________________________________________________
216     const std::vector<std::pair<std::string, float> > & _discri = jet->getPairDiscri();
217     _b_tagger_label->clear();
218     _b_tagger_discr->clear();
219     for (std::vector<std::pair<std::string, float> >::const_iterator _di=_discri.begin(); _di!=_discri.end(); _di++){
220     //cout << " ==> Found available tagger: " << _di->first << ", discr=" << _di->second << endl;
221     _b_tagger_label->push_back(_di->first);
222     _b_tagger_discr->push_back(_di->second);
223     }
224 kukartse 1.1
225     if (nOfGoodJets.getCount()==1){
226 kukartse 1.7 _jet1_et=jet->et();
227 kukartse 1.1 _jet1_pt=jet->pt();
228     _jet1_eta=jet->eta();
229     _jet1_phi=jet->phi();
230     _jet1_energy=jet->energy();
231     }
232     if (nOfGoodJets.getCount()==2){
233 kukartse 1.7 _jet2_et=jet->et();
234 kukartse 1.1 _jet2_pt=jet->pt();
235     _jet2_eta=jet->eta();
236     _jet2_phi=jet->phi();
237     _jet2_energy=jet->energy();
238     }
239     if (nOfGoodJets.getCount()==3){
240 kukartse 1.7 _jet3_et=jet->et();
241 kukartse 1.1 _jet3_pt=jet->pt();
242     _jet3_eta=jet->eta();
243     _jet3_phi=jet->phi();
244     _jet3_energy=jet->energy();
245     }
246     if (nOfGoodJets.getCount()==4){
247 kukartse 1.7 _jet4_et=jet->et();
248 kukartse 1.1 _jet4_pt=jet->pt();
249     _jet4_eta=jet->eta();
250     _jet4_phi=jet->phi();
251     _jet4_energy=jet->energy();
252     }
253     }
254     jet_ind++;
255     }
256    
257     // loop over electrons
258     RooGKCounter nOfGoodElectrons( "" );
259     int el_ind = 0;
260     for ( vector<pat::Electron>::const_iterator el = electrons -> begin(); el != electrons -> end(); el++){
261     if (
262     (*el) . pt() > electron_pt_min &&
263     fabs( (*el) . eta() ) < electron_eta_max &&
264 kukartse 1.7 (*el).trackIso() < electron_trackIso_max &&
265     (*el).caloIso() < electron_caloIso_max
266 kukartse 1.1 ){
267     good_electron_key . push_back( el_ind );
268     nOfGoodElectrons . count();
269     }
270     el_ind++;
271     }
272    
273     // loop over muons
274     RooGKCounter nOfGoodMuons( "" );
275     int mu_ind = 0;
276     for ( vector<pat::Muon>::const_iterator mu = muons -> begin(); mu != muons -> end(); mu++){
277     if (
278     (*mu) . pt() > muon_pt_min &&
279     fabs( (*mu) . eta() ) < muon_eta_max &&
280 kukartse 1.7 (*mu).trackIso() < muon_trackIso_max &&
281     (*mu).caloIso() < muon_caloIso_max
282 kukartse 1.1 )
283     {
284     good_muon_key . push_back( mu_ind );
285     nOfGoodMuons . count();
286     }
287     mu_ind++;
288     }
289    
290     // loop over METs
291     RooGKCounter nOfGoodMETs( "" );
292     for ( vector<pat::MET>::const_iterator met = METs -> begin(); met != METs -> end(); met++){
293     if (
294     (*met) . et() > met_et_min
295     )
296     {
297     nOfGoodMETs . count();
298     }
299     }
300    
301     // ====== SELECTION =================
302     if (
303     (int)nOfGoodJets . getCount() >= nCaloJets_min &&
304     ( (int)nOfGoodElectrons . getCount() + (int)nOfGoodMuons . getCount() >= nLepton_min ) &&
305     nOfGoodMETs . getCount() > 0 ){
306     selectedEvents . count();
307     selectedEvents . incrementDouble( weight );
308    
309     _event = eventCounter . getCount();
310    
311 kukartse 1.2 //_process_id = * prId;
312     _process_id = 0;
313 kukartse 1.1 _n_jets = nOfGoodJets.getCount();
314     _n_met = nOfGoodMETs.getCount();
315     _n_muons = nOfGoodMuons.getCount();
316     _n_electrons = nOfGoodElectrons.getCount();
317    
318     string lepton_source;
319     bool is_muon;
320     if (nOfGoodElectrons . getCount() > 0 && nOfGoodMuons . getCount() > 0){
321     if ((*muons)[good_muon_key[0]].pt() > (*electrons)[good_electron_key[0]].pt()) is_muon = true;
322     else is_muon = false;
323     }
324     else if (nOfGoodMuons . getCount() > 0){
325     is_muon = true;
326     }
327     else{
328     is_muon = false;
329     }
330 kukartse 1.7
331 kukartse 1.1 if(is_muon){
332     _lepton_is_muon = 1;
333     lepton_source = _muonSource;
334 kukartse 1.7 _lepton_et = (*muons)[good_muon_key[0]].pt();
335 kukartse 1.1 _lepton_pt = (*muons)[good_muon_key[0]].pt();
336     _lepton_eta = (*muons)[good_muon_key[0]].eta();
337     _lepton_phi = (*muons)[good_muon_key[0]].phi();
338     _lepton_energy = (*muons)[good_muon_key[0]].energy();
339 kukartse 1.7 _lepton_track_iso = (*muons)[good_muon_key[0]].trackIso();
340     _lepton_calo_iso = (*muons)[good_muon_key[0]].caloIso();
341     _lepton_ecal_iso = (*muons)[good_muon_key[0]].ecalIso();
342     _lepton_hcal_iso = (*muons)[good_muon_key[0]].hcalIso();
343     _lepton_user_iso = (*muons)[good_muon_key[0]].userIso();
344     }
345     else{
346     _lepton_is_muon = 0;
347     lepton_source = _electronSource;
348     _lepton_et = (*electrons)[good_electron_key[0]].et();
349     _lepton_pt = (*electrons)[good_electron_key[0]].pt();
350     _lepton_eta = (*electrons)[good_electron_key[0]].eta();
351     _lepton_phi = (*electrons)[good_electron_key[0]].phi();
352     _lepton_energy = (*electrons)[good_electron_key[0]].energy();
353     _lepton_track_iso = (*electrons)[good_electron_key[0]].trackIso();
354     _lepton_calo_iso = (*electrons)[good_electron_key[0]].caloIso();
355     _lepton_ecal_iso = (*electrons)[good_electron_key[0]].ecalIso();
356     _lepton_hcal_iso = (*electrons)[good_electron_key[0]].hcalIso();
357     _lepton_user_iso = (*electrons)[good_electron_key[0]].userIso();
358     }
359    
360     if ( nOfGoodMuons.getCount() > 0 ){
361 kukartse 1.4 _muon_track_chi2 = (*muons)[good_muon_key[0]].track()->chi2();
362     _muon_track_ndof = (*muons)[good_muon_key[0]].track()->ndof();
363     _muon_track_nChi2 = (*muons)[good_muon_key[0]].track()->normalizedChi2();
364     //_muon_outerTrack_chi2 = (*muons)[good_muon_key[0]].outerTrack()->chi2();
365     //_muon_outerTrack_ndof = (*muons)[good_muon_key[0]].outerTrack()->ndof();
366     //_muon_outerTrack_nChi2 = (*muons)[good_muon_key[0]].outerTrack()->normalizedChi2();
367     //_muon_globalTrack_chi2 = (*muons)[good_muon_key[0]].globalTrack()->chi2();
368     //_muon_globalTrack_ndof = (*muons)[good_muon_key[0]].globalTrack()->ndof();
369     //_muon_globalTrack_nChi2 = (*muons)[good_muon_key[0]].globalTrack()->normalizedChi2();
370 kukartse 1.7 //
371     //_____ muon quality _________________________
372     _muon_isGood_All = (*muons)[good_muon_key[0]].isGood(reco::Muon::All);
373     _muon_isGood_AllGlobalMuons = (*muons)[good_muon_key[0]].isGood(reco::Muon::AllGlobalMuons);
374     _muon_isGood_AllStandAloneMuons = (*muons)[good_muon_key[0]].isGood(reco::Muon::AllStandAloneMuons);
375     _muon_isGood_AllTrackerMuons = (*muons)[good_muon_key[0]].isGood(reco::Muon::AllTrackerMuons);
376     _muon_isGood_TrackerMuonArbitrated = (*muons)[good_muon_key[0]].isGood(reco::Muon::TrackerMuonArbitrated);
377     _muon_isGood_AllArbitrated = (*muons)[good_muon_key[0]].isGood(reco::Muon::AllArbitrated);
378     _muon_isGood_GlobalMuonPromptTight = (*muons)[good_muon_key[0]].isGood(reco::Muon::GlobalMuonPromptTight);
379     _muon_isGood_TMLastStationLoose = (*muons)[good_muon_key[0]].isGood(reco::Muon::TMLastStationLoose);
380     _muon_isGood_TMLastStationTight = (*muons)[good_muon_key[0]].isGood(reco::Muon::TMLastStationTight);
381     _muon_isGood_TM2DCompatibilityLoose = (*muons)[good_muon_key[0]].isGood(reco::Muon::TM2DCompatibilityLoose);
382     _muon_isGood_TM2DCompatibilityTight = (*muons)[good_muon_key[0]].isGood(reco::Muon::TM2DCompatibilityTight);
383     _muon_isGood_TMOneStationLoose = (*muons)[good_muon_key[0]].isGood(reco::Muon::TMOneStationLoose);
384     _muon_isGood_TMOneStationTight = (*muons)[good_muon_key[0]].isGood(reco::Muon::TMOneStationTight);
385     _muon_isGood_TMLastStationOptimizedLowPtLoose = (*muons)[good_muon_key[0]].isGood(reco::Muon::TMLastStationOptimizedLowPtLoose);
386     _muon_isGood_TMLastStationOptimizedLowPtTight = (*muons)[good_muon_key[0]].isGood(reco::Muon::TMLastStationOptimizedLowPtTight);
387    
388 kukartse 1.1 }
389 kukartse 1.7 if ( nOfGoodElectrons.getCount() > 0 ){
390     //
391     // _____ electron ID _________________________________________________
392     //cout << " ------------### Electron ID labels: " << endl;
393     //const vector<std::pair<std::string,float> > & _ids = (*electrons)[good_electron_key[0]].electronIDs();
394     //for ( vector<std::pair<std::string,float> >::const_iterator _id = _ids.begin(); _id!=_ids.end(); _id++){
395     // cout << _id->first << ": " << _id->second << endl;
396 kukartse 1.5 //}
397 kukartse 1.7 _eidLoose = (*electrons)[good_electron_key[0]].electronID("eidLoose");
398     _eidRobustHighEnergy = (*electrons)[good_electron_key[0]].electronID("eidRobustHighEnergy");
399     _eidRobustLoose = (*electrons)[good_electron_key[0]].electronID("eidRobustLoose");
400     _eidRobustTight = (*electrons)[good_electron_key[0]].electronID("eidRobustTight");
401     _eidTight = (*electrons)[good_electron_key[0]].electronID("eidTight");
402     _GsfElectron_classification = (*electrons)[good_electron_key[0]].classification();
403     _GsfElectron_hadronicOverEm = (*electrons)[good_electron_key[0]].hadronicOverEm();
404     _GsfElectron_caloEnergyError = (*electrons)[good_electron_key[0]].caloEnergyError();
405     _GsfElectron_trackMomentumError = (*electrons)[good_electron_key[0]].trackMomentumError();
406     //_GsfElectron_numberOfClusters = (*electrons)[good_electron_key[0]].numberOfClusters();
407     _GsfElectron_caloEnergy = (*electrons)[good_electron_key[0]].caloEnergy();
408     _GsfElectron_eSuperClusterOverP = (*electrons)[good_electron_key[0]].eSuperClusterOverP();
409     _GsfElectron_eSeedClusterOverPout = (*electrons)[good_electron_key[0]].eSeedClusterOverPout();
410     _GsfElectron_deltaEtaSuperClusterTrackAtVtx = (*electrons)[good_electron_key[0]].deltaEtaSuperClusterTrackAtVtx();
411     _GsfElectron_deltaEtaSeedClusterTrackAtCalo = (*electrons)[good_electron_key[0]].deltaEtaSeedClusterTrackAtCalo();
412     _GsfElectron_deltaPhiSuperClusterTrackAtVtx = (*electrons)[good_electron_key[0]].deltaPhiSuperClusterTrackAtVtx();
413     _GsfElectron_deltaPhiSeedClusterTrackAtCalo = (*electrons)[good_electron_key[0]].deltaPhiSeedClusterTrackAtCalo();
414     }
415 kukartse 1.5
416 kukartse 1.1 _event_weight = weight;
417    
418 kukartse 1.7 _met_et = METs->begin()->et();
419 kukartse 1.1 _met_pt = METs->begin()->pt();
420     _met_eta = METs->begin()->eta();
421     _met_phi = METs->begin()->phi();
422     _met_energy = METs->begin()->energy();
423 kukartse 1.7
424     //
425     // _ b tagging ______________________________________________________
426 kukartse 1.1 _n_tagged_jets_trackCounting_loose = n_trackCounting_loose.getCount();
427     _n_tagged_jets_trackCounting_medium = n_trackCounting_medium.getCount();
428     _n_tagged_jets_trackCounting_tight = n_trackCounting_tight.getCount();
429     _n_tagged_jets_jetProb_loose = n_jetProb_loose.getCount();
430     _n_tagged_jets_jetProb_medium = n_jetProb_medium.getCount();
431     _n_tagged_jets_jetProb_tight = n_jetProb_tight.getCount();
432 kukartse 1.7 //
433     // _____ MVA kinematic variables ____________________________________
434     LJetsTopoVars ljets_topo_vars( _jetSource, _METSource, lepton_source, is_muon );
435     ljets_topo_vars . setEvent( iEvent );
436     //
437 kukartse 1.1 _aplanarity = ljets_topo_vars . aplanarity();
438     _centrality = ljets_topo_vars . centrality();
439     _sphericity = ljets_topo_vars . sphericity();
440     _ht = ljets_topo_vars . ht();
441     _htPlusLepton = ljets_topo_vars . htpluslepton();
442     _metHtPlusLepton = ljets_topo_vars . methtpluslepton();
443     _h = ljets_topo_vars . h();
444     _ktMinPrime = ljets_topo_vars . ktMinPrime();
445     _dPhiLMet = ljets_topo_vars . dphiLepMet();
446     _minDijetMass = ljets_topo_vars . minDijetMass();
447     _maxJetEta = ljets_topo_vars . maxJetEta();
448     _et3 = ljets_topo_vars . Et3();
449     _minDiJetDeltaR = ljets_topo_vars . minDijetDeltaR();
450     _leptonJetDeltaR = ljets_topo_vars . LeptonJet_DeltaR();
451     _ht2p = ljets_topo_vars . getHt2p();
452     _jet1Jet2DeltaR = ljets_topo_vars . Jet1Jet2_DeltaR();
453     _jet1Jet2DeltaPhi = ljets_topo_vars . Jet1Jet2_DeltaPhi();
454     _jet1Jet2_M = ljets_topo_vars . Jet1Jet2_M();
455     _jet1Jet2_Pt = ljets_topo_vars . Jet1Jet2_Pt();
456     _jet1Jet2W_M = ljets_topo_vars . Jet1Jet2W_M();
457     _jet1Jet2W_Pt = ljets_topo_vars . Jet1Jet2W_Pt();
458     _hz = ljets_topo_vars . Hz();
459     _HT2 = ljets_topo_vars . HT2();
460     _HT2prime = ljets_topo_vars . HT2prime();
461     _W_MT = ljets_topo_vars . W_MT();
462     _W_M = ljets_topo_vars . W_M();
463     _W_Pt = ljets_topo_vars . W_Pt();
464     _DphiJMET = ljets_topo_vars . DphiJMET();
465 kukartse 1.7 //
466     // _____ Ht _________________________________________________________
467 kukartse 1.1 _getHt = ljets_topo_vars . getHt();
468     _getHtp = ljets_topo_vars . getHtp();
469     _getHtpp = ljets_topo_vars . getHtpp();
470     _getHt2 = ljets_topo_vars . getHt2();
471     _getHt2p = ljets_topo_vars . getHt2p();
472     _getHt2pp = ljets_topo_vars . getHt2pp();
473     _getHt3 = ljets_topo_vars . getHt3();
474     _getHt3p = ljets_topo_vars . getHt3p();
475     _getHt3pp = ljets_topo_vars . getHt3pp();
476     _getCen = ljets_topo_vars . getCen();
477     _getNJW = ljets_topo_vars . getNJW();
478     _getJetEtaMax = ljets_topo_vars . getJetEtaMax();
479     _getMdijetMin = ljets_topo_vars . getMdijetMin();
480     _getMtjets = ljets_topo_vars . getMtjets();
481     _getSqrtsT = ljets_topo_vars . getSqrtsT();
482     _getMtAurelio = ljets_topo_vars . getMtAurelio();
483     _getPzOverHT = ljets_topo_vars . getPzOverHT();
484     _getMevent = ljets_topo_vars . getMevent();
485     _getM123inv = ljets_topo_vars . getM123inv();
486     _getEta2Sum = ljets_topo_vars . getEta2Sum();
487     _getMwRec = ljets_topo_vars . getMwRec();
488     _getH = ljets_topo_vars . getH();
489 kukartse 1.7 //
490     // _____ event topo _________________________________________________
491 kukartse 1.1 _getSph = ljets_topo_vars . getSph();
492     _getApl = ljets_topo_vars . getApl();
493     _getAplMu = ljets_topo_vars . getAplMu();
494 kukartse 1.7 //
495     // _____ Kt _________________________________________________________
496 kukartse 1.1 _getKtminp = ljets_topo_vars . getKtminp();
497     _getKtminpReduced = ljets_topo_vars . getKtminpReduced();
498     _getDrMinJetJet = ljets_topo_vars . getDrMinJetJet();
499 kukartse 1.7 //
500     // _____ mT _________________________________________________________
501 kukartse 1.1 _getDphiMuMet = ljets_topo_vars . getDphiMuMet();
502     _getMt = ljets_topo_vars . getMt();
503    
504     _tree -> Fill();
505    
506     //test printout
507     /*******
508     cout << endl << "TtLJetAnalyzer::analyze(): number of jets = " << jets -> size() << endl;
509     //cout << "TtLJetAnalyzer::analyze(): Et3 = " << ljets_topo_vars . Et3() << endl;
510     //cout << "TtLJetAnalyzer::analyze(): HT2p = " << ljets_topo_vars . ht()/ljets_topo_vars . Hz() << endl;
511     //cout << "TtLJetAnalyzer::analyze(): aplanarity = " << ljets_topo_vars . aplanarity() << endl;
512     //cout << "TtLJetAnalyzer::analyze(): centrality = " << ljets_topo_vars . centrality() << endl;
513     //cout << "TtLJetAnalyzer::analyze(): sphericity = " << ljets_topo_vars . sphericity() << endl;
514     cout << "DEBUG#### n_good_el = " << nOfGoodElectrons.getCount() << endl;
515     cout << "DEBUG#### n_good_mu = " << nOfGoodMuons.getCount() << endl;
516     cout << "DEBUG#### is_muon = " << is_muon << endl;
517     cout << "DEBUG#### track_iso = " << _lepton_track_iso << endl;
518     cout << "DEBUG#### calo_iso = " << _lepton_calo_iso << endl;
519     if (electrons->size()>0){
520 kukartse 1.7 cout << "DEBUG#### el_calo_iso = " << (*electrons)[good_electron_key[0]].caloIso() << endl;
521     cout << "DEBUG#### el_track_iso = " << (*electrons)[good_electron_key[0]].trackIso() << endl;
522 kukartse 1.1 }
523     if (muons->size()>0){
524     cout << "DEBUG#### mu_calo_iso = " << muons->begin()->caloIso() << endl;
525     cout << "DEBUG#### mu_track_iso = " << muons->begin()->trackIso() << endl;
526     }
527     *******/
528     }
529     }
530    
531    
532     void TtLJetsAnalyzer::beginJob(const edm::EventSetup&)
533     {
534 kukartse 1.7 // _____ b tagging ___________________________________________________
535     _b_tagger_label = new vector<string>;
536     _b_tagger_discr = new vector<float>;
537    
538 kukartse 1.1 _file = new TFile(_outFile . c_str(), "RECREATE");
539     _tree = new TTree("ttljets", "ttljets", 64000000);
540    
541     b_event = _tree -> Branch("event", &_event, "event/I" );
542     b_process_id = _tree -> Branch("process_id", &_process_id, "process_id/I" );
543     b_n_jets = _tree -> Branch("n_jets", &_n_jets, "n_jets/I" );
544     b_n_met = _tree -> Branch("n_met", &_n_met, "n_met/I" );
545     b_n_muons = _tree -> Branch("n_muons", &_n_muons, "n_muons/I" );
546     b_n_electrons = _tree -> Branch("n_electrons", &_n_electrons, "n_electrons/I" );
547     b_lepton_is_muon = _tree -> Branch("lepton_is_muon", &_lepton_is_muon, "lepton_is_muon/I" );
548     b_event_weight = _tree -> Branch("event_weight", &_event_weight, "event_weight/D" );
549 kukartse 1.7 b_lepton_et = _tree -> Branch("lepton_et", &_lepton_et, "lepton_et/D" );
550 kukartse 1.1 b_lepton_pt = _tree -> Branch("lepton_pt", &_lepton_pt, "lepton_pt/D" );
551     b_lepton_eta = _tree -> Branch("lepton_eta", &_lepton_eta, "lepton_eta/D" );
552     b_lepton_phi = _tree -> Branch("lepton_phi", &_lepton_phi, "lepton_phi/D" );
553     b_lepton_energy = _tree -> Branch("lepton_energy", &_lepton_energy, "lepton_energy/D" );
554 kukartse 1.4 b_muon_track_chi2 = _tree -> Branch("muon_track_chi2", &_muon_track_chi2, "muon_track_chi/D" );
555     b_muon_track_ndof = _tree -> Branch("muon_track_ndof", &_muon_track_ndof, "muon_track_ndof/D" );
556     b_muon_track_nChi2 = _tree -> Branch("muon_track_nChi2", &_muon_track_nChi2, "muon_track_nChi2/D" );
557 kukartse 1.1 b_lepton_track_iso = _tree -> Branch("lepton_track_iso", &_lepton_track_iso, "lepton_track_iso/D" );
558     b_lepton_calo_iso = _tree -> Branch("lepton_calo_iso", &_lepton_calo_iso, "lepton_calo_iso/D" );
559 kukartse 1.3 b_lepton_ecal_iso = _tree -> Branch("lepton_ecal_iso", &_lepton_ecal_iso, "lepton_ecal_iso/D" );
560     b_lepton_hcal_iso = _tree -> Branch("lepton_hcal_iso", &_lepton_hcal_iso, "lepton_hcal_iso/D" );
561     b_lepton_user_iso = _tree -> Branch("lepton_user_iso", &_lepton_user_iso, "lepton_user_iso/D" );
562 kukartse 1.7 b_met_et = _tree -> Branch("met_et", &_met_et, "met_et/D" );
563 kukartse 1.1 b_met_pt = _tree -> Branch("met_pt", &_met_pt, "met_pt/D" );
564     b_met_eta = _tree -> Branch("met_eta", &_met_eta, "met_eta/D" );
565     b_met_phi = _tree -> Branch("met_phi", &_met_phi, "met_phi/D" );
566     b_met_energy = _tree -> Branch("met_energy", &_met_energy, "met_energy/D" );
567 kukartse 1.7 b_jet1_et = _tree -> Branch("jet1_et", &_jet1_et, "jet1_et/D" );
568 kukartse 1.1 b_jet1_pt = _tree -> Branch("jet1_pt", &_jet1_pt, "jet1_pt/D" );
569     b_jet1_eta = _tree -> Branch("jet1_eta", &_jet1_eta, "jet1_eta/D" );
570     b_jet1_phi = _tree -> Branch("jet1_phi", &_jet1_phi, "jet1_phi/D" );
571     b_jet1_energy = _tree -> Branch("jet1_energy", &_jet1_energy, "jet1_energy/D" );
572 kukartse 1.7 b_jet2_et = _tree -> Branch("jet2_et", &_jet2_et, "jet2_et/D" );
573 kukartse 1.1 b_jet2_pt = _tree -> Branch("jet2_pt", &_jet2_pt, "jet2_pt/D" );
574     b_jet2_eta = _tree -> Branch("jet2_eta", &_jet2_eta, "jet2_eta/D" );
575     b_jet2_phi = _tree -> Branch("jet2_phi", &_jet2_phi, "jet2_phi/D" );
576     b_jet2_energy = _tree -> Branch("jet2_energy", &_jet2_energy, "jet2_energy/D" );
577 kukartse 1.7 b_jet3_et = _tree -> Branch("jet3_et", &_jet3_et, "jet3_et/D" );
578 kukartse 1.1 b_jet3_pt = _tree -> Branch("jet3_pt", &_jet3_pt, "jet3_pt/D" );
579     b_jet3_eta = _tree -> Branch("jet3_eta", &_jet3_eta, "jet3_eta/D" );
580     b_jet3_phi = _tree -> Branch("jet3_phi", &_jet3_phi, "jet3_phi/D" );
581     b_jet3_energy = _tree -> Branch("jet3_energy", &_jet3_energy, "jet3_energy/D" );
582 kukartse 1.7 b_jet4_et = _tree -> Branch("jet4_et", &_jet4_et, "jet4_et/D" );
583 kukartse 1.1 b_jet4_pt = _tree -> Branch("jet4_pt", &_jet4_pt, "jet4_pt/D" );
584     b_jet4_eta = _tree -> Branch("jet4_eta", &_jet4_eta, "jet4_eta/D" );
585     b_jet4_phi = _tree -> Branch("jet4_phi", &_jet4_phi, "jet4_phi/D" );
586     b_jet4_energy = _tree -> Branch("jet4_energy", &_jet4_energy, "jet4_energy/D" );
587 kukartse 1.7 //
588     // MVA kinematic variables
589 kukartse 1.1 b_aplanarity = _tree -> Branch("aplanarity", &_aplanarity, "aplanarity/D" );
590     b_centrality = _tree -> Branch("centrality", &_centrality, "centrality/D" );
591     b_sphericity = _tree -> Branch("sphericity", &_sphericity, "sphericity/D" );
592     b_ht = _tree -> Branch("ht", &_ht, "ht/D" );
593     b_htPlusLepton = _tree -> Branch("htPlusLepton", &_htPlusLepton, "htPlusLepton/D" );
594     b_metHtPlusLepton = _tree -> Branch("metHtPlusLepton", &_metHtPlusLepton, "metHtPlusLepton/D" );
595     b_h = _tree -> Branch("h", &_h, "h/D" );
596     b_ktMinPrime = _tree -> Branch("ktMinPrime", &_ktMinPrime, "ktMinPrime/D" );
597     b_dPhiLMet = _tree -> Branch("dPhiLMet", &_dPhiLMet, "dPhiLMet/D" );
598     b_minDijetMass = _tree -> Branch("minDijetMass", &_minDijetMass, "minDijetMass/D" );
599     b_maxJetEta = _tree -> Branch("maxJetEta", &_maxJetEta, "maxJetEta/D" );
600     b_et3 = _tree -> Branch("et3", &_et3, "et3/D" );
601     b_minDiJetDeltaR = _tree -> Branch("minDiJetDeltaR", &_minDiJetDeltaR, "minDiJetDeltaR/D" );
602     b_leptonJetDeltaR = _tree -> Branch("leptonJetDeltaR", &_leptonJetDeltaR, "leptonJetDeltaR/D" );
603     b_ht2p = _tree -> Branch("ht2p", &_ht2p, "ht2p/D" );
604     b_jet1Jet2DeltaR = _tree -> Branch("jet1Jet2DeltaR", &_jet1Jet2DeltaR, "jet1Jet2DeltaR/D" );
605     b_jet1Jet2DeltaPhi = _tree -> Branch("jet1Jet2DeltaPhi", &_jet1Jet2DeltaPhi, "jet1Jet2DeltaPhi/D" );
606     b_jet1Jet2_M = _tree -> Branch("jet1Jet2_M", &_jet1Jet2_M, "jet1Jet2_M/D" );
607     b_jet1Jet2_Pt = _tree -> Branch("jet1Jet2_Pt", &_jet1Jet2_Pt, "jet1Jet2_Pt/D" );
608     b_jet1Jet2W_M = _tree -> Branch("jet1Jet2W_M", &_jet1Jet2W_M, "jet1Jet2W_M/D" );
609     b_jet1Jet2W_Pt = _tree -> Branch("jet1Jet2W_Pt", &_jet1Jet2W_Pt, "jet1Jet2W_Pt/D" );
610     b_hz = _tree -> Branch("hz", &_hz, "hz/D" );
611     b_HT2 = _tree -> Branch("HT2", &_HT2, "HT2/D" );
612     b_HT2prime = _tree -> Branch("HT2prime", &_HT2prime, "HT2prime/D" );
613     b_W_MT = _tree -> Branch("W_MT", &_W_MT, "W_MT/D" );
614     b_W_M = _tree -> Branch("W_M", &_W_M, "W_M/D" );
615     b_W_Pt = _tree -> Branch("W_Pt", &_W_Pt, "W_Pt/D" );
616     b_DphiJMET = _tree -> Branch("DphiJMET", &_DphiJMET, "DphiJMET/D" );
617 kukartse 1.5 //____________ Ht __________________
618 kukartse 1.1 b_getHt = _tree -> Branch("getHt", &_getHt, "getHt/D" );
619     b_getHtp = _tree -> Branch("getHtp", &_getHtp, "getHtp/D" );
620     b_getHtpp = _tree -> Branch("getHtpp", &_getHtpp, "getHtpp/D" );
621     b_getHt2 = _tree -> Branch("getHt2", &_getHt2, "getHt2/D" );
622     b_getHt2p = _tree -> Branch("getHt2p", &_getHt2p, "getHt2p/D" );
623     b_getHt2pp = _tree -> Branch("getHt2pp", &_getHt2pp, "getHt2pp/D" );
624     b_getHt3 = _tree -> Branch("getHt3", &_getHt3, "getHt3/D" );
625     b_getHt3p = _tree -> Branch("getHt3p", &_getHt3p, "getHt3p/D" );
626     b_getHt3pp = _tree -> Branch("getHt3pp", &_getHt3pp, "getHt3pp/D" );
627     b_getCen = _tree -> Branch("getCen", &_getCen, "getCen/D" );
628     b_getNJW = _tree -> Branch("getNJW", &_getNJW, "getNJW/D" );
629     b_getJetEtaMax = _tree -> Branch("getJetEtaMax", &_getJetEtaMax, "getJetEtaMax/D" );
630     b_getMdijetMin = _tree -> Branch("getMdijetMin", &_getMdijetMin, "getMdijetMin/D" );
631     b_getMtjets = _tree -> Branch("getMtjets", &_getMtjets, "getMtjets/D" );
632     b_getSqrtsT = _tree -> Branch("getSqrtsT", &_getSqrtsT, "getSqrtsT/D" );
633     b_getMtAurelio = _tree -> Branch("getMtAurelio", &_getMtAurelio, "getMtAurelio/D" );
634     b_getPzOverHT = _tree -> Branch("getPzOverHT", &_getPzOverHT, "getPzOverHT/D" );
635     b_getMevent = _tree -> Branch("getMevent", &_getMevent, "getMevent/D" );
636     b_getM123inv = _tree -> Branch("getM123inv", &_getM123inv, "getM123inv/D" );
637     b_getEta2Sum = _tree -> Branch("getEta2Sum", &_getEta2Sum, "getEta2Sum/D" );
638     b_getMwRec = _tree -> Branch("getMwRec", &_getMwRec, "getMwRec/D" );
639     b_getH = _tree -> Branch("getH", &_getH, "getH/D" );
640 kukartse 1.7 //
641 kukartse 1.5 //____ event topology ____________________________
642 kukartse 1.1 b_getSph = _tree -> Branch("getSph", &_getSph, "getSph/D" );
643     b_getApl = _tree -> Branch("getApl", &_getApl, "getApl/D" );
644     b_getAplMu = _tree -> Branch("getAplMu", &_getAplMu, "getAplMu/D" );
645 kukartse 1.7 //
646 kukartse 1.5 //____ Kt ________________________________________
647 kukartse 1.1 b_getKtminp = _tree -> Branch("getKtminp", &_getKtminp, "getKtminp/D" );
648     b_getKtminpReduced = _tree -> Branch("getKtminpReduced", &_getKtminpReduced, "getKtminpReduced/D" );
649     b_getDrMinJetJet = _tree -> Branch("getDrMinJetJet", &_getDrMinJetJet, "getDrMinJetJet/D" );
650 kukartse 1.7 //
651 kukartse 1.5 //____ mT ________________________________________
652 kukartse 1.1 b_getDphiMuMet = _tree -> Branch("getDphiMuMet", &_getDphiMuMet, "getDphiMuMet/D" );
653     b_getMt = _tree -> Branch("getMt", &_getMt, "getMt/D" );
654 kukartse 1.7 //
655     // _____ electron ID _____________________________
656     b_eidLoose = _tree -> Branch("eidLoose", &_eidLoose, "eidLoose/F");
657     b_eidRobustHighEnergy = _tree -> Branch("eidRobustHighEnergy", &_eidRobustHighEnergy, "eidRobustHighEnergy/F");
658     b_eidRobustLoose = _tree -> Branch("eidRobustLoose", &_eidRobustLoose, "eidRobustLoose/F");
659     b_eidRobustTight = _tree -> Branch("eidRobustTight", &_eidRobustTight, "eidRobustTight/F");
660     b_eidTight = _tree -> Branch("eidTight", &_eidTight, "eidTight/F");
661     b_GsfElectron_classification = _tree -> Branch("GsfElectron_classification", &_GsfElectron_classification, "GsfElectron_classification/I");
662     b_GsfElectron_hadronicOverEm = _tree -> Branch("GsfElectron_hadronicOverEm", &_GsfElectron_hadronicOverEm, "GsfElectron_hadronicOverEm/D");
663     b_GsfElectron_caloEnergyError = _tree -> Branch("GsfElectron_caloEnergyError", &_GsfElectron_caloEnergyError, "GsfElectron_caloEnergyError/D");
664     b_GsfElectron_trackMomentumError = _tree -> Branch("GsfElectron_trackMomentumError", &_GsfElectron_trackMomentumError, "GsfElectron_trackMomentumError/D");
665     //b_GsfElectron_numberOfClusters = _tree -> Branch("GsfElectron_numberOfClusters", &_GsfElectron_numberOfClusters, "GsfElectron_numberOfClusters/I");
666     b_GsfElectron_caloEnergy = _tree -> Branch("GsfElectron_caloEnergy", &_GsfElectron_caloEnergy, "GsfElectron_caloEnergy/D");
667     b_GsfElectron_eSuperClusterOverP = _tree -> Branch("GsfElectron_eSuperClusterOverP", &_GsfElectron_eSuperClusterOverP, "GsfElectron_eSuperClusterOverP/D");
668     b_GsfElectron_eSeedClusterOverPout = _tree -> Branch("GsfElectron_eSeedClusterOverPout", &_GsfElectron_eSeedClusterOverPout, "GsfElectron_eSeedClusterOverPout/D");
669     b_GsfElectron_deltaEtaSuperClusterTrackAtVtx = _tree -> Branch("GsfElectron_deltaEtaSuperClusterTrackAtVtx", &_GsfElectron_deltaEtaSuperClusterTrackAtVtx, "GsfElectron_deltaEtaSuperClusterTrackAtVtx/D");
670     b_GsfElectron_deltaEtaSeedClusterTrackAtCalo = _tree -> Branch("GsfElectron_deltaEtaSeedClusterTrackAtCalo", &_GsfElectron_deltaEtaSeedClusterTrackAtCalo, "GsfElectron_deltaEtaSeedClusterTrackAtCalo/D");
671     b_GsfElectron_deltaPhiSuperClusterTrackAtVtx = _tree -> Branch("GsfElectron_deltaPhiSuperClusterTrackAtVtx", &_GsfElectron_deltaPhiSuperClusterTrackAtVtx, "GsfElectron_deltaPhiSuperClusterTrackAtVtx/D");
672     b_GsfElectron_deltaPhiSeedClusterTrackAtCalo = _tree -> Branch("GsfElectron_deltaPhiSeedClusterTrackAtCalo", &_GsfElectron_deltaPhiSeedClusterTrackAtCalo, "GsfElectron_deltaPhiSeedClusterTrackAtCalo/D");
673     //
674     // _____ b tagging ________________________________
675     b_b_tagger_label = _tree->Branch("b_tagger_label", &_b_tagger_label);
676     b_b_tagger_discr = _tree->Branch("b_tagger_discr", &_b_tagger_discr);
677 kukartse 1.1 b_n_tagged_jets_trackCounting_loose = _tree -> Branch("n_tagged_jets_trackCounting_loose", &_n_tagged_jets_trackCounting_loose, "n_tagged_jets_trackCounting_loose/I" );
678     b_n_tagged_jets_trackCounting_medium = _tree -> Branch("n_tagged_jets_trackCounting_medium", &_n_tagged_jets_trackCounting_medium, "n_tagged_jets_trackCounting_medium/I" );
679     b_n_tagged_jets_trackCounting_tight = _tree -> Branch("n_tagged_jets_trackCounting_tight", &_n_tagged_jets_trackCounting_tight, "n_tagged_jets_trackCounting_tight/I" );
680     b_n_tagged_jets_jetProb_loose = _tree -> Branch("n_tagged_jets_jetProb_loose", &_n_tagged_jets_jetProb_loose, "n_tagged_jets_jetProb_loose/I" );
681     b_n_tagged_jets_jetProb_medium = _tree -> Branch("n_tagged_jets_jetProb_medium", &_n_tagged_jets_jetProb_medium, "n_tagged_jets_jetProb_medium/I" );
682     b_n_tagged_jets_jetProb_tight = _tree -> Branch("n_tagged_jets_jetProb_tight", &_n_tagged_jets_jetProb_tight, "n_tagged_jets_jetProb_tight/I" );
683 kukartse 1.5 //
684     //
685     //_____ muon quality _______________________________________
686     b_muon_isGood_All = _tree -> Branch("muon_isGood_All", &_muon_isGood_All, "muon_isGood_All/O" );
687     b_muon_isGood_AllGlobalMuons = _tree -> Branch("muon_isGood_AllGlobalMuons", &_muon_isGood_AllGlobalMuons, "muon_isGood_AllGlobalMuons/O");
688     b_muon_isGood_AllStandAloneMuons = _tree -> Branch("muon_isGood_AllStandAloneMuons", &_muon_isGood_AllStandAloneMuons, "muon_isGood_AllStandAloneMuons/O");
689     b_muon_isGood_AllTrackerMuons = _tree -> Branch("muon_isGood_AllTrackerMuons", &_muon_isGood_AllTrackerMuons, "muon_isGood_AllTrackerMuons/O");
690     b_muon_isGood_TrackerMuonArbitrated = _tree -> Branch("muon_isGood_TrackerMuonArbitrated", &_muon_isGood_TrackerMuonArbitrated, "muon_isGood_TrackerMuonArbitrated/O");
691     b_muon_isGood_AllArbitrated = _tree -> Branch("muon_isGood_AllArbitrated", &_muon_isGood_AllArbitrated, "muon_isGood_AllArbitrated/O");
692     b_muon_isGood_GlobalMuonPromptTight = _tree -> Branch("muon_isGood_GlobalMuonPromptTight", &_muon_isGood_GlobalMuonPromptTight, "muon_isGood_GlobalMuonPromptTight/O");
693     b_muon_isGood_TMLastStationLoose = _tree -> Branch("muon_isGood_TMLastStationLoose", &_muon_isGood_TMLastStationLoose, "muon_isGood_TMLastStationLoose/O");
694     b_muon_isGood_TMLastStationTight = _tree -> Branch("muon_isGood_TMLastStationTight", &_muon_isGood_TMLastStationTight, "muon_isGood_TMLastStationTight/O");
695     b_muon_isGood_TM2DCompatibilityLoose = _tree -> Branch("muon_isGood_TM2DCompatibilityLoose", &_muon_isGood_TM2DCompatibilityLoose, "muon_isGood_TM2DCompatibilityLoose/O");
696     b_muon_isGood_TM2DCompatibilityTight = _tree -> Branch("muon_isGood_TM2DCompatibilityTight", &_muon_isGood_TM2DCompatibilityTight, "muon_isGood_TM2DCompatibilityTight/O");
697     b_muon_isGood_TMOneStationLoose = _tree -> Branch("muon_isGood_TMOneStationLoose", &_muon_isGood_TMOneStationLoose, "muon_isGood_TMOneStationLoose/O");
698     b_muon_isGood_TMOneStationTight = _tree -> Branch("muon_isGood_TMOneStationTight", &_muon_isGood_TMOneStationTight, "muon_isGood_TMOneStationTight/O");
699     b_muon_isGood_TMLastStationOptimizedLowPtLoose = _tree -> Branch("muon_isGood_TMLastStationOptimizedLowPtLoose", &_muon_isGood_TMLastStationOptimizedLowPtLoose, "muon_isGood_TMLastStationOptimizedLowPtLoose/O");
700     b_muon_isGood_TMLastStationOptimizedLowPtTight = _tree -> Branch("muon_isGood_TMLastStationOptimizedLowPtTight", &_muon_isGood_TMLastStationOptimizedLowPtTight, "muon_isGood_TMLastStationOptimizedLowPtTight/O");
701    
702    
703    
704 kukartse 1.1
705     //===> set verbosity of the main event counter ===
706     eventCounter . setPrintCount(true);
707     eventCounter . setNewLine(false);
708     eventCounter . setMessage("Events processed: ");
709     eventCounter . setDivider(100);
710     }
711    
712     void TtLJetsAnalyzer::endJob() {
713     cout << endl << "TtLJetsAnalyzer::endJob(): " << selectedEvents.getCount() << " out of " << eventCounter.getCount() << " passed the selection" << endl;
714    
715     _file -> Write();
716     _file -> Close();
717 kukartse 1.7
718     // _____ b tagging ___________________________________________________
719     delete _b_tagger_label;
720     delete _b_tagger_discr;
721 kukartse 1.1 }
722    
723     //define this as a plug-in
724     DEFINE_FWK_MODULE(TtLJetsAnalyzer);