Go to the documentation of this file.
51 int main(
int argc,
char **argv)
57 JLimit_t& numberOfEvents = inputFile.getLimit();
65 JParser<> zap(
"Program to histogram event-by-event data of shower light for making PDFs.");
69 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
76 catch(
const exception &error) {
77 FATAL(error.what() << endl);
81 NOTICE(
"Plotting hadronic showers." << endl);
83 NOTICE(
"Plotting EM showers." << endl);
98 NOTICE(
"Apply detector offset " << center << endl);
123 JMultiHistogram_t h0;
124 JMultiHistogram_t h1;
132 for (JQuadrature::const_iterator i = qeant.begin(); i != qeant.end(); ++i) {
141 const double R[] = {0.0, 2.5, 5.0, 7.5, 10.0, 12.5, 15.0, 17.5, 20.0, 25.0, 30.0, 35.0, 40.0, 50.0, 60.0, 70.0, 80.0};
142 const double Dmax_m = 80.0;
144 for (
int i = 0; i !=
sizeof(R)/
sizeof(R[0]); ++i) {
146 const double R_m = R[i];
150 const double cd = *c;
152 const double grid = 10.0 + 0.0 * R_m/100.0;
153 const double alpha = 2.0 * sqrt(1.0 - cos(grid *
PI / 180.0));
155 const int number_of_theta_points = max(2, (
int) (180.0/(1.4 * grid)));
156 const double theta_step =
PI / (number_of_theta_points + 1);
158 for (
double theta = -0.5*theta_step; theta <
PI + theta_step; theta += theta_step) {
160 const int number_of_phi_points = max(2, (
int) (
PI * sin(theta) / alpha));
161 const double phi_step =
PI / (number_of_phi_points + 1);
163 for (
double phi = -0.5*phi_step; phi <
PI + phi_step; phi += phi_step) {
165 for (JMultiHistogram_t* buffer[] = { &h0, &h1, NULL }, **histogram = buffer; *histogram != NULL; ++histogram) {
166 (**histogram)[R_m][cd][theta][phi];
173 double buffer[] = { 0.0, 0.5, 1.0, 1.5, 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 };
174 for (JMultiHistogram_t::super_iterator
175 i1 = h1.super_begin(); i1 != h1.super_end(); ++i1) {
177 for (
int j = 0;
j !=
sizeof(buffer)/
sizeof(buffer[0]); ++
j) {
178 i1.getValue()[buffer[
j]];
186 const Evt*
event = inputFile.
next();
196 WARNING(
"No electron/hadrons found. Perhaps you meant to run this program in hadronic mode." << endl);
221 const double cd = axis.
getZ()/D_m;
222 const double theta = axis.
getTheta();
223 const double phi = fabs(axis.
getPhi());
224 const double dt =
getTime(*hit) - t1;
225 const double npe =
getNPE(*hit);
228 h1.fill(D_m, cd, theta, phi, dt, npe/E);
232 catch(
const exception& error) {
233 FATAL(error.what() << endl);
237 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
247 for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
259 for (JMultiHistogram_t::super_iterator i = h0.super_begin(); i != h0.super_end(); ++i) {
260 integral+=i.getValue().getIntegral();
262 DEBUG(
"Integral:\t" << integral << endl);
268 NOTICE(
"Storing, " << flush);
270 for (
const JMultiHistogram_t* buffer[] = { &h0, &h1, NULL }, **i = buffer; *i != NULL; ++i) {
const Trk & get_electron(const Evt &evt)
Get first electron from the event tracklist.
Binary buffered file output.
Auxiliary class for defining the range of iterations of objects.
bool from_electron(const Hit &hit)
Test whether given hit was produced by an electron.
double getZ() const
Get z position.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
double E
Energy (either MC truth or reconstructed)
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
Data structure for direction in three dimensions.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
double getNPE(const Hit &hit)
Get true charge of hit.
Utility class to parse command line options.
double t
track time (when the particle is at pos )
Router for direct addressing of PMT data in detector data structure.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
int main(int argc, char **argv)
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
counter_type getCounter() const
Get counter.
double getTheta() const
Get theta angle.
virtual const pointer_type & next()
Get next element.
double getAmbientPressure()
Get ambient pressure.
bool from_hadron(const Hit &hit)
Test whether given hit was produced by a hadronic shower.
Implementation of dispersion for water in deep sea.
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
Data structure for position in three dimensions.
double getTime(const Hit &hit)
Get true time of hit.
virtual bool hasNext()
Check availability of next element.
Trk get_hadronic_cascade(const Evt &evt)
Auxiliary function to get average direction and total energy of a hadronic cascade.
JDirection3D getDirection(const Vec &v)
Get direction.
int count_electrons(const Evt &evt)
Count the number of electrons in a given event.
Function object for the probability density function of photon emission from EM-shower as a function ...
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose class for object reading from a list of file names.
const JPosition3D & getPosition() const
Get position.
JPosition3D getPosition(const Vec &v)
Get position.
virtual double getIndexOfRefractionGroup(const double lambda) const
Index of refraction for group velocity.
#define DEBUG(A)
Message macros.
int count_hadrons(const Evt &evt)
Count the number of hadrons in a given event (not including neutral pions)
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
double getLength() const
Get length.
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT.
double getPhi() const
Get phi angle.