19 if (
m_json.length() == 0) {
20 throw std::invalid_argument(
21 "Trying to copy a VNetworkLWTNN with length 0 m_json, probably "
22 "deleteAllButNet was called on the object being coppied from.");
32 ATH_MSG_DEBUG(
"Making an LWTNN network using a file on disk, "
37 ATH_MSG_DEBUG(
"Making an LWTNN network using a json in memory, length "
57 TTree *
tree = (TTree *)tfile.Get(tree_name.c_str());
59 ATH_MSG_DEBUG(
"Read json from root file, length " << found.length());
65 std::ostringstream sstr;
66 sstr << input.rdbuf();
74 std::string found = std::string();
75 std::string *to_found = &found;
76 tree.SetBranchAddress(
"lwtnn_json", &to_found);
82 tree.Branch(
"lwtnn_json", &json_string);
95 <<
m_json.capacity() <<
". m_inputFile now has capacity "
97 <<
". m_printable_name now has capacity "
#define ATH_MSG_VERBOSE(x)
std::string m_inputFile
Path to the file describing the network, including filename.
bool isRootFile(std::string const &filename="") const
Check if a string is possibly a root file path.
bool isFile() const
Check if the argument inputFile is the path of a file on disk.
void deleteAllButNet() override
Get rid of any memory objects that arn't needed to run the net.
virtual void print(std::ostream &strm) const override
Write a short description of this net to the string stream.
VNetworkBase()
VNetworkBase default constructor.
void writeNetToTTree(TTree &tree) override
Save the network to a TTree.
void fillJson(std::string const &tree_name=m_defaultTreeName)
Fill out m_json from a file provided to the constructor.
void writeStringToTTree(TTree &tree, std::string json_string)
Get json string from TTree.
std::string m_printable_name
Stores a printable identifyer for the net.
std::string m_json
String containing json input file.
VNetworkLWTNN(const VNetworkLWTNN ©_from)
VNetworkLWTNN copy constructor.
std::string readStringFromTTree(TTree &tree)
Get json string from TTree.
void setupPersistedVariables() override
Perform actions that prep data to create the net.