Belle II Software  release-08-01-10
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 
17 #include <TH1D.h>
18 
19 namespace Belle2 {
26  class GRLNeuroModule : public Module {
27  public:
30 
32  virtual ~GRLNeuroModule() {}
33 
37  virtual void initialize() override;
38 
42  virtual void event() override;
43 
44  virtual void terminate() override;
45 
51  bool loadTraindata(const std::string& filename, const std::string& arrayname = "trainSets");
52 
53  protected:
54  //module parameters
58  std::vector<std::string> m_weightFileNames;
60  std::vector<std::string> m_biasFileNames;
62  std::string m_arrayname;
64  std::string m_GRLCollectionName;
68  bool m_use_cdc;
70  bool m_use_ecl;
72  bool m_use_klm;
74  int trainMode;
76  std::string m_TrgECLClusterName;
78  std::vector<float> m_nNodes;
80  std::vector<float> m_nn_thres;
82  bool m_saveHist;
84  std::string m_HistFileName;
87 
89  std::vector<int> TCThetaID;
91  std::vector<float> TCPhiCOM;
93  std::vector<float> TCThetaCOM;
95  std::vector<TH1D*> h_target;
96 
97  };
99 }
100 
101 #endif
The module for application of the neural networks of the GRL.
bool loadTraindata(const std::string &filename, const std::string &arrayname="trainSets")
Load saved training samples.
bool m_use_ecl
switch to use trg ecl cluster.
std::vector< float > TCThetaCOM
Polar 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.
std::string m_TrgGrlInformationName
name of TRG GRL information object
bool m_saveHist
save the output histogram
std::vector< float > TCPhiCOM
Azimuth angle of a given TRGcluster.
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
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
Base class for Modules.
Definition: Module.h:72
Abstract base class for different kinds of events.
Struct to keep neurotrigger parameters.
Definition: GRLNeuro.h:41