File indexing completed on 2024-04-06 12:24:37
0001 #ifndef RecoBTau_JetTagComputer_GenericMVAComputerCache_h
0002 #define RecoBTau_JetTagComputer_GenericMVAComputerCache_h
0003
0004 #include <string>
0005 #include <vector>
0006 #include <memory>
0007
0008 #include "DataFormats/BTauReco/interface/BaseTagInfo.h"
0009 #include "CondFormats/PhysicsToolsObjects/interface/MVAComputer.h"
0010 #include "RecoBTau/JetTagComputer/interface/GenericMVAComputer.h"
0011
0012 class GenericMVAComputerCache {
0013 public:
0014 GenericMVAComputerCache(const std::vector<std::string> &labels);
0015 ~GenericMVAComputerCache();
0016
0017 bool update(const PhysicsTools::Calibration::MVAComputerContainer *calib);
0018
0019 GenericMVAComputer const *getComputer(int index) const;
0020
0021 bool isEmpty() const;
0022
0023 private:
0024 struct IndividualComputer {
0025 IndividualComputer();
0026 IndividualComputer(const IndividualComputer &orig);
0027 ~IndividualComputer();
0028
0029 std::string label;
0030 std::unique_ptr<GenericMVAComputer> computer;
0031 PhysicsTools::Calibration::MVAComputer::CacheId cacheId;
0032 };
0033
0034 std::vector<IndividualComputer> computers;
0035 PhysicsTools::Calibration::MVAComputerContainer::CacheId cacheId;
0036 bool initialized;
0037 bool empty;
0038 std::string errorUpdatingLabel;
0039 };
0040
0041 #endif