43int main(
int argc,
char**argv)
56 size_t numberOfEvents;
82 zap[
'M'] =
make_field(
morphology,
"morphology: \"<type> (parameters)+\"\n\twhere <type> can be:" << get_keys(morphology_helper));
83 zap[
'r'] =
make_field(resolution,
"resolution: \"<type> (parameters)+\"\n\twhere <type> can be:" << get_keys(resolution_helper));
84 zap[
'B'] =
make_field(background,
"number of events / s / sr") = 0.0;
85 zap[
'O'] =
make_field(omega,
"effective bin width [sr]") = 1.0e-4;
91 catch(
const exception &error) {
101 const time_t Tmax_s =
UTC.getUpperLimit().getTime();
105 const double xmin = getRadians(X.getLowerLimit());
106 const double xmax = getRadians(X.getUpperLimit());
107 const double ymin =
sin(getRadians(Y.getLowerLimit()));
108 const double ymax =
sin(getRadians(Y.getUpperLimit()));
110 const double V = (
ymax -
ymin) * (xmax - xmin);
112 x0 = 1.0 - V / (sqrt(2.0)*2.0*PI);
114 const double dx = omega / (2.0*PI);
115 const int nx = (
int) ((1.0 - x0) /
dx);
120 X.getNumberOfBins(), X.getLowerLimit(), X.getUpperLimit(),
121 Y.getNumberOfBins(), Y.getLowerLimit(), Y.getUpperLimit());
126 TH2D hs(
"hs",
NULL, 100, 0.0, NUMBER_OF_SECONDS_PER_SEDERIAL_DAY / NUMBER_OF_SECONDS_PER_HOUR, 100, -1.0, +1.0);
128 for (
size_t counter = 0; counter != numberOfEvents; ++counter) {
159 hs.Fill(
fmod(t1, NUMBER_OF_SECONDS_PER_SEDERIAL_DAY) / NUMBER_OF_SECONDS_PER_HOUR,
u3.getDZ());
161 if (!parameters.ct(
u3.getDZ())) {
183 const double x = getDegrees(
asin(vs.
getDX() -
us.getDX()));
184 const double y = getDegrees(
asin(vs.
getDY() -
us.getDY()));
189 const double dot = getDot(
us, vs);
197 if (background > 0.0) {
199 NOTICE(
"Background: " <<
FIXED(9,5) << background * (Tmax_s -
Tmin_s) * omega <<
" events / bin" <<
endl);
204 const double xmin = getRadians(h2.GetXaxis()->GetBinLowEdge(
ix));
205 const double xmax = getRadians(h2.GetXaxis()->GetBinUpEdge (
ix));
206 const double ymin =
sin(getRadians(h2.GetYaxis()->GetBinLowEdge(
iy)));
207 const double ymax =
sin(getRadians(h2.GetYaxis()->GetBinUpEdge (
iy)));
209 const double omega = (
ymax -
ymin) * (xmax - xmin);
211 const double mu = background * omega * (Tmax_s -
Tmin_s);
213 const double x = h2.GetXaxis()->GetBinCenter(
ix);
214 const double y = h2.GetYaxis()->GetBinCenter(
iy);
215 const double z =
gRandom->Poisson(mu);
221 const double xmin = getRadians(X.getLowerLimit());
222 const double xmax = getRadians(X.getUpperLimit());
223 const double ymin =
sin(getRadians(Y.getLowerLimit()));
224 const double ymax =
sin(getRadians(Y.getUpperLimit()));
226 const double omega = (
ymax -
ymin) * (xmax - xmin);
228 const double mu = background * omega * (Tmax_s -
Tmin_s);
230 const size_t N =
gRandom->Poisson(mu);
232 for (
size_t i = 0; i != N; ++i) {
234 const double x =
gRandom->Uniform(xmin, xmax);
237 g1.put(getDegrees(x), getDegrees(
asin(y)));
239 const double dot = sqrt(1.0 - y*y -
sin(x)*
sin(x));
248 out <<
ha << h1 << h2 <<
hs;