Belle II Software development
SectorMapBootstrapModule.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#pragma once
10
11//framework:
12#include <framework/core/Module.h>
13#include <framework/database/PayloadFile.h>
14
15#include <vector>
16#include <string>
17#include <tuple>
18
19namespace Belle2 {
25 struct SectorMapConfig;
26
32
33 public:
34
37
40 {
41 if (m_ptrDBObjPtr != nullptr) delete m_ptrDBObjPtr;
42 };
43
47 void initialize() override;
48
52 void beginRun() override;
53
57 void event() override;
58
62 void endRun() override;
63
64 private:
65
67 void bootstrapSectorMap(void);
70 void bootstrapSectorMap(const SectorMapConfig& config);
72 void persistSectorMap(void);
74 void retrieveSectorMap(void);
75
77 const std::string c_setupKeyNameTTreeName = "Setups";
79 const std::string c_setupKeyNameBranchName = "name";
80
82 std::string m_sectorMapsInputFile = "SectorMaps.root";
84 std::string m_sectorMapsOutputFile = "SectorMaps.root";
85
87 std::string m_setupToRead = std::string("");
88
91
92
96 std::vector< std::tuple<int, std::string> > m_twoHitFilterAdjustFunctions = {};
97
101 std::vector< std::tuple<int, std::string> > m_threeHitFilterAdjustFunctions = {};
102
104 bool m_readSecMapFromDB = false;
105
107 bool m_readSectorMap = true;
109 bool m_writeSectorMap = false;
110 };
112} // Belle2 namespace
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Base class for Modules.
Definition: Module.h:72
The SegmentFilterConverterModule is a module able to read the cutoff values for filtering the Segment...
bool m_readSecMapFromDB
if true the sector map will be read from the DB. NOTE: this will override m_readSectorMap (read from ...
std::string m_sectorMapsInputFile
the name of the input root file the sectormaps are read from
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.
std::vector< std::tuple< int, std::string > > m_twoHitFilterAdjustFunctions
vector of tuple<int, string> specifying how 2-hit filters are altered.
void bootstrapSectorMap(void)
puts several empty sectormaps into the framework
void beginRun() override
Called when entering a new run.
bool m_readSectorMap
if true a sectormap will be read from a file. NOTE: this will be overridden by m_readSecMapFromDB!
DBObjPtr< PayloadFile > * m_ptrDBObjPtr
pointer to the DBObjPtr for the payloadfile from which the sectormap is read
const std::string c_setupKeyNameBranchName
the name of the branch the setupt are stored in the tree
std::vector< std::tuple< int, std::string > > m_threeHitFilterAdjustFunctions
vector of tuple<int, string> specifying how 3-hit filters are altered.
const std::string c_setupKeyNameTTreeName
the name of the tree the setups are stored in in the root file
std::string m_setupToRead
if specified (non "") ONLY the setup with this name will be read. Else all setups in the root file wi...
std::string m_sectorMapsOutputFile
the name of the output root file the sectormaps are written to
void persistSectorMap(void)
writes a sectormap to a root file
void retrieveSectorMap(void)
retrieves SectorMap from file or from the DB
bool m_writeSectorMap
if true the sectormap will be written to an output file
Abstract base class for different kinds of events.
simple struct containing all the configuration data needed for the SecMapTrainer.