28 JSINFO <<
"Created JetScapeXML Instance";
36 void JetScapeXML::OpenXMLMasterFile() {
37 JSWARN <<
"Deprecated function OpenXMLMasterFile(): Call OpenXMLMainFile() instead!";
41 void JetScapeXML::OpenXMLMainFile() {
43 if (!IsMainFileOpen()) {
45 xml_doc_main.LoadFile((
char *)GetXMLMainFileName().c_str());
46 VERBOSE(2) <<
"Trying XML Main file : " << GetXMLMainFileName();
48 if (xml_doc_main.ErrorID() < 1) {
49 JSINFO <<
"Open XML Main file : " << GetXMLMainFileName();
54 JSWARN <<
"Not a valid JetScape XML Main file!";
58 auto errCode = xml_doc_main.ErrorID();
59 SetXMLMainFileName(
"../config/jetscape_master.xml");
60 xml_doc_main.LoadFile((
char *)GetXMLMainFileName().c_str());
61 VERBOSE(2) <<
"Looking for Old XML Master file : " << GetXMLMainFileName();
63 if (xml_doc_main.ErrorID() < 1) {
64 JSWARN <<
"Using Deprecated XML Master file : " << GetXMLMainFileName();
69 JSWARN <<
"Not a valid JetScape XML Main file!";
73 JSWARN <<
"XML Main file not found/not properly opened! Error code : "
79 xml_main_file_open =
true;
84 void JetScapeXML::OpenXMLMasterFile(
string m_name) {
85 JSWARN <<
"Deprecated function OpenXMLMasterFile(): Call OpenXMLMainFile() instead!";
86 OpenXMLMainFile(m_name);
90 void JetScapeXML::OpenXMLMainFile(
string m_name) {
91 SetXMLMainFileName(m_name);
96 void JetScapeXML::OpenXMLUserFile() {
98 if (!xml_user_file_open) {
100 xml_doc_user.LoadFile((
char *)GetXMLUserFileName().c_str());
101 VERBOSE(2) <<
"Trying XML User file : " << GetXMLUserFileName();
103 if (xml_doc_user.ErrorID() < 1) {
104 JSINFO <<
"Open XML User file : " << GetXMLUserFileName();
108 if (!xml_root_user) {
109 JSWARN <<
"Not a valid JetScape XML User file!";
113 JSWARN <<
"XML User file not found/not properly opened! Error code : "
114 << xml_doc_user.ErrorID();
118 xml_user_file_open =
true;
123 void JetScapeXML::OpenXMLUserFile(
string m_name) {
124 SetXMLUserFileName(m_name);
130 JetScapeXML::GetXMLElementMaster(std::initializer_list<const char *> &
path) {
132 JSWARN <<
"Deprecated function GetXMLElementMaster(). Call GetXMLElementMain() instead!";
133 return GetXMLElementMain(path);
138 JetScapeXML::GetXMLElementMain(std::initializer_list<const char *> &
path) {
140 VERBOSE(2) <<
"Looking for element in Main file: " <<
path;
145 for (
auto &elementName : path) {
146 if (!currentElement) {
149 if (currentElement) {
150 VERBOSE(3) <<
"Loaded " << elementName <<
" from xml_root_main";
152 VERBOSE(3) << elementName <<
" not found in xml_root_main";
157 if (currentElement) {
158 VERBOSE(3) <<
"Loaded " << elementName <<
" from "
159 << currentElement->
Name();
161 VERBOSE(3) << elementName <<
" not found in " << elementName;
166 if (currentElement) {
167 VERBOSE(2) <<
"Found element.";
169 VERBOSE(2) <<
"Did not find element.";
172 return currentElement;
177 JetScapeXML::GetXMLElementUser(std::initializer_list<const char *> &
path) {
179 VERBOSE(2) <<
"Looking for element in User file: " <<
path;
184 for (
auto &elementName : path) {
185 if (!currentElement) {
188 if (currentElement) {
189 VERBOSE(3) <<
"Loaded " << elementName <<
" from xml_root_user";
191 VERBOSE(3) << elementName <<
" not found in xml_root_user";
196 if (currentElement) {
197 VERBOSE(3) <<
"Loaded " << elementName <<
" from "
198 << currentElement->
Name();
200 VERBOSE(3) << elementName <<
" not found in " << elementName;
205 if (currentElement) {
206 VERBOSE(2) <<
"Found element.";
208 VERBOSE(2) <<
"Did not find element.";
211 return currentElement;
216 JetScapeXML::GetElement(std::initializer_list<const char *>
path,
231 JSWARN <<
"XML element " << path <<
" not found, but is required.";
241 JetScapeXML::GetElementText(std::initializer_list<const char *>
path,
254 int JetScapeXML::GetElementInt(std::initializer_list<const char *>
path,
269 double JetScapeXML::GetElementDouble(std::initializer_list<const char *>
path,
285 std::initializer_list<const char *>
path) {
288 int size = path.size();
291 for (
auto name : path) {