DESY Hbb Analysis Framework
JetAnalyser.h
Go to the documentation of this file.
1 #ifndef Analysis_Tools_JetAnalyser_h
2 #define Analysis_Tools_JetAnalyser_h 1
3 
4 // -*- C++ -*-
5 //
6 // Package: Analysis/Tools
7 // Class: JetAnalyser
8 //
16 //
17 // Original Author: Roberval Walsh Bastos Rangel
18 // Created: Mon, 20 Oct 2014 14:24:08 GMT
19 //
20 //
21 
22 // system include files
23 #include <memory>
24 #include <vector>
25 #include <string>
26 //
28 //
29 // class declaration
30 //
31 
32 namespace analysis {
33  namespace tools {
34 
35  class JetAnalyser : virtual public analysis::tools::BaseAnalyser {
36 
37  public:
39  JetAnalyser();
40  JetAnalyser(int argc, char * argv[]);
42  ~JetAnalyser();
43 
44  // ----------member data ---------------------------
45  protected:
46  std::vector< std::shared_ptr<Jet> > jets_;
47  std::vector< std::shared_ptr<Jet> > selectedJets_;
48 
49  // number of histogrammed jets
50  int n_hjets_;
51 
53  bool applyjer_;
54 
55  std::map<std::string, std::shared_ptr<BTagCalibrationReader> >bsf_reader_;
56 
57  std::shared_ptr<JetResolutionInfo> jerinfo_;
58 
59  std::vector<std::string> flavours_;
60 
61  private:
62 
63  public:
65  std::vector< std::shared_ptr<Jet> > selectedJets();
67  std::vector< std::shared_ptr<Jet> > jets();
68 
70  float btag(const Jet & jet, const std::string & algo);
71 
73  void jets(const std::string & col);
74 
75  // Actions
76  virtual bool analysisWithJets();
78  virtual bool selectionJet(const int & r);
80  virtual bool selectionJet(const int & r, const float & pt_min, const float &eta_max, const float &pt_max=-1. );
82  virtual bool selectionJetDeta(const int & r1, const int &r2);
84  virtual bool selectionJetDeta(const int & r1, const int & r2, const float & delta);
86  virtual bool selectionJetDphi(const int & r1, const int & r2);
88  virtual bool selectionJetDphi(const int & r1, const int & r2, const float & delta);
90  virtual bool selectionJetDr(const int & r1, const int & r2);
92  virtual bool selectionJetDr(const int & r1, const int & r2, const float & delta);
94  virtual bool selectionJetPtImbalance(const int & r1, const int & r2);
96  virtual bool selectionJetPtImbalance(const int & r1, const int & r2, const float & delta);
97 
98 
99  virtual bool selectionJetId();
100  virtual bool selectionJetPileupId();
101  virtual bool selectionNJets();
102  virtual bool selectionDiJetMass(const int &, const int &);
103  virtual bool selectionBJet(const int &);
104  virtual bool selectionBJetProbB(const int &);
105  virtual bool selectionBJetProbBB(const int &);
106  virtual bool selectionBJetProbLepB(const int &);
107  virtual bool selectionBJetProbC(const int &);
108  virtual bool selectionBJetProbG(const int &);
109  virtual bool selectionBJetProbLight(const int &);
110  virtual ScaleFactors btagSF(const int &, const std::string &);
111  virtual bool selectionNonBJet(const int &);
112  virtual bool onlineJetMatching(const int &);
113  virtual bool onlineBJetMatching(const int &);
115  virtual void jetHistograms(const int & n, const std::string & label = "x");
117  virtual void jetHistograms(const std::string & label = "x");
119  virtual void fillJetHistograms(const std::string & label = "x");
121  virtual void fillJetHistograms(const int & r = -1, const std::string & label = "x", const float & sf = 1.,const bool & workflow = false);
122  virtual void actionApplyJER();
123  virtual float actionApplyBtagSF(const int &, const bool & global_weight = true);
124  virtual float getBtagSF(const int &);
125  virtual void actionApplyBjetRegression();
126  virtual void actionApplyBjetRegression(const int &);
127  virtual void jetSwap(const int &, const int &);
128  virtual bool selectionJetQGlikelihood(const int &, const float &);
129  virtual bool selectionJetQGlikelihood(const int &);
130 // virtual void actionApplyBtagEfficiencyWeight(const int &);
131 // virtual float btagEfficiency(const int &);
133  virtual bool jetCorrections();
134 
135  };
136  }
137 }
138 
139 #endif // Analysis_Tools_JetAnalyser_h
virtual bool selectionBJetProbLight(const int &)
virtual bool selectionJetDphi(const int &r1, const int &r2)
Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_phi selection;...
Definition: JetAnalyser.cc:492
virtual bool selectionNonBJet(const int &)
Definition: JetAnalyser.cc:728
virtual void jetSwap(const int &, const int &)
virtual bool selectionBJetProbB(const int &)
virtual float getBtagSF(const int &)
virtual bool analysisWithJets()
Definition: JetAnalyser.cc:72
virtual ScaleFactors btagSF(const int &, const std::string &)
Definition: JetAnalyser.cc:980
std::vector< std::shared_ptr< Jet > > jets_
Definition: JetAnalyser.h:46
virtual bool selectionJet(const int &r)
Given the ranking &#39;r&#39; of a jet, it returns whether the jet passes the pt_min and |eta_max|, optionally pt_max, where the values of the thresholds pt_min and |eta_max|, pt_max are passed by configuration file.
Definition: JetAnalyser.cc:378
virtual bool selectionJetQGlikelihood(const int &, const float &)
std::map< std::string, std::shared_ptr< BTagCalibrationReader > > bsf_reader_
Definition: JetAnalyser.h:55
virtual void fillJetHistograms(const std::string &label="x")
Fill the pre-defined histograms created by the jetHistograms() method.
Definition: JetAnalyser.cc:795
virtual bool selectionBJetProbBB(const int &)
std::vector< std::shared_ptr< Jet > > jets()
vector of pointers of all jets from the "Jets" collection
Definition: JetAnalyser.cc:613
virtual bool onlineJetMatching(const int &)
Definition: JetAnalyser.cc:746
float btag(const Jet &jet, const std::string &algo)
Returns the btag value of the jet for a given btag algorithm.
Definition: JetAnalyser.cc:366
virtual bool onlineBJetMatching(const int &)
Definition: JetAnalyser.cc:778
virtual bool selectionBJetProbC(const int &)
virtual bool selectionJetPtImbalance(const int &r1, const int &r2)
Given the rankings r1 and r2 of two jets, it returns whether the jets passes the pt imbalance selecti...
Definition: JetAnalyser.cc:588
virtual bool selectionBJet(const int &)
Definition: JetAnalyser.cc:708
virtual void jetHistograms(const int &n, const std::string &label="x")
Creates pre-defined histograms in directory &#39;label&#39; for analysis with &#39;n&#39; jets.
Definition: JetAnalyser.cc:172
virtual bool selectionJetDeta(const int &r1, const int &r2)
Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_eta selection;...
Definition: JetAnalyser.cc:445
std::vector< std::shared_ptr< Jet > > selectedJets_
Definition: JetAnalyser.h:47
virtual bool selectionJetDr(const int &r1, const int &r2)
Given the rankings r1 and r2 of two jets, it returns whether the jets passes the delta_R selection; t...
Definition: JetAnalyser.cc:541
virtual bool selectionDiJetMass(const int &, const int &)
virtual float actionApplyBtagSF(const int &, const bool &global_weight=true)
std::shared_ptr< JetResolutionInfo > jerinfo_
Definition: JetAnalyser.h:57
virtual bool jetCorrections()
multiple actions: apply JER and b-tag regression corrections
virtual void actionApplyBjetRegression()
virtual bool selectionBJetProbG(const int &)
virtual bool selectionJetPileupId()
Definition: JetAnalyser.cc:646
std::vector< std::string > flavours_
Definition: JetAnalyser.h:59
virtual bool selectionBJetProbLepB(const int &)
std::vector< std::shared_ptr< Jet > > selectedJets()
vector of pointers of the selectedJets
Definition: JetAnalyser.cc:618