56 JParser<> zap(
"Example program to check contents of acoustic events.");
58 zap[
'f'] =
make_field(inputFile,
"output of JKatoomba[.sh]");
59 zap[
'n'] =
make_field(numberOfEvents) = JLimit_t::max();
68 catch(
const exception &error) {
69 FATAL(error.what() << endl);
85 STATUS(
"loading input from file(s) " << inputFile <<
"... " << flush);
87 dynamics.load(inputFile);
95 Double_t xmin = numeric_limits<Double_t>::max();
96 Double_t xmax = numeric_limits<Double_t>::lowest();
100 if (!string->second.empty()) {
101 xmin = min(xmin, string->second.getXmin());
102 xmax = max(xmax, string->second.getXmax());
106 const JFormat_t format(4, 0, std::ios_base::fmtflags(),
'0');
108 JManager<int, TH2D> H2(
new TH2D (
"[%].tilt", NULL, 100, -1.0, +1.0, 100, -1.0, +1.0),
'%', format);
111 JManager<int, TH1D> HO(
new TH1D (
"H[%].orientation", NULL, 1000, xmin, xmax),
'%', format);
116 TH1D* ho = HO[
string->first];
117 TH1D* ha = HA[
string->first];
119 for (Int_t i = 1; i <= HO->GetXaxis()->GetNbins(); ++i) {
121 const Double_t x = HO->GetXaxis()->GetBinCenter(i);
125 ho->SetBinContent(i, tilt.
getAngle());
133 if (string->second.size() > 1) {
135 TH2D* h2 = H2[
string->first];
136 TH1D* hc = HT[
string->first];
140 const double t1 = q->getX() - p->getX();
144 if (t1 > 0 && t1 < Tmax_s) {
145 h2->Fill(600.0e3 * (q->getY().tx - p->getY().tx) / t1,
146 600.0e3 * (q->getY().ty - p->getY().ty) / t1);
151 ZO[
string->first].put(i->getX(), i->getY().getAngle());
152 ZA[
string->first].put(i->getX(), i->getY().getLength());
158 if (text_file !=
"") {
160 ofstream out(text_file.c_str());
164 comment.
add(
"documentation: https://common.pages.km3net.de/jpp/Position_calibration.PDF");
165 comment.
add(
"format: string number; UTC [s]; Tx; Ty");
172 while (abc.hasNext()) {
173 comment.add(*abc.next());
180 out << setw(4) <<
string->first <<
';'
181 <<
FIXED(20,5) << i->getX() <<
';'
182 <<
FIXED( 9,6) << i->getY().tx <<
';'
183 <<
FIXED( 9,6) << i->getY().ty << endl;
193 out << H2 << HT << HO << HA;
Utility class to parse command line options.
double getAngle() const
Get angle.
#define MAKE_CSTRING(A)
Make C-string.
Auxiliary data structure for floating point format specification.
Auxiliary class for multiplexing object iterators.
Auxiliary data structure to build TGraph.
data_type::const_iterator const_iterator
Auxiliary class for defining the range of iterations of objects.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Dynamic detector calibration.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
General purpose class for object reading from a list of file names.
const JLimit & getLimit() const
Get limit.
do set_variable DETECTOR_TXT $WORKDIR detector
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
double getLength() const
Get length.