42#include "PStringUtils.h"
91 xmlSize = xmlFile.tellg();
92 xmlFile.seekg(0, std::ios::beg);
93 xmlBuffer = new char[xmlSize];
94 xmlFile.read(xmlBuffer, xmlSize);
153 Char_t *pmusrpath=
nullptr;
154 Char_t *home=
nullptr;
155 Char_t musrpath[128];
158 strncpy(musrpath,
"",
sizeof(musrpath));
168 home = getenv(
"HOME");
169 if (home !=
nullptr) {
179 pmusrpath = getenv(
"MUSRFITPATH");
180 if (pmusrpath !=
nullptr) {
189 home = getenv(
"ROOTSYS");
190 if (home !=
nullptr) {
191 snprintf(musrpath,
sizeof(musrpath),
"%s/bin", home);
192 std::cerr << std::endl <<
"**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << std::endl;
203 std::cout << std::endl;
204 std::cout <<
">> Will only reset the file: '" <<
fStartupFilePath.Data() <<
"'."<< std::endl;
205 std::cout << std::endl;
207 std::cerr << std::endl <<
"**ERROR** couldn't re-write " <<
fStartupFilePath.Data() <<
"." << std::endl;
214 std::cout << std::endl <<
"**INFO** no musrfit_startup.xml file found, will write a default one." << std::endl;
216 std::cerr << std::endl <<
"**ERROR** couldn't write default musrfit_startup.xml." << std::endl;
218 home = getenv(
"HOME");
219 if (home !=
nullptr) {
350 if (!strcmp(str,
"data_path")) {
352 }
else if (!strcmp(str,
"run_name_template")) {
355 TIter next(attributes);
356 while ((attr = (TXMLAttr*) next())) {
357 if (!strcmp(attr->GetName(),
"inst")) {
361 }
else if (!strcmp(str,
"marker")) {
363 }
else if (!strcmp(str,
"color")) {
365 }
else if (!strcmp(str,
"units")) {
367 }
else if (!strcmp(str,
"fourier_power")) {
369 }
else if (!strcmp(str,
"apodization")) {
371 }
else if (!strcmp(str,
"plot")) {
373 }
else if (!strcmp(str,
"phase")) {
375 }
else if (!strcmp(str,
"phase_increment")) {
454 Int_t color, r, g, b, ival;
472 if (tstr.IsDigit()) {
476 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a number, will ignore it";
477 std::cerr << std::endl;
483 std::vector<std::string> rgb = PStringUtils::Split(str,
",");
485 if (rgb.size() != 3) {
486 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a rbg code, will ignore it";
487 std::cerr << std::endl;
491 if (PStringUtils::IsInt(rgb[0])) {
492 r = PStringUtils::ToInt(rgb[0]);
494 std::cerr << std::endl <<
"PStartupHandler **WARNING** r within the rgb code is not a number, will ignore it";
495 std::cerr << std::endl;
499 if (PStringUtils::IsInt(rgb[1])) {
500 g = PStringUtils::ToInt(rgb[1]);
502 std::cerr << std::endl <<
"PStartupHandler **WARNING** g within the rgb code is not a number, will ignore it";
503 std::cerr << std::endl;
507 if (PStringUtils::IsInt(rgb[2])) {
508 b = PStringUtils::ToInt(rgb[2]);
510 std::cerr << std::endl <<
"PStartupHandler **WARNING** b within the rgb code is not a number, will ignore it";
511 std::cerr << std::endl;
515 color = TColor::GetColor(r,g,b);
522 if (!tstr.CompareTo(
"gauss", TString::kIgnoreCase)) {
524 }
else if (!tstr.CompareTo(
"tesla", TString::kIgnoreCase)) {
526 }
else if (!tstr.CompareTo(
"mhz", TString::kIgnoreCase)) {
528 }
else if (!tstr.CompareTo(
"mc/s", TString::kIgnoreCase)) {
531 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a valid unit, will ignore it.";
532 std::cerr << std::endl;
537 if (tstr.IsDigit()) {
539 if ((ival >= 0) && (ival <= 20)) {
542 std::cerr << std::endl <<
"PStartupHandler **WARNING** fourier power '" << str <<
"' is not a valid number (0..20), will ignore it.";
543 std::cerr << std::endl;
546 std::cerr << std::endl <<
"PStartupHandler **WARNING** fourier power '" << str <<
"' is not a valid number (0..20), will ignore it.";
547 std::cerr << std::endl;
552 if (!tstr.CompareTo(
"none", TString::kIgnoreCase)) {
554 }
else if (!tstr.CompareTo(
"weak", TString::kIgnoreCase)) {
556 }
else if (!tstr.CompareTo(
"medium", TString::kIgnoreCase)) {
558 }
else if (!tstr.CompareTo(
"strong", TString::kIgnoreCase)) {
561 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a valid apodization, will ignore it.";
562 std::cerr << std::endl;
567 if (!tstr.CompareTo(
"real", TString::kIgnoreCase)) {
569 }
else if (!tstr.CompareTo(
"imag", TString::kIgnoreCase)) {
571 }
else if (!tstr.CompareTo(
"real_and_imag", TString::kIgnoreCase)) {
573 }
else if (!tstr.CompareTo(
"power", TString::kIgnoreCase)) {
575 }
else if (!tstr.CompareTo(
"phase", TString::kIgnoreCase)) {
578 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a valid plot option, will ignore it.";
579 std::cerr << std::endl;
584 if (tstr.IsFloat()) {
587 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a valid phase, will ignore it.";
588 std::cerr << std::endl;
593 if (tstr.IsFloat()) {
596 std::cerr << std::endl <<
"PStartupHandler **WARNING** '" << str <<
"' is not a valid phase increment, will ignore it.";
597 std::cerr << std::endl;
641 std::cerr << std::endl <<
"PStartupHandler **WARNING** " << str;
642 std::cerr << std::endl;
664 std::cerr << std::endl <<
"PStartupHandler **ERROR** " << str;
665 std::cerr << std::endl;
688 std::cerr << std::endl <<
"PStartupHandler **FATAL ERROR** " << str;
689 std::cerr << std::endl;
753 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/lem/his/"));
754 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/alc/his/"));
755 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/dolly/his/"));
756 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/flame/his/"));
757 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/gpd/his/"));
758 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/gps/his/"));
759 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/hal/his/"));
760 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/ltf/his/"));
761 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/misc/his/"));
762 fDataPathList.push_back(TString(
"/psi.ch/group/lmu/public/data/vms/his/"));
785 fColorList.push_back(TColor::GetColor(0, 0, 0));
786 fColorList.push_back(TColor::GetColor(255, 0, 0));
787 fColorList.push_back(TColor::GetColor(0, 255, 0));
788 fColorList.push_back(TColor::GetColor(0, 0, 255));
789 fColorList.push_back(TColor::GetColor(255, 0, 255));
790 fColorList.push_back(TColor::GetColor(0, 255, 255));
791 fColorList.push_back(TColor::GetColor(156, 0, 255));
792 fColorList.push_back(TColor::GetColor(99, 101, 49));
793 fColorList.push_back(TColor::GetColor(49, 101, 49));
794 fColorList.push_back(TColor::GetColor(156, 48, 0));
817 Bool_t result =
false;
819 std::ifstream ifile(fln);
883 if (reset_startup_file) {
887 Char_t *home =
nullptr;
888 home = getenv(
"HOME");
889 if (home ==
nullptr) {
890 std::cerr << std::endl <<
"**ERROR** couldn't obtain $HOME." << std::endl;
899 if (!(info.st_mode & S_IFDIR))
903 std::cerr << std::endl <<
"**ERROR** couldn't create '" <<
startup_path_name <<
"'" << std::endl;
913 if (!fout.is_open()) {
914 std::cerr << std::endl <<
"**ERROR** couldn't open '" <<
startup_path_name <<
"' for writing." << std::endl;
919 fout <<
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl;
920 fout <<
"<musrfit xmlns=\"https://lmu.pages.psi.ch/musrfit-docu/\">" << std::endl;
921 fout <<
" <comment>" << std::endl;
922 fout <<
" Defines default settings for the musrfit package" << std::endl;
923 fout <<
" </comment>" << std::endl;
924 fout <<
" <data_path>/psi.ch/group/lmu/public/data/lem/his</data_path>" << std::endl;
925 fout <<
" <data_path>/psi.ch/group/lmu/public/data/alc/his</data_path>" << std::endl;
926 fout <<
" <data_path>/psi.ch/group/lmu/public/data/dolly/his</data_path>" << std::endl;
927 fout <<
" <data_path>/psi.ch/group/lmu/public/data/flame/his</data_path>" << std::endl;
928 fout <<
" <data_path>/psi.ch/group/lmu/public/data/gpd/his</data_path>" << std::endl;
929 fout <<
" <data_path>/psi.ch/group/lmu/public/data/gps/his</data_path>" << std::endl;
930 fout <<
" <data_path>/psi.ch/group/lmu/public/data/hal/his</data_path>" << std::endl;
931 fout <<
" <data_path>/psi.ch/group/lmu/public/data/ltf/his</data_path>" << std::endl;
932 fout <<
" <data_path>/psi.ch/group/lmu/public/data/misc/his</data_path>" << std::endl;
933 fout <<
" <data_path>/psi.ch/group/lmu/public/data/vms/his</data_path>" << std::endl;
934 fout <<
" <!-- MISC/PSI 1985 - 1990 -->" << std::endl;
935 fout <<
" <run_name_template inst=\"misc\">d%yyyy%/deltat_misc_%rrrr%.bin</run_name_template>" << std::endl;
936 fout <<
" <!-- ALC TD/PSI -->" << std::endl;
937 fout <<
" <run_name_template inst=\"alc\">d%yyyy%/deltat_zh_chem_%rrrr%.bin</run_name_template>" << std:: endl;
938 fout <<
" <run_name_template inst=\"alc\">d%yyyy%/deltat_tdc_alc_%rrrr%.bin</run_name_template>" << std::endl;
939 fout <<
" <run_name_template inst=\"alc\">d%yyyy%/tdc/deltat_tdc_alc_%rrrr%.bin</run_name_template>" << std::endl;
940 fout <<
" <!-- VMS/PSI -->" << std::endl;
941 fout <<
" <run_name_template inst=\"vms\">d%yyyy%/tdc/root/deltat_tdc_vms_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
942 fout <<
" <!-- Dolly/PSI -->" << std::endl;
943 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/tdc/root/deltat_tdc_dolly_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
944 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/pie1/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
945 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/pie3/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
946 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
947 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
948 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
949 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/tdc/deltat_tdc_dolly_%rrrr%.bin</run_name_template>" << std::endl;
950 fout <<
" <run_name_template inst=\"dolly\">d%yyyy%/tdc/mdu/deltat_tdc_dolly_%rrrr%.mdu</run_name_template>" << std::endl;
951 fout <<
" <!-- Flame/PSI -->" << std::endl;
952 fout <<
" <run_name_template inst=\"flame\">d%yyyy%/tdc/root/deltat_tdc_flame_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
953 fout <<
" <run_name_template inst=\"flame\">d%yyyy%/tdc/deltat_tdc_flame_%rrrr%.bin</run_name_template>" << std::endl;
954 fout <<
" <run_name_template inst=\"flame\">d%yyyy%/tdc/mdu/deltat_tdc_flame_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
955 fout <<
" <!-- GPD/PSI -->" << std::endl;
956 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/tdc/root/deltat_tdc_gpd_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
957 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_mue1_%rrrr%.bin</run_name_template>" << std::endl;
958 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_fq_si_%rrrr%.bin</run_name_template>" << std::endl;
959 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_strobo_%rrrr%.bin</run_name_template>" << std::endl;
960 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_hp_ni_ht_%rrrr%.bin</run_name_template>" << std::endl;
961 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_hp_ni_%rrrr%.bin</run_name_template>" << std::endl;
962 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_ccr2_%rrrr%.bin</run_name_template>" << std::endl;
963 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_gpd_%rrrr%.bin</run_name_template>" << std::endl;
964 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_%rrrr%.bin</run_name_template>" << std::endl;
965 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_gpd_%rrrr%.bin</run_name_template>" << std::endl;
966 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
967 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/pta/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
968 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/tdc/deltat_tdc_gpd_%rrrr%.bin</run_name_template>" << std::endl;
969 fout <<
" <run_name_template inst=\"gpd\">d%yyyy%/tdc/mdu/deltat_tdc_gpd_%rrrr%.mdu</run_name_template>" << std::endl;
970 fout <<
" <!-- GPS/PSI -->" << std::endl;
971 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
972 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_ccr_%rrrr%.bin</run_name_template>" << std::endl;
973 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_he3_%rrrr%.bin</run_name_template>" << std::endl;
974 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_stutt_%rrrr%.bin</run_name_template>" << std::endl;
975 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_ltf_%rrrr%.bin</run_name_template>" << std::endl;
976 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
977 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_flc2_%rrrr%.bin</run_name_template>" << std::endl;
978 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_oven_%rrrr%.bin</run_name_template>" << std::endl;
979 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_oven2_%rrrr%.bin</run_name_template>" << std::endl;
980 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/deltat_pta_gps_%rrrr%.bin</run_name_template>" << std::endl;
981 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/tdc/deltat_tdc_gps_%rrrr%.bin</run_name_template>" << std::endl;
982 fout <<
" <run_name_template inst=\"gps\">d%yyyy%/tdc/mdu/deltat_tdc_gps_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
983 fout <<
" <!-- HAL-9500/PSI == HIFI/PSI -->" << std::endl;
984 fout <<
" <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
985 fout <<
" <run_name_template inst=\"hifi\">d%yyyy%/tdc/deltat_hifi_%rrrr%.bin</run_name_template>" << std::endl;
986 fout <<
" <run_name_template inst=\"hifi\">d%yyyy%/tdc/tdc_hifi_%yyyy%_%rrrrr%.mdu</run_name_template>" << std::endl;
987 fout <<
" <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
988 fout <<
" <!-- LTF/PSI -->" << std::endl;
989 fout <<
" <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf_%rrrr%.bin</run_name_template>" << std::endl;
990 fout <<
" <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf2_%rrrr%.bin</run_name_template>" << std::endl;
991 fout <<
" <run_name_template inst=\"ltf\">d%yyyy%/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
992 fout <<
" <run_name_template inst=\"ltf\">d%yyyy%/pta/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
993 fout <<
" <run_name_template inst=\"ltf\">d%yyyy%/tdc/deltat_tdc_ltf_%rrrr%.bin</run_name_template>" << std::endl;
994 fout <<
" <!-- LEM/PSI -->" << std::endl;
995 fout <<
" <run_name_template inst=\"lem\">%yyyy%/lem%yy%_his_%rrrr%.root</run_name_template>" << std::endl;
996 fout <<
" <run_name_template inst=\"lem\">d%yyyy%/tdc/lem%yy%_his_%rrrr%.root</run_name_template>" << std::endl;
997 fout <<
" <run_name_template inst=\"lem\">%yyyy%/lem%yy%_his_%rrrrr%.root</run_name_template>" << std::endl;
998 fout <<
" <run_name_template inst=\"lem\">d%yyyy%/tdc/lem%yy%_his_%rrrrr%.root</run_name_template>" << std::endl;
999 fout <<
" <fourier_settings>" << std::endl;
1000 fout <<
" <units>Gauss</units>" << std::endl;
1001 fout <<
" <fourier_power>0</fourier_power>" << std::endl;
1002 fout <<
" <apodization>none</apodization>" << std::endl;
1003 fout <<
" <plot>real_and_imag</plot>" << std::endl;
1004 fout <<
" <phase>0.0</phase>" << std::endl;
1005 fout <<
" <phase_increment>1.0</phase_increment>" << std::endl;
1006 fout <<
" </fourier_settings>" << std::endl;
1007 fout <<
" <root_settings>" << std::endl;
1008 fout <<
" <marker_list>" << std::endl;
1009 fout <<
" <!-- Root marker numbers -->" << std::endl;
1010 fout <<
" <marker>24</marker> <!-- open circle -->" << std::endl;
1011 fout <<
" <marker>25</marker> <!-- open square -->" << std::endl;
1012 fout <<
" <marker>26</marker> <!-- open triangle -->" << std::endl;
1013 fout <<
" <marker>27</marker> <!-- open diamond -->" << std::endl;
1014 fout <<
" <marker>28</marker> <!-- open cross -->" << std::endl;
1015 fout <<
" <marker>29</marker> <!-- full star -->" << std::endl;
1016 fout <<
" <marker>30</marker> <!-- open star -->" << std::endl;
1017 fout <<
" <marker>20</marker> <!-- full circle -->" << std::endl;
1018 fout <<
" <marker>21</marker> <!-- full square -->" << std::endl;
1019 fout <<
" <marker>22</marker> <!-- full triangle -->" << std::endl;
1020 fout <<
" <marker>23</marker> <!-- full triangle down -->" << std::endl;
1021 fout <<
" <marker>2</marker> <!-- thin cross -->" << std::endl;
1022 fout <<
" <marker>3</marker> <!-- thin star -->" << std::endl;
1023 fout <<
" <marker>5</marker> <!-- thin x -->" << std::endl;
1024 fout <<
" </marker_list>" << std::endl;
1025 fout <<
" <color_list>" << std::endl;
1026 fout <<
" <!-- Color as RGB coded string -->" << std::endl;
1027 fout <<
" <color>0,0,0</color> <!-- kBlack -->" << std::endl;
1028 fout <<
" <color>255,0,0</color> <!-- kRed -->" << std::endl;
1029 fout <<
" <color>0,153,0</color> <!-- kGreen+2 -->" << std::endl;
1030 fout <<
" <color>0,0,255</color> <!-- kBlue -->" << std::endl;
1031 fout <<
" <color>255,0,255</color> <!-- kMagenta -->" << std::endl;
1032 fout <<
" <color>0,255,255</color> <!-- kCyan -->" << std::endl;
1033 fout <<
" <color>153,0,255</color> <!-- kViolet-3 -->" << std::endl;
1034 fout <<
" <color>102,102,51</color> <!-- kYellow-1 -->" << std::endl;
1035 fout <<
" <color>51,102,51</color> <!-- kGreen-1 -->" << std::endl;
1036 fout <<
" <color>153,0,0</color> <!-- kRed+2 -->" << std::endl;
1037 fout <<
" </color_list>" << std::endl;
1038 fout <<
" </root_settings>" << std::endl;
1039 fout <<
"</musrfit>" << std::endl;
#define FOURIER_UNIT_FREQ
Frequency in MHz.
#define FOURIER_PLOT_REAL_AND_IMAG
Plot both real and imaginary components (default)
#define FOURIER_UNIT_GAUSS
Magnetic field in Gauss (G)
#define FOURIER_PLOT_POWER
Plot power spectrum |F(ω)|²
#define FOURIER_PLOT_REAL
Plot real component only.
#define FOURIER_APOD_WEAK
Weak apodization (gentle windowing)
#define FOURIER_APOD_NONE
No apodization (rectangular window)
#define FOURIER_UNIT_CYCLES
Angular frequency in Mc/s (Mega-cycles per second)
#define FOURIER_APOD_STRONG
Strong apodization (heavy windowing for best frequency resolution)
#define FOURIER_PLOT_IMAG
Plot imaginary component only.
#define FOURIER_APOD_MEDIUM
Medium apodization (moderate windowing)
#define FOURIER_PLOT_PHASE
Plot phase spectrum arg(F(ω))
#define FOURIER_UNIT_TESLA
Magnetic field in Tesla (T)
const char * startup_path_name
ClassImpQ(PStartupHandler) int parseXmlFile(TSAXParser *saxParser
Replacement for TSAXParser::ParseFile() that uses buffer-based parsing.
int parseXmlFile(TSAXParser *, const char *)
Replacement function for TSAXParser::ParseFile().
Handles the musrfit XML startup configuration file (musrfit_startup.xml).
PRunNameTemplateList fRunNameTemplate
List of instrument-specific run name patterns.
PStartupHandler(bool reset_startup_file=false)
Constructor that locates and parses the musrfit startup configuration file.
virtual void CheckLists()
Validates configuration lists and fills missing entries with defaults.
virtual void OnComment(const Char_t *)
SAX callback: Called when XML comment is found (unused).
PIntVector fColorList
List of ROOT TColor codes (from RGB) for plotting.
PStringVector fDataPathList
List of directories to search for data files.
Bool_t fStartupFileFound
True if musrfit_startup.xml was located.
virtual void OnWarning(const Char_t *)
SAX callback: Called when XML parser issues a warning.
virtual void OnError(const Char_t *)
SAX callback: Called when XML parser encounters an error.
virtual void OnFatalError(const Char_t *)
SAX callback: Called when XML parser encounters a fatal error.
EKeyWords fKey
Current XML element type (SAX parser state)
TString fStartupFilePath
Full path to located startup file (empty if not found)
@ eApodization
Inside <apodization> element (none/weak/medium/strong)
@ eFourierPower
Inside <fourier_power> element (0-20)
@ eEmpty
No active element (between elements or unknown)
@ eMarker
Inside <marker> element (ROOT marker code)
@ ePhaseIncrement
Inside <phase_increment> element (degrees per step)
@ eUnits
Inside <units> element (Gauss/Tesla/MHz/Mc/s)
@ ePhase
Inside <phase> element (degrees)
@ ePlot
Inside <plot> element (real/imag/real_and_imag/power/phase)
@ eColor
Inside <color> element (RGB comma-separated)
@ eRunNameTemplate
Inside <run_name_template> element.
@ eDataPath
Inside <data_path> element.
TString fCurrentInstrumentName
Instrument name from run_name_template inst attribute.
virtual void OnEndElement(const Char_t *)
SAX callback: Called when an XML end element is encountered.
virtual void OnCharacters(const Char_t *)
SAX callback: Called with element text content.
PIntVector fMarkerList
List of ROOT TMarker style codes for plotting.
virtual ~PStartupHandler()
Destructor releasing allocated resources.
virtual void OnEndDocument()
SAX callback: Called when XML document parsing ends. Triggers CheckLists() to ensure all required set...
Bool_t WriteDefaultStartupFile(bool reset_startup_file=false)
Creates or overwrites a startup file with default configuration.
virtual void OnCdataBlock(const Char_t *, Int_t)
SAX callback: Called for CDATA blocks (unused).
PMsrFourierStructure fFourierDefaults
Fourier transform default settings structure.
virtual void OnStartElement(const Char_t *, const TList *)
SAX callback: Called when an XML start element is encountered.
virtual void OnStartDocument()
SAX callback: Called when XML document parsing begins. Initializes all configuration variables to def...
Bool_t StartupFileExists(Char_t *fln)
Checks if a file exists at the specified path.
TString runNameTemplate
File path template with placeholders (r=run, y=year)
TString instrument
Instrument identifier (e.g., "GPS", "LEM", "DOLLY")