Auxiliary program to determine PDF of L1 hit.
47 JHistogram_t histogram;
52 JParser<> zap(
"Auxiliary program to determine PDF of L1 hit.");
56 zap[
'E'] =
make_field(
E,
"muon energy [GeV]") = 1.0;
57 zap[
'R'] =
make_field(
R,
"distance of approach [m]");
58 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
59 zap[
'T'] =
make_field(T_ns,
"time window [ns]") = 10.0;
60 zap[
'B'] =
make_field(R_Hz,
"background rate [Hz]") = 0.0;
61 zap[
'H'] =
make_field(histogram,
"histogram binning") = JHistogram_t();
66 catch(
const exception &error) {
67 FATAL(error.what() << endl);
76 JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(
zero));
85 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
89 for (
int i = 0; i !=
N; ++i) {
93 const string file_name =
getFilename(inputFile, pdf_t[i]);
95 NOTICE(
"loading input from file " << file_name <<
"... " << flush);
97 pdf[i].load(file_name.c_str());
105 pdf[i].setExceptionHandler(supervisor);
108 if (!histogram.is_valid()) {
110 histogram = JHistogram_t(-50.0, +50.0);
112 histogram.setBinWidth(0.1);
116 JModule module = getModule<JKM3NeT_t>(1);
123 TH1D h0(
"h0", NULL, histogram.getNumberOfBins(), histogram.getLowerLimit(), histogram.getUpperLimit());
127 for (
double t1 = histogram.getLowerLimit(); t1 <= histogram.getUpperLimit(); t1 += 0.1) {
129 const double t2 = t1 + T_ns;
131 JFunction1D_t::result_type y1;
132 JFunction1D_t::result_type y2;
134 for (
int i = 0; i !=
N; ++i) {
136 JFunction1D_t::result_type
p1;
137 JFunction1D_t::result_type
p2;
141 for (
const auto& pmt : module) {
142 p1 += pdf[i](
R, pmt.getTheta(), pmt.getPhi(), t1);
143 p2 += pdf[i](
R, pmt.getTheta(), pmt.getPhi(), t2);
161 y1.v += R_Hz * 1e-9 * (t1 - histogram.getLowerLimit());
162 y2.v += R_Hz * 1e-9 * (t2 - histogram.getLowerLimit());
164 zsp[t1] = y1.f * (1.0 -
exp(y1.v - y2.v));
169 for (
int ix = 1; ix <= h0.GetNbinsX(); ++ix) {
171 const double t1 = h0.GetBinCenter(ix);
175 const JFunction1D_t::result_type
result = zsp(t1);
177 const double W =
exp(-result.v) * result.f / (1.0 -
exp(-result.V));
179 h0.SetBinContent(ix, W);
181 catch(
const exception&) {}
Data structure for angles in three dimensions.
Utility class to parse command line options.
Data structure for a composite optical module.
direct light from EM showers
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
static const JZero zero
Function object to assign zero value.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
scattered light from muon
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Multi-dimensional PDF table for arrival time of Cherenkov light.
scattered light from delta-rays
scattered light from EM showers
void rotate(const JRotation3D &R)
Rotate module.
direct light from delta-rays
then JCookie sh JDataQuality D $DETECTOR_ID R
virtual const char * what() const override
Get error message.
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