39 int main(
int argc,
char **argv)
44 typedef JAbstractHistogram<Double_t> JHistogram_t;
58 JParser<> zap(
"Program to plot PDF of Cherenkov light from EM-shower using interpolation tables.");
63 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
64 zap[
'x'] =
make_field(
x,
"histogram x-binning") = JHistogram_t();
65 zap[
'y'] =
make_field(
y,
"histogram y-binning") = JHistogram_t();
72 catch(
const exception &error) {
73 FATAL(error.what() << endl);
77 const double theta = dir.first;
78 const double phi = dir.second;
80 typedef JSplineFunction1S_t JFunction1D_t;
82 JMapList<JPolint1FunctionalMap,
83 JMapList<JPolint1FunctionalMap,
84 JMapList<JPolint1FunctionalGridMap,
85 JMapList<JPolint1FunctionalGridMap> > > > JMapList_t;
86 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
87 typedef JNPETable<double, double, JMapList_t> JNPE_t;
88 typedef JCDFTable<JFunction1D_t, JMapList_t> JCDF_t;
90 JDistance<double>::precision = 1.0e-10;
98 NOTICE(
"loading input from file " << pdfFile <<
"... " << flush);
100 pdf.load(pdfFile.c_str());
102 pdf.setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
108 NOTICE(
"loading input from file " << cdfFile <<
"... " << flush);
110 cdf.load(cdfFile.c_str());
114 catch(
const JException& error) {
115 FATAL(error.what() << endl);
118 if (!
x.is_valid()) {
x = JHistogram_t(250, 0.0, 250.0); }
119 if (!
y.is_valid()) {
y = JHistogram_t(200, -1.0, +1.0); }
121 TH2D h0(
"pdf", NULL,
x.getNumberOfBins(),
x.getLowerLimit(),
x.getUpperLimit(),
y.getNumberOfBins(),
y.getLowerLimit(),
y.getUpperLimit());
122 TH2D h1(
"npe", NULL,
x.getNumberOfBins(),
x.getLowerLimit(),
x.getUpperLimit(),
y.getNumberOfBins(),
y.getLowerLimit(),
y.getUpperLimit());
123 TH2D h2(
"cdf", NULL,
x.getNumberOfBins(),
x.getLowerLimit(),
x.getUpperLimit(),
y.getNumberOfBins(),
y.getLowerLimit(),
y.getUpperLimit());
125 for (
int i = 1;
i <= h0.GetNbinsX(); ++
i) {
126 for (
int j = 1;
j <= h0.GetNbinsY(); ++
j) {
128 const double D = h0.GetXaxis()->GetBinCenter(
i);
129 const double cd = h0.GetYaxis()->GetBinCenter(
j);
133 const double y0 =
get_integral(pdf(D, cd, theta, phi, 1.0e3));
134 const double y1 = npe (D, cd, theta, phi);
135 const double y2 =
cdf.getNPE (D, cd, theta, phi);
138 <<
FIXED(5,1) << D <<
' '
139 <<
FIXED(5,1) << cd <<
' '
144 h0.SetBinContent(
i,
j,
E * y0);
145 h1.SetBinContent(
i,
j,
E * y1);
146 h2.SetBinContent(
i,
j,
E * y2);
148 catch(
const exception& error) {
158 out << h0 << h1 << h2;
Utility class to parse command line options.
int main(int argc, char *argv[])
then usage $script< input file >[option[primary[working directory]]] nWhere option can be E
static const JZero zero
Function object to assign zero value.
Auxiliary data structure for floating point format specification.
Various implementations of functional maps.
Numbering scheme for PDF types.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
then for FUNCTION in pdf npe cdf
std::istream & operator>>(std::istream &in, JAANET::JHead &header)
Read header from input.
Utility class to parse command line options.
std::pair< double, double > orientation
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Auxiliary data structure for floating point format specification.
do echo Generating $dir eval D
#define DEBUG(A)
Message macros.