26{
29
31 int numberOfHits;
34
35 try {
36
38
39 JParser<> zap(
"Example program to histogram PMT simulator features.");
40
45
46 zap(argc, argv);
47 }
48 catch(const exception &error) {
49 FATAL(error.what() << endl);
50 }
51
52
54 cout << "PMT parameters:" << endl;
56 }
57
59
63
65
68
69
71
72 TProfile h0(
"tot", NULL, 1000, parameters.
threshold, 1000.0);
73 TProfile h1(
"hit", NULL, 1000, parameters.
threshold, 1000.0);
74 TProfile2D h2("2D", NULL, 50, 0.0, 250.0, 100, 0.0, 1000.0);
75
76
77 for (int i = 1; i <= h1.GetNbinsX(); ++i) {
78
79 const double t_ns = 100.0;
80 const double x = h1.GetBinCenter(i);
81 const int npe = (int) x;
82
83 for (int i = 0; i != numberOfHits; ++i) {
84
85 input .clear();
86 output.clear();
87
89
90 simulator.processHits(pmt,
calibration, status, input, output);
91
92 double tot = 0.0;
93
95 tot += hit->tot_ns;
96 }
97
98 h0.Fill(x, tot);
99 h1.Fill(x, (double) output.size());
100 }
101 }
102
103
104 for (int i = 1; i <= h2.GetXaxis()->GetNbins(); ++i) {
105 for (
int j = 1;
j <= h2.GetYaxis()->GetNbins(); ++
j) {
106
107 const double t_ns = (int) h2.GetXaxis()->GetBinCenter(i);
108 const int npe = (int) h2.GetYaxis()->GetBinCenter(j);
109
110 for (int i = 0; i != numberOfHits; ++i) {
111
112 input .clear();
113 output.clear();
114
117
118 simulator.processHits(pmt,
calibration, status, input, output);
119
120 if (!output.empty()) {
121 h2.Fill(t_ns, (double) npe, output.begin()->tot_ns);
122 }
123 }
124 }
125 }
126
127 out.Write();
128 out.Close();
129}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for time calibration.
Template data structure for PMT I/O.
std::vector< JElement_t >::const_iterator const_iterator
Data structure for PMT parameters.
double threshold
threshold [npe]
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.
Data structure for PMT analogue signal.
Auxiliary class for handling status.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...