ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/interface/TtLJetsAnalyzer.h
(Generate patch)

Comparing UserCode/LJMet/MultivariateAnalysis/interface/TtLJetsAnalyzer.h (file contents):
Revision 1.2 by kukartse, Thu Nov 20 17:27:21 2008 UTC vs.
Revision 1.10 by kukartse, Mon Apr 6 18:22:33 2009 UTC

# Line 17 | Line 17
17   //
18   //
19  
20 + #include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h"
21 +
22   #include <memory>
23   #include <string>
24 <
24 > //#include "TFile.h"
25 > #include "TTree.h"
26 > #include "Rtypes.h"
27   #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"
28 #include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h"
32  
33 < #include "TFile.h"
34 < #include "TTree.h"
32 < #include "Rtypes.h"
33 > #include "FWCore/ServiceRegistry/interface/Service.h"
34 > #include "PhysicsTools/UtilAlgos/interface/TFileService.h"
35  
36   class TtLJetsAnalyzer : public edm::EDAnalyzer {
37   public:
# Line 38 | Line 40 | public:
40    
41    
42   private:
43 <  std::string _jetSource, _electronSource, _muonSource, _METSource;
43 >
44 >  virtual void beginJob(const edm::EventSetup&);
45 >  virtual void analyze(const edm::Event&, const edm::EventSetup&);
46 >  virtual void endJob(void);
47 >
48 >  edm::Service<TFileService> fs;
49 >
50 >  // _____ quantities read from the config file _________________________
51 >  std::string _jetSource, _electronSource, _muonSource, _METSource, _beamSpotSource;
52 >  bool _lepton_flavor_is_muon;
53    std::string _outFile;
54 +  bool _is_mc;
55    int nCaloJets_min;
56    int nLepton_min;
57    double jet_pt_min            ;
# Line 53 | Line 65 | private:
65    double electron_trackIso_max ;
66    double electron_caloIso_max  ;
67    double met_et_min            ;
68 +  double min_dr_jet_lepton     ;
69  
70    RooGKCounter eventCounter;
71    RooGKCounter selectedEvents;
72  
60  TFile * _file;
73    TTree * _tree;
74  
75 +  //
76 +  // _____ output tree variables ________________________________________
77    Int_t _event;
78    Int_t _process_id;
79    Int_t _n_jets;
80 +  Int_t _n_removed_jets;
81    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 +  Double_t _lepton_et;
87    Double_t _lepton_pt;
88    Double_t _lepton_eta;
89    Double_t _lepton_phi;
90 +  Double_t _lepton_ptrel; // relative to the nearest jet
91 +  Double_t _lepton_d0;    // relative to the beam spot
92 +  Double_t _lepton_d0_err;    // relative to the beam spot
93 +  Double_t _lepton_d0_significance;    // relative to the beam spot
94    Double_t _lepton_energy;
75  Double_t _lepton_track_chi2;
76  Double_t _lepton_track_ndof;
77  Double_t _lepton_track_nChi2;
95    Double_t _lepton_track_iso;
96    Double_t _lepton_calo_iso;
97    Double_t _lepton_ecal_iso;
98    Double_t _lepton_hcal_iso;
99    Double_t _lepton_user_iso;
100 <  Double_t _met_pt;
100 >  Double_t _lepton_IsoDeposit_em;
101 >  Double_t _lepton_IsoDeposit_had;
102 >  Double_t _muon_track_chi2;
103 >  Double_t _muon_track_ndof;
104 >  Double_t _muon_track_nChi2;
105 >  Double_t _muon_outerTrack_chi2;
106 >  Double_t _muon_outerTrack_ndof;
107 >  Double_t _muon_outerTrack_nChi2;
108 >  Double_t _muon_globalTrack_chi2;
109 >  Double_t _muon_globalTrack_ndof;
110 >  Double_t _muon_globalTrack_nChi2;
111    Double_t _met_et;
112 +  Double_t _met_pt;
113    Double_t _met_eta;
114    Double_t _met_phi;
115    Double_t _met_energy;
116 +  Double_t _jet1_et;
117    Double_t _jet1_pt;
118    Double_t _jet1_eta;
119    Double_t _jet1_phi;
120    Double_t _jet1_energy;
121 +  Double_t _jet2_et;
122    Double_t _jet2_pt;
123    Double_t _jet2_eta;
124    Double_t _jet2_phi;
125    Double_t _jet2_energy;
126 +  Double_t _jet3_et;
127    Double_t _jet3_pt;
128    Double_t _jet3_eta;
129    Double_t _jet3_phi;
130    Double_t _jet3_energy;
131 +  Double_t _jet4_et;
132    Double_t _jet4_pt;
133    Double_t _jet4_eta;
134    Double_t _jet4_phi;
135    Double_t _jet4_energy;
104
136    Double_t _aplanarity       ;
137    Double_t _centrality       ;
138    Double_t _sphericity       ;
# Line 123 | Line 154 | private:
154    Double_t _jet1Jet2_Pt      ;
155    Double_t _jet1Jet2W_M      ;
156    Double_t _jet1Jet2W_Pt     ;
126
157    Double_t _hz               ;
158    Double_t _HT2              ;
159    Double_t _HT2prime         ;
# Line 131 | Line 161 | private:
161    Double_t _W_M              ;
162    Double_t _W_Pt             ;
163    Double_t _DphiJMET         ;
134                      
164    // Ht              
165    Double_t _getHt            ;
166    Double_t _getHtp           ;
# Line 155 | Line 184 | private:
184    Double_t _getEta2Sum       ;
185    Double_t _getMwRec         ;
186    Double_t _getH             ;
158                      
187    // event topo      
188    Double_t _getSph           ;
189    Double_t _getApl           ;
190    Double_t _getAplMu         ;
163                      
191    // Kt              
192    Double_t _getKtminp        ;
193    Double_t _getKtminpReduced ;
194    Double_t _getDrMinJetJet   ;
168                      
195    // mT              
196    Double_t _getDphiMuMet     ;
197    Double_t _getMt            ;
198 <
199 <  Double_t _lepton_id;
200 <  Double_t _electron_id_robust;
201 <  Double_t _electron_id_loose;
202 <  Double_t _electron_id_tight;
203 <  Double_t _electron_tdrid_medium;
204 <  Double_t _electron_tdrid_loose;
205 <  Double_t _electron_tdrid_tight;
198 >  //
199 >  //
200 >  //_____ b tagging ______________________________________________
201 >  vector<double> * _jet_pt;
202 >  vector<double> * _jet_pz;
203 >  vector<double> * _jet_eta;
204 >  vector<double> * _jet_phi;
205 >  vector<double> * _jet_et;
206 >  vector<double> * _jet_energy;
207 >  vector<int> *    _jet_flavor;
208 >  //
209 >  vector<double> * _muon_pt;
210 >  vector<double> * _muon_pz;
211 >  vector<double> * _muon_eta;
212 >  vector<double> * _muon_phi;
213 >  vector<double> * _muon_et;
214 >  vector<double> * _muon_energy;
215 >  vector<int> *    _muon_flavor;
216 >  //
217 >  vector<double> * _electron_pt;
218 >  vector<double> * _electron_pz;
219 >  vector<double> * _electron_eta;
220 >  vector<double> * _electron_phi;
221 >  vector<double> * _electron_et;
222 >  vector<double> * _electron_energy;
223 >  vector<int> *    _electron_flavor;
224 >  /* FIXME: add vectors of these:
225 >  Double_t _lepton_track_iso;
226 >  Double_t _lepton_calo_iso;
227 >  Double_t _lepton_ecal_iso;
228 >  Double_t _lepton_hcal_iso;
229 >  Double_t _lepton_user_iso;
230 >  Double_t _lepton_IsoDeposit_em;
231 >  Double_t _lepton_IsoDeposit_had;
232 >  */
233 >  TBranch * b_jet_pt;
234 >  TBranch * b_jet_pz;
235 >  TBranch * b_jet_eta;
236 >  TBranch * b_jet_phi;
237 >  TBranch * b_jet_et;
238 >  TBranch * b_jet_energy;
239 >  TBranch * b_jet_flavor;
240 >  //
241 >  TBranch * b_lepton_pt;
242 >  TBranch * b_lepton_pz;
243 >  TBranch * b_lepton_eta;
244 >  TBranch * b_lepton_phi;
245 >  TBranch * b_lepton_et;
246 >  TBranch * b_lepton_energy;
247 >  TBranch * b_lepton_flavor;
248 >  //
249 >  vector<string> * _b_tagger_label;
250 >  vector<float> * _b_tagger_discr;
251 >  TBranch * b_b_tagger_label;
252 >  TBranch * b_b_tagger_discr;
253    Int_t _n_tagged_jets_trackCounting_loose;
254    Int_t _n_tagged_jets_trackCounting_medium;
255    Int_t _n_tagged_jets_trackCounting_tight;
# Line 184 | Line 257 | private:
257    Int_t _n_tagged_jets_jetProb_medium;
258    Int_t _n_tagged_jets_jetProb_tight;
259  
260 +  //
261 +  //
262 +  //_____ electron quality _______________________________________
263 +  Float_t _eidLoose;
264 +  Float_t _eidRobustHighEnergy;
265 +  Float_t _eidRobustLoose;
266 +  Float_t _eidRobustTight;
267 +  Float_t _eidTight;
268 +  Int_t    _GsfElectron_classification;
269 +  Double_t _GsfElectron_hadronicOverEm;
270 +  Double_t _GsfElectron_caloEnergyError;
271 +  Double_t _GsfElectron_trackMomentumError;
272 +  Int_t    _GsfElectron_numberOfClusters;
273 +  Double_t _GsfElectron_caloEnergy;  // the super cluster energy corrected by EnergyScaleFactor
274 +  Double_t _GsfElectron_eSuperClusterOverP;  // the supercluster energy / track momentum at impact point
275 +  Double_t _GsfElectron_eSeedClusterOverPout;  // the seed cluster energy / track momentum at calo from outermost state
276 +  Double_t _GsfElectron_deltaEtaSuperClusterTrackAtVtx;  // the supercluster eta - track eta from helix extrapolation from impact point
277 +  Double_t _GsfElectron_deltaEtaSeedClusterTrackAtCalo;  // the seed cluster eta - track eta at calo from outermost state
278 +  Double_t _GsfElectron_deltaPhiSuperClusterTrackAtVtx;  // the supercluster phi - track phi from helix extrapolation from impact point
279 +  Double_t _GsfElectron_deltaPhiSeedClusterTrackAtCalo;  // the seed cluster phi - track phi at calo from outermost state
280 +  // ____ branches
281 +  TBranch * b_eidLoose;
282 +  TBranch * b_eidRobustHighEnergy;
283 +  TBranch * b_eidRobustLoose;
284 +  TBranch * b_eidRobustTight;
285 +  TBranch * b_eidTight;
286 +  TBranch * b_GsfElectron_classification;
287 +  TBranch * b_GsfElectron_hadronicOverEm;
288 +  TBranch * b_GsfElectron_caloEnergyError;
289 +  TBranch * b_GsfElectron_trackMomentumError;
290 +  TBranch * b_GsfElectron_numberOfClusters;
291 +  TBranch * b_GsfElectron_caloEnergy;  // the super cluster energy corrected by EnergyScaleFactor
292 +  TBranch * b_GsfElectron_eSuperClusterOverP;  // the supercluster energy / track momentum at impact point
293 +  TBranch * b_GsfElectron_eSeedClusterOverPout;  // the seed cluster energy / track momentum at calo from outermost state
294 +  TBranch * b_GsfElectron_deltaEtaSuperClusterTrackAtVtx;  // the supercluster eta - track eta from helix extrapolation from impact point
295 +  TBranch * b_GsfElectron_deltaEtaSeedClusterTrackAtCalo;  // the seed cluster eta - track eta at calo from outermost state
296 +  TBranch * b_GsfElectron_deltaPhiSuperClusterTrackAtVtx;  // the supercluster phi - track phi from helix extrapolation from impact point
297 +  TBranch * b_GsfElectron_deltaPhiSeedClusterTrackAtCalo;  // the seed cluster phi - track phi at calo from outermost state
298 +  //
299 +  //
300 +  //_____ muon quality _______________________________________
301 +  bool _muon_isGood_All;                      // dummy options - always true
302 +  bool _muon_isGood_AllGlobalMuons;           // checks isGlobalMuon flag
303 +  bool _muon_isGood_AllStandAloneMuons;       // checks isStandAloneMuon flag
304 +  bool _muon_isGood_AllTrackerMuons;          // checks isTrackerMuon flag
305 +  bool _muon_isGood_TrackerMuonArbitrated;    // resolve ambiguity of sharing segments
306 +  bool _muon_isGood_AllArbitrated;            // all muons with the tracker muon arbitrated
307 +  bool _muon_isGood_GlobalMuonPromptTight;    // global muons with tighter fit requirements
308 +  bool _muon_isGood_TMLastStationLoose;       // penetration depth loose selector
309 +  bool _muon_isGood_TMLastStationTight;       // penetration depth tight selector
310 +  bool _muon_isGood_TM2DCompatibilityLoose;   // likelihood based loose selector
311 +  bool _muon_isGood_TM2DCompatibilityTight;   // likelihood based tight selector
312 +  bool _muon_isGood_TMOneStationLoose;        // require one well matched segment
313 +  bool _muon_isGood_TMOneStationTight;        // require one well matched segment
314 +  bool _muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
315 +  bool _muon_isGood_TMLastStationOptimizedLowPtTight;  // combination of TMLastStation and TMOneStation
316 +  //____ branches
317 +  TBranch * b_muon_isGood_All;                      // dummy options - always true
318 +  TBranch * b_muon_isGood_AllGlobalMuons;           // checks isGlobalMuon flag
319 +  TBranch * b_muon_isGood_AllStandAloneMuons;       // checks isStandAloneMuon flag
320 +  TBranch * b_muon_isGood_AllTrackerMuons;          // checks isTrackerMuon flag
321 +  TBranch * b_muon_isGood_TrackerMuonArbitrated;    // resolve ambiguity of sharing segments
322 +  TBranch * b_muon_isGood_AllArbitrated;            // all muons with the tracker muon arbitrated
323 +  TBranch * b_muon_isGood_GlobalMuonPromptTight;    // global muons with tighter fit requirements
324 +  TBranch * b_muon_isGood_TMLastStationLoose;       // penetration depth loose selector
325 +  TBranch * b_muon_isGood_TMLastStationTight;       // penetration depth tight selector
326 +  TBranch * b_muon_isGood_TM2DCompatibilityLoose;   // likelihood based loose selector
327 +  TBranch * b_muon_isGood_TM2DCompatibilityTight;   // likelihood based tight selector
328 +  TBranch * b_muon_isGood_TMOneStationLoose;        // require one well matched segment
329 +  TBranch * b_muon_isGood_TMOneStationTight;        // require one well matched segment
330 +  TBranch * b_muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
331 +  TBranch * b_muon_isGood_TMLastStationOptimizedLowPtTight;  // combination of TMLastStation and TMOneStation
332 +  //____ output tree variables
333    TBranch * b_event;
334    TBranch * b_process_id;
335    TBranch * b_n_jets;
336 +  TBranch * b_n_removed_jets;
337    TBranch * b_n_met;
338    TBranch * b_n_muons;
339    TBranch * b_n_electrons;
340    TBranch * b_lepton_is_muon;
341    TBranch * b_event_weight;
342 <  TBranch * b_lepton_pt;
343 <  TBranch * b_lepton_eta;
344 <  TBranch * b_lepton_phi;
345 <  TBranch * b_lepton_energy;
346 <  TBranch * b_lepton_track_chi2;
347 <  TBranch * b_lepton_track_ndof;
348 <  TBranch * b_lepton_track_nChi2;
342 >  //
343 >  TBranch * b_muon_et;
344 >  TBranch * b_muon_pt;
345 >  TBranch * b_muon_pz;
346 >  TBranch * b_muon_eta;
347 >  TBranch * b_muon_phi;
348 >  TBranch * b_muon_energy;
349 >  TBranch * b_muon_flavor;
350 >  //
351 >  TBranch * b_electron_et;
352 >  TBranch * b_electron_pt;
353 >  TBranch * b_electron_pz;
354 >  TBranch * b_electron_eta;
355 >  TBranch * b_electron_phi;
356 >  TBranch * b_electron_energy;
357 >  TBranch * b_electron_flavor;
358 >  //
359 >  TBranch * b_muon_track_chi2;
360 >  TBranch * b_muon_track_ndof;
361 >  TBranch * b_muon_track_nChi2;
362 >  TBranch * b_muon_outerTrack_chi2;
363 >  TBranch * b_muon_outerTrack_ndof;
364 >  TBranch * b_muon_outerTrack_nChi2;
365 >  TBranch * b_muon_globalTrack_chi2;
366 >  TBranch * b_muon_globalTrack_ndof;
367 >  TBranch * b_muon_globalTrack_nChi2;
368    TBranch * b_lepton_track_iso;
369    TBranch * b_lepton_calo_iso;
370    TBranch * b_lepton_ecal_iso;
371    TBranch * b_lepton_hcal_iso;
372    TBranch * b_lepton_user_iso;
373 <  TBranch * b_met_pt;
373 >  TBranch * b_lepton_IsoDeposit_em;
374 >  TBranch * b_lepton_IsoDeposit_had;
375    TBranch * b_met_et;
376 +  TBranch * b_met_pt;
377    TBranch * b_met_eta;
378    TBranch * b_met_phi;
379    TBranch * b_met_energy;
380 +  TBranch * b_jet1_et;
381    TBranch * b_jet1_pt;
382    TBranch * b_jet1_eta;
383    TBranch * b_jet1_phi;
384    TBranch * b_jet1_energy;
385 +  TBranch * b_jet2_et;
386    TBranch * b_jet2_pt;
387    TBranch * b_jet2_eta;
388    TBranch * b_jet2_phi;
389    TBranch * b_jet2_energy;
390 +  TBranch * b_jet3_et;
391    TBranch * b_jet3_pt;
392    TBranch * b_jet3_eta;
393    TBranch * b_jet3_phi;
394    TBranch * b_jet3_energy;
395 +  TBranch * b_jet4_et;
396    TBranch * b_jet4_pt;
397    TBranch * b_jet4_eta;
398    TBranch * b_jet4_phi;
399    TBranch * b_jet4_energy;
228  TBranch * b_lepton_id;
229  TBranch * b_electron_id_robust;
230  TBranch * b_electron_id_loose;
231  TBranch * b_electron_id_tight;
232  TBranch * b_electron_tdrid_medium;
233  TBranch * b_electron_tdrid_loose;
234  TBranch * b_electron_tdrid_tight;
400    TBranch * b_n_tagged_jets_trackCounting_loose;
401    TBranch * b_n_tagged_jets_trackCounting_medium;
402    TBranch * b_n_tagged_jets_trackCounting_tight;
403    TBranch * b_n_tagged_jets_jetProb_loose;
404    TBranch * b_n_tagged_jets_jetProb_medium;
405    TBranch * b_n_tagged_jets_jetProb_tight;      
406 <
406 >  // ____
407    TBranch * b_aplanarity       ;
408    TBranch * b_centrality       ;
409    TBranch * b_sphericity       ;
# Line 260 | Line 425 | private:
425    TBranch * b_jet1Jet2_Pt      ;
426    TBranch * b_jet1Jet2W_M      ;
427    TBranch * b_jet1Jet2W_Pt     ;
263                      
428    TBranch * b_hz               ;
429 <  TBranch * b_HT2              ;
430 <  TBranch * b_HT2prime         ;
431 <  TBranch * b_W_MT             ;
429 >  TBranch * b_HT2;
430 >  TBranch * b_HT2prime;
431 >  TBranch * b_W_MT;
432    TBranch * b_W_M              ;
433    TBranch * b_W_Pt             ;
434    TBranch * b_DphiJMET         ;
271                      
435    // Ht              
436    TBranch * b_getHt            ;
437    TBranch * b_getHtp           ;
# Line 292 | Line 455 | private:
455    TBranch * b_getEta2Sum       ;
456    TBranch * b_getMwRec         ;
457    TBranch * b_getH             ;
295                      
458    // event topo      
459    TBranch * b_getSph           ;
460    TBranch * b_getApl           ;
461    TBranch * b_getAplMu         ;
300                      
462    // Kt              
463    TBranch * b_getKtminp        ;
464    TBranch * b_getKtminpReduced ;
465    TBranch * b_getDrMinJetJet   ;
305                      
466    // mT              
467    TBranch * b_getDphiMuMet     ;
468    TBranch * b_getMt            ;
469  
470 <  virtual void beginJob(const edm::EventSetup&) ;
311 <  virtual void analyze(const edm::Event&, const edm::EventSetup&);
312 <  virtual void endJob() ;
470 >  
471   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines