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);
90 const JEvt* evt =
in.next();
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));
168 if (Qx.getCount() > 1 && Qy.getCount() > 1) {
169 cout <<
"deviation: " <<
FIXED(7,3) << Qx.getSTDev() <<
' ' <<
FIXED(7,3) << Qy.getSTDev() << endl;
174 out << h1 << h2 << hx << hy
178 out << H1 << *H1 << H2 << *H2;
Utility class to parse command line options.
int npar
number of fit parameters
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Data structure for graph data.
#define MAKE_CSTRING(A)
Make C-string.
Long64_t counter_type
Type definition for counter.
Auxiliary data structure for floating point format specification.
Auxiliary class for multiplexing object iterators.
Auxiliary data structure to build TGraph.
double UNIXTimeStop
stop time
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...
double ndf
weighed number of degrees of freedom
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary data structure for sequence of same character.
double UNIXTimeStart
start time
General purpose class for object reading from a list of file names.
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
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
const JLimit & getLimit() const
Get limit.
#define DEBUG(A)
Message macros.
Double_t g1(const Double_t x)
Function.