52 template<
class JMultiHistogram_t>
65 detector -=
JCenter3D(detector.begin(), detector.end());
68 detector -= get<JPosition3D>(head);
79 int operator()(
const Trk& track,
const Hit& hit)
const
82 return classify_km3sim(track, hit);
84 return classify_km3(track, hit);
99 inline double getEnergy(
const Evt&
event,
const Trk& track,
const JAxis3D& axis)
const
119 int classify_km3(
const Trk& track,
const Hit& hit)
const
121 if (track.id == hit.origin) {
147 int classify_km3sim(
const Trk& track,
const Hit& hit)
const
164 int main(
int argc,
char **argv)
177 JParser<> zap(
"Program to histogram event-by-event data of muon light for making PDFs.");
181 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
187 catch(
const exception &error) {
188 FATAL(error.what() << endl);
198 load(detectorFile, detector);
222 JMultiHistogram_t h0;
223 JMultiHistogram_t h1;
224 JMultiHistogram_t h2;
226 const JHitClassifier<JMultiHistogram_t> classifier(head, detector);
228 const double cmin = dispersion.
getKmin (wmax);
236 const double R[] = { 0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 70.0, 80.0, 90.0, 100.0, 170.0, 250.0 };
238 for (
int i = 0; i !=
sizeof(R)/
sizeof(R[0]); ++i) {
240 const double R_m = R[i];
242 const double grid = 10.0 + 0.0 * R_m/100.0;
243 const double alpha = 2.0 * sqrt(1.0 - cos(grid *
PI / 180.0));
245 const int number_of_theta_points = max(2, (
int) (180.0/(1.4 * grid)));
246 const double theta_step =
PI / (number_of_theta_points + 1);
248 for (
double theta = -0.5*theta_step; theta <
PI + theta_step; theta += theta_step) {
250 const int number_of_phi_points = max(2, (
int) (
PI * sin(theta) / alpha));
251 const double phi_step =
PI / (number_of_phi_points + 1);
253 for (
double phi = -0.5*phi_step; phi <
PI + phi_step; phi += phi_step) {
255 for (JMultiHistogram_t* buffer[] = { &h0, &h1, &h2, NULL }, **histogram = buffer; *histogram != NULL; ++histogram) {
256 (**histogram)[R_m][theta][phi];
262 for (JMultiHistogram_t::super_iterator
263 i1 = h1.super_begin(),
264 i2 = h2.super_begin(); i1 != h1.super_end(); ++i1, ++i2) {
266 for (
double buffer[] = { 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.5, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 85.0, 100.0, 125.0, 150.0, 200.0, 500.0, -1.0 }, *x = buffer; *x >= 0.0; ++x) {
273 while (inputFile.hasNext()) {
275 NOTICE(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
STATUS(endl);
277 const Evt*
event = inputFile.next();
288 double t0 = track->t;
304 const double E1 = classifier.getEnergy(*event, *track, axis);
307 const double R_m = axis.
getX();
308 const double theta = axis.
getTheta();
309 const double phi = fabs(axis.
getPhi());
310 const double dt =
getTime(*hit) - t1;
311 const double npe =
getNPE(*hit);
313 switch (classifier(*track, *hit)) {
316 h1.fill(R_m, theta, phi, dt, npe);
320 h2.fill(R_m, theta, phi, dt, npe/max(1.0, E1));
324 catch(
const exception& error) {
325 FATAL(error.what() << endl);
330 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
340 for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
362 for (
const JMultiHistogram_t* buffer[] = { &h0, &h1, &h2, NULL }, **i = buffer; *i != NULL; ++i) {
Router for direct addressing of PMT data in detector data structure.
Utility class to parse command line options.
double getKmin(const double lambda) const
Get smallest index of refraction for Bremsstrahlung light (i.e.
JWriter & store(const JSerialisable &object)
Write object.
static const JGeane gWater(2.67e-1 *JTOOLS::DENSITY_SEA_WATER, 3.4e-4 *JTOOLS::DENSITY_SEA_WATER)
Function object for Energy loss of muon in sea water.
Data structure for direction in three dimensions.
Scattered light from muon.
Implementation of dispersion for water in deep sea.
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
Optical properties of Antares deep-sea site.
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
Scattered light from Bremsstrahlung.
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT.
Direct light from Bremsstrahlung.
double getTime(const Hit &hit)
Get true time of hit.
double getPhi() const
Get phi angle.
Data structure for detector geometry and calibration.
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
Various implementations of functional maps.
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
Auxiliary class for defining the range of iterations of objects.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Optical properties of KM3NeT deep-sea site.
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
Trk get_hadronic_cascade(const Evt &evt)
Auxiliary function to get average direction and total energy of a hadronic cascade.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getTheta() const
Get theta angle.
double getAmbientPressure()
Get ambient pressure.
double getY() const
Get y position.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Direct access to PMT in detector data structure.
const JPosition3D & getPosition() const
Get position.
General purpose messaging.
Template specialisation of JMultipleFileScanner for Monte Carlo header.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
ROOT TTree parameter settings.
double getX() const
Get x position.
JDirection3D getDirection(const Vec &v)
Get direction.
bool is_km3sim(const JHead &header)
Check for generator.
double getNPE(const Hit &hit)
Get true charge of hit.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Binary buffered file output.
double getZ() const
Get z position.
JPosition3D getPosition(const Vec &v)
Get position.
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
int main(int argc, char *argv[])
bool from_muon(const Hit &hit)
Test whether given hit was produced by a muon.