38 int main(
int argc,
char **argv)
46 JLimit_t& numberOfEvents = inputFile.getLimit();
53 JParser<> zap(
"Example program to plot acoustic fit results.");
55 zap[
'f'] =
make_field(inputFile,
"input file (output of JKatoomba[.sh]/JFremantle[.sh])");
56 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
58 zap[
'Z'] =
make_field(Z,
"detector height (for 2nd order tilt correction)") = 0.0;
63 catch(
const exception &error) {
64 FATAL(error.what() << endl);
69 const JFormat_t format(4, 0, std::ios_base::fmtflags(),
'0');
71 TH1D h1(
"chi2/NDF", NULL, 500, 0.0, 10.0);
72 TH1D h2(
"amplitude", NULL, 500, 0.0, 100.0);
82 JManager<int, TH2D> H2(
new TH2D(
"[%].tiltdeviation", NULL, 300, -4.0, +4.0, 300, -4.0, +4.0),
'%', format);
86 for (
counter_type counter = 0; in.
hasNext() && counter != inputFile.getLimit(); ++counter) {
88 STATUS(
"event: " << setw(10) << counter <<
'\r');
DEBUG(endl);
104 for (JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
106 const int id = i->id;
107 const double tx = (i->tx + i->tx2 * Z) * 1.0e3;
108 const double ty = (i->ty + i->ty2 * Z) * 1.0e3;
109 const double vs = i->vs * 1.0e2;
110 const double ts = sqrt(tx*tx + ty*ty);
120 H1[id]->Fill(ts,
vs);
122 GO[id].put(t1, atan2(ty, tx));
132 for (JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
134 const double tx = (i->tx + i->tx2 * Z) * 1.0e3;
135 const double ty = (i->ty + i->ty2 * Z) * 1.0e3;
137 H2 ->Fill(tx - Tx, ty - Ty);
138 H2[i->id]->Fill(tx - Tx, ty - Ty);
140 GO[-1].put(t1, atan2(Ty, Tx));
147 TH1D hx(
"hx", NULL, H2.size(), -0.5, H2.size() + 0.5);
148 TH1D hy(
"hy", NULL, H2.size(), -0.5, H2.size() + 0.5);
154 const int ix =
distance(H2.cbegin(), i) + 1;
159 hx.SetBinContent(ix, i->second->GetMean(1));
160 hy.SetBinContent(ix, i->second->GetMean(2));
161 hx.SetBinError (ix, i->second->GetStdDev(1));
162 hy.SetBinError (ix, i->second->GetStdDev(2));
164 Qx.
put(i->second->GetMean(1));
165 Qy.
put(i->second->GetMean(2));
174 out << h1 << h2 << hx << hy
178 out << H1 << *H1 << H2 << *H2;
ROOT TTree parameter settings.
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
int main(int argc, char **argv)
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
#define MAKE_CSTRING(A)
Make C-string.
Double_t g1(const Double_t x)
Function.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Auxiliary class for multiplexing object iterators.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
Utility class to parse command line options.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
General purpose class for object reading from a list of file names.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Long64_t counter_type
Type definition for counter.
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
double UNIXTimeStop
stop time
double ndf
weighed number of degrees of freedom
int npar
number of fit parameters
double UNIXTimeStart
start time
Data structure for graph data.
void put(const Double_t x, const Double_t y)
Put data.
Auxiliary data structure to build TGraph.
Auxiliary class for defining the range of iterations of objects.