1 #ifndef __JRUNCONTROLTOOLKIT__
2 #define __JRUNCONTROLTOOLKIT__
72 const std::string& process)
81 if (
j != string::npos) {
82 buffer.replace(
j, 1, process);
98 const std::string&
name)
100 using namespace JSYSTEM;
124 return buffer.substr(0, j);
213 string buffer(file_name);
215 for (string::iterator
i = buffer.begin();
i != buffer.end(); ++
i) {
221 istringstream
is(buffer);
227 if (pos == string::npos) {
228 pos = result.
path.rfind(
"/");
231 if (pos != string::npos) {
232 result.
path.erase(pos);
235 if (!(is >> result.
run)) {
271 if (*path.rbegin() !=
'/') {
277 <<
"_" << setw(8) << setfill(
'0') <<
unique_id
278 <<
"_" << setw(8) << setfill(
'0') <<
run
295 return JDAQRun(path, unique_id, run).toString();
319 const std::string&
name)
322 using namespace JSYSTEM;
330 if (pos != string::npos) {
331 os << name.substr(pos + 1, 4);
334 return JTag(os.str());
361 const std::string& key =
"") :
375 using namespace JSYSTEM;
381 return JTag(os.str());
451 out << static_cast<const JHostname&>(object);
472 static const string target =
"Operational.";
474 string buffer =
name;
476 const string::size_type pos = buffer.find(
target);
478 if (pos != string::npos)
479 return buffer.erase(pos,
target.size());
int getIPnumber(const std::string &host_name)
Get IP number.
std::string getProcessName(const std::string &name, const std::string &process)
Get process name of run control client.
friend std::istream & operator>>(std::istream &in, JDAQProcess &object)
Read process from input stream.
static std::string getFilename(const std::string &path, const int unique_id, const int run)
Get file name of run.
JTag getUniqueTag(const std::string &hostname, const std::string &name)
Get unique tag of run control client.
static const char EVENTNAME_DELIMETER
std::string extension
file name extension
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
int unique_id
unique identifier
std::string getIPaddress(const int ip)
Get IP address (decimal-dot notation).
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
static const std::string TOKEN_DELIMETER
unsigned short getSubaddress(const int ip)
Get host identifier within network.
Auxiliary data structure for hostname and port number.
Simple data structure for DAQ run.
JDAQRun(const char *file_name)
Constructor.
static const char WILDCARD
std::string index
index in process list
std::string path
directory path
std::string getStateName(const std::string &name)
Get name of state.
static const std::string RUN_CONTROL_CLIENT
Auxiliary class for itemization of process list.
friend std::ostream & operator<<(std::ostream &out, const JDAQProcess &object)
Write process to output stream.
JDAQProcess()
Default constructor.
static const std::string CLIENTNAME_DELIMETER
JDAQRun(const std::string &path, const int run, const std::string &extension="root")
Constructor .
bool equals(int port) const
Test whether given port equals.
JDAQProcess(const JHostname &hostname, const std::string &key="")
Constructor.
char getTokenDelimeter()
Get the token delimeter for command messages.
JTag getUniqueTag() const
Get unique tag.
char getEventnameDelimeter()
Get the event name delimeter.
char getWildCard()
Get the wild card.
then fatal The output file must have the wildcard in the name
bool equals(const JTag &tag) const
Test whether given tag equals.
static const char * getPrefix()
Get file name prefix.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
static JDAQRun valueOf(const std::string &file_name)
Extract DAQ run parameters.
std::string toString() const
Convert DAQ run to string.
JDAQRun(const std::string &path, const int unique_id, const int run, const std::string &extension="root")
Constructor .
std::string getFullName(const std::string &hostname, const std::string &name)
Get full name of run control client.
JDAQRun()
Default constructor .
bool equals(const JHostname &hostname) const
Test whether given host name equals.
Hostname and IP address functions.