Jpp  pmt_effective_area_update_2
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_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::WILD_CARD.

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,
48 
49  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
50 
52  JCollection,
53  double> JFunction1D_t;
54  typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_t;
55 
56 
57  const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
58 
59  for (int i = 0; i != N; ++i) {
60 
61  JPDF_t pdf;
62 
63  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
64 
65  cout << "loading PDF from file " << file_name << "... " << flush;
66 
67  pdf.load(file_name.c_str());
68 
69  cout << "OK" << endl;
70 
71  pdf.setExceptionHandler(supervisor);
72 
73  if (!is_bremsstrahlung(pdf_t[i]))
74  Y1.push_back(JNPE_t(pdf));
75  else
76  YB.push_back(JNPE_t(pdf));
77  }
78 
79  // Add PDFs
80 
81  cout << "adding PDFs... " << flush;
82 
83  Y1[1].add(Y1[0]); Y1.erase(Y1.begin());
84  YB[1].add(YB[0]); YB.erase(YB.begin());
85 
86  cout << "OK" << endl;
87  }
std::vector< JNPE_t > Y1
light from muon
Definition: JNPE_t.hh:119
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition: JNPE_t.hh:29
direct light from EM showers
Definition: JPDFTypes.hh:32
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
direct light from muon
Definition: JPDFTypes.hh:29
Template class for spline interpolation in 1D.
Definition: JSpline.hh:657
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
Definition: JPDFTypes.hh:163
scattered light from muon
Definition: JPDFTypes.hh:30
scattered light from EM showers
Definition: JPDFTypes.hh:33
JPDFType_t
PDF types.
Definition: JPDFTypes.hh:27
std::vector< JNPE_t > YB
light from EM showers
Definition: JNPE_t.hh:120
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:88
then usage $script[input file[working directory[option]]] nWhere option can be N
Definition: JMuonPostfit.sh:36

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 102 of file JNPE_t.hh.

106  {
107  using namespace JPP;
108 
109  const double yA = getNPE(Y1, R, theta, phi);
110  const double yB = getNPE(YB, R, theta, phi);
111 
113  return yA + E * yB;
114  else
115  return 0.0;
116  }
std::vector< JNPE_t > Y1
light from muon
Definition: JNPE_t.hh:119
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:131
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
std::vector< JNPE_t > YB
light from EM showers
Definition: JNPE_t.hh:120
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:36
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 131 of file JNPE_t.hh.

135  {
136  using namespace std;
137  using namespace JPP;
138 
139  double npe = 0.0;
140 
141  for (vector<JNPE_t>::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
142 
143  if (R <= i->getXmax()) {
144 
145  try {
146 
147  const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
148 
149  if (y > 0.0) {
150  npe += y;
151  }
152  }
153  catch(const exception& error) {
154  cerr << error.what() << endl;
155  }
156  }
157  }
158 
159  return npe;
160  }
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
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 119 of file JNPE_t.hh.

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

light from EM showers

Definition at line 120 of file JNPE_t.hh.


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