56 |
CALL HCDIR('//FIELD1',' ') |
CALL HCDIR('//FIELD1',' ') |
57 |
call HRIN(ntpl_Bmap,9999,0) !puts B map ntuple in memory |
call HRIN(ntpl_Bmap,9999,0) !puts B map ntuple in memory |
58 |
|
|
59 |
call HPRNTU(ntpl_Bmap) |
|
60 |
call HBNAME(ntpl_Bmap,' ',0,'$CLEAR') |
call HBNAME(ntpl_Bmap,' ',0,'$CLEAR') |
61 |
call HBNAME(ntpl_Bmap,'INDEX',index,'$SET') |
call HBNAME(ntpl_Bmap,'INDEX',index,'$SET') |
62 |
call HBNAME(ntpl_Bmap,'BX',pfx,'$SET') |
call HBNAME(ntpl_Bmap,'BX',pfx,'$SET') |
149 |
|
|
150 |
|
|
151 |
|
|
|
|
|
152 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
153 |
c |
c |
154 |
c *** SECOND MAP *** |
c *** SECOND MAP *** |
159 |
CALL HCDIR('//FIELD2',' ') |
CALL HCDIR('//FIELD2',' ') |
160 |
call HRIN(ntpl_Bmap,9999,0) !puts B map ntuple in memory |
call HRIN(ntpl_Bmap,9999,0) !puts B map ntuple in memory |
161 |
|
|
162 |
call HPRNTU(ntpl_Bmap) |
|
163 |
call HBNAME(ntpl_Bmap,' ',0,'$CLEAR') |
call HBNAME(ntpl_Bmap,' ',0,'$CLEAR') |
164 |
call HBNAME(ntpl_Bmap,'INDEX',index,'$SET') |
call HBNAME(ntpl_Bmap,'INDEX',index,'$SET') |
165 |
call HBNAME(ntpl_Bmap,'BX',pfx,'$SET') |
call HBNAME(ntpl_Bmap,'BX',pfx,'$SET') |
256 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
257 |
|
|
258 |
print*,' ' |
print*,' ' |
259 |
print*,'MAGNETIC FIELD SUCCESSFULLY READ' |
print*,'INTERNAL MAGNETIC FIELD SUCCESSFULLY READ' |
260 |
|
print*,' ' |
261 |
|
print*,' ' |
262 |
|
|
263 |
|
|
264 |
|
c------------------------------------------------------------------------ |
265 |
|
c |
266 |
|
c *** EXTERNAL MAP *** |
267 |
|
c |
268 |
|
c------------------------------------------------------------------------ |
269 |
|
|
270 |
|
c------------------------------------------------------------------------ |
271 |
|
c |
272 |
|
c initialization and map file opening |
273 |
|
c |
274 |
|
c------------------------------------------------------------------------ |
275 |
|
|
276 |
|
|
277 |
|
CALL HCDIR('//FIELD3',' ') |
278 |
|
|
279 |
|
call HRIN(ntpl_Bmap,9999,0) !puts B map ntuple in memory |
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
call HBNAME(ntpl_Bmap,' ',0,'$CLEAR') |
284 |
|
call HBNAME(ntpl_Bmap,'INDEX',index,'$SET') |
285 |
|
call HBNAME(ntpl_Bmap,'BX',pfx,'$SET') |
286 |
|
call HBNAME(ntpl_Bmap,'BY',pfy,'$SET') |
287 |
|
call HBNAME(ntpl_Bmap,'BZ',pfz,'$SET') |
288 |
|
|
289 |
|
|
290 |
|
c------------------------------------------------------------------------ |
291 |
|
c |
292 |
|
c reads events and fills variables |
293 |
|
c |
294 |
|
c------------------------------------------------------------------------ |
295 |
|
|
296 |
|
call HNOENT(ntpl_Bmap,iemax) !number of events |
297 |
|
|
298 |
|
c initializes measurement grid edges |
299 |
|
do ic=1,3 |
300 |
|
poxmax(ic)=0. |
301 |
|
poxmin(ic)=0. |
302 |
|
poymax(ic)=0. |
303 |
|
poymin(ic)=0. |
304 |
|
pozmax(ic)=0. |
305 |
|
pozmin(ic)=0. |
306 |
|
enddo |
307 |
|
|
308 |
|
|
309 |
|
do iev=1,iemax !event loop |
310 |
|
|
311 |
|
call HGNT(ntpl_Bmap,iev,ierr) !reads event |
312 |
|
if(ierr.ne.0) goto 22 |
313 |
|
|
314 |
|
c the output consists of matrices for coordinates, B components values |
315 |
|
c and errors: |
316 |
|
c e.g. px1(4,2) = X coordinate of the point with index = 4 along X, |
317 |
|
c in which By (=2) component has been measured |
318 |
|
c e.g. b1(3,23,4,1) = Bx (=1) component value, measured in the point with |
319 |
|
c indexes = 3,23,4 along X, Y and Z |
320 |
|
|
321 |
|
c Bx component |
322 |
|
pox(index(1),1) = pfx(1) |
323 |
|
if(pox(index(1),1).lt.poxmin(1)) poxmin(1)=pox(index(1),1) |
324 |
|
if(pox(index(1),1).gt.poxmax(1)) poxmax(1)=pox(index(1),1) |
325 |
|
poy(index(2),1) = pfx(2) |
326 |
|
if(poy(index(2),1).lt.poymin(1)) poymin(1)=poy(index(2),1) |
327 |
|
if(poy(index(2),1).gt.poymax(1)) poymax(1)=poy(index(2),1) |
328 |
|
poz(index(3),1) = pfx(3) |
329 |
|
if(poz(index(3),1).lt.pozmin(1)) pozmin(1)=poz(index(3),1) |
330 |
|
if(poz(index(3),1).gt.pozmax(1)) pozmax(1)=poz(index(3),1) |
331 |
|
|
332 |
|
bo(index(1),index(2),index(3),1) = DBLE(ffx) |
333 |
|
|
334 |
|
|
335 |
|
c By component |
336 |
|
pox(index(1),2) = pfy(1) |
337 |
|
if(pox(index(1),2).lt.poxmin(2)) poxmin(2)=pox(index(1),2) |
338 |
|
if(pox(index(1),2).gt.poxmax(2)) poxmax(2)=pox(index(1),2) |
339 |
|
poy(index(2),2) = pfy(2) |
340 |
|
if(poy(index(2),2).lt.poymin(2)) poymin(2)=poy(index(2),2) |
341 |
|
if(poy(index(2),2).gt.poymax(2)) poymax(2)=poy(index(2),2) |
342 |
|
poz(index(3),2) = pfy(3) |
343 |
|
if(poz(index(3),2).lt.pozmin(2)) pozmin(2)=poz(index(3),2) |
344 |
|
if(poz(index(3),2).gt.pozmax(2)) pozmax(2)=poz(index(3),2) |
345 |
|
|
346 |
|
bo(index(1),index(2),index(3),2) = DBLE(ffy) |
347 |
|
|
348 |
|
|
349 |
|
c Bz component |
350 |
|
pox(index(1),3) = pfz(1) |
351 |
|
if(pox(index(1),3).lt.poxmin(3)) poxmin(3)=pox(index(1),3) |
352 |
|
if(pox(index(1),3).gt.poxmax(3)) poxmax(3)=pox(index(1),3) |
353 |
|
poy(index(2),3) = pfz(2) |
354 |
|
if(poy(index(2),3).lt.poymin(3)) poymin(3)=poy(index(2),3) |
355 |
|
if(poy(index(2),3).gt.poymax(3)) poymax(3)=poy(index(2),3) |
356 |
|
poz(index(3),3) = pfz(3) |
357 |
|
if(poz(index(3),3).lt.pozmin(3)) pozmin(3)=poz(index(3),3) |
358 |
|
if(poz(index(3),3).gt.pozmax(3)) pozmax(3)=poz(index(3),3) |
359 |
|
|
360 |
|
bo(index(1),index(2),index(3),3) = DBLE(ffz) |
361 |
|
|
362 |
|
enddo |
363 |
|
|
364 |
|
|
365 |
|
c------------------------------------------------------------------------ |
366 |
|
c |
367 |
|
c closes files |
368 |
|
c |
369 |
|
c------------------------------------------------------------------------ |
370 |
|
|
371 |
|
call HREND('FIELD3') |
372 |
|
|
373 |
|
c------------------------------------------------------------------------ |
374 |
|
c |
375 |
|
c no error exit |
376 |
|
c |
377 |
|
c------------------------------------------------------------------------ |
378 |
|
|
379 |
|
print*,' ' |
380 |
|
print*,'EXTERNAL MAGNETIC FIELD SUCCESSFULLY READ' |
381 |
print*,' ' |
print*,' ' |
382 |
print*,' ' |
print*,' ' |
383 |
|
|
384 |
|
|
385 |
goto 9000 !happy ending |
goto 9000 !happy ending |
386 |
|
|
401 |
22 continue |
22 continue |
402 |
|
|
403 |
print*,' ' |
print*,' ' |
404 |
print*,'read_B_inner: ERROR WHILE READING NTUPLE, AT EVENT |
print*,' ERROR WHILE READING NTUPLE, AT EVENT |
405 |
$ : ',iev |
$ : ',iev |
406 |
print*,' ' |
print*,' ' |
407 |
print*,' ' |
print*,' ' |