4 #include <TCollection.h>
5 #include <TDOMParser.h>
8 #include <TXMLDocument.h>
25 std::shared_ptr<TDOMParser> parser = std::make_shared<TDOMParser>();
26 Int_t parsecode = parser->ParseFile(filename);
29 std::cerr << parser->GetParseCodeMessage(parsecode) <<
"\n";
33 TXMLNode *
node = parser->GetXMLDocument()->GetRootNode();
38 void AtTools::AtParsers::ParseIonList(TXMLNode *
node)
43 if (
node->GetNodeType() == TXMLNode::kXMLElementNode) {
45 if (strcmp(
node->GetNodeName(),
"ion") == 0) {
48 if (
node->HasAttributes()) {
49 TList *attrList =
node->GetAttributes();
50 TXMLAttr *attr =
nullptr;
52 while ((attr =
dynamic_cast<TXMLAttr *
>(next()))) {
53 if (strcmp(attr->GetName(),
"ID") == 0) {
54 id = atoi(attr->GetValue());
60 ionList.push_back(ParseIon(
node->GetChildren(),
id));
66 ParseIonList(
node->GetChildren());
78 std::string eLossFile;
81 if (
node->GetNodeType() == TXMLNode::kXMLElementNode) {
82 if (strcmp(
node->GetNodeName(),
"Ion") == 0) {
83 ionName =
node->GetText();
85 if (strcmp(
node->GetNodeName(),
"PDG") == 0) {
86 PDG = std::atoi(
node->GetText());
88 if (strcmp(
node->GetNodeName(),
"Mass") == 0) {
91 if (strcmp(
node->GetNodeName(),
"AtomicNumber") == 0) {
92 atomicNumber = std::atoi(
node->GetText());
94 if (strcmp(
node->GetNodeName(),
"MassNumber") == 0) {
95 MassNumber = std::atoi(
node->GetText());
97 if (strcmp(
node->GetNodeName(),
"ElossFile") == 0) {
98 eLossFile =
node->GetText();