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

Member Typedef Documentation

Definition at line 172 of file JNPE_t.hh.

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

185  :
187  {
188  using namespace std;
189  using namespace JPP;
190 
191  const JPDFType_t pdf_t[] = { SCATTERED_LIGHT_FROM_EMSHOWER,
193 
194  const int N = sizeof(pdf_t) / sizeof(pdf_t[0]);
195 
197  JCollection,
198  double> JFunction1D_t;
199  typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_t;
200 
201 
202  const JNPE_t::JSupervisor supervisor(new JNPE_t::JDefaultResult(zero));
203 
204  for (int i = 0; i != N; ++i) {
205 
206  const string file_name = getFilename(fileDescriptor, pdf_t[i]);
207 
208  cout << "loading input from file " << file_name << "... " << flush;
209 
210  JPDF_t pdf;
211 
212  pdf.load(file_name.c_str());
213 
214  pdf.setExceptionHandler(supervisor);
215 
216  if (npe.empty())
217  npe = JNPE_t(pdf);
218  else
219  npe.add(JNPE_t(pdf));
220 
221  F[i] = JNPE_t(pdf);
222 
223  cout << "OK" << endl;
224  }
225  }
int numberOfPoints
Definition: JNPE_t.hh:285
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
Definition: JNPE_t.hh:173
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:287
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:286

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

246  {
247  using namespace std;
248  using namespace JPP;
249 
250  double Y = 0.0;
251 
252  if (numberOfPoints > 0) {
253 
254  const double W = 1.0 / (double) numberOfPoints;
255 
256  for (int i = 0; i != numberOfPoints; ++i) {
257 
258  const double z = geanz.getLength(E, (i + 0.5) / (double) numberOfPoints);
259 
260  const double __D = sqrt(D*D - 2.0*(D*cd)*z + z*z);
261  const double __cd = (D * cd - z) / __D;
262 
263  try {
264  Y += W * npe (__D, __cd, theta, phi);
265  }
266  catch(const exception& error) {
267  //cerr << error.what() << endl;
268  }
269  }
270 
271  } else {
272 
273  try {
274  Y = npe(D, cd, theta, phi);
275  }
276  catch(const exception& error) {
277  //cerr << error.what() << endl;
278  }
279  }
280 
281  return E * Y;
282  }
do echo Generating $dir eval D
Definition: JDrawLED.sh:50
int numberOfPoints
Definition: JNPE_t.hh:285
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
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:286

Member Data Documentation

int JShowerNPE_t::numberOfPoints
private

Definition at line 285 of file JNPE_t.hh.

JNPE_t JShowerNPE_t::npe
private

PDF for shower.

Definition at line 286 of file JNPE_t.hh.

JNPE_t JShowerNPE_t::F[2]
private

PDF for shower.

Definition at line 287 of file JNPE_t.hh.


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