12 #include "TTimeStamp.h"
39 JKey_t(
const int string,
41 const std::string& parameter) :
55 friend inline bool operator<(
const JKey_t&
first,
const JKey_t& second)
57 if (first.string == second.string) {
59 if (first.floor == second.floor)
60 return first.parameter < second.parameter;
62 return first.floor < second.floor;
66 return first.string < second.string;
76 std::string toString()
const
78 std::ostringstream os;
93 friend inline std::ostream&
operator<<(std::ostream& out,
const JKey_t&
object)
97 return out << setw(3) << setfill(
'0') <<
object.string <<
'.'
98 << setw(2) << setfill(
'0') <<
object.floor <<
'.'
99 << setfill(
' ') <<
object.parameter;
104 std::string parameter;
115 int main(
int argc,
char **argv)
128 JParser<> zap(
"Auxiliary program to convert ROOT TTree with slow control data to ROOT TGraph's.");
130 zap[
'f'] =
make_field(inputFile,
"ROOT input file (output file of JTuna).");
131 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
138 catch(
const exception &error) {
139 FATAL(error.what() << endl);
145 void put(
const Double_t x,
const Double_t y)
161 long long int counter = 0;
163 for (inputFile.rewind(); inputFile.hasNext(); ++counter) {
175 strings.insert(p->
string);
176 floors .insert(p->
floor);
186 TGraph
g1(i->second.X.size(), i->second.X.data(), i->second.Y.data());
188 g1.SetName(i->first.toString().c_str());
190 const JRange<double> range(i->second.Y.begin(), i->second.Y.end());
192 g1.SetMinimum(range.getLowerLimit());
193 g1.SetMaximum(range.getUpperLimit());
200 os <<
"set_variable NUMBER_OF_STRINGS " << setw(4) << strings.size() <<
";" << endl;
201 os <<
"set_variable NUMBER_OF_FLOORS " << setw(4) << floors. size() <<
";" << endl;
202 if (!strings.empty()) {
203 os <<
"set_variable FIRST_STRING " << setw(4) << *strings. begin() <<
";" << endl;
204 os <<
"set_variable LAST_STRING " << setw(4) << *strings.rbegin() <<
";" << endl;
206 if (!floors.empty()) {
207 os <<
"set_variable FIRST_FLOOR " << setw(4) << *floors. begin() <<
";" << endl;
208 os <<
"set_variable LAST_FLOOR " << setw(4) << *floors. rbegin() <<
";" << endl;
210 os <<
"set_array STRINGS ";
211 copy(strings.begin(), strings.end(), ostream_iterator<int>(os,
" "));
214 TNamed meta(
"TUNA", os.str().c_str());
Utility class to parse command line options.
double getTime() const
Get time.
bool operator<(const Head &first, const Head &second)
Less than operator.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Auxiliary class for defining the range of iterations of objects.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
ROOT TTree parameter settings.
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Auxiliary class to define a range between two values.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
void copy(const Head &from, JHead &to)
Copy header from from to to.
const JLimit & getLimit() const
Get limit.
#define DEBUG(A)
Message macros.
Double_t g1(const Double_t x)
Function.
int main(int argc, char *argv[])