36 int main(
int argc,
char **argv)
54 JParser<> zap(
"Program to verify generation of arrival times of Cherenkov photons from a muon using tabulated CDF.");
58 zap[
'E'] =
make_field(E,
"muon energy [GeV]") = 1.0;
59 zap[
'R'] =
make_field(R,
"distance of approach [m]");
60 zap[
'D'] =
make_field(dir,
"(theta, phi) of PMT [rad]");
67 catch(
const exception& error) {
68 FATAL(error.what() << endl);
80 const int N = inputFile.size();
87 for (
int i = 0; i != N; ++i) {
89 NOTICE(
"loading input from file " << inputFile[i] <<
"... " << flush);
93 cdf [i].load(inputFile[i].c_str());
99 FATAL(error.what() << endl);
109 cout <<
"> " << flush;
114 for (
int i = 0; i != N; ++i) {
127 cout <<
' ' <<
FIXED(6,2) << t <<
' ' <<
FIXED(5,2) << npe;
129 catch(
const exception& error) {
130 ERROR(error.what() << endl);
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());
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) {
194 ERROR(error.what() << endl);
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) {
225 for (
int j = gRandom->Poisson(npe);
j != 0; --
j) {
227 const double x = gRandom->Rndm();
233 catch(
const exception& error) {
234 NOTICE(error.what() << endl);
242 const double W = 1.0 / (double) numberOfEvents;
245 timer.
print(cout, W);
Various implementations of functional maps.
Dynamic ROOT object management.
General purpose messaging.
#define DEBUG(A)
Message macros.
Numbering scheme for PDF types.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
int main(int argc, char **argv)
Auxiliary class for CPU timing and usage.
void print(std::ostream &out, const JScale_t scale=milli_t) const
Print timer data.
Data structure for angles in three dimensions.
double getTheta() const
Get theta angle.
double getPhi() const
Get phi angle.
Utility class to parse command line options.
Multi-dimensional CDF table for arrival time of Cherenkov light.
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
void Write(TDirectory &out, const bool wm=false)
Write objects to file.
JAbstractHistogram< double > JHistogram_t
Type definition for scan along axis.
void convertToPDF(TH1 &h1, const std::string &option="NW", const double factor=1.0)
Convert 1D histogram to PDF.
double getDeltaRaysFromMuon(const double E, const JRange< double > T_GeV=JRange< double >(DELTARAY_TMIN, DELTARAY_TMAX))
Equivalent EM-shower energy due to delta-rays per unit muon track length.
bool is_deltarays(const int pdf)
Test if given PDF type corresponds to Cherenkov light from delta-rays.
bool is_bremsstrahlung(const int pdf)
Test if given PDF type corresponds to Cherenkov light from Bremsstrahlung.
@ DIRECT_LIGHT_FROM_MUON
direct light from muon
int getPDFType(const std::string &file_name)
Get PDF type.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.