Belle II Software development
SVDDatabaseImporter.cc
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// Own header.
10#include <svd/calibration/SVDDatabaseImporter.h>
11
12// framework - Database
13#include <framework/database/IntervalOfValidity.h>
14#include <framework/database/DBImportObjPtr.h>
15
16// framework aux
17#include <framework/logging/Logger.h>
18
19// wrapper objects
20#include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
21
22#include <boost/property_tree/ptree.hpp>
23
24#include <iostream>
25#include <fstream>
26#include <sstream>
27
28using namespace Belle2;
29using boost::property_tree::ptree;
30
31
32void SVDDatabaseImporter::importSVDHitTimeNeuralNetwork(std::string fileName, bool threeSamples)
33{
34 std::ifstream xml(fileName);
35 if (!xml.good()) {
36 B2RESULT("ERROR: File not found.\nNeural network from " << fileName << " could not be imported.");
37 return;
38 }
39 std::string label("SVDTimeNet_6samples");
40 if (threeSamples)
41 label = "SVDTimeNet_3samples";
42 std::stringstream buffer;
43 buffer << xml.rdbuf();
45 importObj.construct();
46 importObj->m_data = buffer.str();
47
50 importObj.import(iov);
51 B2RESULT("Neural network from " << fileName << " successfully imported.");
52}
bool import(const IntervalOfValidity &iov)
Import the object to database.
Definition: DBImportBase.cc:36
Class for importing a single object to the database.
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
A class that describes the interval of experiments/runs for which an object in the database is valid.
int m_lastExperiment
Last experiment.
void importSVDHitTimeNeuralNetwork(std::string fileName, bool threeSamples=false)
This method import to the database the neural network for hit time determination.
int m_firstExperiment
The interval of validity coordinates are defined as private members.
Abstract base class for different kinds of events.