Belle II Software  release-08-01-10
CDCTriggerNeuroDataModule.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 
9 
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 #include <trg/cdc/NeuroTrigger.h>
14 #include <trg/cdc/NeuroTriggerParameters.h>
15 #include <trg/cdc/dataobjects/CDCTriggerMLPData.h>
16 #include <iostream>
17 #include "boost/iostreams/filter/gzip.hpp"
18 #include "boost/iostreams/filtering_streambuf.hpp"
19 #include "boost/iostreams/filtering_stream.hpp"
20 #include "boost/multi_array.hpp"
21 #define BOOST_MULTI_ARRAY_NO_GENERATORS
22 namespace Belle2 {
33  public:
36 
39 
43  virtual void initialize() override;
44 
48  virtual void event() override;
49 
51  virtual void terminate() override;
52 
53  bool loadIDHist(const std::string& filename, NeuroTrigger& neuro);
54 
55  void saveData_gzip(const std::string& filename, const std::vector<CDCTriggerMLPData>& dataset,
56  boost::iostreams::filtering_streambuf<boost::iostreams::output> outStream);
57 
58  protected:
59  //module parameters
61  std::string m_hitCollectionName;
63  std::string m_inputCollectionName;
69  std::string m_EventTimeName;
71  std::string m_filename;
73  std::string m_configFileName;
75  std::string m_writeconfigFileName;
82  //other data
86  std::vector<CDCTriggerMLPData> m_trainSet;
87 
92  };
94 }
std::string m_EventTimeName
name of the event time StoreObjPtr
std::vector< CDCTriggerMLPData > m_trainSet
Sets of training data for all sectors.
bool m_trainOnRecoTracks
Switch between MCParticles or RecoTracks as targets.
NeuroTriggerParameters m_neuroParameters
Parameters for the NeuroTrigger.
NeuroTrigger m_NeuroTrigger
Instance of the NeuroTrigger.
std::string m_targetCollectionName
Name of the MCParticles/RecoTracks collection used as target values.
bool m_neuroTrackInputMode
Switch to rescale out of range target values or ignore them.
std::string m_inputCollectionName
Name of the StoreArray containing the input 2D tracks.
StoreArray< CDCTriggerTrack > m_tracks
List of input tracks.
std::string m_filename
Name of gzip file where the training data are saved.
bool m_singleUse
use a track only once and not for every expert
std::string m_writeconfigFileName
Name of the configuration file used in the module to write the neuroparamters.
std::string m_hitCollectionName
Name of the StoreArray containing the input track segment hits.
std::string m_configFileName
Name of the configuration file used in the module to load the neuroparamters.
Base class for Modules.
Definition: Module.h:72
Class to represent the CDC Neurotrigger.
Definition: NeuroTrigger.h:40
virtual void initialize() override
Initialize the module.
virtual void event() override
Called once for each event.
virtual void terminate() override
Do the training for all sectors.
CDCTriggerNeuroDataModule()
Constructor, for setting module description and parameters.
Abstract base class for different kinds of events.