File indexing completed on 2024-04-06 12:24:37
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 protected:
0060 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0061 return (static_cast<const Provider &>(*this))(
0062 info.get<TI1>(0), info.get<TI2>(1), info.get<TI3>(2), info.get<TI4>(3));
0063 }
0064 };
0065
0066
0067
0068 template <class Provider, class TI1, const char *ti1, class TI2, const char *ti2, class TI3, const char *ti3>
0069 class GenericMVAJetTagComputerWrapper<Provider, TI1, ti1, TI2, ti2, TI3, ti3, btau_dummy::Null, btau_dummy::none>
0070 : public GenericMVAJetTagComputer, private Provider {
0071 public:
0072 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0073 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0074 uses(0, ti1);
0075 uses(1, ti2);
0076 uses(2, ti3);
0077 }
0078
0079 protected:
0080 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0081 return (static_cast<const Provider &>(*this))(info.get<TI1>(0), info.get<TI2>(1), info.get<TI3>(2));
0082 }
0083 };
0084
0085
0086
0087 template <class Provider, class TI1, const char *ti1, class TI2, const char *ti2>
0088 class GenericMVAJetTagComputerWrapper<Provider,
0089 TI1,
0090 ti1,
0091 TI2,
0092 ti2,
0093 btau_dummy::Null,
0094 btau_dummy::none,
0095 btau_dummy::Null,
0096 btau_dummy::none> : public GenericMVAJetTagComputer,
0097 private Provider {
0098 public:
0099 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0100 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0101 uses(0, ti1);
0102 uses(1, ti2);
0103 }
0104
0105 protected:
0106 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0107 return (static_cast<const Provider &>(*this))(info.get<TI1>(0), info.get<TI2>(1));
0108 }
0109 };
0110
0111
0112
0113 template <class Provider, class TI1, const char *ti1>
0114 class GenericMVAJetTagComputerWrapper<Provider,
0115 TI1,
0116 ti1,
0117 btau_dummy::Null,
0118 btau_dummy::none,
0119 btau_dummy::Null,
0120 btau_dummy::none,
0121 btau_dummy::Null,
0122 btau_dummy::none> : public GenericMVAJetTagComputer,
0123 private Provider {
0124 public:
0125 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0126 : GenericMVAJetTagComputer(params, tokens), Provider(params) {
0127 uses(0, ti1);
0128 }
0129
0130 protected:
0131 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0132 return (static_cast<const Provider &>(*this))(info.get<TI1>(0));
0133 }
0134 };
0135
0136
0137
0138 template <class Provider, class TI1>
0139 class GenericMVAJetTagComputerWrapper<Provider,
0140 TI1,
0141 btau_dummy::none,
0142 btau_dummy::Null,
0143 btau_dummy::none,
0144 btau_dummy::Null,
0145 btau_dummy::none,
0146 btau_dummy::Null,
0147 btau_dummy::none> : public GenericMVAJetTagComputer,
0148 private Provider {
0149 public:
0150 GenericMVAJetTagComputerWrapper(const edm::ParameterSet ¶ms, Tokens tokens)
0151 : GenericMVAJetTagComputer(params, tokens), Provider(params) {}
0152
0153 protected:
0154 reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const override {
0155 return (static_cast<const Provider &>(*this))(info.get<TI1>(0));
0156 }
0157 };
0158
0159 #endif