10#include <analysis/modules/BelleNbarMVAModule/BelleNbarMVAModule.h>
13#include <framework/database/DBObjPtr.h>
14#include <framework/database/Database.h>
15#include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
16#include <mdst/dataobjects/ECLCluster.h>
23#define FDEEP_FLOAT_TYPE double
24#include <fdeep/fdeep.hpp>
33 R
"DOC(Apply nbarMVA for Belle I, a DNN trained with ECLCluster variables for discrimination of anti-neutrons against photons. Anti-neutron-like particles have scores closer to 1; photon-like particles have scores closer to 0.)DOC");
48 const ECLCluster* cluster = particle.getECLCluster();
49 std::vector<double> v{
52 cluster->getEnergyHighestCrystal(),
53 cluster->getNumberOfCrystals(),
56 particle.addExtraInfo(
"nbarMVA",
double(
m_model->predict_single_output({fdeep::tensor(fdeep::tensor_shape(5), v)})));
void initialize() override
Load the weight file.
void event() override
Perform the calculation here.
std::unique_ptr< fdeep::model > m_model
Model of the MVA.
std::string m_particleList
Name of the ParticleList to apply the MVA.
StoreObjPtr< ParticleList > m_plist
ParticeList to apply the MVA.
BelleNbarMVAModule()
Constructor: Sets the description, the properties and the parameters of the module.
std::string m_identifier
Identifier of the MVA.
Database representation of a Weightfile object.
@ c_nPhotons
CR is split into n photons (N1)
void setDescription(const std::string &description)
Sets the description of the module.
Class to store reconstructed particles.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
static Database & Instance()
Instance of a singleton Database.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.