File indexing completed on 2025-01-31 02:19:52
0001 #ifndef RecoBTag_CTagging_CharmTagger_h
0002 #define RecoBTag_CTagging_CharmTagger_h
0003
0004 #include "CommonTools/MVAUtils/interface/TMVAEvaluator.h"
0005 #include "DataFormats/BTauReco/interface/TaggingVariable.h"
0006 #include "FWCore/Framework/interface/ESConsumesCollector.h"
0007 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0010 #include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h"
0011 #include "RecoBTau/JetTagComputer/interface/JetTagComputer.h"
0012 #include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h"
0013
0014 #include <memory>
0015
0016
0017
0018
0019
0020
0021 class CharmTagger : public JetTagComputer {
0022 public:
0023 struct Tokens {
0024 Tokens(const edm::ParameterSet& configuration, edm::ESConsumesCollector&& cc);
0025 edm::ESGetToken<GBRForest, GBRWrapperRcd> gbrForest_;
0026 };
0027
0028
0029 CharmTagger(const edm::ParameterSet&, Tokens);
0030 ~CharmTagger() override;
0031 float discriminator(const TagInfoHelper& tagInfo) const override;
0032 void initialize(const JetTagComputerRecord& record) override;
0033
0034 static void fillPSetDescription(edm::ParameterSetDescription& desc);
0035
0036 typedef std::vector<edm::ParameterSet> vpset;
0037
0038 struct MVAVar {
0039 std::string name;
0040 reco::btau::TaggingVariableName id;
0041 size_t index;
0042 bool has_index;
0043 float default_value;
0044 };
0045
0046 private:
0047 std::unique_ptr<TMVAEvaluator> mvaID_;
0048 CombinedSVSoftLeptonComputer sl_computer_;
0049 std::vector<MVAVar> variables_;
0050
0051 std::string mva_name_;
0052 edm::FileInPath weight_file_;
0053 bool use_GBRForest_;
0054 bool use_adaBoost_;
0055 bool defaultValueNoTracks_;
0056 Tokens tokens_;
0057 };
0058
0059 #endif