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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines