Belle II Software development
VXDQETrainingDataCollectorModule.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#include <tracking/spacePointCreation/SpacePointTrackCand.h>
12#include <tracking/trackFindingVXD/trackQualityEstimators/QualityEstimatorBase.h>
13#include <tracking/trackFindingVXD/variableExtractors/SimpleVariableRecorder.h>
14#include <tracking/trackFindingVXD/variableExtractors/ClusterInfoExtractor.h>
15#include <tracking/trackFindingVXD/variableExtractors/QEResultsExtractor.h>
16
17
18#include <framework/datastore/StoreArray.h>
19#include <framework/core/Module.h>
20
21#include <memory>
22
23
24namespace Belle2 {
34
35 public:
38
40 void initialize() override;
41
43 void beginRun() override;
44
46 void event() override;
47
49 void terminate() override;
50
51
52 protected:
53
54 // -----module parameters---
55
61 std::string m_EstimationMethod = "tripletFit";
62
64 bool m_MCInfo = true;
65
67 std::string m_SpacePointTrackCandsStoreArrayName = "SPTrackCands";
68
70 std::string m_MCRecoTracksStoreArrayName = "MCRecoTracks";
71
74
77 bool m_mva_target = false;
78
80 std::string m_TrainingDataOutputName = "QETrainingOutput.root";
81
83 std::string m_ClusterInformation = "Average";
84
86 bool m_UseTimingInfo = false;
87
88 // -------------------------
89
92
94 std::unique_ptr<QualityEstimatorBase> m_estimator;
95
97 std::unique_ptr<QualityEstimatorBase> m_estimatorMC;
98
101 std::unique_ptr<QEResultsExtractor> m_qeResultsExtractor;
102
104 std::unique_ptr<ClusterInfoExtractor> m_clusterInfoExtractor;
105
107 std::unique_ptr<SimpleVariableRecorder> m_recorder;
108
110 std::vector<Named<float*>> m_variableSet;
111
114 float m_nSpacePoints = NAN;
115
118 float m_truth = NAN;
119
120 };
122}
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
VXD Quality Estimator Data Collector Module to collect data for a MVA training using VXDQE_teacher....
std::unique_ptr< SimpleVariableRecorder > m_recorder
pointer to the object that writes out the collected data into a root file
std::string m_SpacePointTrackCandsStoreArrayName
sets the name of the expected StoreArray containing SpacePointTrackCands
bool m_MCStrictQualityEstimator
Required for MCInfo method, activates its strict version.
void initialize() override
Initializes the Module.
void event() override
applies the selected quality estimation method for a given set of TCs
float m_truth
truth information collected with m_estimatorMC type is float to be consistend with m_variableSet (and...
std::string m_EstimationMethod
Identifier which estimation method to use.
float m_nSpacePoints
number of SpacePoints in SPTC as additional info to be collected, type is float to be consistend with...
void terminate() override
write out data from m_recorder
std::unique_ptr< QEResultsExtractor > m_qeResultsExtractor
pointer to object that extracts the results from the estimation mehtod (including QI,...
bool m_UseTimingInfo
whether to collect timing information
bool m_mva_target
Bool to indicate if mva target requiring complete agreement in SVD Clusters between MC and PR track t...
void beginRun() override
sets magnetic field strength
std::unique_ptr< ClusterInfoExtractor > m_clusterInfoExtractor
pointer to object that extracts info from the clusters of a SPTC
std::string m_MCRecoTracksStoreArrayName
sets the name of the expected StoreArray containing MCRecoTracks.
std::vector< Named< float * > > m_variableSet
set of named variables to be collected
bool m_MCInfo
whether to collect MC truth information
std::unique_ptr< QualityEstimatorBase > m_estimatorMC
QualityEstimatorMC as target for training.
std::unique_ptr< QualityEstimatorBase > m_estimator
pointer to the selected QualityEstimator
std::string m_TrainingDataOutputName
name of the output rootfile
StoreArray< SpacePointTrackCand > m_spacePointTrackCands
the storeArray for SpacePointTrackCands as member, is faster than recreating link for each event
std::string m_ClusterInformation
how to compile information from clusters ['Average']
Abstract base class for different kinds of events.