#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <cstdlib>
#include "TRandom3.h"
#include "TFile.h"
#include "TPolyLine3D.h"
#include "TPolyMarker3D.h"
#include "TAxis3D.h"
#include "TView.h"
#include "TView3D.h"
#include "TCanvas.h"
#include "TPad.h"
#include "Jeep/JParser.hh"
#include "JMarkov/JPhotonPath.hh"
#include "JMarkov/JPhotonPathReader.hh"
#include "JMarkov/JPhotonPathWriter.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 37 of file JMarkovPathSelecter.cc.
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()) ;
86 cerr <<
"FATAL ERROR: unable to open input file '" << ifname <<
"'." << endl ;
92 cout <<
"Reading file" << endl ;
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 ;
Utility class to parse command line options.
virtual void open(const char *file_name) override
Open file.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
virtual bool put(const T &object) override
Object output.
int read(const int argc, const char *const argv[])
Parse the program's command line options.
virtual void close()
Close file.
Data structure for position in three dimensions.