Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JMuonNPE_t Struct Reference

#include <JNPE_t.hh>

Public Types

typedef JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalGridMap, JPP::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
 
typedef JPP::JNPETable< double, double, JNPEMaplist_tJNPE_t
 

Public Member Functions

 JMuonNPE_t (const std::string &fileDescriptor)
 Constructor.
 
double calculate (const double E, const double R, const double theta, const double phi) const
 Get PDF.
 

Static Private Member Functions

static double getNPE (const std::vector< JNPE_t > &NPE, const double R, const double theta, const double phi)
 Get number of photo-electrons.
 

Private Attributes

std::vector< JNPE_tY1
 light from muon
 
std::vector< JNPE_tYA
 light from delta-rays
 
std::vector< JNPE_tYB
 light from EM showers
 

Detailed Description

Definition at line 24 of file JNPE_t.hh.

Member Typedef Documentation

◆ JNPEMaplist_t

◆ JNPE_t

Definition at line 29 of file JNPE_t.hh.

Constructor & Destructor Documentation

◆ JMuonNPE_t()

JMuonNPE_t::JMuonNPE_t ( const std::string & fileDescriptor)
inline

Constructor.

The PDF file descriptor should contain the wild card character JPHYSICS::WILDCARD.

Parameters
fileDescriptorPDF file descriptor

Definition at line 39 of file JNPE_t.hh.

40 {
41 using namespace std;
42 using namespace JPP;
43
44 const JPDFType_t pdf_t[] = { DIRECT_LIGHT_FROM_MUON,
45 SCATTERED_LIGHT_FROM_MUON,
46 DIRECT_LIGHT_FROM_DELTARAYS,
47 SCATTERED_LIGHT_FROM_DELTARAYS,
48 DIRECT_LIGHT_FROM_EMSHOWERS,
49 SCATTERED_LIGHT_FROM_EMSHOWERS };
50
51 const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
52
55 double> JFunction1D_t;
57
58
59 const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
60
61 for (int i = 0; i != N; ++i) {
62
63 JPDF_t pdf;
64
65 const JPDFType_t type = pdf_t[i];
66 const string file_name = getFilename(fileDescriptor, type);
67
68 cout << "loading PDF from file " << file_name << "... " << flush;
69
70 pdf.load(file_name.c_str());
71
72 cout << "OK" << endl;
73
74 pdf.setExceptionHandler(supervisor);
75
76 if (is_bremsstrahlung(type))
77 YB.push_back(JNPE_t(pdf));
78 else if (is_deltarays(type))
79 YA.push_back(JNPE_t(pdf));
80 else
81 Y1.push_back(JNPE_t(pdf));
82 }
83
84 // Add PDFs
85
86 cout << "adding PDFs... " << flush;
87
88 Y1[1].add(Y1[0]); Y1.erase(Y1.begin());
89 YA[1].add(YA[0]); YA.erase(YA.begin());
90 YB[1].add(YB[0]); YB.erase(YB.begin());
91
92 cout << "OK" << endl;
93 }
Multi-dimensional PDF table for arrival time of Cherenkov light.
Definition JPDFTable.hh:44
General purpose class for collection of elements, see: <a href="JTools.PDF";>Collection of elements....
Definition JSet.hh:22
Template class for spline interpolation in 1D.
Definition JSpline.hh:734
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
Definition JPDFTypes.hh:151
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
Definition JPDFTypes.hh:137
JPDFType_t
PDF types.
Definition JPDFTypes.hh:24
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JNPE_t > YA
light from delta-rays
Definition JNPE_t.hh:127
std::vector< JNPE_t > YB
light from EM showers
Definition JNPE_t.hh:128
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition JNPE_t.hh:29
std::vector< JNPE_t > Y1
light from muon
Definition JNPE_t.hh:126

Member Function Documentation

◆ calculate()

double JMuonNPE_t::calculate ( const double E,
const double R,
const double theta,
const double phi ) const
inline

Get PDF.

The orientation of the PMT should be defined according this documentation.
In this, the zenith and azimuth angles are limited to

\[\left[0, \pi\right]\]

.

Parameters
Emuon energy at minimum distance of approach [GeV]
Rminimum distance of approach [m]
thetaPMT zenith angle [rad]
phiPMT azimuth angle [rad]
Returns
number of photo-electrons

Definition at line 108 of file JNPE_t.hh.

112 {
113 using namespace JPP;
114
115 const double y1 = getNPE(Y1, R, theta, phi);
116 const double yA = getNPE(YA, R, theta, phi);
117 const double yB = getNPE(YB, R, theta, phi);
118
119 if (E >= MASS_MUON * INDEX_OF_REFRACTION_WATER)
120 return y1 + getDeltaRaysFromMuon(E) * yA + E * yB;
121 else
122 return 0.0;
123 }
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.
static double getNPE(const std::vector< JNPE_t > &NPE, const double R, const double theta, const double phi)
Get number of photo-electrons.
Definition JNPE_t.hh:139

◆ getNPE()

static double JMuonNPE_t::getNPE ( const std::vector< JNPE_t > & NPE,
const double R,
const double theta,
const double phi )
inlinestaticprivate

Get number of photo-electrons.

Parameters
NPENPE tables
Rdistance between muon and PMT [m]
thetazenith angle orientation PMT [rad]
phiazimuth angle orientation PMT [rad]
Returns
number of photo-electrons

Definition at line 139 of file JNPE_t.hh.

143 {
144 using namespace std;
145 using namespace JPP;
146
147 double npe = 0.0;
148
149 for (vector<JNPE_t>::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
150
151 if (R <= i->getXmax()) {
152
153 try {
154
155 const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
156
157 if (y > 0.0) {
158 npe += y;
159 }
160 }
161 catch(const exception& error) {
162 cerr << error.what() << endl;
163 }
164 }
165 }
166
167 return npe;
168 }

Member Data Documentation

◆ Y1

std::vector<JNPE_t> JMuonNPE_t::Y1
private

light from muon

Definition at line 126 of file JNPE_t.hh.

◆ YA

std::vector<JNPE_t> JMuonNPE_t::YA
private

light from delta-rays

Definition at line 127 of file JNPE_t.hh.

◆ YB

std::vector<JNPE_t> JMuonNPE_t::YB
private

light from EM showers

Definition at line 128 of file JNPE_t.hh.


The documentation for this struct was generated from the following file: