Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:56

0001 #ifndef BTagCalibration_H
0002 #define BTagCalibration_H
0003 
0004 /**
0005  * BTagCalibration
0006  *
0007  * The 'hierarchy' of stored information is this:
0008  * - by tagger (BTagCalibration)
0009  *   - by operating point or reshape bin
0010  *     - by jet parton flavor
0011  *       - by type of measurement
0012  *         - by systematic
0013  *           - by eta bin
0014  *             - as 1D-function dependent of pt or discriminant
0015  *
0016  ************************************************************/
0017 
0018 #include <map>
0019 #include <vector>
0020 #include <string>
0021 #include <istream>
0022 #include <ostream>
0023 
0024 #include "CondFormats/Serialization/interface/Serializable.h"
0025 #include "CondFormats/BTauObjects/interface/BTagEntry.h"
0026 
0027 class BTagCalibration {
0028 public:
0029   BTagCalibration() {}
0030   BTagCalibration(const std::string &tagger);
0031   BTagCalibration(const std::string &tagger, const std::string &filename, bool validate);
0032   ~BTagCalibration() {}
0033 
0034   std::string tagger() const { return tagger_; }
0035 
0036   void addEntry(const BTagEntry &entry);
0037   const std::vector<BTagEntry> &getEntries(const BTagEntry::Parameters &par) const;
0038 
0039   void readCSV(std::istream &s, bool validate);
0040   void readCSV(const std::string &s, bool validate);
0041   void makeCSV(std::ostream &s) const;
0042   std::string makeCSV() const;
0043 
0044 protected:
0045   static std::string token(const BTagEntry::Parameters &par);
0046 
0047   std::string tagger_;
0048   std::map<std::string, std::vector<BTagEntry> > data_;
0049 
0050   COND_SERIALIZABLE;
0051 };
0052 
0053 #endif  // BTagCalibration_H