Jpp  master_rocky-43-ge265d140c
the software that should make you happy
Public Types | Public Member Functions | Public Attributes | List of all members
JShowerPDF_t Struct Reference

Auxiliary data structure for shower PDF. More...

#include <JPDF_t.hh>

Public Types

typedef JPP::JSplineFunction1D< JPP::JSplineElement2S< double, double >, JPP::JCollection, JPP::JResultPDF< double > > JFunction1D_t
 
typedef JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalMap, JPP::JPolint0FunctionalGridMap, JPP::JPolint0FunctionalGridMap >::maplist JPDFMaplist_t
 
typedef JPP::JPDFTable< JFunction1D_t, JPDFMaplist_tJPDF_t
 
typedef JFunction1D_t::result_type result_type
 

Public Member Functions

 JShowerPDF_t (const std::string &fileDescriptor, const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10)
 Constructor. More...
 
result_type calculate (const double E, const double D, const double cd, const double theta, const double phi, const double t1) const
 Get PDF. More...
 

Public Attributes

JPDF_t pdfA
 PDF for shower. More...
 

Detailed Description

Auxiliary data structure for shower PDF.

Definition at line 268 of file JPDF_t.hh.

Member Typedef Documentation

◆ JFunction1D_t

Definition at line 272 of file JPDF_t.hh.

◆ JPDFMaplist_t

Definition at line 277 of file JPDF_t.hh.

◆ JPDF_t

Definition at line 278 of file JPDF_t.hh.

◆ result_type

Definition at line 279 of file JPDF_t.hh.

Constructor & Destructor Documentation

◆ JShowerPDF_t()

JShowerPDF_t::JShowerPDF_t ( const std::string &  fileDescriptor,
const double  TTS,
const int  numberOfPoints = 25,
const double  epsilon = 1.0e-10 
)
inline

Constructor.

The PDF file descriptor should contain the wild card character JPHYSICS::WILDCARD.
The TTS corresponds to the additional time smearing applied to the PDFs.

Parameters
fileDescriptorPDF file descriptor
TTSTTS [ns]
numberOfPointsnumber of points for Gauss-Hermite integration of TTS
epsilonprecision for Gauss-Hermite integration of TTS

Definition at line 293 of file JPDF_t.hh.

297  {
298  using namespace std;
299  using namespace JPP;
300 
301  const JPDFType_t pdf_t[] = { SCATTERED_LIGHT_FROM_EMSHOWER,
303 
304  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
305 
306  const JPDF_t::JSupervisor supervisor(new JPDF_t::JDefaultResult(zero));
307 
308  for (int i = 0; i != N; ++i) {
309 
310  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
311 
312  cout << "loading input from file " << file_name << "... " << flush;
313 
314  JPDF_t pdf;
315 
316  pdf.load(file_name.c_str());
317 
318  pdf.setExceptionHandler(supervisor);
319 
320  if (pdfA.empty())
321  pdfA = pdf;
322  else
323  pdfA.add(pdf);
324 
325  cout << "OK" << endl;
326  }
327 
328  if (TTS > 0.0) {
329 
330  cout << "bluring PDFs... " << flush;
331 
333 
334  cout << "OK" << endl;
335 
336  } else if (TTS < 0.0) {
337 
338  THROW(JValueOutOfRange, "Illegal value of TTS [ns]: " << TTS);
339  }
340  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
int numberOfPoints
Definition: JResultPDF.cc:22
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:180
void blur(const double TTS, const int numberOfPoints=25, const double epsilon=1.0e-10, const double quantile=0.99)
Blur PDF.
Definition: JPDFTable.hh:111
void add(const JMultiFunction_t &input)
Add function.
const double epsilon
Definition: JQuadrature.cc:21
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
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
JPDFType_t
PDF types.
Definition: JPDFTypes.hh:24
@ SCATTERED_LIGHT_FROM_EMSHOWER
scattered light from EM shower
Definition: JPDFTypes.hh:38
@ DIRECT_LIGHT_FROM_EMSHOWER
direct light from EM shower
Definition: JPDFTypes.hh:37
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14
void load(const char *file_name)
Load from input file.
JPP::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
Definition: JPDF_t.hh:278
JPDF_t pdfA
PDF for shower.
Definition: JPDF_t.hh:382

Member Function Documentation

◆ calculate()

result_type JShowerPDF_t::calculate ( const double  E,
const double  D,
const double  cd,
const double  theta,
const double  phi,
const double  t1 
) 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
Eshower energy [GeV]
Ddistance [m]
cdcosine emission angle
thetaPMT zenith angle [rad]
phiPMT azimuth angle [rad]
t1arrival time relative to Cherenkov hypothesis [ns]
Returns
hypothesis value

Definition at line 357 of file JPDF_t.hh.

363  {
364  using namespace JPP;
365 
366  result_type h1 = pdfA(D, cd, theta, phi, t1) * E;
367 
368  // safety measures
369 
370  if (h1.f <= 0.0) {
371  h1.f = 0.0;
372  h1.fp = 0.0;
373  }
374 
375  if (h1.v <= 0.0) {
376  h1.v = 0.0;
377  }
378 
379  return h1;
380  }
JFunction1D_t::result_type result_type
Definition: JPDF_t.hh:279

Member Data Documentation

◆ pdfA

JPDF_t JShowerPDF_t::pdfA

PDF for shower.

Definition at line 382 of file JPDF_t.hh.


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