32 int main(
int argc,
char **argv)
37 string fileDescriptor;
51 zap[
'O'] =
make_field(option) =
"KM3NeT",
"Antares";
61 catch(
const exception &error) {
62 FATAL(error.what() << endl);
66 typedef JSplineFunction1S_t JFunction1D_t;
68 JMapList<JPolint1FunctionalMap,
69 JMapList<JPolint1FunctionalGridMap,
70 JMapList<JPolint1FunctionalGridMap> > > JMapList_t;
71 typedef JPDFTable<JFunction1D_t, JMapList_t> JPDF_t;
81 const double TTS = 2.0;
85 const int NUMBER_OF_PDFS =
sizeof(pdf_t)/
sizeof(pdf_t[0]);
87 JPDF_t pdf[NUMBER_OF_PDFS];
89 const JPDF_t::JSupervisor supervisor(
new JPDF_t::JDefaultResult(
JMATH::zero));
91 for (
int i = 0; i != NUMBER_OF_PDFS; ++i) {
95 const string file_name =
getFilename(fileDescriptor, pdf_t[i]);
97 NOTICE(
"loading PDF from file " << file_name <<
"... " << flush);
99 pdf[i].load(file_name.c_str());
103 pdf[i].setExceptionHandler(supervisor);
106 catch(
const JException& error) {
107 FATAL(error.what() << endl);
116 if (option ==
"KM3NeT") {
118 PMT.push_back(JAngle3D(3.142, 0.000));
119 PMT.push_back(JAngle3D(2.582, 0.524));
120 PMT.push_back(JAngle3D(2.582, 1.571));
121 PMT.push_back(JAngle3D(2.582, 2.618));
122 PMT.push_back(JAngle3D(2.582, 3.665));
123 PMT.push_back(JAngle3D(2.582, 4.712));
124 PMT.push_back(JAngle3D(2.582, 5.760));
125 PMT.push_back(JAngle3D(2.162, 0.000));
126 PMT.push_back(JAngle3D(2.162, 1.047));
127 PMT.push_back(JAngle3D(2.162, 2.094));
128 PMT.push_back(JAngle3D(2.162, 3.142));
129 PMT.push_back(JAngle3D(2.162, 4.189));
130 PMT.push_back(JAngle3D(2.162, 5.236));
131 PMT.push_back(JAngle3D(1.872, 0.524));
132 PMT.push_back(JAngle3D(1.872, 1.571));
133 PMT.push_back(JAngle3D(1.872, 2.618));
134 PMT.push_back(JAngle3D(1.872, 3.665));
135 PMT.push_back(JAngle3D(1.872, 4.712));
136 PMT.push_back(JAngle3D(1.872, 5.760));
137 PMT.push_back(JAngle3D(1.270, 0.000));
138 PMT.push_back(JAngle3D(1.270, 1.047));
139 PMT.push_back(JAngle3D(1.270, 2.094));
140 PMT.push_back(JAngle3D(1.270, 3.142));
141 PMT.push_back(JAngle3D(1.270, 4.189));
142 PMT.push_back(JAngle3D(1.270, 5.236));
143 PMT.push_back(JAngle3D(0.980, 0.524));
144 PMT.push_back(JAngle3D(0.980, 1.571));
145 PMT.push_back(JAngle3D(0.980, 2.618));
146 PMT.push_back(JAngle3D(0.980, 3.665));
147 PMT.push_back(JAngle3D(0.980, 4.712));
148 PMT.push_back(JAngle3D(0.980, 5.760));
150 }
else if (option ==
"Antares") {
152 PMT.push_back(JAngle3D(2.36, +1.05));
153 PMT.push_back(JAngle3D(2.36, 3.14));
154 PMT.push_back(JAngle3D(2.36, -1.05));
158 FATAL(
"Fatal error at detector option " << option << endl);
164 const JRotation3D
R(dir);
167 *i = JDirection3D(*i).rotate(R);
174 TH1D h0(
"L0", NULL, 300, 1.0, 151.0);
175 TH1D h1(
"L1", NULL, 300, 1.0, 151.0);
178 for (
int i = 1; i <= h0.GetNbinsX(); ++i) {
180 const double R = h0.GetBinCenter(i);
186 V += (pdf[0](
R, pmt->getTheta(), fabs(pmt->getPhi()), 0.0).V +
187 pdf[1](
R, pmt->getTheta(), fabs(pmt->getPhi()), 0.0).V +
188 pdf[2](
R, pmt->getTheta(), fabs(pmt->getPhi()), 0.0).V * E_GeV +
189 pdf[3](
R, pmt->getTheta(), fabs(pmt->getPhi()), 0.0).V * E_GeV);
192 h0.SetBinContent(i, 1.0 - TMath::PoissonI(0,V));
200 const double Tmin = -15.0;
201 const double Tmax = +250.0;
202 const double dt = 1.0;
205 for (
int i = 1; i <= h1.GetNbinsX(); ++i) {
207 const double R = h1.GetBinCenter(i);
211 for (
double x = Tmin;
x <= Tmax;
x += dt) {
217 Vi[pmt] = ((pdf[0](
R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x + TMax_ns).
v +
218 pdf[1](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x + TMax_ns).
v +
219 pdf[2](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x + TMax_ns).
v * E_GeV +
220 pdf[3](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x + TMax_ns).
v * E_GeV)
224 (pdf[0](
R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
v +
225 pdf[1](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
v +
226 pdf[2](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
v * E_GeV +
227 pdf[3](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
v * E_GeV));
238 const double y = (pdf[0](
R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
f +
239 pdf[1](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
f +
240 pdf[2](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
f * E_GeV +
241 pdf[3](R,
PMT[pmt].getTheta(), fabs(
PMT[pmt].getPhi()),
x).
f * E_GeV);
244 Y += y * (1.0 - TMath::PoissonI(0, V - Vi[pmt])) * dt;
249 h1.SetBinContent(i, 1.0 - TMath::PoissonI(0,Y));
Utility class to parse command line options.
int main(int argc, char *argv[])
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
direct light from EM showers
static const JZero zero
Function object to assign zero value.
then fatal Wrong number of arguments fi set_variable STRING $argv[1] set_variable DETECTORXY_TXT $WORKDIR $DETECTORXY_TXT tail read X Y CHI2 RMS printf optimum n $X $Y $CHI2 $RMS awk v Y
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Various implementations of functional maps.
Numbering scheme for PDF types.
scattered light from muon
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
scattered light from EM showers
General purpose messaging.
Empty structure for specification of parser element that is not initialised (i.e. does require input)...
then JCookie sh JDataQuality D $DETECTOR_ID R
Utility class to parse command line options.
std::string getFilename(const std::string &file_name)
Get file name part, i.e. part after last JEEP::PATHNAME_SEPARATOR if any.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.