41 {
42 cout <<
"JMarkovPathDisplayer" <<
endl
43 <<
"Written by Martijn Jongen" <<
endl
45 cout <<
"Type '" <<
argv[0] <<
" -h!' to display the command-line options." <<
endl ;
47
49 string ofname =
"out.root" ;
51
52 try {
57
59 return 1 ;
60 }
61 }
62 catch(const exception &error) {
63
64 }
65
66
72
74 reader.open(
it->c_str()) ;
75 if( !reader.is_open() ) {
76 cerr <<
"FATAL ERROR: unable to open input file '" << *
it <<
"'." <<
endl ;
77 exit(1) ;
78 }
82 p = reader.next() ;
86 }
88 reader.close() ;
89 }
91 cout <<
"Done reading paths." <<
endl ;
93
95 cerr <<
"FATAL ERROR: could not read any JPhotonPaths from the file(s)." <<
endl ;
96 exit(1) ;
97 }
98
101
102
103 double xmin = 1.0/0.0 ;
104 double xmax = -1.0/0.0 ;
105 double ymin = 1.0/0.0 ;
106 double ymax = -1.0/0.0 ;
107 double zmin = 1.0/0.0 ;
108 double zmax = -1.0/0.0 ;
109
110
113
115
116
118
122
123
125 pl->SetLineWidth(1) ;
128
130 double x =
paths[i][
j].getX() ;
131 double y =
paths[i][
j].getY() ;
132 double z =
paths[i][
j].getZ() ;
133 if( x>xmax ) xmax =
x ;
135 if( x<xmin ) xmin =
x ;
137 if( z<zmin ) zmin = z ;
138 if( z>zmax ) zmax = z ;
139 pl->SetPoint(
j, x, y, z ) ;
140 }
143 }
144
145
146
147 double range = 0 ;
148 if( xmax-xmin > range ) range = xmax-xmin ;
150 if( zmax-zmin > range ) range = zmax-zmin ;
151 range *= 1.1 ;
153
154 extra = 0.5*(range-xmax-xmin) ;
157
161
162 extra = 0.5*(range-zmax-zmin) ;
165
167 <<
"x = [ " << xmin <<
" , " << xmax <<
" ] [m]" <<
endl
168 <<
"y = [ " <<
ymin <<
" , " << xmax <<
" ] [m]" <<
endl
169 <<
"z = [ " << zmin <<
" , " << xmax <<
" ] [m]" <<
endl ;
171
172
173 cout <<
"Creating and filling TH3F" <<
endl ;
176 "Local path density;X [m];Y [m];Z [m]",
180 h3->SetOption(
"colz") ;
182 double z =
h3->GetZaxis()->GetBinCenter(
zbin) ;
186 h3->Fill(
it->getX(),
it->getY(),
it->getZ() ) ;
187 }
188 }
189 }
192
193
194 cout <<
"Creating and filling TH3F" <<
endl ;
196 "Local path density;X [m];Y [m];Z [m]",
200 h3X->SetOption(
"colz") ;
202 double x =
h3X->GetXaxis()->GetBinCenter(
xbin) ;
206 h3X->Fill(
it->getX(),
it->getY(),
it->getZ() ) ;
207 }
208 }
209 }
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243 double csize = 2048 ;
249
252
253
254
255
259 pm->SetMarkerSize(2) ;
260 pm->SetMarkerColor(
kRed) ;
261 pm->SetMarkerStyle(20) ;
263
265 (*it)->Draw() ;
266 }
267
270 cout <<
"Output in 'display.png'." <<
endl ;
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
293
298}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Data structure for position in three dimensions.
Template definition of a multi-dimensional oscillation probability interpolation table.
JReader & read(JReader &in) override final
Read from input.