Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_t
JPDF_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 152 of file JPDF_t.hh.

Member Typedef Documentation

Definition at line 156 of file JPDF_t.hh.

Definition at line 161 of file JPDF_t.hh.

Definition at line 162 of file JPDF_t.hh.

Definition at line 163 of file JPDF_t.hh.

Constructor & Destructor Documentation

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::WILD_CARD.
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 177 of file JPDF_t.hh.

181  {
182  using namespace std;
183  using namespace JPP;
184 
185  const JPDFType_t pdf_t[] = { SCATTERED_LIGHT_FROM_EMSHOWER,
187 
188  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
189 
190  const JPDF_t::JSupervisor supervisor(new JPDF_t::JDefaultResult(zero));
191 
192  for (int i = 0; i != N; ++i) {
193 
194  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
195 
196  cout << "loading input from file " << file_name << "... " << flush;
197 
198  JPDF_t pdf;
199 
200  pdf.load(file_name.c_str());
201 
202  pdf.setExceptionHandler(supervisor);
203 
204  if (pdfA.empty())
205  pdfA = pdf;
206  else
207  pdfA.add(pdf);
208 
209  cout << "OK" << endl;
210  }
211 
212  if (TTS > 0.0) {
213 
214  cout << "bluring PDFs... " << flush;
215 
216  pdfA.blur(TTS, numberOfPoints, epsilon);
217 
218  cout << "OK" << endl;
219 
220  } else if (TTS < 0.0) {
221 
222  THROW(JValueOutOfRange, "Illegal value of TTS [ns]: " << TTS);
223  }
224  }
void load(const char *file_name)
Load from input file.
scattered light from EM shower
Definition: JPDFTypes.hh:41
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
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:110
JPDF_t pdfA
PDF for shower.
Definition: JPDF_t.hh:266
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
void add(const JMultiFunction_t &input)
Add function.
direct light from EM shower
Definition: JPDFTypes.hh:40
JPDFType_t
PDF types.
Definition: JPDFTypes.hh:27
int numberOfPoints
Definition: JResultPDF.cc:22
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
JPP::JPDFTable< JFunction1D_t, JPDFMaplist_t > JPDF_t
Definition: JPDF_t.hh:162

Member Function Documentation

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 at minimum distance of approach [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 241 of file JPDF_t.hh.

247  {
248  using namespace JPP;
249 
250  result_type h1 = pdfA(D, cd, theta, phi, t1) * E;
251 
252  // safety measures
253 
254  if (h1.f <= 0.0) {
255  h1.f = 0.0;
256  h1.fp = 0.0;
257  }
258 
259  if (h1.v <= 0.0) {
260  h1.v = 0.0;
261  }
262 
263  return h1;
264  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
JPDF_t pdfA
PDF for shower.
Definition: JPDF_t.hh:266
then for HISTOGRAM in h0 h1
Definition: JMatrixNZ.sh:69
JFunction1D_t::result_type result_type
Definition: JPDF_t.hh:163
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37

Member Data Documentation

JPDF_t JShowerPDF_t::pdfA

PDF for shower.

Definition at line 266 of file JPDF_t.hh.


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