Belle II Software development
GRLNeuroModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef GRLNEUROMODULE_H
9#define GRLNEUROMODULE_H
10
11#include <framework/core/Module.h>
12
13#include <trg/grl/GRLNeuro.h>
14#include <trg/grl/dataobjects/TRGGRLInfo.h>
15#include <trg/grl/dataobjects/GRLMLPData.h>
16#include <framework/database/DBObjPtr.h>
17#include <trg/grl/dbobjects/TRGGRLConfig.h>
18
19#include <TH1D.h>
20
21namespace Belle2 {
28 class GRLNeuroModule : public Module {
29 public:
32
34 virtual ~GRLNeuroModule() {}
35
39 virtual void initialize() override;
40
42 virtual void beginRun() override;
43
47 virtual void event() override;
48
49 virtual void terminate() override;
50
56 bool loadTraindata(const std::string& filename, const std::string& arrayname = "trainSets");
57
58 protected:
59 //module parameters
63 std::vector<std::string> m_weightFileNames;
65 std::vector<std::string> m_biasFileNames;
67 std::string m_arrayname;
83 std::vector<float> m_nNodes;
85 std::vector<float> m_nn_thres;
89 std::string m_HistFileName;
92
95
97 std::vector<int> TCThetaID;
99 std::vector<double> TCThetaLab;
101 std::vector<double> TCPhiLab;
102
104 std::vector<TH1D*> h_target;
105
108
109 };
110
111}
112
113#endif
Class for accessing objects in the database.
Definition DBObjPtr.h:21
bool loadTraindata(const std::string &filename, const std::string &arrayname="trainSets")
Load saved training samples.
std::vector< double > TCThetaLab
Polar angle of a given TRGcluster.
DBObjPtr< TRGGRLConfig > m_db_trggrlconfig
dbobject to store grl config
bool m_use_ecl
switch to use trg ecl cluster.
std::vector< double > TCPhiLab
Azimuthal angle of a given TRGcluster.
std::string m_HistFileName
Name of root file to save the histogram.
virtual void initialize() override
Initialize the module.
std::string m_TrgECLClusterName
Name of the StoreArray containing the ECL clusters.
std::vector< int > TCThetaID
TCID of a given TRGcluster.
GRLNeuro m_GRLNeuro
Instance of the NeuroTrigger.
virtual void event() override
Called once for each event.
GRLNeuro::Parameters m_parameters
Parameters for the NeuroTrigger.
GRLNeuroModule()
Constructor, for setting module description and parameters.
std::string m_arrayname
Name of the TObjArray holding the networks.
virtual void terminate() override
This method is called at the end of the event processing.
std::vector< std::string > m_weightFileNames
Name of file where network weights etc.
std::string m_GRLCollectionName
Name of the StoreObj containing the input GRL.
bool m_use_klm
switch to use trg klm summary.
virtual void beginRun() override
Register run-dependent DataStore arrays.
std::string m_TrgGrlInformationName
name of TRG GRL information object
bool m_saveHist
save the output histogram
std::vector< float > m_nn_thres
cut on MVA to separate signal
std::vector< float > m_nNodes
Number of nodes in all laysers.
bool m_use_cdc
switch to use cdc tracks.
std::vector< TH1D * > h_target
Histograms to save the NN classifiers.
int trainMode
selection which is signal and which is background
bool m_useDB
flag to use database to load config
virtual ~GRLNeuroModule()
Destructor.
std::vector< std::string > m_biasFileNames
Name of file where network bias etc.
Class to represent the GRL Neuro.
Definition GRLNeuro.h:35
Module()
Constructor.
Definition Module.cc:30
Abstract base class for different kinds of events.
Struct to keep neurotrigger parameters.
Definition GRLNeuro.h:41