10 #include "evt/Head.hh"
37 inline double rxj1713(
const double E)
39 static const double k = 16.80e-15;
40 static const double a = 1.72;
41 static const double e = 2.10;
43 return 1e4 * k * pow(E*1e-3, -a) * exp(-sqrt(E*1e-3/e));
54 int main(
int argc,
char **argv)
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;
110 FATAL(
"No generated events." << 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.
Synchronously read DAQ events and Monte Carlo events (and optionally other events).
bool has_neutrino(const Evt &evt)
Test whether given event has an incoming neutrino.
double numberOfEvents
Number of events.
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.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Interface methods for slalib and auxiliary classes and methods for astronomy.
Utility class to parse command line options.
ROOT TTree parameter settings.
double cosTmax
Maximal cosine zenith angle.
const JLimit & getLimit() const
Get limit.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
double cosTmin
Minimal cosine zenith angle.
bool is_valid(const T &value)
Check validity of given value.
#define DEBUG(A)
Message macros.
int main(int argc, char *argv[])