58 using namespace KM3NETDAQ;
60 JTriggeredFileScanner<> inputFile;
64 double numberOfBlocks;
70 JParser<> zap(
"Example program to plot event rates using JASTRONOMY::JStarTrek.");
74 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
82 catch(
const exception &error) {
83 FATAL(error.what() << endl);
88 const double radius = 1.0;
89 const double omega = 2*
PI * (1.0 - cos(radius*
PI/180));
99 catch(
const JException& error) {
104 double Wall = numberOfBlocks;
109 if (!
is_valid(buffer.genvol) || buffer.genvol.numberOfEvents == 0) {
110 FATAL(
"No generated events." << endl);
113 Wall /= buffer.genvol.numberOfEvents;
115 STATUS(
"Generation: " << buffer.genvol.numberOfEvents << endl);
118 STATUS(
"Solid angle: " << 2 * (buffer.cut_nu.cosTmax - buffer.cut_nu.cosTmin) <<
"pi" << endl);
131 TH1D hc(
"ct [live time]", NULL, 1000, -1.0, +1.0);
133 for (
int i = 1; i != hc.GetNbinsX(); ++i) {
135 const double x = hc.GetBinCenter(i);
136 const double y = startrek(x);
138 hc.SetBinContent(i, y);
141 TH1D h0(
"h0 [background]", NULL, 20, +1.0, +6.0);
142 TH1D h1(
"h1 [signal]", NULL, 20, +1.0, +6.0);
144 TH1D*
H[] = { &h0, &h1 };
145 double W[] = { 0.0, 0.0 };
147 for (
int i = 0; i !=
sizeof(
H)/
sizeof(
H[0]); ++i) {
152 while (inputFile.hasNext()) {
154 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
156 JTriggeredFileScanner<>::multi_pointer_type ps = inputFile.next();
159 const Evt*
event = ps;
165 const double E = neutrino.E;
166 const double dz = neutrino.dir.z;
167 const double P = 1.0;
168 const double W2 =
event->w[1];
169 const double W3 =
event->w[2];
173 const double x = log10(E);
174 const double y[] = { P * W3 * omega * startrek(dz),
175 P * W2 * rxj1713(E) * startrek(dz) };
178 for (
int i = 0; i !=
sizeof(
H)/
sizeof(
H[0]); ++i) {
179 H[i]->Fill(x, y[i] * Wall);
187 for (
int i = 0; i !=
sizeof(W)/
sizeof(W[0]); ++i) {
188 NOTICE(
"W[" << i <<
"] = " <<
FIXED(9,2) << W[i] << endl);
static const JGeographicalLocation Sicily(36, 16, 16, 06)
Utility class to parse command line options.
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
Auxiliary data structure for floating point format specification.
static const JSourceLocation RXJ1713(getRadians(-39,-46, 0.0), getHourAngle(17, 13, 7))
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
JLimit JLimit_t
Type definition of limit.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const JLimit & getLimit() const
Get limit.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
bool is_valid(const T &value)
Check validity of given value.
#define DEBUG(A)
Message macros.