Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
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_t
JNPE_t
 

Public Member Functions

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

Private Attributes

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

Detailed Description

Auxiliary data structure for shower PDF.

Definition at line 164 of file JNPE_t.hh.

Member Typedef Documentation

Definition at line 169 of file JNPE_t.hh.

Definition at line 170 of file JNPE_t.hh.

Constructor & Destructor Documentation

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::WILD_CARD.

Parameters
fileDescriptorPDF file descriptor
numberOfPointsnumber of points for shower elongation

Definition at line 181 of file JNPE_t.hh.

182  :
184  {
185  using namespace std;
186  using namespace JPP;
187 
188  const JPDFType_t pdf_t[] = { SCATTERED_LIGHT_FROM_EMSHOWER,
190 
191  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
192 
194  JCollection,
195  double> JFunction1D_t;
196  typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_t;
197 
198 
199  const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
200 
201  for (int i = 0; i != N; ++i) {
202 
203  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
204 
205  cout << "loading input from file " << file_name << "... " << flush;
206 
207  JPDF_t pdf;
208 
209  pdf.load(file_name.c_str());
210 
211  pdf.setExceptionHandler(supervisor);
212 
213  if (npe.empty())
214  npe = JNPE_t(pdf);
215  else
216  npe.add(JNPE_t(pdf));
217 
218  F[i] = JNPE_t(pdf);
219 
220  cout << "OK" << endl;
221  }
222  }
int numberOfPoints
Definition: JNPE_t.hh:282
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition: JNPE_t.hh:170
scattered light from EM shower
Definition: JPDFTypes.hh:41
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
Template class for spline interpolation in 1D.
Definition: JSpline.hh:657
void add(const JNPETable &input)
Add NPE table.
Definition: JNPETable.hh:124
JNPE_t F[2]
PDF for shower.
Definition: JNPE_t.hh:284
direct light from EM shower
Definition: JPDFTypes.hh:40
JPDFType_t
PDF types.
Definition: JPDFTypes.hh:27
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
JNPE_t npe
PDF for shower.
Definition: JNPE_t.hh:283

Member Function Documentation

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

243  {
244  using namespace std;
245  using namespace JPP;
246 
247  double Y = 0.0;
248 
249  if (numberOfPoints > 0) {
250 
251  const double W = 1.0 / (double) numberOfPoints;
252 
253  for (int i = 0; i != numberOfPoints; ++i) {
254 
255  const double z = geanz.getLength(E, (i + 0.5) / (double) numberOfPoints);
256 
257  const double __D = sqrt(D*D - 2.0*(D*cd)*z + z*z);
258  const double __cd = (D * cd - z) / __D;
259 
260  try {
261  Y += W * npe (__D, __cd, theta, phi);
262  }
263  catch(const exception& error) {
264  //cerr << error.what() << endl;
265  }
266  }
267 
268  } else {
269 
270  try {
271  Y = npe(D, cd, theta, phi);
272  }
273  catch(const exception& error) {
274  //cerr << error.what() << endl;
275  }
276  }
277 
278  return E * Y;
279  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
int numberOfPoints
Definition: JNPE_t.hh:282
static const JGeanz geanz(1.85, 0.62, 0.54)
Function object for longitudinal EM-shower profile.
double getLength(const double E, const double P, const double eps=1.0e-3) const
Get shower length for a given integrated probability.
Definition: JGeanz.hh:122
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
JNPE_t npe
PDF for shower.
Definition: JNPE_t.hh:283

Member Data Documentation

int JShowerNPE_t::numberOfPoints
private

Definition at line 282 of file JNPE_t.hh.

JNPE_t JShowerNPE_t::npe
private

PDF for shower.

Definition at line 283 of file JNPE_t.hh.

JNPE_t JShowerNPE_t::F[2]
private

PDF for shower.

Definition at line 284 of file JNPE_t.hh.


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