CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoBTau/JetTagComputer/interface/GenericMVAComputerCache.h

Go to the documentation of this file.
00001 #ifndef RecoBTau_JetTagComputer_GenericMVAComputerCache_h
00002 #define RecoBTau_JetTagComputer_GenericMVAComputerCache_h
00003 
00004 #include <string>
00005 #include <vector>
00006 #include <memory>
00007 
00008 #include "DataFormats/BTauReco/interface/BaseTagInfo.h"
00009 #include "CondFormats/PhysicsToolsObjects/interface/MVAComputer.h"
00010 #include "RecoBTau/JetTagComputer/interface/GenericMVAComputer.h"
00011 
00012 class GenericMVAComputerCache {
00013     public:
00014         GenericMVAComputerCache(const std::vector<std::string> &labels);
00015         ~GenericMVAComputerCache();
00016 
00017         bool
00018         update(const PhysicsTools::Calibration::MVAComputerContainer *calib);
00019 
00020         inline GenericMVAComputer *getComputer(int index) const
00021         { return index >= 0 ? computers[index].computer.get() : 0; }
00022 
00023         inline bool isEmpty() const { return empty; }
00024 
00025     private:
00026         struct IndividualComputer {
00027                 IndividualComputer();
00028                 IndividualComputer(const IndividualComputer &orig);
00029                 ~IndividualComputer();
00030 
00031                 std::string                                             label;
00032                 std::auto_ptr<GenericMVAComputer>                       computer;
00033                 PhysicsTools::Calibration::MVAComputer::CacheId         cacheId;
00034         };
00035 
00036         std::vector<IndividualComputer>                                 computers;
00037         PhysicsTools::Calibration::MVAComputerContainer::CacheId        cacheId;
00038         bool                                                            initialized;
00039         bool                                                            empty;
00040 };
00041 
00042 #endif // RecoBTau_JetTagComputer_GenericMVAComputerCache_h