Jpp  18.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
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_t
JNPE_t
 

Public Member Functions

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

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. More...
 

Private Attributes

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

Detailed Description

Definition at line 24 of file JNPE_t.hh.

Member Typedef Documentation

Definition at line 28 of file JNPE_t.hh.

Definition at line 29 of file JNPE_t.hh.

Constructor & Destructor Documentation

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,
50 
51  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
52 
54  JCollection,
55  double> JFunction1D_t;
56  typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_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  }
std::vector< JNPE_t > Y1
light from muon
Definition: JNPE_t.hh:126
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition: JNPE_t.hh:29
direct light from EM showers
Definition: JPDFTypes.hh:29
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
direct light from muon
Definition: JPDFTypes.hh:26
Template class for spline interpolation in 1D.
Definition: JSpline.hh:734
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
Definition: JPDFTypes.hh:137
scattered light from muon
Definition: JPDFTypes.hh:27
scattered light from delta-rays
Definition: JPDFTypes.hh:33
scattered light from EM showers
Definition: JPDFTypes.hh:30
JPDFType_t
PDF types.
Definition: JPDFTypes.hh:24
direct light from delta-rays
Definition: JPDFTypes.hh:32
std::vector< JNPE_t > YB
light from EM showers
Definition: JNPE_t.hh:128
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
std::vector< JNPE_t > YA
light from delta-rays
Definition: JNPE_t.hh:127
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
Definition: JPDFTypes.hh:151
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
Definition: JeepToolkit.hh:128

Member Function Documentation

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 
120  return y1 + getDeltaRaysFromMuon(E) * yA + E * yB;
121  else
122  return 0.0;
123  }
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
std::vector< JNPE_t > Y1
light from muon
Definition: JNPE_t.hh:126
static const double MASS_MUON
muon mass [GeV]
static const double INDEX_OF_REFRACTION_WATER
Average index of refraction of water corresponding to the group velocity.
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
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
std::vector< JNPE_t > YB
light from EM showers
Definition: JNPE_t.hh:128
std::vector< JNPE_t > YA
light from delta-rays
Definition: JNPE_t.hh:127
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
Definition: JPDFToolkit.hh:67
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  }
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
JResultEvaluator< JResult_t >::result_type get_value(const JResult_t &value)
Helper method to recursively evaluate a to function value.
Definition: JResult.hh:998

Member Data Documentation

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

light from muon

Definition at line 126 of file JNPE_t.hh.

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

light from delta-rays

Definition at line 127 of file JNPE_t.hh.

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: