49 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
53 double> JFunction1D_t;
54 typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_t;
57 const JNPE_t::JSupervisor supervisor(
new JNPE_t::JDefaultResult(
zero));
59 for (
int i = 0; i !=
N; ++i) {
63 const string file_name =
getFilename(fileDescriptor, pdf_t[i]);
65 cout <<
"loading PDF from file " << file_name <<
"... " << flush;
67 pdf.load(file_name.c_str());
71 pdf.setExceptionHandler(supervisor);
81 cout <<
"adding PDFs... " << flush;
83 Y1[1].add(
Y1[0]);
Y1.erase(
Y1.begin());
84 YB[1].add(
YB[0]);
YB.erase(
YB.begin());
105 const double phi)
const
109 const double yA =
getNPE(
Y1, R, theta, phi);
110 const double yB =
getNPE(
YB, R, theta, phi);
143 if (R <= i->getXmax()) {
147 const double y =
get_value((*i)(std::max(R, i->getXmin()), theta, phi));
153 catch(
const exception& error) {
154 cerr << error.what() << endl;
194 const int N =
sizeof(pdf_t) /
sizeof(pdf_t[0]);
198 double> JFunction1D_t;
199 typedef JPDFTable<JFunction1D_t, JNPEMaplist_t> JPDF_t;
202 const JNPE_t::JSupervisor supervisor(
new JNPE_t::JDefaultResult(
zero));
204 for (
int i = 0; i !=
N; ++i) {
206 const string file_name =
getFilename(fileDescriptor, pdf_t[i]);
208 cout <<
"loading input from file " << file_name <<
"... " << flush;
212 pdf.load(file_name.c_str());
214 pdf.setExceptionHandler(supervisor);
223 cout <<
"OK" << endl;
245 const double phi)
const
260 const double __D = sqrt(D*D - 2.0*(D*cd)*z + z*z);
261 const double __cd = (D * cd - z) / __D;
264 Y += W * npe (__D, __cd, theta, phi);
266 catch(
const exception& error) {
274 Y = npe(D, cd, theta, phi);
276 catch(
const exception& error) {
JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalGridMap, JPP::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
double calculate(const double E, const double R, const double theta, const double phi) const
Get PDF.
do echo Generating $dir eval D
JShowerNPE_t(const std::string &fileDescriptor, const int numberOfPoints=0)
Constructor.
The elements in a collection are sorted according to their abscissa values and a given distance opera...
std::vector< JNPE_t > Y1
light from muon
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
scattered light from EM shower
JMuonNPE_t(const std::string &fileDescriptor)
Constructor.
JPP::JNPETable< double, double, JNPEMaplist_t > JNPE_t
static const double MASS_MUON
muon mass [GeV]
static const double INDEX_OF_REFRACTION_WATER
Average index of refraction of water corresponding to the group velocity.
Auxiliary data structure for shower PDF.
direct light from EM showers
static const JZero zero
Function object to assign zero value.
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
JPP::JMAPLIST< JPP::JPolint1FunctionalMap, JPP::JPolint1FunctionalGridMap, JPP::JPolint1FunctionalGridMap >::maplist JNPEMaplist_t
Definition of zero value for any class.
Numbering scheme for PDF types.
void add(const JNPETable &input)
Add NPE table.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
scattered light from muon
static double getNPE(const std::vector< JNPE_t > &NPE, const double R, const double theta, const double phi)
Get number of photo-electrons.
static const JGeanz geanz(1.85, 0.62, 0.54)
Function object for longitudinal EM-shower profile.
direct light from EM shower
scattered light from EM showers
General purpose class for a collection of sorted elements.
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable NORTH set_variable EAST set_variable SOUTH set_variable WEST set_variable WORKDIR tmp set_variable R set_variable CT set_variable YMAX set_variable YMIN if do_usage *then usage $script[distance] fi case set_variable R
std::vector< JNPE_t > YB
light from EM showers
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
Longitudinal emission profile EM-shower.
double getLength(const double E, const double P, const double eps=1.0e-3) const
Get shower length for a given integrated probability.
then usage $script[input file[working directory[option]]] nWhere option can be N
double calculate(const double E, const double D, const double cd, const double theta, const double phi) const
Get PDF.
then usage $script[input file[working directory[option]]] nWhere option can be E
JNPE_t npe
PDF for shower.