31 int main(
int argc,
char **argv)
36 typedef JAbstractHistogram<double> JHistogram_t;
49 JParser<> zap(
"Program to plot PDF of Cherenkov light from muon using interpolation tables.");
53 zap[
'E'] =
make_field(
E,
"muon energy [GeV]") = 1.0;
54 zap[
'R'] =
make_field(
R,
"distance of approach [m]");
55 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
56 zap[
'T'] =
make_field(TTS_ns,
"PMT time smearing [ns]") = 0.0;
62 catch(
const exception &error) {
63 FATAL(error.what() << endl);
67 typedef JSplineFunction1S_t JFunction1D_t;
69 typedef JMAPLIST<JPolint1FunctionalMap,
70 JPolint1FunctionalGridMap,
71 JPolint1FunctionalGridMap>::maplist JMapList_t;
72 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
74 const int N = inputFile.size();
81 for (
int i = 0;
i !=
N; ++
i) {
83 NOTICE(
"loading input from file " << inputFile[
i] <<
"... " << flush);
87 pdf [
i].load(inputFile[i].c_str());
89 pdf [
i].setExceptionHandler(
new JFunction1D_t::JDefaultResult(
JMATH::zero));
98 catch(
const JException& error) {
99 FATAL(error.what() << endl);
105 for (
double dt; cin >> dt; ) {
107 for (
int i = 0;
i !=
N; ++
i) {
109 JFunction1D_t::result_type
y = pdf[
i](
R, dir.getTheta(), dir.getPhi(), dt);
117 cout << setw(2) << type[
i] <<
' '
119 <<
FIXED(5,1) << R <<
' '
120 <<
FIXED(5,2) << dir.getTheta() <<
' '
121 <<
FIXED(5,2) << dir.getPhi() <<
' '
122 <<
FIXED(5,1) << dt <<
' '
141 const double t0 = 0.0;
147 histogram = JHistogram_t(t0 - 20.0, t0 + 50.0);
153 histogram = JHistogram_t(t0 - 20.0, t0 + 500.0);
163 for (
int i = 1;
i <= h0.GetNbinsX(); ++
i) {
165 const double dt = h0.GetBinCenter(
i) - t0;
169 for (
int j = 0;
j !=
N; ++
j) {
171 JFunction1D_t::result_type
y = pdf[
j](
R, dir.getTheta(), dir.getPhi(), dt);
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.
then warning Cannot perform comparison test for histogram
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.
Various implementations of functional maps.
Numbering scheme for PDF types.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
int getPDFType(const std::string &file_name)
Get PDF type.
then JCookie sh JDataQuality D $DETECTOR_ID R
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Utility class to parse command line options.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
double getDeltaRaysFromMuon(const double E)
Equivalent EM-shower energy due to delta-rays per unit muon track length.
Auxiliary data structure for floating point format specification.