29{
31
33 bool pdf;
35
36 try {
37
38 JParser<> zap(
"Auxiliary program to plot QE and angular acceptance of PMT.");
39
43
44 zap(argc, argv);
45 }
46 catch(const exception &error) {
47 FATAL(error.what() << endl);
48 }
49
50 using namespace NAMESPACE;
52
53
54 TH1D h0(
MAKE_CSTRING(
"QE[" << getNamespace() <<
"]"), NULL, 340, 280.0, 900.0);
55 TH1D h1(
MAKE_CSTRING(
"PMT[" << getNamespace() <<
"]"), NULL, 1000, -1.0, +1.0);
56
57 typedef JManager<double, TH1D> JManager_t;
58
59 JManager_t qe ((TH1D*) h0.Clone(
"QE[%]"),
'%',
JFormat_t(3, 1, ios::fixed));
60 JManager_t pmt((TH1D*) h1.Clone(
"PMT[%]"),
'%',
JFormat_t(4, 0, ios::fixed));
61
62 for (int i = 1; i <= h0.GetNbinsX(); ++i) {
63
64 const double y = h0.GetBinCenter (i);
65
66 h0.SetBinContent(i,
getQE(y));
67
68 for (
double x = -1.0;
x <= +1.0;
x += 0.1) {
69 if (KM3NET::getAngularAcceptance(x) > 0.0) {
71 }
72 }
73 }
74
75
76 double W = 0.0;
77
78 for (int i = 1; i <= h1.GetNbinsX(); ++i) {
79
80 const double x = h1.GetBinCenter (i);
81 const double dx = h1.GetBinWidth (i);
82
84
86
87 for (
double y = 340;
y <= 640;
y += 20.0) {
88 if (KM3NET::getQE(y) > 0.0) {
90 }
91 }
92 }
93
94 NOTICE(getNamespace() <<
" PMT average photo-cathode area " <<
FIXED(5,2) << W <<
" [cm^2]" << endl);
95
96 if (pdf) {
97
100
101 for (JManager_t::iterator i = qe .begin(); i != qe .end(); ++i) {
convertToPDF(*i->second,
"NW"); }
102 for (JManager_t::iterator i = pmt.begin(); i != pmt.end(); ++i) {
convertToPDF(*i->second,
"NW"); }
103 }
104
105
107
108 out << h0 << h1;
109 out << qe << pmt;
110
111 out.Write();
112 out.Close();
113}
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define MAKE_CSTRING(A)
Make C-string.
Utility class to parse command line options.
double getPhotocathodeArea()
Get photo-cathode area of PMT.
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons.
void convertToPDF(TH1 &h1, const std::string &option="NW", const double factor=1.0)
Convert 1D histogram to PDF.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const JPhotocathodeArea2D getPhotocathodeArea2D
Function object for effective photo-cathode area of PMT.
Auxiliary data structure for floating point format specification.