103{
  107 
  109  JLimit_t&   numberOfEvents = inputFile.getLimit();
 
  111  string      detectorFile;
  113 
  114  try {
  115 
  116    JParser<> zap(
"Program to histogram event-by-event data of muon light for making PDFs.");
 
  117 
  123 
  124    zap(argc, argv);
  125  }
  126  catch(const exception &error) {
  127    FATAL(error.what() << endl);
 
  128  }
  129 
  130 
  132 
  133  try {
  135  }
  138  }
  139 
  141 
  144 
  145  NOTICE(
"Apply detector offset " << offset << endl);
 
  146 
  148 
  150 
  152 
  153  const double P_atm = NAMESPACE::getAmbientPressure();
  155    
  157 
  159 
  164 
  166 
  167  JMultiHistogram_t h0;   
  168  JMultiHistogram_t h1;   
  169  JMultiHistogram_t h2;   
  170 
  171  const double cmin = dispersion.getKmin (wmax);
  172 
  173  h1.transformer.reset(new JFunction3DTransformer_t(35.0, 2, cmin, 0.0,  NAMESPACE::getAngularAcceptance, 0.10));
  174  h2.transformer.reset(new JFunction3DTransformer_t(35.0, 2, cmin, 0.0,  NAMESPACE::getAngularAcceptance, 0.10));
  175 
  176 
  177  
  178 
  179  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 };
  180 
  181  for (int i = 0; i != sizeof(R)/sizeof(R[0]); ++i) {
  182 
  183    const double R_m = R[i];
  184    
  185    const double grid  = 10.0 +  0.0 * R_m/100.0;                         
  186    const double alpha = 2.0 * sqrt(1.0 - cos(grid * PI / 180.0));        
  187    
  188    const int    number_of_theta_points = max(2, (int) (180.0/(1.4 * grid)));
  189    const double theta_step             = PI / (number_of_theta_points + 1);
  190    
  191    for (double theta = -0.5*theta_step; theta < PI + theta_step; theta += theta_step) {
  192      
  193      const int    number_of_phi_points = max(2, (int) (PI * sin(theta) / alpha));
  194      const double phi_step             = PI / (number_of_phi_points + 1);
  195      
  196      for (double phi = -0.5*phi_step; phi < PI + phi_step; phi += phi_step) {
  197 
  198        for (JMultiHistogram_t* p : { &h0, &h1, &h2 }) {
  199          (*p)[R_m][theta][phi];
  200        }
  201      }
  202    }
  203  }
  204 
  205  for (JMultiHistogram_t::super_iterator 
  206         i1 = h1.super_begin(),
  207         i2 = h2.super_begin(); i1 != h1.super_end(); ++i1, ++i2) {
  208 
  209    for (double x : { 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} ) {
  212    }
  213  }
  214 
  215 
  217 
  219 
  220    const Evt* 
event = inputFile.
next();
 
  221 
  222    for (vector<Trk>::const_iterator track = event->mc_trks.begin(); track != event->mc_trks.end(); ++track) {
  223 
  225 
  226        
  227 
  230 
  232 
  234 
  236 
  238 
  239        for (vector<Hit>::const_iterator hit = event->mc_hits.begin(); hit != event->mc_hits.end(); ++hit) {
  240        
  241          try {
  242        
  243            JAxis3D axis = pmtRouter.getPMT(hit->pmt_id);
 
  244 
  246 
  248        
  249            const double R_m   = axis.
getX();
 
  250            const double theta = axis.
getTheta();
 
  251            const double phi   = fabs(axis.
getPhi());
 
  252            const double dt    = 
getTime(*hit) - t1;
 
  253            const double npe   = 
getNPE (*hit);
 
  254 
  255            const int    ID    = (KM3Sim ? classify_km3sim(*track, *hit) : classify(*track, *hit));
 
  256            
  258 
  259            case 1:
  260              h1.fill(R_m, theta, phi, dt, npe);                  
  261              break;
  262 
  263            case 2:
  264              h2.fill(R_m, theta, phi, dt, npe / max(1.0, Evis)); 
  265              break;
  266            }
  267          }
  268          catch(const exception& error) {
  269            FATAL(error.what() << endl);
 
  270          }
  271        }
  272 
  273 
  274        for (JDetector::const_iterator module = 
detector.begin(); module != 
detector.end(); ++module) {
 
  275          
  277 
  279 
  281 
  283 
  284            for (JModule::const_iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
  285          
  287 
  289 
  290              if (Z(axis.
getZ() - axis.
getX()/getTanThetaC())) {
 
  292              }
  293            }
  294          }
  295        }
  296      }
  297    }
  298  }
  300 
  301 
  302  
  303 
  305 
  306  for (const JMultiHistogram_t* p : { &h0, &h1, &h2 }) {
  307    out.store(*p);
  308  }
  309 
  310  out.close();
  311}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
Router for direct addressing of PMT data in detector data structure.
 
void transform(const JAxis3D &axis)
Transform axis to reference frame of given axis.
 
Data structure for position in three dimensions.
 
JPosition3D & rotate(const JRotation3D &R)
Rotate.
 
double getY() const
Get y position.
 
double getZ() const
Get z position.
 
JVector3D & sub(const JVector3D &vector)
Subtract vector.
 
double getX() const
Get x position.
 
double getTheta() const
Get theta angle.
 
double getPhi() const
Get phi angle.
 
double getT(const JVector3D &pos) const
Get arrival time of Cherenkov light at given position.
 
Binary buffered file output.
 
Utility class to parse command line options.
 
Implementation of dispersion for water in deep sea.
 
General purpose class for object reading from a list of file names.
 
virtual bool hasNext() override
Check availability of next element.
 
counter_type getCounter() const
Get counter.
 
virtual const pointer_type & next() override
Get next element.
 
JDirection3D getDirection(const Vec &dir)
Get direction.
 
bool is_km3sim(const JHead &header)
Check for detector simulation.
 
JVertex3D getVertex(const Trk &track)
Get vertex.
 
JPosition3D getPosition(const Vec &pos)
Get position.
 
bool is_muon(const Trk &track)
Test whether given track is a (anti-)muon.
 
double getNPE(const Hit &hit)
Get true charge of hit.
 
Vec getOffset(const JHead &header)
Get offset.
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
 
static const JGeaneWater gWater
Function object for energy loss of muon in sea water.
 
const double getSpeedOfLight()
Get speed of light.
 
double getMaximalWavelength()
Get maximal wavelength for PDF evaluations.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
double getVisibleEnergy(const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
Get the visible energy of a track.
 
Vec getVisibleEnergyVector(const Trk &track, const JCylinder3D &can=getMaximumContainmentVolume())
Get the visible energy vector of a track.
 
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
 
const char * getTime()
Get current local time conform ISO-8601 standard.
 
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
 
The cylinder used for photon tracking.
 
Auxiliary class for defining the range of iterations of objects.
 
static counter_type max()
Get maximum counter value.
 
The Vec class is a straightforward 3-d vector, which also works in pyroot.