10#include <analysis/modules/LowEnergyPi0IdentificationExpert/LowEnergyPi0IdentificationExpertModule.h>
13#include <analysis/variables/ECLVariables.h>
14#include <analysis/variables/HelicityVariables.h>
17#include <mva/interface/Interface.h>
20#include <boost/algorithm/string/predicate.hpp>
33 "Database identifier or file used to load the weights.",
62 std::stringstream ss((*m_weightfile_representation)->m_data);
82 m_expert = supported_interfaces[general_options.m_method]->getExpert();
84 std::vector<float> dummy;
91 dummy.resize(nInputVariables, 0);
98 for (
int i = 0; i < n; ++i) {
102 const Particle* gammaLowEnergy, *gammaHighEnergy;
104 gammaLowEnergy = gamma2;
105 gammaHighEnergy = gamma1;
107 gammaLowEnergy = gamma1;
108 gammaHighEnergy = gamma2;
110 double gammaLowEnergyPi0Veto, gammaHighEnergyPi0Veto;
111 double gammaLowEnergyE9E21, gammaHighEnergyE9E21;
112 double gammaLowEnergyClusterTheta, gammaHighEnergyClusterTheta;
113 double gammaLowEnergyZernikeMVA, gammaHighEnergyZernikeMVA;
114 double gammaLowEnergyIsolation, gammaHighEnergyIsolation;
115 gammaLowEnergyPi0Veto = pi0->
getExtraInfo(
"lowEnergyPi0VetoGammaLowEnergy");
116 gammaHighEnergyPi0Veto =
118 gammaLowEnergyE9E21 = Variable::eclClusterE9E21(gammaLowEnergy);
119 gammaHighEnergyE9E21 = Variable::eclClusterE9E21(gammaHighEnergy);
120 gammaLowEnergyClusterTheta = Variable::eclClusterTheta(gammaLowEnergy);
121 gammaHighEnergyClusterTheta = Variable::eclClusterTheta(gammaHighEnergy);
123 gammaLowEnergyZernikeMVA = Variable::eclClusterZernikeMVA(gammaLowEnergy);
124 gammaHighEnergyZernikeMVA =
125 Variable::eclClusterZernikeMVA(gammaHighEnergy);
126 gammaLowEnergyIsolation = Variable::eclClusterIsolation(gammaLowEnergy);
127 gammaHighEnergyIsolation = Variable::eclClusterIsolation(gammaHighEnergy);
129 m_dataset->m_input[0] = gammaLowEnergyPi0Veto;
130 m_dataset->m_input[1] = gammaHighEnergyPi0Veto;
131 m_dataset->m_input[2] = gammaLowEnergyE9E21;
132 m_dataset->m_input[3] = gammaHighEnergyE9E21;
133 m_dataset->m_input[4] = gammaLowEnergyClusterTheta;
134 m_dataset->m_input[5] = gammaHighEnergyClusterTheta;
136 m_dataset->m_input[6] = gammaLowEnergyZernikeMVA;
137 m_dataset->m_input[7] = gammaHighEnergyZernikeMVA;
138 m_dataset->m_input[8] = gammaLowEnergyIsolation;
139 m_dataset->m_input[9] = gammaHighEnergyIsolation;
142 pi0->
addExtraInfo(
"lowEnergyPi0Identification", identification);
Class for accessing objects in the database.
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
bool m_Belle1
Belle 1 data analysis.
void initialize() override
Initializer.
void event() override
This method is called for each event.
void endRun() override
This method is called if the current run ends.
void terminate() override
This method is called at the end of the event processing.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA expert.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the database representation of the weightfile.
void beginRun() override
Called when entering a new run.
StoreObjPtr< ParticleList > m_ListPi0
pi0 candidates.
LowEnergyPi0IdentificationExpertModule()
Constructor.
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called every time the weightfile in the database changes ...
~LowEnergyPi0IdentificationExpertModule()
Destructor.
std::string m_Pi0ListName
Pi0 particle list name.
std::string m_identifier
Database identifier or file used to load the weights.
static void initSupportedInterfaces()
Static function which initliazes all supported interfaces, has to be called once before getSupportedI...
static std::map< std::string, AbstractInterface * > getSupportedInterfaces()
Returns interfaces supported by the MVA Interface.
General options which are shared by all MVA trainings.
Wraps the data of a single event into a Dataset.
The Weightfile class serializes all information about a training into an xml tree.
static Weightfile loadFromStream(std::istream &stream)
Static function which deserializes a Weightfile from a stream.
void getOptions(Options &options) const
Fills an Option object from the xml tree.
static Weightfile loadFromFile(const std::string &filename)
Static function which loads a Weightfile from a file.
void addSignalFraction(float signal_fraction)
Saves the signal fraction in the xml tree.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Class to store reconstructed particles.
double getEnergy() const
Returns total energy.
void addExtraInfo(const std::string &name, double value)
Sets the user-defined data of given name to the given value.
const Particle * getDaughter(unsigned i) const
Returns a pointer to the i-th daughter particle.
double getExtraInfo(const std::string &name) const
Return given value if set.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.