Belle II Software development
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
22namespace Belle2 {
30 public:
33
36
40 virtual void initialize() override;
41
45 virtual void event() override;
46
48 virtual void terminate() override;
49
50 bool loadIDHist(const std::string& filename, NeuroTrigger& neuro);
51
52 void saveData_gzip(const std::string& filename, const std::vector<CDCTriggerMLPData>& dataset,
53 boost::iostreams::filtering_streambuf<boost::iostreams::output> outStream);
54
55 protected:
56 //module parameters
66 std::string m_EventTimeName;
68 std::string m_filename;
70 std::string m_configFileName;
79 //other data
83 std::vector<CDCTriggerMLPData> m_trainSet;
84
89 };
91}
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
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
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.