 |
Belle II Software
release-05-02-19
|
15 #include <tracking/modules/vxdtfRedesign/FastBDTClassifierAnalyzerModule.h>
16 #include <tracking/spacePointCreation/MapHelperFunctions.h>
25 "analyzes performance of given FastBDT on a test and a training set and determines a global classification cut. TODO");
36 if (!fbdt.is_open()) {
41 if (!train.is_open()) {
46 if (!test.is_open()) {
66 std::ofstream ofs(
"analyze_trout.dat");
67 B2DEBUG(10,
"Processing the training sample");
74 B2DEBUG(10,
"Processing the test sample");
86 TTree* tree =
new TTree(
"classifierOutputs",
"outputs of FBDTClassifier for the different samples");
87 tree->Branch(
"train_bg_outputs", &trainBgOut);
88 tree->Branch(
"train_sig_outputs", &trainSigOut);
89 tree->Branch(
"test_bg_outputs", &testBgOut);
90 tree->Branch(
"test_sig_outputs", &testSigOut);
double analyze(const std::array< double, Ndims > &hits) const
calculate the output of the FastBDT.
void setDescription(const std::string &description)
Sets the description of the module.
static void readSamplesFromStream(std::istream &is, std::vector< FBDTTrainSample< Ndims > > &samples)
read samples from stream and append them to samples
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
std::string m_PARAMrootOutFileName
output file name
virtual void event()
This method is the core of the module.
void initialize() override
Module initialization.
Belle2::FBDTClassifier< 9 > m_classifier
classifier
void readFromStream(std::istream &is)
read all the necessary data from stream and fill the Forest and the FeatureBinnings NOTE: uses FastBD...
Abstract base class for different kinds of events.
std::string m_PARAMfbdtFileName
weight file name
std::string m_PARAMtrainSampleFileName
training sample file name
std::multimap< int, double > m_trainOutput
map containing output for each training event
std::vector< TrainSample > m_trainSample
vector for training sample
std::vector< TrainSample > m_testSample
vector for test sample
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
void terminate() override
Module termination.
std::string m_PARAMtestSampleFileName
test sample file name
FastBDTClassifierAnalyzerModule()
Constructor.
std::vector< typename MapType::mapped_type > getValuesToKey(const MapType &aMap, typename MapType::key_type aKey)
get all values stored in the map for a given key
std::multimap< int, double > m_testOutput
map containing output for each test event