51 int main(
int argc,
char **argv)
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]];
182 while (inputFile.hasNext()) {
184 NOTICE(
"event: " << setw(10) << inputFile.getCounter() <<
'\r');
STATUS(endl);
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) {
Router for direct addressing of PMT data in detector data structure.
int count_electrons(const Evt &evt)
Count the number of electrons in a given event.
Utility class to parse command line options.
ROOT TTree parameter settings.
Data structure for direction in three dimensions.
double t
track time [ns] (when the particle is at pos )
Implementation of dispersion for water in deep sea.
Optical properties of Antares deep-sea site.
then for HISTOGRAM in h0 h1
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT.
double getMinimalWavelength()
Get minimal wavelength for PDF evaluations.
double getTime(const Hit &hit)
Get true time of hit.
double getPhi() const
Get phi angle.
double E
Energy [GeV] (either MC truth or reconstructed)
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.
esac $JPP_DIR examples JDetector JTransitTime o $OUTPUT_FILE n N $NPE T $TTS_NS d $DEBUG for HISTOGRAM in tts tt2 pmt
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.
const Trk & get_electron(const Evt &evt)
Get first electron from the event tracklist.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
double getTheta() const
Get theta angle.
double getAmbientPressure()
Get ambient pressure.
void load(const JString &file_name, JDetector &detector)
Load detector from input file.
Direct access to PMT in detector data structure.
double getLength() const
Get length.
then usage $script[distance] fi case set_variable R
General purpose messaging.
bool from_hadron(const Hit &hit)
Test whether given hit was produced by a hadronic shower.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Probability density function of photon emission from EM-shower as a function of cosine of the emissio...
virtual double getIndexOfRefractionGroup(const double lambda) const
Index of refraction for group velocity.
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
JDirection3D getDirection(const Vec &v)
Get direction.
double getNPE(const Hit &hit)
Get true charge of hit.
Data structure for position in three dimensions.
const JLimit & getLimit() const
Get limit.
Function object for the probability density function of photon emission from EM-shower as a function ...
bool from_electron(const Hit &hit)
Test whether given hit was produced by an electron.
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Binary buffered file output.
double getZ() const
Get z position.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
then usage $script[input file[working directory[option]]] nWhere option can be E
int count_hadrons(const Evt &evt)
Count the number of hadrons in a given event (not including neutral pions)
#define DEBUG(A)
Message macros.
JPosition3D getPosition(const Vec &v)
Get position.
double getAngularAcceptance(const double x)
Angular acceptence of PMT.
int main(int argc, char *argv[])