36 inline double rxj1713(
const double E)
38 static const double k = 16.80e-15;
39 static const double a = 1.72;
40 static const double e = 2.10;
42 return 1e4 * k *
pow(E*1e-3, -a) *
exp(-sqrt(E*1e-3/e));
53 int main(
int argc,
char **argv)
57 using namespace KM3NETDAQ;
63 double numberOfBlocks;
69 JParser<> zap(
"Example program to plot event rates using JASTRONOMY::JStarTrek.");
73 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
81 catch(
const exception &error) {
82 FATAL(error.what() << endl);
87 const double radius = 1.0;
88 const double omega = 2*
PI * (1.0 - cos(radius*
PI/180));
103 double Wall = numberOfBlocks;
109 FATAL(
"No generated events." << endl);
116 if (buffer.
is_valid(&JHead::cut_nu)) {
130 TH1D hc(
"ct [live time]", NULL, 1000, -1.0, +1.0);
132 for (
int i = 1; i != hc.GetNbinsX(); ++i) {
134 const double x = hc.GetBinCenter(i);
135 const double y = startrek(x);
137 hc.SetBinContent(i, y);
140 TH1D h0(
"h0 [background]", NULL, 20, +1.0, +6.0);
141 TH1D
h1(
"h1 [signal]", NULL, 20, +1.0, +6.0);
143 TH1D*
H[] = { &h0, &h1 };
144 double W[] = { 0.0, 0.0 };
146 for (
int i = 0; i !=
sizeof(
H)/
sizeof(
H[0]); ++i) {
151 while (inputFile.hasNext()) {
153 STATUS(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
DEBUG(endl);
158 const Evt*
event = ps;
164 const double E = neutrino.
E;
165 const double dz = neutrino.
dir.
z;
166 const double P = 1.0;
167 const double W2 =
event->w[1];
168 const double W3 =
event->w[2];
172 const double x = log10(E);
173 const double y[] = { P * W3 * omega * startrek(dz),
174 P * W2 * rxj1713(E) * startrek(dz) };
177 for (
int i = 0; i !=
sizeof(
H)/
sizeof(
H[0]); ++i) {
178 H[i]->Fill(x, y[i] * Wall);
186 for (
int i = 0; i !=
sizeof(W)/
sizeof(W[0]); ++i) {
187 NOTICE(
"W[" << i <<
"] = " <<
FIXED(9,2) << W[i] << endl);
static const JGeographicalLocation Sicily(36, 16, 16, 06)
Auxiliary class for source tracking.
Utility class to parse command line options.
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
int main(int argc, char *argv[])
ROOT TTree parameter settings of various packages.
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.
Auxiliary class to synchronously read DAQ events and Monte Carlo events (and optionally other events)...
static const double H
Planck constant [eV s].
then for HISTOGRAM in h0 h1
Auxiliary data structure for floating point format specification.
static const JSourceLocation RXJ1713(getRadians(-39,-46, 0.0), getHourAngle(17, 13, 7))
double E
Energy [GeV] (either MC truth or reconstructed)
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable STRING $argv[2] set_array QUANTILES set_variable FORMULA *[0] exp(-0.5 *(x-[1])*(x-[1])/([2]*[2]))" set_variable MODULE `getModule -a $DETECTOR -L "$STRING 0"` typeset -Z 4 STRING JOpera1D -f hydrophone.root
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Auxiliary class for defining the range of iterations of objects.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
T pow(const T &x, const double y)
Power .
static const double PI
Mathematical constants.
General purpose messaging.
The Head class reflects the header of Monte-Carlo event files, which consists of keys (also referred ...
Interface methods for slalib and auxiliary classes and methods for astronomy.
Utility class to parse command line options.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
double cosTmax
Maximal cosine zenith angle.
const JLimit & getLimit() const
Get limit.
const Trk & get_neutrino(const Evt &evt)
Get incoming neutrino.
General purpose class for multiple pointers.
bool is_valid(T JHead::*pd) const
Check validity of given data member in JHead.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
double cosTmin
Minimal cosine zenith angle.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.