32{
35
37
38 string detectorFile;
41
42 try {
43
45
51
52 JParser<> zap(
"Auxiliary plot fit function of JFitK40.cc.");
53
58
59 zap(argc, argv);
60 }
61 catch(const exception &error) {
62 FATAL(error.what() << endl);
63 }
64
65
67
68 if (detectorFile != "") {
69
71
72 try {
74 }
77 }
78
79 module = detector[0];
80
81 } else {
82
83 module = getModule<JKM3NeT_t>(1001);
84 }
85
87
88 const int nx =
model.getNumberOfPairs();
89 const double xmin = -0.5;
90 const double xmax = nx - 0.5;
91
92 if (
debug >= debug_t) {
93 for (size_t i = 0; i != module.size(); ++i) {
95 }
96 }
97
99
100 TH1D h1("h1", NULL, nx, xmin, xmax);
101
102 double R = 0.0;
103
104 for (int ix = 1; ix <= h1.GetXaxis()->GetNbins(); ++ix) {
105
106 const Double_t
x = h1.GetXaxis()->GetBinCenter(ix);
107
109 const double ct =
getDot(model[
pair.first].getDirection(), model[
pair.second].getDirection());
110 const double rate =
model.getValue(ct);
111
112 R += rate;
113
114 DEBUG(
"bin " << setw(3) << ix <<
' '
115 <<
"(" <<
FILL(2,
'0') <<
pair.first <<
"," <<
FILL(2,
'0') <<
pair.second <<
")" <<
FILL() <<
' '
117 module[
pair.second].getDirection()) <<
' '
118 <<
FIXED(6,3) << rate << endl);
119
120 h1.SetBinContent(ix, rate);
121 }
122
123 cout <<
"Total rate " <<
FIXED(7,3) << R <<
" [Hz]." << endl;
124
125 out.Write();
126 out.Close();
127}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
Data structure for a composite optical module.
Utility class to parse parameter values.
Utility class to parse command line options.
JDirection3D getDirection(const Vec &dir)
Get direction.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
Model for fit to acoustics data.
Fit parameters for two-fold coincidence rate due to K40.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...