45 JParser<> zap(
"Demonstration program to plot RMS of arrival time of first hit as a function of the minimal distance of approach of a muon to the PMT.");
49 zap[
'E'] =
make_field(E_GeV,
"muon energy [GeV]");
50 zap[
'R'] =
make_field(R_Hz,
"background rate [Hz]");
51 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
56 catch(
const exception &error) {
57 FATAL(error.what() << endl);
67 JFunction1D_t::JSupervisor supervisor(
new JFunction1D_t::JDefaultResult(
zero));
74 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
78 for (
int i = 0; i != N; ++i) {
82 const string file_name =
getFilename(inputFile, pdf_t[i]);
84 NOTICE(
"loading input from file " << file_name <<
"... " << flush);
86 pdf[i].load(file_name.c_str());
94 pdf[i].setExceptionHandler(supervisor);
122 os <<
"t[" << *i <<
"]";
124 buffer.push_back(
new TH1D(os.str().c_str(), NULL, 5000, -250.0, +250.0));
133 x.push_back(*i - 0.5*(*
j-*i));
135 for (;
j != X.end(); ++i, ++
j)
136 x.push_back(0.5*(*i+*
j));
141 x.push_back(*
j + 0.5*(*
j-*i));
144 TH1D rms(
"rms", NULL, X.size(), &
x[0]);
147 JFunction1D_t::result_type p[4];
153 const double Tmin = -250.0;
154 const double Tmax = +250.0;
158 for (
size_t i = 0; i != X.size(); ++i) {
161 const double R = X[i];
165 for (
int j = 1;
j <= h->GetNbinsX(); ++
j) {
167 const double t1 = h->GetBinCenter(
j);
173 for (
int k = 0; k != 4; ++k) {
183 R_Hz * 1e-9 * (t1 - Tmin);
191 R_Hz * 1e-9 * (Tmax - Tmin);
201 const double W = exp(-
v) *
y / (1.0 - exp(-V));
207 h->SetBinContent(
j,W);
214 const double sig =
result.getFWHM() * 0.5 / sqrt(2.0*log(2.0));
218 NOTICE(
"integral " << R <<
' ' <<
result.getIntegral() << endl);
221 const float w = 1.0 / (float)
n;
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Auxiliary class for CPU timing and usage.
void print(std::ostream &out, const JScale_t scale=milli_t) const
Print timer data.
Data structure for angles in three dimensions.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
virtual const char * what() const override
Get error message.
Utility class to parse command line options.
Multi-dimensional PDF table for arrival time of Cherenkov light.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
static const JZero zero
Function object to assign zero value.
@ DIRECT_LIGHT_FROM_EMSHOWERS
direct light from EM showers
@ SCATTERED_LIGHT_FROM_EMSHOWERS
scattered light from EM showers
@ SCATTERED_LIGHT_FROM_MUON
scattered light from muon
@ DIRECT_LIGHT_FROM_MUON
direct light from muon
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).