Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JShowerNPE_t Struct Reference

Auxiliary data structure for shower PDF. More...

#include <JNPE_t.hh>

Public Types

typedef JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalGridMap, JPP::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
 
typedef JPP::JNPETable< double, double, JNPEMaplist_tJNPE_t
 

Public Member Functions

 JShowerNPE_t (const std::string &fileDescriptor, const int numberOfPoints=0)
 Constructor.
 
double calculate (const double E, const double D, const double cd, const double theta, const double phi) const
 Get PDF.
 

Private Attributes

int numberOfPoints
 
JNPE_t npe
 PDF for shower.
 
JNPE_t F [2]
 PDF for shower.
 

Detailed Description

Auxiliary data structure for shower PDF.

Definition at line 175 of file JNPE_t.hh.

Member Typedef Documentation

◆ JNPEMaplist_t

◆ JNPE_t

Definition at line 181 of file JNPE_t.hh.

Constructor & Destructor Documentation

◆ JShowerNPE_t()

JShowerNPE_t::JShowerNPE_t ( const std::string & fileDescriptor,
const int numberOfPoints = 0 )
inline

Constructor.

The PDF file descriptor should contain the wild card character JPHYSICS::WILDCARD.

Parameters
fileDescriptorPDF file descriptor
numberOfPointsnumber of points for shower elongation

Definition at line 192 of file JNPE_t.hh.

193 :
195 {
196 using namespace std;
197 using namespace JPP;
198
199 const JPDFType_t pdf_t[] = { SCATTERED_LIGHT_FROM_EMSHOWER,
200 DIRECT_LIGHT_FROM_EMSHOWER };
201
202 const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
203
206 double> JFunction1D_t;
208
209
210 const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
211
212 for (int i = 0; i != N; ++i) {
213
214 const string file_name = getFilename(fileDescriptor, pdf_t[i]);
215
216 cout << "loading input from file " << file_name << "... " << flush;
217
218 JPDF_t pdf;
219
220 pdf.load(file_name.c_str());
221
222 pdf.setExceptionHandler(supervisor);
223
224 if (npe.empty())
225 npe = JNPE_t(pdf);
226 else
227 npe.add(JNPE_t(pdf));
228
229 F[i] = JNPE_t(pdf);
230
231 cout << "OK" << endl;
232 }
233 }
void add(const JNPETable &input)
Add NPE table.
Definition JNPETable.hh:130
Multi-dimensional PDF table for arrival time of Cherenkov light.
Definition JPDFTable.hh:44
General purpose class for collection of elements, see: <a href="JTools.PDF";>Collection of elements....
Definition JSet.hh:22
Template class for spline interpolation in 1D.
Definition JSpline.hh:734
JPDFType_t
PDF types.
Definition JPDFTypes.hh:24
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JNPE_t npe
PDF for shower.
Definition JNPE_t.hh:294
JNPE_t F[2]
PDF for shower.
Definition JNPE_t.hh:295
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition JNPE_t.hh:181
int numberOfPoints
Definition JNPE_t.hh:293

Member Function Documentation

◆ calculate()

double JShowerNPE_t::calculate ( const double E,
const double D,
const double cd,
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
Eshower energy at minimum distance of approach [GeV]
Ddistance [m]
cdcosine emission angle
thetaPMT zenith angle [rad]
phiPMT azimuth angle [rad]
Returns
hypothesis value

Definition at line 249 of file JNPE_t.hh.

254 {
255 using namespace std;
256 using namespace JPP;
257
258 double Y = 0.0;
259
260 if (numberOfPoints > 0) {
261
262 const double W = 1.0 / (double) numberOfPoints;
263
264 for (int i = 0; i != numberOfPoints; ++i) {
265
266 const double z = geanz.getLength(E, (i + 0.5) / (double) numberOfPoints);
267
268 const double __D = sqrt(D*D - 2.0*(D*cd)*z + z*z);
269 const double __cd = (D * cd - z) / __D;
270
271 try {
272 Y += W * npe (__D, __cd, theta, phi);
273 }
274 catch(const exception& error) {
275 //cerr << error.what() << endl;
276 }
277 }
278
279 } else {
280
281 try {
282 Y = npe(D, cd, theta, phi);
283 }
284 catch(const exception& error) {
285 //cerr << error.what() << endl;
286 }
287 }
288
289 return E * Y;
290 }

Member Data Documentation

◆ numberOfPoints

int JShowerNPE_t::numberOfPoints
private

Definition at line 293 of file JNPE_t.hh.

◆ npe

JNPE_t JShowerNPE_t::npe
private

PDF for shower.

Definition at line 294 of file JNPE_t.hh.

◆ F

JNPE_t JShowerNPE_t::F[2]
private

PDF for shower.

Definition at line 295 of file JNPE_t.hh.


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