Belle II Software  release-05-02-19
Belle2::DNN Namespace Reference

namespace for DirectedNodeNetwork-related stuff More...

Functions

template<class NodeEntryType >
void printCANetwork (DirectedNodeNetwork< NodeEntryType, CACell > &network, const std::string &fName)
 TODO. More...
 
template<class NodeEntryType , class AnyMetaInfo >
void printNetwork (DirectedNodeNetwork< NodeEntryType, AnyMetaInfo > &network, const std::string &fName)
 overloaded print-version for typical activeSector-networks without CACell-stuff
 

Detailed Description

namespace for DirectedNodeNetwork-related stuff

Function Documentation

◆ printCANetwork()

void Belle2::DNN::printCANetwork ( DirectedNodeNetwork< NodeEntryType, CACell > &  network,
const std::string &  fName 
)

TODO.

  • code isSeed and getState to colors for fill and for border function for printing networks with CACells:

takes network and prints it to given fileName.

prerequisite for NodeEntryType:

  • std::string getName()

Definition at line 47 of file NodeNetworkHelperFunctions.h.

49  : " +
50  std::to_string(node->getMetaInfo().getState()) +
51  "," +
52  std::to_string(node->getMetaInfo().isSeed()) +
53  "\"];\n";
54  }
55  // write edges:
56  for (auto* node : network) {
57  for (auto* innerNode : node->getInnerNodes()) {
58  auto innerEntry = innerNode->getEntry();
59  std::string arrowStyle = (node->getMetaInfo().getState() == (innerNode->getMetaInfo().getState() + 1)) ? "" : " [style=dotted]";
60  fullOut += "\"" + node->getEntry().getName() + "\" -> \"" + innerEntry.getName() + "\"" + arrowStyle + ";\n";
61  }
62  }
63  fullOut += "labelloc=\"t\";\nlabel=\"" + fName + "\";\n";
64  fullOut += "}\n";
65 
66  std::ofstream ofs;
67  ofs.open(fName + ".gv", std::ofstream::out | std::ofstream::trunc);
68  ofs << fullOut;
69  ofs.close();
70  };
71 
72 
74  template<class NodeEntryType, class AnyMetaInfo>
75  void printNetwork(DirectedNodeNetwork<NodeEntryType, AnyMetaInfo>& network, const std::string& fName)
76  {
77  std::string fullOut = "digraph G {\n";
78  fullOut +=
Belle2::DNN::printNetwork
void printNetwork(DirectedNodeNetwork< NodeEntryType, AnyMetaInfo > &network, const std::string &fName)
overloaded print-version for typical activeSector-networks without CACell-stuff
Definition: NodeNetworkHelperFunctions.h:83