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) {
37 computer.
name = iter->getParameter<std::string>(
"jetTagComputer");
38 computer.
discriminator = iter->getParameter<
bool>(
"discriminator");
39 computer.
variables = iter->getParameter<
bool>(
"variables");
42 this->computers.push_back(computer);
53 std::map<std::string, int> indexMap;
57 for(std::vector<Computer>::iterator iter =
computers.begin();
59 if (!iter->computer) {
62 iter->name, computer);
63 iter->computer = computer.
product();
66 std::vector<std::string> inputLabels(
67 iter->computer->getInputLabels());
70 if (inputLabels.empty()) {
71 std::ostringstream ss;
72 ss <<
"tagInfo" << ++nonameIndex;
73 inputLabels.push_back(ss.str());
76 for(std::vector<std::string>::const_iterator
label =
79 if (indexMap.find(*
label) == indexMap.end()) {
83 iter->indices.push_back(index++);
85 iter->indices.push_back(
93 if (iter->variables && !mvaComputer)
95 <<
"JetTagComputer \"" << iter->name
96 <<
"\" is not an MVAJetTagCompputer, "
97 "but tagging variables have been "
98 "requested." << std::endl;
100 if (!pass || iter->discriminator)
101 iter->computer->setEventSetup(es);
102 else if (mvaComputer)
111 std::vector<const BaseTagInfo*> tagInfos;
113 for(std::vector<Computer>::iterator iter =
computers.begin();
117 <<
"JetTagComputer \"" << iter->name
118 <<
"\" is not available in "
119 "CombinedMVAJetTagComputer::"
120 "taggingVariables()" << std::endl;
123 for(std::vector<int>::const_iterator
i = iter->indices.begin();
124 i != iter->indices.end(); ++
i)
125 tagInfos.push_back(&info.
getBase(*
i));
127 if (iter->variables) {
134 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 passEventSetup(const edm::EventSetup &es) 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
T const * product() const
virtual void setEventSetup(const edm::EventSetup &es) const
void insert(const TaggingVariable &variable, bool delayed=false)
virtual reco::TaggingVariableList taggingVariables(const reco::BaseTagInfo &tagInfo) const