#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 "TH1F.h"
#include "TH2F.h"
#include "Jeep/JParser.hh"
#include "JMarkov/JPhotonPath.hh"
#include "JMarkov/JPhotonPathReader.hh"
#include "JMarkov/JScatteringModel.hh"
Go to the source code of this file.
◆ main()
Definition at line 42 of file JMarkovPathReader.cc.
42 {
44 <<
"Written by Martijn Jongen" <<
endl
46
51
52 try {
58
59
60
61
62
64 return 1 ;
65 }
66 }
67 catch(const exception &error) {
69 cout <<
"Type '" <<
argv[0] <<
" -h!' to display the command-line options." <<
endl ;
70 exit(1) ;
71 }
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
115 if( f->IsZombie() ) {
117 exit(1) ;
118 }
121 cerr <<
"Could not read JScatteringModel from file!" <<
endl ;
122 exit(1) ;
123 }
124 cout <<
"JScatteringModel loaded" <<
endl
125 <<
" absorption length = " <<
sm->getAbsorptionLength() <<
" m" <<
endl
126 <<
" scattering length = " <<
sm->getScatteringLength() <<
" m" <<
endl
128
129
130
132
133
134
138
140 reader.open(
it->c_str()) ;
141 if( !reader.is_open() ) {
142 cerr <<
"FATAL ERROR: unable to open input file '" << *
it <<
"'." <<
endl ;
143 exit(1) ;
144 }
147 while( reader.hasNext() ) {
148 p = reader.next() ;
153 }
155 reader.close() ;
156 }
158 cout <<
"Done reading paths." <<
endl ;
160
162
163
170 }
171 }
172
173
181 }
182 }
183
184 cout <<
"Determining histogram ranges." <<
endl ;
189
190 double INF = 1.0/0.0 ;
191 double MININF = -1.0/0.0 ;
201 }
202 }
203
204
206
209 if( length > Lmax[
nscat] ) Lmax[
nscat] = length ;
210 if( length < Lmin[
nscat] ) Lmin[
nscat] = length ;
211
215 min(posmin[
nscat][
j].getY(),p->at(
j).getY()),
216 min(posmin[
nscat][
j].getZ(),p->at(
j).getZ()) ) ;
218 max(posmax[
nscat][
j].getY(),p->at(
j).getY()),
219 max(posmax[
nscat][
j].getZ(),p->at(
j).getZ()) ) ;
220 }
221 }
222 }
224
225 cout <<
"Allocating histograms." <<
endl ;
226
238
244
247
250
254
258
259 double ctmax = 1+1e-8 ;
263
267
272
284
288
292
299
306
313 }
314 }
316
317
318 cout <<
"Filling histograms." <<
endl ;
321
326
327 {
330 }
331
332 {
336 }
337
339 double x = p->at(
j).getX() ;
340 double y = p->at(
j).getY() ;
341 double z = p->at(
j).getZ() ;
348 }
349 }
350 }
352
353
354 cout <<
"Normalizing histograms." <<
endl ;
369 }
370 }
371
372
378
394 }
396 }
399
401
403
404 return 0 ;
405}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for position in three dimensions.
Data structure for normalised vector in three dimensions.
double getLength()
get the total path length
Virtual base class for a scattering model.
Template definition of a multi-dimensional oscillation probability interpolation table.
JReader & read(JReader &in) override final
Read from input.