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.16 by kukartse, Fri Jun 26 17:43:54 2009 UTC

# Line 17 | Line 17
17   //
18   //
19  
20 + #include "DataFormats/BeamSpot/interface/BeamSpot.h"
21 +
22 + #include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h"
23 +
24   #include <memory>
25   #include <string>
26 <
26 > //#include "TFile.h"
27 > #include "TTree.h"
28 > #include "Rtypes.h"
29   #include "FWCore/Framework/interface/Frameworkfwd.h"
30   #include "FWCore/Framework/interface/EDAnalyzer.h"
31   #include "FWCore/Framework/interface/Event.h"
32   #include "FWCore/Framework/interface/MakerMacros.h"
33   #include "FWCore/ParameterSet/interface/ParameterSet.h"
28 #include "LJMet/MultivariateAnalysis/interface/RooGKCounter.h"
34  
35 < #include "TFile.h"
36 < #include "TTree.h"
37 < #include "Rtypes.h"
35 > #include "FWCore/ServiceRegistry/interface/Service.h"
36 > #include "PhysicsTools/UtilAlgos/interface/TFileService.h"
37 > #include "DataFormats/Math/interface/LorentzVector.h"
38 > #include "DataFormats/Common/interface/View.h"
39 > #include "DataFormats/PatCandidates/interface/Electron.h"
40 > #include "DataFormats/TrackReco/interface/Track.h"
41  
42   class TtLJetsAnalyzer : public edm::EDAnalyzer {
43   public:
# Line 38 | Line 46 | public:
46    
47    
48   private:
49 <  std::string _jetSource, _electronSource, _muonSource, _METSource;
49 >
50 >  virtual void beginJob(const edm::EventSetup&);
51 >  virtual void analyze(const edm::Event&, const edm::EventSetup&);
52 >  virtual void endJob(void);
53 >
54 >  // returns pair<dist,dcot>
55 >  pair<float, float> getConversionInfo(const pat::Electron & el,
56 >                                       const reco::Track & track,
57 >                                       const reco::BeamSpot::Point _bs,
58 >                                       float bField);
59 >
60 >  bool ConversionAlgo(const pat::Electron& e, edm::Handle<edm::View<reco::Track> > track_h);
61 >  double DelRTrackEle(const pat::Electron& e,const reco::Track& tk);
62 >
63 >  edm::Service<TFileService> fs;
64 >
65 >  bool first_event;
66 >
67 >  // _____ quantities read from the config file _________________________
68 >  std::string _jetSource, _electronSource, _muonSource, _METSource,
69 >    _beamSpotSource, _trigger_source, _track_source;
70 >  std::string pdfWeightTag_;
71 >  bool _lepton_flavor_is_muon;
72    std::string _outFile;
73 +  bool _is_mc;
74    int nCaloJets_min;
75    int nLepton_min;
76    double jet_pt_min            ;
# Line 53 | Line 84 | private:
84    double electron_trackIso_max ;
85    double electron_caloIso_max  ;
86    double met_et_min            ;
87 +  double min_dr_jet_lepton     ;
88 +  double _bfield;
89 +  double _dist_min;
90 +  double _dist_max;
91 +  double _abs_dcot_max;
92 +  double _e_track_dr;
93  
94    RooGKCounter eventCounter;
95    RooGKCounter selectedEvents;
96  
60  TFile * _file;
97    TTree * _tree;
98  
99 +  //
100 +  // _____ output tree variables ________________________________________
101 +  //
102    Int_t _event;
103    Int_t _process_id;
104    Int_t _n_jets;
105 +  Int_t _n_removed_jets;
106    Int_t _n_met;
107    Int_t _n_muons;
108    Int_t _n_electrons;
109    Int_t _lepton_is_muon;
110 +  //
111 +  //_____ photon conversion _____________________________________________
112 +  //
113 +  vector<double> * _e_dist;
114 +  vector<double> * _e_dcot;
115 +  bool     _is_conv;
116 +  //
117 +  //_____ PDF weights ___________________________________________________
118 +  //
119 +  vector<double> * _pdf_weights;
120 +  Double_t _weight_pdf_pos;
121 +  Double_t _weight_pdf_neg;
122 +  //
123 +  //_____ trigger _______________________________________________________
124 +  //
125 +  std::map<std::string,bool> _hlt;
126 +  //vector<TBranch> b_hlt;
127 +  //
128    Double_t _event_weight;
129 +  Double_t _lepton_et;
130    Double_t _lepton_pt;
131    Double_t _lepton_eta;
132    Double_t _lepton_phi;
133 +  Double_t _lepton_jet_min_dr;
134 +  Double_t _lepton_ptrel; // relative to the nearest jet
135 +  Double_t _lepton_d0;    // relative to the beam spot
136 +  Double_t _lepton_d0_err;    // relative to the beam spot
137 +  Double_t _lepton_d0_significance;    // relative to the beam spot
138    Double_t _lepton_energy;
75  Double_t _lepton_track_chi2;
76  Double_t _lepton_track_ndof;
77  Double_t _lepton_track_nChi2;
139    Double_t _lepton_track_iso;
140    Double_t _lepton_calo_iso;
141    Double_t _lepton_ecal_iso;
142    Double_t _lepton_hcal_iso;
143    Double_t _lepton_user_iso;
144 <  Double_t _met_pt;
144 >  Double_t _lepton_IsoDeposit_em;
145 >  Double_t _lepton_IsoDeposit_had;
146 >  Int_t    _muon_track_nhits;
147 >  Double_t _muon_track_chi2;
148 >  Double_t _muon_track_ndof;
149 >  Double_t _muon_track_nChi2;
150 >  Double_t _muon_outerTrack_chi2;
151 >  Double_t _muon_outerTrack_ndof;
152 >  Double_t _muon_outerTrack_nChi2;
153 >  Double_t _muon_globalTrack_chi2;
154 >  Double_t _muon_globalTrack_ndof;
155 >  Double_t _muon_globalTrack_nChi2;
156    Double_t _met_et;
157 +  Double_t _met_pt;
158    Double_t _met_eta;
159    Double_t _met_phi;
160    Double_t _met_energy;
161 +  Double_t _jet1_et;
162    Double_t _jet1_pt;
163    Double_t _jet1_eta;
164    Double_t _jet1_phi;
165    Double_t _jet1_energy;
166 +  Double_t _jet2_et;
167    Double_t _jet2_pt;
168    Double_t _jet2_eta;
169    Double_t _jet2_phi;
170    Double_t _jet2_energy;
171 +  Double_t _jet3_et;
172    Double_t _jet3_pt;
173    Double_t _jet3_eta;
174    Double_t _jet3_phi;
175    Double_t _jet3_energy;
176 +  Double_t _jet4_et;
177    Double_t _jet4_pt;
178    Double_t _jet4_eta;
179    Double_t _jet4_phi;
180    Double_t _jet4_energy;
104
181    Double_t _aplanarity       ;
182    Double_t _centrality       ;
183    Double_t _sphericity       ;
# Line 123 | Line 199 | private:
199    Double_t _jet1Jet2_Pt      ;
200    Double_t _jet1Jet2W_M      ;
201    Double_t _jet1Jet2W_Pt     ;
126
202    Double_t _hz               ;
203    Double_t _HT2              ;
204    Double_t _HT2prime         ;
# Line 131 | Line 206 | private:
206    Double_t _W_M              ;
207    Double_t _W_Pt             ;
208    Double_t _DphiJMET         ;
134                      
209    // Ht              
210    Double_t _getHt            ;
211    Double_t _getHtp           ;
# Line 155 | Line 229 | private:
229    Double_t _getEta2Sum       ;
230    Double_t _getMwRec         ;
231    Double_t _getH             ;
158                      
232    // event topo      
233    Double_t _getSph           ;
234    Double_t _getApl           ;
235    Double_t _getAplMu         ;
163                      
236    // Kt              
237    Double_t _getKtminp        ;
238    Double_t _getKtminpReduced ;
239    Double_t _getDrMinJetJet   ;
168                      
240    // mT              
241    Double_t _getDphiMuMet     ;
242    Double_t _getMt            ;
243 <
244 <  Double_t _lepton_id;
245 <  Double_t _electron_id_robust;
246 <  Double_t _electron_id_loose;
247 <  Double_t _electron_id_tight;
248 <  Double_t _electron_tdrid_medium;
249 <  Double_t _electron_tdrid_loose;
250 <  Double_t _electron_tdrid_tight;
243 >  //
244 >  //
245 >  //_____ b tagging ______________________________________________
246 >  vector<double> * _jet_pt;
247 >  vector<double> * _jet_pz;
248 >  vector<double> * _jet_eta;
249 >  vector<double> * _jet_phi;
250 >  vector<double> * _jet_et;
251 >  vector<double> * _jet_energy;
252 >  vector<int> *    _jet_flavor;
253 >  //
254 >  vector<double> * _muon_pt;
255 >  vector<double> * _muon_pz;
256 >  vector<double> * _muon_eta;
257 >  vector<double> * _muon_phi;
258 >  vector<double> * _muon_et;
259 >  vector<double> * _muon_energy;
260 >  vector<int> *    _muon_flavor;
261 >  //
262 >  vector<double> * _electron_pt;
263 >  vector<double> * _electron_pz;
264 >  vector<double> * _electron_eta;
265 >  vector<double> * _electron_phi;
266 >  vector<double> * _electron_et;
267 >  vector<double> * _electron_energy;
268 >  vector<int> *    _electron_flavor;
269 >  /* FIXME: add vectors of these:
270 >  Double_t _lepton_track_iso;
271 >  Double_t _lepton_calo_iso;
272 >  Double_t _lepton_ecal_iso;
273 >  Double_t _lepton_hcal_iso;
274 >  Double_t _lepton_user_iso;
275 >  Double_t _lepton_IsoDeposit_em;
276 >  Double_t _lepton_IsoDeposit_had;
277 >  */
278 >  TBranch * b_jet_pt;
279 >  TBranch * b_jet_pz;
280 >  TBranch * b_jet_eta;
281 >  TBranch * b_jet_phi;
282 >  TBranch * b_jet_et;
283 >  TBranch * b_jet_energy;
284 >  TBranch * b_jet_flavor;
285 >  //
286 >  TBranch * b_lepton_pt;
287 >  TBranch * b_lepton_pz;
288 >  TBranch * b_lepton_eta;
289 >  TBranch * b_lepton_phi;
290 >  TBranch * b_lepton_et;
291 >  TBranch * b_lepton_energy;
292 >  TBranch * b_lepton_flavor;
293 >  TBranch * b_lepton_jet_min_dr;
294 >  TBranch * b_lepton_ptrel;
295 >  TBranch * b_lepton_d0;
296 >  TBranch * b_lepton_d0_err;
297 >  TBranch * b_lepton_d0_significance;
298 >  //
299 >  vector<string> * _b_tagger_label;
300 >  vector<float> * _b_tagger_discr;
301 >  TBranch * b_b_tagger_label;
302 >  TBranch * b_b_tagger_discr;
303    Int_t _n_tagged_jets_trackCounting_loose;
304    Int_t _n_tagged_jets_trackCounting_medium;
305    Int_t _n_tagged_jets_trackCounting_tight;
# Line 184 | Line 307 | private:
307    Int_t _n_tagged_jets_jetProb_medium;
308    Int_t _n_tagged_jets_jetProb_tight;
309  
310 +  //
311 +  //
312 +  //_____ electron quality _______________________________________
313 +  Float_t _eidLoose;
314 +  Float_t _eidRobustHighEnergy;
315 +  Float_t _eidRobustLoose;
316 +  Float_t _eidRobustTight;
317 +  Float_t _eidTight;
318 +  Int_t    _GsfElectron_classification;
319 +  Double_t _GsfElectron_hadronicOverEm;
320 +  Double_t _GsfElectron_caloEnergyError;
321 +  Double_t _GsfElectron_trackMomentumError;
322 +  Int_t    _GsfElectron_numberOfClusters;
323 +  Double_t _GsfElectron_caloEnergy;  // the super cluster energy corrected by EnergyScaleFactor
324 +  Double_t _GsfElectron_eSuperClusterOverP;  // the supercluster energy / track momentum at impact point
325 +  Double_t _GsfElectron_eSeedClusterOverPout;  // the seed cluster energy / track momentum at calo from outermost state
326 +  Double_t _GsfElectron_deltaEtaSuperClusterTrackAtVtx;  // the supercluster eta - track eta from helix extrapolation from impact point
327 +  Double_t _GsfElectron_deltaEtaSeedClusterTrackAtCalo;  // the seed cluster eta - track eta at calo from outermost state
328 +  Double_t _GsfElectron_deltaPhiSuperClusterTrackAtVtx;  // the supercluster phi - track phi from helix extrapolation from impact point
329 +  Double_t _GsfElectron_deltaPhiSeedClusterTrackAtCalo;  // the seed cluster phi - track phi at calo from outermost state
330 +  // ____ branches
331 +  TBranch * b_eidLoose;
332 +  TBranch * b_eidRobustHighEnergy;
333 +  TBranch * b_eidRobustLoose;
334 +  TBranch * b_eidRobustTight;
335 +  TBranch * b_eidTight;
336 +  TBranch * b_GsfElectron_classification;
337 +  TBranch * b_GsfElectron_hadronicOverEm;
338 +  TBranch * b_GsfElectron_caloEnergyError;
339 +  TBranch * b_GsfElectron_trackMomentumError;
340 +  TBranch * b_GsfElectron_numberOfClusters;
341 +  TBranch * b_GsfElectron_caloEnergy;  // the super cluster energy corrected by EnergyScaleFactor
342 +  TBranch * b_GsfElectron_eSuperClusterOverP;  // the supercluster energy / track momentum at impact point
343 +  TBranch * b_GsfElectron_eSeedClusterOverPout;  // the seed cluster energy / track momentum at calo from outermost state
344 +  TBranch * b_GsfElectron_deltaEtaSuperClusterTrackAtVtx;  // the supercluster eta - track eta from helix extrapolation from impact point
345 +  TBranch * b_GsfElectron_deltaEtaSeedClusterTrackAtCalo;  // the seed cluster eta - track eta at calo from outermost state
346 +  TBranch * b_GsfElectron_deltaPhiSuperClusterTrackAtVtx;  // the supercluster phi - track phi from helix extrapolation from impact point
347 +  TBranch * b_GsfElectron_deltaPhiSeedClusterTrackAtCalo;  // the seed cluster phi - track phi at calo from outermost state
348 +  //
349 +  //
350 +  //_____ muon quality _______________________________________
351 +  bool _muon_isGood_All;                      // dummy options - always true
352 +  bool _muon_isGood_AllGlobalMuons;           // checks isGlobalMuon flag
353 +  bool _muon_isGood_AllStandAloneMuons;       // checks isStandAloneMuon flag
354 +  bool _muon_isGood_AllTrackerMuons;          // checks isTrackerMuon flag
355 +  bool _muon_isGood_TrackerMuonArbitrated;    // resolve ambiguity of sharing segments
356 +  bool _muon_isGood_AllArbitrated;            // all muons with the tracker muon arbitrated
357 +  bool _muon_isGood_GlobalMuonPromptTight;    // global muons with tighter fit requirements
358 +  bool _muon_isGood_TMLastStationLoose;       // penetration depth loose selector
359 +  bool _muon_isGood_TMLastStationTight;       // penetration depth tight selector
360 +  bool _muon_isGood_TM2DCompatibilityLoose;   // likelihood based loose selector
361 +  bool _muon_isGood_TM2DCompatibilityTight;   // likelihood based tight selector
362 +  bool _muon_isGood_TMOneStationLoose;        // require one well matched segment
363 +  bool _muon_isGood_TMOneStationTight;        // require one well matched segment
364 +  bool _muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
365 +  bool _muon_isGood_TMLastStationOptimizedLowPtTight;  // combination of TMLastStation and TMOneStation
366 +  //____ branches
367 +  TBranch * b_muon_isGood_All;                      // dummy options - always true
368 +  TBranch * b_muon_isGood_AllGlobalMuons;           // checks isGlobalMuon flag
369 +  TBranch * b_muon_isGood_AllStandAloneMuons;       // checks isStandAloneMuon flag
370 +  TBranch * b_muon_isGood_AllTrackerMuons;          // checks isTrackerMuon flag
371 +  TBranch * b_muon_isGood_TrackerMuonArbitrated;    // resolve ambiguity of sharing segments
372 +  TBranch * b_muon_isGood_AllArbitrated;            // all muons with the tracker muon arbitrated
373 +  TBranch * b_muon_isGood_GlobalMuonPromptTight;    // global muons with tighter fit requirements
374 +  TBranch * b_muon_isGood_TMLastStationLoose;       // penetration depth loose selector
375 +  TBranch * b_muon_isGood_TMLastStationTight;       // penetration depth tight selector
376 +  TBranch * b_muon_isGood_TM2DCompatibilityLoose;   // likelihood based loose selector
377 +  TBranch * b_muon_isGood_TM2DCompatibilityTight;   // likelihood based tight selector
378 +  TBranch * b_muon_isGood_TMOneStationLoose;        // require one well matched segment
379 +  TBranch * b_muon_isGood_TMOneStationTight;        // require one well matched segment
380 +  TBranch * b_muon_isGood_TMLastStationOptimizedLowPtLoose; // combination of TMLastStation and TMOneStation
381 +  TBranch * b_muon_isGood_TMLastStationOptimizedLowPtTight;  // combination of TMLastStation and TMOneStation
382 +  //____ output tree variables
383    TBranch * b_event;
384    TBranch * b_process_id;
385    TBranch * b_n_jets;
386 +  TBranch * b_n_removed_jets;
387    TBranch * b_n_met;
388    TBranch * b_n_muons;
389    TBranch * b_n_electrons;
390    TBranch * b_lepton_is_muon;
391    TBranch * b_event_weight;
392 <  TBranch * b_lepton_pt;
393 <  TBranch * b_lepton_eta;
394 <  TBranch * b_lepton_phi;
395 <  TBranch * b_lepton_energy;
396 <  TBranch * b_lepton_track_chi2;
397 <  TBranch * b_lepton_track_ndof;
398 <  TBranch * b_lepton_track_nChi2;
392 >  //
393 >  TBranch * b_muon_et;
394 >  TBranch * b_muon_pt;
395 >  TBranch * b_muon_pz;
396 >  TBranch * b_muon_eta;
397 >  TBranch * b_muon_phi;
398 >  TBranch * b_muon_energy;
399 >  TBranch * b_muon_flavor;
400 >  //
401 >  TBranch * b_electron_et;
402 >  TBranch * b_electron_pt;
403 >  TBranch * b_electron_pz;
404 >  TBranch * b_electron_eta;
405 >  TBranch * b_electron_phi;
406 >  TBranch * b_electron_energy;
407 >  TBranch * b_electron_flavor;
408 >  //
409 >  TBranch * b_muon_track_chi2;
410 >  TBranch * b_muon_track_ndof;
411 >  TBranch * b_muon_track_nChi2;
412 >  TBranch * b_muon_outerTrack_chi2;
413 >  TBranch * b_muon_outerTrack_ndof;
414 >  TBranch * b_muon_outerTrack_nChi2;
415 >  TBranch * b_muon_globalTrack_chi2;
416 >  TBranch * b_muon_globalTrack_ndof;
417 >  TBranch * b_muon_globalTrack_nChi2;
418    TBranch * b_lepton_track_iso;
419    TBranch * b_lepton_calo_iso;
420    TBranch * b_lepton_ecal_iso;
421    TBranch * b_lepton_hcal_iso;
422    TBranch * b_lepton_user_iso;
423 <  TBranch * b_met_pt;
423 >  TBranch * b_lepton_IsoDeposit_em;
424 >  TBranch * b_lepton_IsoDeposit_had;
425    TBranch * b_met_et;
426 +  TBranch * b_met_pt;
427    TBranch * b_met_eta;
428    TBranch * b_met_phi;
429    TBranch * b_met_energy;
430 +  TBranch * b_jet1_et;
431    TBranch * b_jet1_pt;
432    TBranch * b_jet1_eta;
433    TBranch * b_jet1_phi;
434    TBranch * b_jet1_energy;
435 +  TBranch * b_jet2_et;
436    TBranch * b_jet2_pt;
437    TBranch * b_jet2_eta;
438    TBranch * b_jet2_phi;
439    TBranch * b_jet2_energy;
440 +  TBranch * b_jet3_et;
441    TBranch * b_jet3_pt;
442    TBranch * b_jet3_eta;
443    TBranch * b_jet3_phi;
444    TBranch * b_jet3_energy;
445 +  TBranch * b_jet4_et;
446    TBranch * b_jet4_pt;
447    TBranch * b_jet4_eta;
448    TBranch * b_jet4_phi;
449    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;
450    TBranch * b_n_tagged_jets_trackCounting_loose;
451    TBranch * b_n_tagged_jets_trackCounting_medium;
452    TBranch * b_n_tagged_jets_trackCounting_tight;
453    TBranch * b_n_tagged_jets_jetProb_loose;
454    TBranch * b_n_tagged_jets_jetProb_medium;
455    TBranch * b_n_tagged_jets_jetProb_tight;      
456 <
456 >  // ____
457    TBranch * b_aplanarity       ;
458    TBranch * b_centrality       ;
459    TBranch * b_sphericity       ;
# Line 260 | Line 475 | private:
475    TBranch * b_jet1Jet2_Pt      ;
476    TBranch * b_jet1Jet2W_M      ;
477    TBranch * b_jet1Jet2W_Pt     ;
263                      
478    TBranch * b_hz               ;
479 <  TBranch * b_HT2              ;
480 <  TBranch * b_HT2prime         ;
481 <  TBranch * b_W_MT             ;
479 >  TBranch * b_HT2;
480 >  TBranch * b_HT2prime;
481 >  TBranch * b_W_MT;
482    TBranch * b_W_M              ;
483    TBranch * b_W_Pt             ;
484    TBranch * b_DphiJMET         ;
271                      
485    // Ht              
486    TBranch * b_getHt            ;
487    TBranch * b_getHtp           ;
# Line 292 | Line 505 | private:
505    TBranch * b_getEta2Sum       ;
506    TBranch * b_getMwRec         ;
507    TBranch * b_getH             ;
295                      
508    // event topo      
509    TBranch * b_getSph           ;
510    TBranch * b_getApl           ;
511    TBranch * b_getAplMu         ;
300                      
512    // Kt              
513    TBranch * b_getKtminp        ;
514    TBranch * b_getKtminpReduced ;
515    TBranch * b_getDrMinJetJet   ;
305                      
516    // mT              
517    TBranch * b_getDphiMuMet     ;
518    TBranch * b_getMt            ;
519  
520 <  virtual void beginJob(const edm::EventSetup&) ;
311 <  virtual void analyze(const edm::Event&, const edm::EventSetup&);
312 <  virtual void endJob() ;
520 >  
521   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines