CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TauJetCorrFactors.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TauJetCorrFactors_h
2 #define DataFormats_PatCandidates_TauJetCorrFactors_h
3 
25 #include <vector>
26 #include <string>
27 #include <math.h>
28 
29 namespace pat {
30 
32 
33  public:
34  // tau-jet energy correction factor.
35  // the std::string indicates the correction level according to jetMET definitions.
36  typedef std::pair<std::string, float> CorrectionFactor;
37 
38  public:
39  // default Constructor
41  // constructor by value
42  TauJetCorrFactors(const std::string& label, const std::vector<CorrectionFactor>& jec);
43 
44  // instance label of the jet energy corrections set
45  std::string jecSet() const { return label_; }
46  // correction level from unsigned int
47  std::string jecLevel(const unsigned int& level) const { return jec_.at(level).first; };
48  // correction level from std::string
49  int jecLevel(const std::string& level) const;
50 
51  // correction factor up to a given level
52  float correction(unsigned int level) const;
53  // a list of the labels of all correction levels according to jetMET definitions, separated by '\n'
54  std::string correctionLabelString() const;
55  // a vector of the labels of all correction levels according to jetMET definitions
56  std::vector<std::string> correctionLabels() const;
57  // label of a specific correction factor according to jetMET definitions; for overflow a string ERROR is returned
58  std::string correctionLabel(unsigned int level) const { return (level<jec_.size() ? jec_.at(level).first : std::string("ERROR")); };
59  // number of available correction factors
60  unsigned int numberOfCorrectionLevels() const { return jec_.size(); };
61  // print function for debugging
62  void print() const;
63 
64  private:
65  // instance label of jet energy correction factors
66  std::string label_;
67  // vector of CorrectionFactors. NOTE: the correction factors are expected to appear
68  // nested; they may appear in arbitary number and order according to the configuration
69  // of the jetCorrFactors module.
70  std::vector<CorrectionFactor> jec_;
71  };
72 }
73 
74 #endif
std::vector< std::string > correctionLabels() const
std::string correctionLabelString() const
std::pair< std::string, float > CorrectionFactor
std::string jecLevel(const unsigned int &level) const
unsigned int numberOfCorrectionLevels() const
std::string jecSet() const
std::string correctionLabel(unsigned int level) const
float correction(unsigned int level) const
std::vector< CorrectionFactor > jec_
tuple level
Definition: testEve_cfg.py:34