16#include "TPolyLine3D.h" 
   17#include "TPolyMarker3D.h" 
   37int main( 
int argc, 
char** argv ) {
 
   38  cout << 
"JMarkovPathSelecter" << endl 
 
   39       << 
"Written by Martijn Jongen" << endl 
 
   41  cout << 
"Type '" << argv[0] << 
" -h!' to display the command-line options." << endl ;
 
   56    zap[
"f"] = 
make_field(ifname,
"input file name (binary file containing JPhotonPaths)") ;
 
   57    zap[
"o"] = 
make_field(ofname,
"output file name (binary file containing a selection of the JPhotonPaths)") ;
 
   58    zap[
"shadow"] = 
make_field(shadow,
"flag to turn on shadowing") ;
 
   59    zap[
"x"] = 
make_field(x,
"x coordinate for shadowing") = 0 ;
 
   60    zap[
"y"] = 
make_field(y,
"y coordinate for shadowing") = 0 ;
 
   61    zap[
"z"] = 
make_field(z,
"z coordinate for shadowing") = 0.5*37 ;
 
   62    zap[
"r"] = 
make_field(r,
"radius for shadowing") = 0.2159 ;
 
   64    if (zap.
read(argc, argv) != 0) {
 
   68  catch(
const exception &error) {
 
   70    cerr << error.what() ;
 
   75  cout << 
"SELECTION CRITERIA:" << endl ;
 
   77    cout << 
"Will exclude all paths intersecting a sphere of radius " << r << 
" m" 
   78         << 
", centered at (" << x << 
", " << y << 
", " << z << 
")" << endl ;
 
   84  reader.open(ifname.c_str()) ;
 
   85  if( !reader.is_open() ) {
 
   86    cerr << 
"FATAL ERROR: unable to open input file '" << ifname << 
"'." << endl ;
 
   92  cout << 
"Reading file" << endl ;
 
   94  while( reader.hasNext() ) {
 
  101    cerr << 
"FATAL ERROR: could not read any JPhotonPaths from the input file '" << ifname << 
"'." << endl ;
 
  104  cout << 
"Done reading file. Read " << nread << 
" paths from it." << endl ;
 
  111  cout << 
"Writing selected paths to '" << ofname << 
"'." << endl ;
 
  113  writer.
open(ofname.c_str()) ;
 
  115    if( shadow && it->hitsSphere(DOMpos,r) ) continue ;
 
  123  cout << 
"Selected " << nselected << 
" / " << nread 
 
  124       << 
" photon paths." << endl
 
  125       << 
"Output written to '" << ofname << 
"'." << endl ;
 
 
int main(int argc, char **argv)
 
Utility class to parse command line options.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
Data structure for position in three dimensions.
 
virtual void open(const char *file_name) override
Open file.
 
virtual void close()
Close file.
 
virtual bool put(const T &object)=0
Object output.
 
Utility class to parse command line options.
 
int read(const int argc, const char *const argv[])
Parse the program's command line options.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).