Jpp test-rotations-old-533-g2bdbdb559
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 177 of file JNPE_t.hh.

Member Typedef Documentation

◆ JNPEMaplist_t

◆ JNPE_t

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

195 :
197 {
198 using namespace std;
199 using namespace JPP;
200
201 const JPDFType_t pdf_t[] = {
202 SCATTERED_LIGHT_FROM_EMSHOWER,
203 DIRECT_LIGHT_FROM_EMSHOWER
204 };
205
206 const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
207
210 double> JFunction1D_t;
212
213
214 const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
215
216 for (int i = 0; i != N; ++i) {
217
218 const string file_name = getFilename(fileDescriptor, pdf_t[i]);
219
220 cout << "loading input from file " << file_name << "... " << flush;
221
222 JPDF_t pdf;
223
224 pdf.load(file_name.c_str());
225
226 pdf.setExceptionHandler(supervisor);
227
228 if (npe.empty())
229 npe = JNPE_t(pdf);
230 else
231 npe.add(JNPE_t(pdf));
232
233 F[i] = JNPE_t(pdf);
234
235 cout << "OK" << endl;
236 }
237 }
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:298
JNPE_t F[2]
PDF for shower.
Definition JNPE_t.hh:299
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition JNPE_t.hh:183
int numberOfPoints
Definition JNPE_t.hh:297

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

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

Member Data Documentation

◆ numberOfPoints

int JShowerNPE_t::numberOfPoints
private

Definition at line 297 of file JNPE_t.hh.

◆ npe

JNPE_t JShowerNPE_t::npe
private

PDF for shower.

Definition at line 298 of file JNPE_t.hh.

◆ F

JNPE_t JShowerNPE_t::F[2]
private

PDF for shower.

Definition at line 299 of file JNPE_t.hh.


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