26{
29
32 int numberOfEvents;
33 int option;
35
36 try {
37
39
40 JParser<> zap(
"Example program to histogram PMT transit time distribution.");
41
47
48 zap(argc, argv);
49 }
50 catch(const exception &error) {
51 FATAL(error.what() << endl);
52 }
53
55 cout << "PMT parameters:" << endl;
57 }
58
59 parameters.
TTS_ns = -option;
60
62
64
65 TH1D h1("tts", NULL, 1300, -30.0, +100.0);
66 TH1D h2("pmt", NULL, 130, -30.0, +100.0);
67
68 double W = 0.0;
69
70 for (int i = 1; i <= h1.GetNbinsX(); ++i) {
71
72 const double t1 = h1.GetBinCenter(i);
74 const double z = h1.GetBinWidth (i);
75
76 h1.SetBinContent(i, y);
77
79 }
80
81 h1.Scale(1.0 / W, "nosw2");
82
83 if (numberOfEvents > 0) {
84
85 for (int i = 0; i != numberOfEvents; ++i) {
86
87 const double t0 = 0.0;
88 const double t1 = cpu.getRandomTime(t0);
89
90 h2.Fill(t1);
91 }
92
93 h2.Scale(1.0 / numberOfEvents);
94 }
95
96 out.Write();
97 out.Close();
98}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for PMT parameters.
double TTS_ns
transition time spread [ns]
JProperties getProperties(const JEquationParameters &equation=JPMTParameters::getEquationParameters())
Get properties of this class.
Utility class to parse parameter values.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
PMT analogue signal processor.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...