23 using namespace PhysicsTools;
29 std::vector<edm::ParameterSet>
computers =
33 for(std::vector<edm::ParameterSet>::const_iterator iter =
34 computers.begin(); iter != computers.end(); ++iter) {
38 computer.
discriminator = iter->getParameter<
bool>(
"discriminator");
39 computer.
variables = iter->getParameter<
bool>(
"variables");
42 this->computers.push_back(computer);
52 std::map<std::string, int> indexMap;
56 for(std::vector<Computer>::iterator iter =
computers.begin();
60 record.
get(iter->name, computerHandle);
61 if (!iter->computer) {
62 iter->computer = computerHandle.
product();
65 std::vector<std::string> inputLabels(iter->computer->getInputLabels());
68 if (inputLabels.empty()) {
69 std::ostringstream
ss;
70 ss <<
"tagInfo" << ++nonameIndex;
71 inputLabels.push_back(ss.str());
73 for(std::vector<std::string>::const_iterator
label =
76 if (indexMap.find(*
label) == indexMap.end()) {
79 iter->indices.push_back(index++);
81 iter->indices.push_back(indexMap[*
label]);
86 if(iter->computer != computerHandle.
product()) {
87 throw cms::Exception(
"LogicError") <<
"CombinedMVAJetTagComputer::initialize. Pointer to JetTagComputer changed!\n";
93 if (iter->variables && !mvaComputer) {
95 <<
"JetTagComputer \"" << iter->name
96 <<
"\" is not an MVAJetTagCompputer, "
97 "but tagging variables have been "
98 "requested." << std::endl;
108 std::vector<const BaseTagInfo*>
tagInfos;
110 for(std::vector<Computer>::const_iterator iter =
computers.begin();
114 <<
"JetTagComputer \"" << iter->name
115 <<
"\" is not available in "
116 "CombinedMVAJetTagComputer::"
117 "taggingVariables()" << std::endl;
120 for(std::vector<int>::const_iterator
i = iter->indices.begin();
121 i != iter->indices.end(); ++
i)
122 tagInfos.push_back(&info.
getBase(*
i));
124 if (iter->variables) {
131 if (iter->discriminator)
T getParameter(std::string const &) const
virtual ~CombinedMVAJetTagComputer()
CombinedMVAJetTagComputer(const edm::ParameterSet ¶meters)
const JetTagComputer * computer
std::vector< Computer > computers
virtual void initialize(const JetTagComputerRecord &)
void get(HolderT &iHolder) const
void uses(unsigned int id, const std::string &label)
const reco::BaseTagInfo & getBase(unsigned int index) const
virtual reco::TaggingVariableList taggingVariables(const TagInfoHelper &info) const
virtual void initialize(const JetTagComputerRecord &record)
T const * product() const
void insert(const TaggingVariable &variable, bool delayed=false)
virtual reco::TaggingVariableList taggingVariables(const reco::BaseTagInfo &tagInfo) const