PDF types.
PDF types.
39 string fileDescriptor;
54 zap[
'O'] =
make_field(option) =
"KM3NeT",
"Antares";
55 zap[
'E'] =
make_field(E,
"muon/shower energy [GeV]");
56 zap[
'c'] =
make_field(cd,
"cosine emission angle");
57 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
58 zap[
'T'] =
make_field(TMax_ns,
"L1 coincidence time window [ns]") = 20.0;
65 catch(
const exception &error) {
66 FATAL(error.what() << endl);
78 if (option ==
"KM3NeT") {
112 }
else if (option ==
"Antares") {
120 FATAL(
"Fatal error at detector option " << option << endl);
136 TH1D h0m(
"L0m", NULL, 300, 1.0, 151.0);
137 TH1D h1m(
"L1m", NULL, 300, 1.0, 151.0);
139 TH1D h0s(
"L0s", NULL, 300, 1.0, 151.0);
140 TH1D h1s(
"L1s", NULL, 300, 1.0, 151.0);
160 const double TTS = 2.0;
162 const double epsilon = 1.0e-10;
164 const int NUMBER_OF_PDFS =
sizeof(type)/
sizeof(type[0]);
166 JPDF_t pdf[NUMBER_OF_PDFS];
168 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
170 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
174 const string file_name =
getFilename(fileDescriptor, type[i]);
176 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
178 pdf[i].load(file_name.c_str());
182 pdf[i].setExceptionHandler(supervisor);
190 const double Tmin = -15.0;
191 const double Tmax = +250.0;
192 const double dt = 1.0;
194 for (
int ix = 1; ix <= h0m.GetNbinsX(); ++ix) {
196 const double R = h0m.GetBinCenter(ix);
202 const double theta = pi.constrain(pmt->getTheta());
203 const double phi = pi.constrain(fabs(pmt->getPhi()));
205 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
207 double yi = pdf[i](R, theta, phi, Tmax).V;
218 h0m.SetBinContent(ix, 1.0 - TMath::PoissonI(0,V));
226 for (
int ix = 1; ix <= h1m.GetNbinsX(); ++ix) {
228 const double R = h1m.GetBinCenter(ix);
232 for (
double x = Tmin;
x <= Tmax;
x += dt) {
240 const double theta = pi.constrain(
PMT[pmt].getTheta());
241 const double phi = pi.constrain(fabs(
PMT[pmt].getPhi()));
243 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
246 pdf[i](R, theta, phi,
x).
v,
247 pdf[i](R, theta, phi,
x + TMax_ns).v
258 Vi[pmt] += yi[1] - yi[0];
266 const double theta = pi.constrain(
PMT[pmt].getTheta());
267 const double phi = pi.constrain(fabs(
PMT[pmt].getPhi()));
271 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
273 double yi = pdf[i](R, theta, phi,
x).f;
285 Y +=
y * (1.0 - TMath::PoissonI(0, V - Vi[pmt])) * dt;
290 h1m.SetBinContent(ix, 1.0 - TMath::PoissonI(0,Y));
309 const double TTS = 2.0;
311 const double epsilon = 1.0e-10;
313 const int NUMBER_OF_PDFS =
sizeof(type)/
sizeof(type[0]);
315 JPDF_t pdf[NUMBER_OF_PDFS];
317 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
319 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
323 const string file_name =
getFilename(fileDescriptor, type[i]);
325 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
327 pdf[i].load(file_name.c_str());
331 pdf[i].setExceptionHandler(supervisor);
339 const double Tmin = -15.0;
340 const double Tmax = +250.0;
341 const double dt = 1.0;
343 for (
int ix = 1; ix <= h0s.GetNbinsX(); ++ix) {
345 const double D = h0s.GetBinCenter(ix);
351 const double theta = pi.constrain(pmt->getTheta());
352 const double phi = pi.constrain(fabs(pmt->getPhi()));
354 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
356 double yi = pdf[i](D, cd, theta, phi, Tmax).V;
364 h0s.SetBinContent(ix, 1.0 - TMath::PoissonI(0,V));
372 for (
int ix = 1; ix <= h1s.GetNbinsX(); ++ix) {
374 const double D = h1s.GetBinCenter(ix);
378 for (
double x = Tmin;
x <= Tmax;
x += dt) {
386 const double theta = pi.constrain(
PMT[pmt].getTheta());
387 const double phi = pi.constrain(fabs(
PMT[pmt].getPhi()));
389 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
392 pdf[i](D, cd, theta, phi,
x).
v,
393 pdf[i](D, cd, theta, phi,
x + TMax_ns).v
399 Vi[pmt] += yi[1] - yi[0];
407 const double theta = pi.constrain(
PMT[pmt].getTheta());
408 const double phi = pi.constrain(fabs(
PMT[pmt].getPhi()));
412 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
414 double yi = pdf[i](D, cd, theta, phi,
x).f;
422 Y +=
y * (1.0 - TMath::PoissonI(0, V - Vi[pmt])) * dt;
427 h1s.SetBinContent(ix, 1.0 - TMath::PoissonI(0,Y));
JDAQPMTIdentifier PMT
Command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for angles in three dimensions.
Data structure for direction in three dimensions.
JDirection3D & rotate(const JRotation3D &R)
Rotate.
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.
static const double PI
Mathematical constants.
double getDeltaRaysFromMuon(const double E, const JRange< double > T_GeV=JRange< double >(DELTARAY_TMIN, DELTARAY_TMAX))
Equivalent EM-shower energy due to delta-rays per unit muon track length.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
@ SCATTERED_LIGHT_FROM_EMSHOWER
scattered light from EM shower
@ SCATTERED_LIGHT_FROM_DELTARAYS
scattered light from delta-rays
@ 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_EMSHOWER
direct light from EM shower
@ DIRECT_LIGHT_FROM_DELTARAYS
direct light from delta-rays
@ DIRECT_LIGHT_FROM_MUON
direct light from muon
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Empty structure for specification of parser element that is not initialised (i.e. does require input)...