34 int main(
int argc,
char **argv)
39 typedef JAbstractHistogram<double> JHistogram_t;
53 JParser<> zap(
"Auxiliary program to determine PDF of L1 hit.");
57 zap[
'E'] =
make_field(
E,
"muon energy [GeV]") = 1.0;
58 zap[
'R'] =
make_field(
R,
"distance of approach [m]");
59 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
60 zap[
'T'] =
make_field(T_ns,
"time window [ns]") = 10.0;
61 zap[
'B'] =
make_field(R_Hz,
"background rate [Hz]") = 0.0;
67 catch(
const exception &error) {
68 FATAL(error.what() << endl);
71 typedef JSplineFunction1S_t JFunction1D_t;
72 typedef JMAPLIST<JPolint1FunctionalMap,
73 JPolint1FunctionalGridMap,
74 JPolint1FunctionalGridMap>::maplist JMapList_t;
75 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
77 JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(
zero));
86 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
90 for (
int i = 0;
i !=
N; ++
i) {
94 const string file_name =
getFilename(inputFile, pdf_t[
i]);
96 NOTICE(
"loading input from file " << file_name <<
"... " << flush);
98 pdf[
i].load(file_name.c_str());
102 catch(
const JException& error) {
103 FATAL(error.what() << endl);
106 pdf[
i].setExceptionHandler(supervisor);
117 JModule module = getModule<JKM3NeT_t>(1);
119 module.rotate(JRotation3D(dir));
126 JSplineFunction1S_t zsp;
128 for (
double t1 =
histogram.getLowerLimit(); t1 <=
histogram.getUpperLimit(); t1 += 0.1) {
130 const double t2 = t1 + T_ns;
132 JFunction1D_t::result_type y1;
133 JFunction1D_t::result_type y2;
135 for (
int i = 0;
i !=
N; ++
i) {
137 JFunction1D_t::result_type
p1;
138 JFunction1D_t::result_type
p2;
142 for (
const auto& pmt : module) {
143 p1 += pdf[
i](
R, pmt.getTheta(), pmt.getPhi(), t1);
144 p2 += pdf[
i](
R, pmt.getTheta(), pmt.getPhi(), t2);
162 y1.v += R_Hz * 1e-9 * (t1 -
histogram.getLowerLimit());
163 y2.v += R_Hz * 1e-9 * (t2 -
histogram.getLowerLimit());
165 zsp[t1] = y1.f * (1.0 -
exp(y1.v - y2.v));
170 for (
int ix = 1; ix <= h0.GetNbinsX(); ++ix) {
172 const double t1 = h0.GetBinCenter(ix);
176 const JFunction1D_t::result_type
result = zsp(t1);
178 const double W =
exp(-result.v) * result.f / (1.0 -
exp(-result.V));
180 h0.SetBinContent(ix, W);
182 catch(
const exception&) {}
Utility class to parse command line options.
int main(int argc, char *argv[])
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
direct light from EM showers
static const JZero zero
Function object to assign zero value.
then warning Cannot perform comparison test for histogram
Various implementations of functional maps.
Numbering scheme for PDF types.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
scattered light from muon
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
scattered light from delta-rays
scattered light from EM showers
General purpose messaging.
direct light from delta-rays
then JCookie sh JDataQuality D $DETECTOR_ID R
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Utility class to parse command line options.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
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"` source JAcousticsToolkit.sh typeset -A TRIPODS get_tripods $WORKDIR/tripod.txt TRIPODS XMEAN
Data structure for optical module.