31{
34
35 const std::string WILDCARD = "%";
36
38 string usr;
39 string pwd;
40 string cookie;
41 string detid;
43 string pmtFile;
45
46 TTS["HAMA-R12199"] = 1;
47 TTS["HAMA-R14374"] = 67;
48 TTS["HAMA-R14374-02"] = 67;
49 TTS[WILDCARD] = 1;
50
51 try {
52
53 JParser<> zap(
"Auxiliary program to set TTS function identifier in PMT parameters file according PMT variant.");
54
60 zap[
'P'] =
make_field(pmtFile,
"PMT parameters file") =
"";
63
64 zap(argc, argv);
65 }
66 catch(const exception &error) {
67 FATAL(error.what() << endl);
68 }
69
70
72
73 if (pmtFile != "" && getFileStatus(pmtFile.c_str())) {
74 parameters.
load(pmtFile.c_str());
75 }
76
77 try {
78
79 JDB::reset(usr, pwd, cookie);
80
82
84
85 if (component.PMTUPI.getPBS() == PBS::PMT) {
86
88
89 if ((p = TTS.find(component.PMTUPI.getVariant())) != TTS.end())
90 ;
91 else if ((p = TTS.find(WILDCARD)) != TTS.end())
92 ;
93 else
94 FATAL(
"Invalid variant " << component.PMTUPI <<
".");
95
97
98 parameters[id].TTS_ns = -(p->second);
99 }
100 }
101
102 rs.Close();
103 }
104 catch(const exception& error) {
105 FATAL(error.what() << endl);
106 }
107
108 if (pmtFile != "") {
109
111
112 parameters.
store(pmtFile.c_str());
113
114 } else {
115
116 cout << parameters << endl;
117 }
118}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for map of PMT parameters.
Utility class to parse command line options.
ResultSet & getResultSet(const std::string &query)
Get result set.
std::vector< JServer > getServernames()
Get list of names of available database servers.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Wrapper class for server name.
Template definition for getting table specific selector.
void store(const char *file_name) const
Store to output file.
void load(const char *file_name)
Load from input file.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...