36int main(
int argc,
char **argv)
54 JParser<> zap(
"Program to verify generation of arrival times of Cherenkov photons from a muon using tabulated CDF.");
67 catch(
const exception& error) {
80 const int N = inputFile.size();
87 for (
int i = 0; i != N; ++i) {
89 NOTICE(
"loading input from file " << inputFile[i] <<
"... " << flush);
91 type[i] = getPDFType(inputFile[i]);
93 cdf [i].
load(inputFile[i].c_str());
109 cout <<
"> " << flush;
114 for (
int i = 0; i != N; ++i) {
121 if (is_bremsstrahlung(type[i])) {
123 }
else if (is_deltarays(type[i])) {
124 npe *= JDeltaRays::getEnergyLossFromMuon(E);
129 catch(
const exception& error) {
143 if (inputFile.size() == 1 && getPDFType(inputFile[0]) == DIRECT_LIGHT_FROM_MUON) {
151 const double t0 = 0.0;
160 for ( ; x < -10.0; x += 5.0) { X.push_back(t0 + x); }
161 for ( ; x < +20.0; x += 1.0) { X.push_back(t0 + x); }
162 for ( ; x < +50.0; x += 2.0) { X.push_back(t0 + x); }
165 for ( ; x < +100.0; x += 5.0) { X.push_back(t0 + x); }
166 for ( ; x < +250.0; x += 10.0) { X.push_back(t0 + x); }
167 for ( ; x < +500.0; x += 25.0) { X.push_back(t0 + x); }
168 for ( ; x < +900.0; x += 50.0) { X.push_back(t0 + x); }
171 h0 =
new TH1D(
"h0",
NULL, X.size() - 1, X.data());
180 JManager<int, TH1D>
H1(
new TH1D(
"h1[%]",
NULL, 100000, 0.0, +1.0));
182 for (
int i = 0; i != N; ++i) {
184 for (
int j = 1; j <=
H1->GetNbinsX(); ++j) {
188 const double x =
H1->GetBinCenter(j);
191 H1[i]->SetBinContent(j, t);
193 catch(
const exception& error) {
199 if (numberOfEvents > 0) {
205 for (
int counter = 0; counter != numberOfEvents; ++counter) {
207 if (counter%1000== 0) {
213 for (
int i = 0; i != N; ++i) {
219 if (is_bremsstrahlung(type[i])) {
221 }
else if (is_deltarays(type[i])) {
222 npe *= JDeltaRays::getEnergyLossFromMuon(E);
225 for (
int j =
gRandom->Poisson(npe); j != 0; --j) {
227 const double x =
gRandom->Rndm();
233 catch(
const exception& error) {
242 const double W = 1.0 / (
double) numberOfEvents;
248 convertToPDF(*h0,
"WE", W);