Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-31 02:19:51

0001 #ifndef RecoBTau_JetTagComputer_CombinedMVAV2JetTagComputer_h
0002 #define RecoBTau_JetTagComputer_CombinedMVAV2JetTagComputer_h
0003 
0004 #include <string>
0005 #include <memory>
0006 #include <vector>
0007 #include <map>
0008 
0009 #include "FWCore/Framework/interface/ESConsumesCollector.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "CommonTools/MVAUtils/interface/TMVAEvaluator.h"
0012 #include "CondFormats/DataRecord/interface/GBRWrapperRcd.h"
0013 #include "RecoBTau/JetTagComputer/interface/JetTagComputer.h"
0014 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0017 
0018 class CombinedMVAV2JetTagComputer : public JetTagComputer {
0019 public:
0020   struct Tokens {
0021     Tokens(const edm::ParameterSet &parameters, edm::ESConsumesCollector &&cc);
0022     edm::ESGetToken<GBRForest, GBRWrapperRcd> gbrForest_;
0023     std::vector<edm::ESGetToken<JetTagComputer, JetTagComputerRecord> > computers_;
0024   };
0025 
0026   CombinedMVAV2JetTagComputer(const edm::ParameterSet &parameters, Tokens tokens);
0027   ~CombinedMVAV2JetTagComputer() override;
0028 
0029   void initialize(const JetTagComputerRecord &record) override;
0030 
0031   float discriminator(const TagInfoHelper &info) const override;
0032 
0033   static void fillPSetDescription(edm::ParameterSetDescription &desc);
0034 
0035 private:
0036   std::vector<const JetTagComputer *> computers;
0037 
0038   const std::string mvaName;
0039   const std::vector<std::string> variables;
0040   const std::vector<std::string> spectators;
0041   const edm::FileInPath weightFile;
0042   const bool useGBRForest;
0043   const bool useAdaBoost;
0044   const Tokens tokens;
0045 
0046   std::unique_ptr<TMVAEvaluator> mvaID;
0047 };
0048 
0049 #endif  // RecoBTau_JetTagComputer_CombinedMVAV2JetTagComputer_h