Skip to content

Instantly share code, notes, and snippets.

@jpata
Created June 25, 2015 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpata/1485e93603be930facd6 to your computer and use it in GitHub Desktop.
Save jpata/1485e93603be930facd6 to your computer and use it in GitHub Desktop.
using namespace reco;
using namespace PhysicsTools;
CombinedMVAJetTagComputerETH::CombinedMVAJetTagComputerETH(
const edm::ParameterSet &params) :
GenericMVAJetTagComputer(params)
{
std::cout << "CombinedMVAJetTagComputerETH::constructor" << std::endl;
inputComputerNames = params.getParameter< std::vector<std::string>>(
"jetTagComputers"
);
uses(0, "ipTagInfos");
uses(1, "svTagInfos");
uses(2, "muonTagInfos");
uses(3, "elecTagInfos");
}
CombinedMVAJetTagComputerETH::~CombinedMVAJetTagComputerETH()
{
}
void CombinedMVAJetTagComputerETH::initialize(const JetTagComputerRecord & record) {
std::cout << "CombinedMVAJetTagComputerETH::initialize" << std::endl;
for (auto & name : inputComputerNames) {
edm::ESHandle<JetTagComputer> computerHandle;
record.get(name, computerHandle);
const JetTagComputer* comp = computerHandle.product();
computers.push_back(comp);
std::vector<std::string> inputLabels(comp->getInputLabels());
for (auto lab : inputLabels) {
std::cout << name << " " << lab << std::endl;
}
}
GenericMVAJetTagComputer::initialize(record);
}
float CombinedMVAJetTagComputerETH::discriminator(const JetTagComputer::TagInfoHelper &info) const
{
int i = 0;
for (const JetTagComputer* comp : computers) {
float d = (*comp)(info);
std::cout << inputComputerNames[i] << " " << d << std::endl;
i++;
}
return 0.0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment