44 const JPDFType_t pdf_t[] = {
45 DIRECT_LIGHT_FROM_MUON,
46 SCATTERED_LIGHT_FROM_MUON,
47 DIRECT_LIGHT_FROM_DELTARAYS,
48 SCATTERED_LIGHT_FROM_DELTARAYS,
49 DIRECT_LIGHT_FROM_EMSHOWERS,
50 SCATTERED_LIGHT_FROM_EMSHOWERS
53 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
57 double> JFunction1D_t;
61 const JNPE_t::JSupervisor
supervisor(
new JNPE_t::JDefaultResult(zero));
63 for (
int i = 0; i != N; ++i) {
67 const JPDFType_t type = pdf_t[i];
68 const string file_name = getFilename(fileDescriptor, type);
70 cout <<
"loading PDF from file " << file_name <<
"... " << flush;
72 pdf.load(file_name.c_str());
78 if (is_bremsstrahlung(type))
80 else if (is_deltarays(type))
88 cout <<
"adding PDFs... " << flush;
90 Y1[1].add(
Y1[0]);
Y1.erase(
Y1.begin());
91 YA[1].add(
YA[0]);
YA.erase(
YA.begin());
92 YB[1].add(
YB[0]);
YB.erase(
YB.begin());
113 const double phi)
const
117 const double y1 =
getNPE(
Y1, R, theta, phi);
118 const double yA =
getNPE(
YA, R, theta, phi);
119 const double yB =
getNPE(
YB, R, theta, phi);
121 if (E >= MASS_MUON * INDEX_OF_REFRACTION_WATER)
122 return y1 + JDeltaRays::getEnergyLossFromMuon(E) * yA + E * yB;
157 const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
163 catch(
const exception& error) {
201 const JPDFType_t pdf_t[] = {
202 SCATTERED_LIGHT_FROM_EMSHOWER,
203 DIRECT_LIGHT_FROM_EMSHOWER
206 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
210 double> JFunction1D_t;
214 const JNPE_t::JSupervisor
supervisor(
new JNPE_t::JDefaultResult(zero));
216 for (
int i = 0; i != N; ++i) {
218 const string file_name = getFilename(fileDescriptor, pdf_t[i]);
220 cout <<
"loading input from file " << file_name <<
"... " << flush;
224 pdf.
load(file_name.c_str());
257 const double phi)
const
272 const double __D = sqrt(D*D - 2.0*(D*
cd)*z + z*z);
278 catch(
const exception& error) {
286 Y =
npe(D,
cd, theta, phi);
288 catch(
const exception& error) {
General purpose class for a collection of sorted elements.
The elements in a collection are sorted according to their abscissa values and a given distance opera...
Longitudinal emission profile EM-shower.
Numbering scheme for PDF types.
Definition of zero value for any class.
Template definition of a multi-dimensional oscillation probability interpolation table.
void load()
Load oscillation probability table.
void add(const JNPETable &input)
Add NPE table.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JNPE_t > YA
light from delta-rays
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
std::vector< JNPE_t > YB
light from EM showers
double calculate(const double E, const double R, const double theta, const double phi) const
Get PDF.
static double getNPE(const std::vector< JNPE_t > &NPE, const double R, const double theta, const double phi)
Get number of photo-electrons.
JMuonNPE_t(const std::string &fileDescriptor)
Constructor.
JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalGridMap, JPP::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
std::vector< JNPE_t > Y1
light from muon
Auxiliary data structure for shower PDF.
JNPE_t npe
PDF for shower.
JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalGridMap, JPP::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
JNPE_t F[2]
PDF for shower.
JShowerNPE_t(const std::string &fileDescriptor, const int numberOfPoints=0)
Constructor.
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
double calculate(const double E, const double D, const double cd, const double theta, const double phi) const
Get PDF.