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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines