Jpp
 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

Auxiliary data structure for muon PDF. More...

#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

Auxiliary data structure for muon PDF.

Definition at line 21 of file JNPE_t.hh.

Member Typedef Documentation

Definition at line 25 of file JNPE_t.hh.

Definition at line 26 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 36 of file JNPE_t.hh.

37  {
38  using namespace std;
39  using namespace JPP;
40 
41  const JPDFType_t pdf_t[] = { DIRECT_LIGHT_FROM_MUON,
45 
46  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
47 
49  JCollection,
50  double> JFunction1D_t;
51  typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_t;
52 
53 
54  const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
55 
56  for (int i = 0; i != N; ++i) {
57 
58  JPDF_t pdf;
59 
60  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
61 
62  cout << "loading PDF from file " << file_name << "... " << flush;
63 
64  pdf.load(file_name.c_str());
65 
66  cout << "OK" << endl;
67 
68  pdf.setExceptionHandler(supervisor);
69 
70  if (!is_bremsstrahlung(pdf_t[i]))
71  Y1.push_back(JNPE_t(pdf));
72  else
73  YB.push_back(JNPE_t(pdf));
74  }
75 
76  // Add PDFs
77 
78  cout << "adding PDFs... " << flush;
79 
80  Y1[1].add(Y1[0]); Y1.erase(Y1.begin());
81  YB[1].add(YB[0]); YB.erase(YB.begin());
82 
83  cout << "OK" << endl;
84  }
std::vector< JNPE_t > Y1
light from muon
Definition: JNPE_t.hh:116
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition: JNPE_t.hh:26
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:117
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:37

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

103  {
104  using namespace JPP;
105 
106  const double yA = getNPE(Y1, R, theta, phi);
107  const double yB = getNPE(YB, R, theta, phi);
108 
110  return yA + E * yB;
111  else
112  return 0.0;
113  }
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
std::vector< JNPE_t > Y1
light from muon
Definition: JNPE_t.hh:116
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:128
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
std::vector< JNPE_t > YB
light from EM showers
Definition: JNPE_t.hh:117
static const double INDEX_OF_REFRACTION_WATER
average index of refraction of water
Definition: JConstants.hh:37
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
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 128 of file JNPE_t.hh.

132  {
133  using namespace std;
134  using namespace JPP;
135 
136  double npe = 0.0;
137 
138  for (vector<JNPE_t>::const_iterator i = NPE.begin(); i != NPE.end(); ++i) {
139 
140  if (R <= i->getXmax()) {
141 
142  try {
143 
144  const double y = get_value((*i)(std::max(R, i->getXmin()), theta, phi));
145 
146  if (y > 0.0) {
147  npe += y;
148  }
149  }
150  catch(const exception& error) {
151  cerr << error.what() << endl;
152  }
153  }
154  }
155 
156  return npe;
157  }
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
JResultEvaluator< JResult_t >::result_type get_value(const JResult_t &value)
Helper method to recursively evaluate a to function value.
Definition: JResult.hh:936

Member Data Documentation

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

light from muon

Definition at line 116 of file JNPE_t.hh.

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

light from EM showers

Definition at line 117 of file JNPE_t.hh.


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