BTagCalibrationReader

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#ifndef BTagCalibrationReader_H
#define BTagCalibrationReader_H

/**
 * BTagCalibrationReader
 *
 * Helper class to pull out a specific set of BTagEntry's out of a
 * BTagCalibration. TF1 functions are set up at initialization time.
 *
 ************************************************************/

#include <memory>
#include <string>

#include "CondFormats/BTauObjects/interface/BTagEntry.h"
#include "CondFormats/BTauObjects/interface/BTagCalibration.h"

class BTagCalibrationReader {
public:
  class BTagCalibrationReaderImpl;

  BTagCalibrationReader() {}
  BTagCalibrationReader(BTagEntry::OperatingPoint op,
                        const std::string& sysType = "central",
                        const std::vector<std::string>& otherSysTypes = {});

  void load(const BTagCalibration& c, BTagEntry::JetFlavor jf, const std::string& measurementType = "comb");

  double eval(BTagEntry::JetFlavor jf, float eta, float pt, float discr = 0.) const;

  double eval_auto_bounds(const std::string& sys, BTagEntry::JetFlavor jf, float eta, float pt, float discr = 0.) const;

  std::pair<float, float> min_max_pt(BTagEntry::JetFlavor jf, float eta, float discr = 0.) const;

protected:
  std::shared_ptr<BTagCalibrationReaderImpl> pimpl;
};

#endif  // BTagCalibrationReader_H