36 typedef JAbstractHistogram<double> JHistogram_t;
49 JParser<> zap(
"Program to plot PDF of Cherenkov light from EM-shower using interpolation tables.");
53 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
54 zap[
'R'] =
make_field(
D,
"distance from vertex to PMT [m]");
55 zap[
'x'] =
make_field(
x,
"histogram x-binning") = JHistogram_t();
62 catch(
const exception &error) {
63 FATAL(error.what() << endl);
76 typedef JPolint0Function1D_t JFunction1D_t;
78 JMapList<JPolint1FunctionalMap,
79 JMapList<JPolint1FunctionalMap,
80 JMapList<JPolint1FunctionalGridMap,
81 JMapList<JPolint1FunctionalGridMap> > > > JMapList_t;
82 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
83 typedef JNPETable<double, double, JMapList_t> JNPE_t;
85 JDistance<double>::precision = 1.0e-10;
87 const int N = inputFile.size();
94 for (
int i = 0;
i !=
N; ++
i) {
96 NOTICE(
"loading input from file " << inputFile[
i] <<
"... " << flush);
98 pdf[
i].load(inputFile[
i].c_str());
100 pdf[
i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
102 npe[
i] = JNPE_t(pdf[
i]);
104 npe[
i].setExceptionHandler(
new JFunction<double, double>::JDefaultResult(
JMATH::zero));
109 catch(
const JException& error) {
110 FATAL(error.what() << endl);
118 if (!
x.is_valid()) {
x = JHistogram_t(100000, -1.0, +1.0); }
120 TH1D h0(
"h0",
"PDF Projection; D [m]; P [npe]",
x.getNumberOfBins(),
x.getLowerLimit(),
x.getUpperLimit());
123 for (
int ix = 1; ix <= h0.GetNbinsX(); ++ix) {
125 const double cd = h0.GetBinCenter(ix);
131 const double W = 1.0 / (double)
Z.size();
135 const double __D = sqrt(
D*
D - 2.0*(
D*cd)*(*z) + (*z)*(*z));
136 const double __cd = (
D * cd - (*z)) / __D;
138 for (
int i = 0;
i !=
N; ++
i) {
140 Y += W * npe[
i](__D, __cd, dir.getTheta(), dir.getPhi());
142 catch(
const exception& error) {}
148 for (
int i = 0;
i !=
N; ++
i) {
149 Y += npe[
i](
D, cd, dir.getTheta(), dir.getPhi());
153 h0.SetBinContent(ix, Y);
161 for (
double cd; ; ) {
163 cout <<
"> " << flush;
166 for (
int i = 0;
i !=
N; ++
i) {
167 cout <<
i <<
' ' <<
FIXED(9,5) << npe[
i](
D, cd, dir.getTheta(), dir.getPhi()) << endl;
Utility class to parse command line options.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
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
Auxiliary data structure for floating point format specification.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
static const JGeanz geanz(1.85, 0.62, 0.54)
Function object for longitudinal EM-shower profile.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
do set_variable MODULE getModule a $WORKDIR detector_a datx L $STRING JEditDetector a $WORKDIR detector_a datx M $MODULE setz o $WORKDIR detector_a datx JEditDetector a $WORKDIR detector_b datx M $MODULE setz o $WORKDIR detector_b datx done echo Output stored at $WORKDIR detector_a datx and $WORKDIR tripod_a txt JDrawDetector2D a $WORKDIR detector_a datx a $WORKDIR detector_b datx L BL o detector $FORMAT $BATCH JDrawDetector2D T $WORKDIR tripod_a txt T $WORKDIR tripod_b txt L BL o tripod $FORMAT $BATCH JCompareDetector a $WORKDIR detector_a datx b $WORKDIR detector_b datx o $WORKDIR abc root &dev null for KEY in X Y Z
double getLength(const double E, const double P, const double eps=1.0e-3) const
Get shower length for a given integrated probability.
do echo Generating $dir eval D