File indexing completed on 2025-01-31 02:19:53
0001 #ifndef RecoBTau_JetTagComputer_GenericMVAJetTagComputerWrapper_h
0002 #define RecoBTau_JetTagComputer_GenericMVAJetTagComputerWrapper_h
0003
0004 #include <memory>
0005
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include "DataFormats/BTauReco/interface/BaseTagInfo.h"
0008 #include "DataFormats/BTauReco/interface/TaggingVariable.h"
0009 #include "RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h"
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 namespace btau_dummy {
0034 struct Null {};
0035 constexpr const char none[] = "";
0036 }
0037
0038
0039
0040 template <class Provider,
0041 class TI1,
0042 const char *ti1 = btau_dummy::none,
0043 class TI2 = btau_dummy::Null,
0044 const char *ti2 = btau_dummy::none,
0045 class TI3 = btau_dummy::Null,
0046 const char *ti3 = btau_dummy::none,
0047 class TI4 = btau_dummy::Null,
0048 const char *ti4 = btau_dummy::none>
0049 class GenericMVAJetTagComputerWrapper : public GenericMVAJetTagComputer, private Provider {
0050 public:
0051 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0052 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0053 uses(0, ti1);
0054 uses(1, ti2);
0055 uses(2, ti3);
0056 uses(3, ti4);
0057 }
0058
0059 static void fillPSetDescription(edm::ParameterSetDescription &desc) {
0060 Provider::fillPSetDescription(desc);
0061 GenericMVAJetTagComputer::fillPSetDescription(desc);
0062 }
0063
0064 protected:
0065 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0066 return (static_cast<const Provider &>(*this))(
0067 info.get<TI1>(0), info.get<TI2>(1), info.get<TI3>(2), info.get<TI4>(3));
0068 }
0069 };
0070
0071
0072
0073 template <class Provider, class TI1, const char *ti1, class TI2, const char *ti2, class TI3, const char *ti3>
0074 class GenericMVAJetTagComputerWrapper<Provider, TI1, ti1, TI2, ti2, TI3, ti3, btau_dummy::Null, btau_dummy::none>
0075 : public GenericMVAJetTagComputer, private Provider {
0076 public:
0077 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0078 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0079 uses(0, ti1);
0080 uses(1, ti2);
0081 uses(2, ti3);
0082 }
0083
0084 static void fillPSetDescription(edm::ParameterSetDescription &desc) {
0085 Provider::fillPSetDescription(desc);
0086 GenericMVAJetTagComputer::fillPSetDescription(desc);
0087 }
0088
0089 protected:
0090 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0091 return (static_cast<const Provider &>(*this))(info.get<TI1>(0), info.get<TI2>(1), info.get<TI3>(2));
0092 }
0093 };
0094
0095
0096
0097 template <class Provider, class TI1, const char *ti1, class TI2, const char *ti2>
0098 class GenericMVAJetTagComputerWrapper<Provider,
0099 TI1,
0100 ti1,
0101 TI2,
0102 ti2,
0103 btau_dummy::Null,
0104 btau_dummy::none,
0105 btau_dummy::Null,
0106 btau_dummy::none> : public GenericMVAJetTagComputer,
0107 private Provider {
0108 public:
0109 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0110 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0111 uses(0, ti1);
0112 uses(1, ti2);
0113 }
0114
0115 static void fillPSetDescription(edm::ParameterSetDescription &desc) {
0116 Provider::fillPSetDescription(desc);
0117 GenericMVAJetTagComputer::fillPSetDescription(desc);
0118 }
0119
0120 protected:
0121 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0122 return (static_cast<const Provider &>(*this))(info.get<TI1>(0), info.get<TI2>(1));
0123 }
0124 };
0125
0126
0127
0128 template <class Provider, class TI1, const char *ti1>
0129 class GenericMVAJetTagComputerWrapper<Provider,
0130 TI1,
0131 ti1,
0132 btau_dummy::Null,
0133 btau_dummy::none,
0134 btau_dummy::Null,
0135 btau_dummy::none,
0136 btau_dummy::Null,
0137 btau_dummy::none> : public GenericMVAJetTagComputer,
0138 private Provider {
0139 public:
0140 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0141 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0142 uses(0, ti1);
0143 }
0144
0145 static void fillPSetDescription(edm::ParameterSetDescription &desc) {
0146 Provider::fillPSetDescription(desc);
0147 GenericMVAJetTagComputer::fillPSetDescription(desc);
0148 }
0149
0150 protected:
0151 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0152 return (static_cast<const Provider &>(*this))(info.get<TI1>(0));
0153 }
0154 };
0155
0156
0157
0158 template <class Provider, class TI1>
0159 class GenericMVAJetTagComputerWrapper<Provider,
0160 TI1,
0161 btau_dummy::none,
0162 btau_dummy::Null,
0163 btau_dummy::none,
0164 btau_dummy::Null,
0165 btau_dummy::none,
0166 btau_dummy::Null,
0167 btau_dummy::none> : public GenericMVAJetTagComputer,
0168 private Provider {
0169 public:
0170 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0171 : GenericMVAJetTagComputer(params, tokens), Provider(params) {}
0172
0173 static void fillPSetDescription(edm::ParameterSetDescription &desc) {
0174 Provider::fillPSetDescription(desc);
0175 GenericMVAJetTagComputer::fillPSetDescription(desc);
0176 }
0177
0178 protected:
0179 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0180 return (static_cast<const Provider &>(*this))(info.get<TI1>(0));
0181 }
0182 };
0183
0184 #endif