/[PAMELA software]/DarthVader/TrackerLevel2/src/F77/functionspfa.f
ViewVC logotype

Contents of /DarthVader/TrackerLevel2/src/F77/functionspfa.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Tue Aug 7 13:56:29 2007 UTC (17 years, 6 months ago) by pam-fi
Branch: MAIN
Changes since 1.13: +134 -106 lines
cog modified

1
2
3 subroutine idtoc(ipfa,cpfa)
4
5 integer ipfa
6 character*4 cpfa
7
8 CPFA='COG4'
9 if(ipfa.eq.0)CPFA='ETA'
10 if(ipfa.eq.2)CPFA='ETA2'
11 if(ipfa.eq.3)CPFA='ETA3'
12 if(ipfa.eq.4)CPFA='ETA4'
13 if(ipfa.eq.10)CPFA='COG'
14 if(ipfa.eq.11)CPFA='COG1'
15 if(ipfa.eq.12)CPFA='COG2'
16 if(ipfa.eq.13)CPFA='COG3'
17 if(ipfa.eq.14)CPFA='COG4'
18
19 end
20
21 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
22 * this file contains all subroutines and functions
23 * that are needed for position finding algorithms
24 *
25 *
26 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
27
28
29 integer function npfastrips(ic,PFA,angle)
30 *--------------------------------------------------------------
31 * thid function returns the number of strips used
32 * to evaluate the position of a cluster, according to the p.f.a.
33 *--------------------------------------------------------------
34 include 'commontracker.f'
35 include 'level1.f'
36 include 'calib.f'
37
38 character*4 usedPFA,PFA
39
40
41 usedPFA=PFA
42
43 npfastrips=0
44
45 if(usedPFA.eq.'COG1')npfastrips=1
46 if(usedPFA.eq.'COG2')npfastrips=2
47 if(usedPFA.eq.'COG3')npfastrips=3
48 if(usedPFA.eq.'COG4')npfastrips=4
49 if(usedPFA.eq.'ETA2')npfastrips=2
50 if(usedPFA.eq.'ETA3')npfastrips=3
51 if(usedPFA.eq.'ETA4')npfastrips=4
52 * ----------------------------------------------------------------
53 if(usedPFA.eq.'ETA')then
54 c print*,VIEW(ic),angle
55 if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
56 if( abs(angle).ge.e2fay.and.abs(angle).lt.e2tay )then
57 npfastrips=2
58 elseif( abs(angle).ge.e3fay.and.abs(angle).lt.e3tay )then
59 npfastrips=3
60 elseif( abs(angle).ge.e4fay.and.abs(angle).lt.e4tay )then
61 npfastrips=4
62 else
63 npfastrips=4
64 c usedPFA='COG'
65 endif
66 else !X-view
67 if( abs(angle).ge.e2fax.and.abs(angle).lt.e2tax )then
68 npfastrips=2
69 elseif( abs(angle).ge.e3fax.and.abs(angle).lt.e3tax )then
70 npfastrips=3
71 elseif( abs(angle).ge.e4fax.and.abs(angle).lt.e4tax )then
72 npfastrips=4
73 else
74 npfastrips=4
75 c usedPFA='COG'
76 endif
77 endif
78 endif
79 * ----------------------------------------------------------------
80 if(usedPFA.eq.'COG')then
81
82 iv=VIEW(ic)
83 if(mod(iv,2).eq.1)incut=incuty
84 if(mod(iv,2).eq.0)incut=incutx
85 istart = INDSTART(IC)
86 istop = TOTCLLENGTH
87 if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1
88 mu = 0
89 do i = INDMAX(IC),istart,-1
90 ipos = i-INDMAX(ic)
91 cut = incut*CLSIGMA(i)
92 if(CLSIGNAL(i).ge.cut)then
93 mu = mu + 1
94 print*,i,mu
95 else
96 goto 10
97 endif
98 enddo
99 10 continue
100 do i = INDMAX(IC)+1,istop
101 ipos = i-INDMAX(ic)
102 cut = incut*CLSIGMA(i)
103 if(CLSIGNAL(i).ge.cut)then
104 mu = mu + 1
105 print*,i,mu
106 else
107 goto 20
108 endif
109 enddo
110 20 continue
111 npfastrips=mu
112
113 endif
114 * ----------------------------------------------------------------
115
116 c print*,pfastrips
117
118 return
119 end
120
121 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
122 real function pfaeta(ic,angle)
123 *--------------------------------------------------------------
124 * this function returns the position (in strip units)
125 * it calls:
126 * - pfaeta2(ic,angle)
127 * - pfaeta3(ic,angle)
128 * - pfaeta4(ic,angle)
129 * according to the angle
130 *--------------------------------------------------------------
131 include 'commontracker.f'
132 include 'level1.f'
133 include 'calib.f'
134
135 pfaeta = 0
136
137 if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
138
139 if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
140 pfaeta = pfaeta2(ic,angle)
141 elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then
142 pfaeta = pfaeta3(ic,angle)
143 elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
144 pfaeta = pfaeta4(ic,angle)
145 else
146 pfaeta = cog(4,ic)
147 endif
148
149 else !X-view
150
151 if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then
152 pfaeta = pfaeta2(ic,angle)
153 elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then
154 pfaeta = pfaeta3(ic,angle)
155 elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then
156 pfaeta = pfaeta4(ic,angle)
157 else
158 pfaeta = cog(4,ic)
159 endif
160
161 endif
162
163 100 return
164 end
165
166 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
167 c real function riseta(ic,angle)
168 real function riseta(iview,angle)
169 *--------------------------------------------------------------
170 * this function returns the average spatial resolution
171 * (in cm) for the ETA algorithm (function pfaeta(ic,angle))
172 * it calls:
173 * - risxeta2(angle)
174 * - risyeta2(angle)
175 * - risxeta3(angle)
176 * - risxeta4(angle)
177 * according to the angle
178 *--------------------------------------------------------------
179 include 'commontracker.f'
180 include 'level1.f'
181 include 'calib.f'
182
183 riseta = 0
184
185 c if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
186 if(mod(iview,2).eq.1)then !Y-view
187
188
189 if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
190 riseta = risyeta2(angle)
191 elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then
192 riseta = risy_cog(angle) !ATTENZIONE!!
193 elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
194 riseta = risy_cog(angle) !ATTENZIONE!!
195 else
196 riseta = risy_cog(angle)
197 endif
198
199 else !X-view
200
201 if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then
202 riseta = risxeta2(angle)
203 elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then
204 riseta = risxeta3(angle)
205 elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then
206 riseta = risxeta4(angle)
207 else
208 riseta = risx_cog(angle)
209 endif
210
211 endif
212
213 cc print*,'---- ',riseta,iview,angle
214
215 100 return
216 end
217
218 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
219 real function fbad_eta(ic,angle)
220 *-------------------------------------------------------
221 * this function returns a factor that takes into
222 * account deterioration of the spatial resolution
223 * in the case BAD strips are included in the cluster.
224 * This factor should multiply the nominal spatial
225 * resolution.
226 * It calls the function FBAD_COG(NCOG,IC),
227 * accordingto the angle
228 *-------------------------------------------------------
229
230 include 'commontracker.f'
231 include 'level1.f'
232 include 'calib.f'
233 fbad_eta = 0
234
235 if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
236
237 if( abs(angle).ge.e2fay.and.abs(angle).le.e2tay )then
238 fbad_eta = fbad_cog(2,ic)
239 elseif( abs(angle).ge.e3fay.and.abs(angle).le.e3tay )then
240 fbad_eta = fbad_cog(3,ic)
241 elseif( abs(angle).ge.e4fay.and.abs(angle).le.e4tay )then
242 fbad_eta = fbad_cog(4,ic)
243 else
244 fbad_eta = fbad_cog(4,ic)
245 endif
246
247 else !X-view
248
249 if( abs(angle).ge.e2fax.and.abs(angle).le.e2tax )then
250 fbad_eta = fbad_cog(2,ic)
251 elseif( abs(angle).ge.e3fax.and.abs(angle).le.e3tax )then
252 fbad_eta = fbad_cog(3,ic)
253 elseif( abs(angle).ge.e4fax.and.abs(angle).le.e4tax )then
254 fbad_eta = fbad_cog(4,ic)
255 else
256 fbad_eta = fbad_cog(4,ic)
257 endif
258
259 endif
260
261 return
262 end
263
264 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
265 real function pfaeta2(ic,angle) !(1)
266 *--------------------------------------------------------------
267 * this function returns
268 *
269 * - the position (in strip units)
270 * corrected according to the ETA2 Position Finding Algorithm.
271 * The function performs an interpolation of FETA2%ETA2
272 *
273 * - if the angle is out of range, the calibration parameters
274 * of the lowest or higher bin are used
275 *
276 *--------------------------------------------------------------
277 include 'commontracker.f'
278 include 'calib.f'
279 include 'level1.f'
280
281 real cog2,angle
282 integer iview,lad
283
284 iview = VIEW(ic)
285 lad = nld(MAXS(ic),VIEW(ic))
286 cog2 = cog(2,ic)
287 pfaeta2=cog2
288
289 * find angular bin
290 * (in futuro possiamo pensare di interpolare anche sull'angolo)
291 do iang=1,nangbin
292 if(angL(iang).lt.angle.and.angR(iang).ge.angle)then
293 iangle=iang
294 goto 98
295 endif
296 enddo
297 if(DEBUG)
298 $ print*,'pfaeta2 *** warning *** angle out of range: ',angle
299 if(angle.lt.angL(1))iang=1
300 if(angle.gt.angR(nangbin))iang=nangbin
301 98 continue !jump here if ok
302
303
304 c$$$* find extremes of interpolation
305 c$$$ iflag=0
306 c$$$* --------------------------------
307 c$$$ if(cog2.lt.eta2(1,iang).or.cog2.gt.eta2(netaval,iang))then
308 c$$$c print*,'pfaeta2 *** warning *** argument out of range: ',cog2
309 c$$$* goto 100
310 c$$$* ----------------------------------------------
311 c$$$* non salto piu`, ma scalo di 1 o -1
312 c$$$* nel caso si tratti di un cluster
313 c$$$* in cui la strip con il segnale massimo non coincide
314 c$$$* con la strip con il rapposto s/n massimo!!!
315 c$$$* ----------------------------------------------
316 c$$$ if(cog2.lt.eta2(1,iang))then !temp
317 c$$$ cog2=cog2+1. !temp
318 c$$$ iflag=1 !temp
319 c$$$ else !temp
320 c$$$ cog2=cog2-1. !temp
321 c$$$ iflag=-1 !temp
322 c$$$ endif !temp
323 c$$$c print*,'shifted >>> ',cog2
324 c$$$ endif
325
326 iadd=0
327 10 continue
328 if(cog2.lt.eta2(1,iang))then
329 cog2 = cog2 + 1
330 iadd = iadd + 1
331 goto 10
332 endif
333 20 continue
334 if(cog2.gt.eta2(netaval,iang))then
335 cog2 = cog2 - 1
336 iadd = iadd - 1
337 goto 20
338 endif
339
340 * --------------------------------
341 c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2
342 do i=2,netaval
343 if(eta2(i,iang).gt.cog2)then
344
345 x1 = eta2(i-1,iang)
346 x2 = eta2(i,iang)
347 y1 = feta2(i-1,iview,lad,iang)
348 y2 = feta2(i,iview,lad,iang)
349
350 c print*,'*****',i,view,lad,iang
351 c print*,'-----',x1,x2,y1,y2
352 goto 99
353 endif
354 enddo
355 99 continue
356
357
358 AA=(y2-y1)/(x2-x1)
359 BB=y1-AA*x1
360
361 pfaeta2 = AA*cog2+BB
362 pfaeta2 = pfaeta2 - iadd
363
364 c$$$ if(iflag.eq.1)then
365 c$$$ pfaeta2=pfaeta2-1. !temp
366 c$$$ cog2=cog2-1. !temp
367 c$$$ endif
368 c$$$ if(iflag.eq.-1)then
369 c$$$ pfaeta2=pfaeta2+1. !temp
370 c$$$ cog2=cog2+1. !temp
371 c$$$ endif
372
373 if(DEBUG)print*,'ETA2 (ic ',ic,' ang',angle,')'
374 $ ,cog2-iadd,' -->',pfaeta2
375
376
377 100 return
378 end
379
380 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
381 real function pfaeta3(ic,angle) !(1)
382 *--------------------------------------------------------------
383 * this function returns
384 *
385 * - the position (in strip units)
386 * corrected according to the ETA3 Position Finding Algorithm.
387 * The function performs an interpolation of FETA3%ETA3
388 *
389 * - if the angle is out of range, the calibration parameters
390 * of the lowest or higher bin are used
391 *
392 *--------------------------------------------------------------
393 include 'commontracker.f'
394 include 'calib.f'
395 include 'level1.f'
396
397 real cog3,angle
398 integer iview,lad
399
400
401 iview = VIEW(ic)
402 lad = nld(MAXS(ic),VIEW(ic))
403 cog3 = cog(3,ic)
404 pfaeta3=cog3
405
406 * find angular bin
407 * (in futuro possiamo pensare di interpolare anche sull'angolo)
408 do iang=1,nangbin
409 c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle
410 if(angL(iang).lt.angle.and.angR(iang).ge.angle)then
411 iangle=iang
412 goto 98
413 endif
414 enddo
415 if(DEBUG)
416 $ print*,'pfaeta3 *** warning *** angle out of range: ',angle
417 if(angle.lt.angL(1))iang=1
418 if(angle.gt.angR(nangbin))iang=nangbin
419 98 continue !jump here if ok
420
421
422 c$$$* find extremes of interpolation
423 c$$$ iflag=0
424 c$$$* --------------------------------
425 c$$$ if(cog3.lt.eta3(1,iang).or.cog3.gt.eta3(netaval,iang))then
426 c$$$* ----------------------------------------------
427 c$$$* non salto piu`, ma scalo di 1 o -1
428 c$$$* nel caso si tratti di un cluster
429 c$$$* in cui la strip con il segnale massimo non coincide
430 c$$$* con la strip con il rapposto s/n massimo!!!
431 c$$$* ----------------------------------------------
432 c$$$ if(cog2.lt.eta2(1,iang))then !temp
433 c$$$ cog2=cog2+1. !temp
434 c$$$ iflag=1 !temp
435 c$$$ else !temp
436 c$$$ cog2=cog2-1. !temp
437 c$$$ iflag=-1 !temp
438 c$$$ endif !temp
439 c$$$c print*,'shifted >>> ',cog2
440 c$$$ endif
441
442
443 iadd=0
444 10 continue
445 if(cog3.lt.eta3(1,iang))then
446 cog3 = cog3 + 1
447 iadd = iadd + 1
448 goto 10
449 endif
450 20 continue
451 if(cog3.gt.eta3(netaval,iang))then
452 cog3 = cog3 - 1
453 iadd = iadd - 1
454 goto 20
455 endif
456
457 * --------------------------------
458 c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2
459 do i=2,netaval
460 if(eta3(i,iang).gt.cog3)then
461
462 x1 = eta3(i-1,iang)
463 x2 = eta3(i,iang)
464 y1 = feta3(i-1,iview,lad,iang)
465 y2 = feta3(i,iview,lad,iang)
466
467 c print*,'*****',i,view,lad,iang
468 c print*,'-----',x1,x2,y1,y2
469 goto 99
470 endif
471 enddo
472 99 continue
473
474
475 AA=(y2-y1)/(x2-x1)
476 BB=y1-AA*x1
477
478 pfaeta3 = AA*cog3+BB
479 pfaeta3 = pfaeta3 - iadd
480
481 c$$$ if(iflag.eq.1)then
482 c$$$ pfaeta2=pfaeta2-1. !temp
483 c$$$ cog2=cog2-1. !temp
484 c$$$ endif
485 c$$$ if(iflag.eq.-1)then
486 c$$$ pfaeta2=pfaeta2+1. !temp
487 c$$$ cog2=cog2+1. !temp
488 c$$$ endif
489
490 if(DEBUG)print*,'ETA3 (ic ',ic,' ang',angle,')'
491 $ ,cog3-iadd,' -->',pfaeta3
492
493 100 return
494 end
495
496 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
497 real function pfaeta4(ic,angle)
498 *--------------------------------------------------------------
499 * this function returns
500 *
501 * - the position (in strip units)
502 * corrected according to the ETA4 Position Finding Algorithm.
503 * The function performs an interpolation of FETA3%ETA3
504 *
505 * - if the angle is out of range, the calibration parameters
506 * of the lowest or higher bin are used
507 *
508 *--------------------------------------------------------------
509 include 'commontracker.f'
510 include 'calib.f'
511 include 'level1.f'
512
513 real cog4,angle
514 integer iview,lad
515
516
517 iview = VIEW(ic)
518 lad = nld(MAXS(ic),VIEW(ic))
519 cog4=cog(4,ic)
520 pfaeta4=cog4
521
522 * find angular bin
523 * (in futuro possiamo pensare di interpolare anche sull'angolo)
524 do iang=1,nangbin
525 c print*,'~~~~~~~~~~~~ ',iang,angL(iang),angR(iang),angle
526 if(angL(iang).lt.angle.and.angR(iang).ge.angle)then
527 iangle=iang
528 goto 98
529 endif
530 enddo
531 if(DEBUG)
532 $ print*,'pfaeta4 *** warning *** angle out of range: ',angle
533 if(angle.lt.angL(1))iang=1
534 if(angle.gt.angR(nangbin))iang=nangbin
535 98 continue !jump here if ok
536
537
538 c$$$* find extremes of interpolation
539 c$$$ iflag=0
540 c$$$* --------------------------------
541 c$$$ if(cog3.lt.eta3(1,iang).or.cog3.gt.eta3(netaval,iang))then
542 c$$$* ----------------------------------------------
543 c$$$* non salto piu`, ma scalo di 1 o -1
544 c$$$* nel caso si tratti di un cluster
545 c$$$* in cui la strip con il segnale massimo non coincide
546 c$$$* con la strip con il rapposto s/n massimo!!!
547 c$$$* ----------------------------------------------
548 c$$$ if(cog2.lt.eta2(1,iang))then !temp
549 c$$$ cog2=cog2+1. !temp
550 c$$$ iflag=1 !temp
551 c$$$ else !temp
552 c$$$ cog2=cog2-1. !temp
553 c$$$ iflag=-1 !temp
554 c$$$ endif !temp
555 c$$$c print*,'shifted >>> ',cog2
556 c$$$ endif
557
558
559 iadd=0
560 10 continue
561 if(cog4.lt.eta4(1,iang))then
562 cog4 = cog4 + 1
563 iadd = iadd + 1
564 goto 10
565 endif
566 20 continue
567 if(cog4.gt.eta4(netaval,iang))then
568 cog4 = cog4 - 1
569 iadd = iadd - 1
570 goto 20
571 endif
572
573 * --------------------------------
574 c print*,'*****',i,view,lad,iang,'------> cog2 ',cog2
575 do i=2,netaval
576 if(eta4(i,iang).gt.cog4)then
577
578 x1 = eta4(i-1,iang)
579 x2 = eta4(i,iang)
580 y1 = feta4(i-1,iview,lad,iang)
581 y2 = feta4(i,iview,lad,iang)
582
583 c print*,'*****',i,view,lad,iang
584 c print*,'-----',x1,x2,y1,y2
585 goto 99
586 endif
587 enddo
588 99 continue
589
590
591 AA=(y2-y1)/(x2-x1)
592 BB=y1-AA*x1
593
594 pfaeta4 = AA*cog4+BB
595 pfaeta4 = pfaeta4 - iadd
596
597 c$$$ if(iflag.eq.1)then
598 c$$$ pfaeta2=pfaeta2-1. !temp
599 c$$$ cog2=cog2-1. !temp
600 c$$$ endif
601 c$$$ if(iflag.eq.-1)then
602 c$$$ pfaeta2=pfaeta2+1. !temp
603 c$$$ cog2=cog2+1. !temp
604 c$$$ endif
605
606 if(DEBUG)print*,'ETA4 (ic ',ic,' ang',angle,')'
607 $ ,cog4-iadd,' -->',pfaeta4
608
609 100 return
610 end
611
612
613
614 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
615 c$$$ real function cog0(ncog,ic)
616 c$$$*-------------------------------------------------
617 c$$$* this function returns
618 c$$$*
619 c$$$* - the Center-Of-Gravity of the cluster IC
620 c$$$* evaluated using NCOG strips,
621 c$$$* calculated relative to MAXS(IC)
622 c$$$*
623 c$$$* - zero in case that not enough strips
624 c$$$* have a positive signal
625 c$$$*
626 c$$$* NOTE:
627 c$$$* This is the old definition, used by Straulino.
628 c$$$* The new routine, according to Landi,
629 c$$$* is COG(NCOG,IC)
630 c$$$*-------------------------------------------------
631 c$$$
632 c$$$
633 c$$$ include 'commontracker.f'
634 c$$$ include 'level1.f'
635 c$$$
636 c$$$* --> signal of the central strip
637 c$$$ sc = CLSIGNAL(INDMAX(ic)) !center
638 c$$$
639 c$$$* signal of adjacent strips
640 c$$$* --> left
641 c$$$ sl1 = 0 !left 1
642 c$$$ if(
643 c$$$ $ (INDMAX(ic)-1).ge.INDSTART(ic)
644 c$$$ $ )
645 c$$$ $ sl1 = max(0.,CLSIGNAL(INDMAX(ic)-1))
646 c$$$
647 c$$$ sl2 = 0 !left 2
648 c$$$ if(
649 c$$$ $ (INDMAX(ic)-2).ge.INDSTART(ic)
650 c$$$ $ )
651 c$$$ $ sl2 = max(0.,CLSIGNAL(INDMAX(ic)-2))
652 c$$$
653 c$$$* --> right
654 c$$$ sr1 = 0 !right 1
655 c$$$ if(
656 c$$$ $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1))
657 c$$$ $ .or.
658 c$$$ $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+1).le.TOTCLLENGTH)
659 c$$$ $ )
660 c$$$ $ sr1 = max(0.,CLSIGNAL(INDMAX(ic)+1))
661 c$$$
662 c$$$ sr2 = 0 !right 2
663 c$$$ if(
664 c$$$ $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1))
665 c$$$ $ .or.
666 c$$$ $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+2).le.TOTCLLENGTH)
667 c$$$ $ )
668 c$$$ $ sr2 = max(0.,CLSIGNAL(INDMAX(ic)+2))
669 c$$$
670 c$$$************************************************************
671 c$$$* COG computation
672 c$$$************************************************************
673 c$$$
674 c$$$c print*,sl2,sl1,sc,sr1,sr2
675 c$$$
676 c$$$ COG = 0.
677 c$$$
678 c$$$ if(sl1.gt.sr1.and.sl1.gt.0.)then
679 c$$$
680 c$$$ if(ncog.eq.2.and.sl1.ne.0)then
681 c$$$ COG = -sl1/(sl1+sc)
682 c$$$ elseif(ncog.eq.3.and.sl1.ne.0.and.sr1.ne.0)then
683 c$$$ COG = (sr1-sl1)/(sl1+sc+sr1)
684 c$$$ elseif(ncog.eq.4.and.sl1.ne.0.and.sr1.ne.0.and.sl2.ne.0)then
685 c$$$ COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)
686 c$$$ else
687 c$$$ COG = 0.
688 c$$$ endif
689 c$$$
690 c$$$ elseif(sl1.le.sr1.and.sr1.gt.0.)then
691 c$$$
692 c$$$ if(ncog.eq.2.and.sr1.ne.0)then
693 c$$$ COG = sr1/(sc+sr1)
694 c$$$ elseif(ncog.eq.3.and.sr1.ne.0.and.sl1.ne.0)then
695 c$$$ COG = (sr1-sl1)/(sl1+sc+sr1)
696 c$$$ elseif(ncog.eq.4.and.sr1.ne.0.and.sl1.ne.0.and.sr2.ne.0)then
697 c$$$ COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1)
698 c$$$ else
699 c$$$ COG = 0.
700 c$$$ endif
701 c$$$
702 c$$$ endif
703 c$$$
704 c$$$ COG0 = COG
705 c$$$
706 c$$$c print *,ncog,ic,cog,'/////////////'
707 c$$$
708 c$$$ return
709 c$$$ end
710
711 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
712 real function cog(ncog,ic)
713 *-------------------------------------------------
714 * this function returns
715 *
716 * - if NCOG=0, the Center-Of-Gravity of the
717 * cluster IC, relative to MAXS(IC), according to
718 * the cluster multiplicity
719 *
720 * - if NCOG>0, the Center-Of-Gravity of the cluster IC
721 * evaluated using NCOG strips, even if they have a
722 * negative signal (according to Landi)
723 *
724 *-------------------------------------------------
725
726
727 include 'commontracker.f'
728 include 'calib.f'
729 include 'level1.f'
730
731
732
733 if (ncog.gt.0) then
734 * ===========================
735 * ETA2 ETA3 ETA4 computation
736 * ===========================
737
738 * --> signal of the central strip
739 sc = CLSIGNAL(INDMAX(ic)) !center
740 * signal of adjacent strips
741 sl1 = -9999. !left 1
742 if(
743 $ (INDMAX(ic)-1).ge.INDSTART(ic)
744 $ )
745 $ sl1 = CLSIGNAL(INDMAX(ic)-1)
746
747 sl2 = -9999. !left 2
748 if(
749 $ (INDMAX(ic)-2).ge.INDSTART(ic)
750 $ )
751 $ sl2 = CLSIGNAL(INDMAX(ic)-2)
752
753 sr1 = -9999. !right 1
754 if(
755 $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1))
756 $ .or.
757 $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+1).le.TOTCLLENGTH)
758 $ )
759 $ sr1 = CLSIGNAL(INDMAX(ic)+1)
760
761 sr2 = -9999. !right 2
762 if(
763 $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1))
764 $ .or.
765 $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+2).le.TOTCLLENGTH)
766 $ )
767 $ sr2 = CLSIGNAL(INDMAX(ic)+2)
768
769 COG = 0.
770
771 c print*,'## ',sl2,sl1,sc,sr1,sr2
772
773 c ==============================================================
774 if(ncog.eq.1)then
775 COG = 0.
776 if(sr1.gt.sc)cog=1. !NEW
777 if(sl1.gt.sc.and.sl1.gt.sr1)cog=-1. !NEW
778 c ==============================================================
779 elseif(ncog.eq.2)then
780 if(sl1.gt.sr1)then
781 if((sl1+sc).ne.0)COG = -sl1/(sl1+sc)
782 elseif(sl1.lt.sr1)then
783 if((sc+sr1).ne.0)COG = sr1/(sc+sr1)
784 elseif( sl1.eq.sr1.and.sl1.ne.-9999.)then !NEW
785 if( clsigma(indmax(ic)-1).lt.clsigma(indmax(ic)+1)
786 $ .and.(sl1+sc).ne.0 )cog = -sl1/(sl1+sc) !NEW
787 if( clsigma(indmax(ic)-1).gt.clsigma(indmax(ic)+1)
788 $ .and.(sc+sr1).ne.0 )cog = sr1/(sc+sr1) !NEW
789 endif
790 c$$$ if(cog==0)print*,'Strange cluster (2) - @maxs ',MAXS(ic)
791 c$$$ $ ,VIEW(ic),LADDER(ic)
792 c$$$ $ ,' : ',sl2,sl1,sc,sr1,sr2
793 c ==============================================================
794 elseif(ncog.eq.3)then
795 if( (sl1+sc+sr1).ne.0 )COG = (sr1-sl1)/(sl1+sc+sr1)
796 c$$$ if(cog==0)print*,'Strange cluster (3) - @maxs ',MAXS(ic)
797 c$$$ $ ,VIEW(ic),LADDER(ic)
798 c$$$ $ ,' : ',sl2,sl1,sc,sr1,sr2
799 c ==============================================================
800 elseif(ncog.eq.4)then
801 if(sl2.gt.sr2)then
802 if((sl2+sl1+sc+sr1).ne.0)
803 $ COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)
804 elseif(sl2.lt.sr2)then
805 if((sr2+sl1+sc+sr1).ne.0)
806 $ COG = (2*sr2+sr1-sl1)/(sr2+sl1+sc+sr1)
807 elseif(sl2.eq.sr2.and.sl2.ne.-9999.)then !NEW
808 if( clsigma(indmax(ic)-2).lt.clsigma(indmax(ic)+2)
809 $ .and.(sl2+sl1+sc+sr1).ne.0 )
810 $ cog = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1) !NEW
811 if( clsigma(indmax(ic)-2).gt.clsigma(indmax(ic)+2)
812 $ .and.(sr2+sl1+sc+sr1).ne.0 )
813 $ cog = (2*sr2+sr1-sl1)/(sr2+sl1+sc+sr1) !NEW
814 endif
815 c$$$ if(cog==0)print*,'Strange cluster (4) - @maxs ',MAXS(ic)
816 c$$$ $ ,VIEW(ic),LADDER(ic)
817 c$$$ $ ,' : ',sl2,sl1,sc,sr1,sr2
818 c ==============================================================
819 else
820 print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG
821 $ ,' not implemented'
822 COG = 0.
823 endif
824
825 c print*,'NCOG ',ncog,ic,' @@@ ',sl1,sc,sr1,' @@@ ',cog
826
827 elseif(ncog.eq.0)then
828 * =========================
829 * COG computation
830 * =========================
831
832 iv=VIEW(ic)
833 if(mod(iv,2).eq.1)incut=incuty
834 if(mod(iv,2).eq.0)incut=incutx
835 istart = INDSTART(IC)
836 istop = TOTCLLENGTH
837 if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1
838 COG = 0
839 SGN = 0.
840 mu = 0
841 c print*,'-------'
842 do i = INDMAX(IC),istart,-1
843 ipos = i-INDMAX(ic)
844 cut = incut*CLSIGMA(i)
845 if(CLSIGNAL(i).ge.cut)then
846 COG = COG + ipos*CLSIGNAL(i)
847 SGN = SGN + CLSIGNAL(i)
848 mu = mu + 1
849 c print*,ipos,CLSIGNAL(i)
850 else
851 goto 10
852 endif
853 enddo
854 10 continue
855 do i = INDMAX(IC)+1,istop
856 ipos = i-INDMAX(ic)
857 cut = incut*CLSIGMA(i)
858 if(CLSIGNAL(i).ge.cut)then
859 COG = COG + ipos*CLSIGNAL(i)
860 SGN = SGN + CLSIGNAL(i)
861 mu = mu + 1
862 c print*,ipos,CLSIGNAL(i)
863 else
864 goto 20
865 endif
866 enddo
867 20 continue
868 if(SGN.le.0)then
869 print*,'cog(0,ic) --> ic, dedx ',ic,SGN
870 print*,(CLSIGNAL(i)/CLSIGMA(i),i=istart,istop)
871 print*,(CLSIGNAL(i),i=istart,istop)
872 c print*,'cog(0,ic) --> NOT EVALUATED '
873 else
874 COG=COG/SGN
875 endif
876 c print*,'-------'
877
878 else
879
880 COG=0
881 print*,'function COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG
882 print*,' (NCOG must be >= 0)'
883
884
885 endif
886
887 c print *,'## cog ',ncog,ic,cog,'/////////////'
888
889 return
890 end
891
892 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
893
894 real function fbad_cog(ncog,ic)
895 *-------------------------------------------------------
896 * this function returns a factor that takes into
897 * account deterioration of the spatial resolution
898 * in the case BAD strips are included in the cluster.
899 * This factor should multiply the nominal spatial
900 * resolution.
901 *
902 *-------------------------------------------------------
903
904 include 'commontracker.f'
905 include 'level1.f'
906 include 'calib.f'
907
908 if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
909 si = 8.4 !average good-strip noise
910 f = 4. !average bad-strip noise: f*si
911 incut=incuty
912 else !X-view
913 si = 3.9 !average good-strip noise
914 f = 6. !average bad-strip noise: f*si
915 incut=incutx
916 endif
917
918 fbad_cog = 1.
919
920 if (ncog.gt.0) then
921
922 * --> signal of the central strip
923 sc = CLSIGNAL(INDMAX(ic)) !center
924 fsc = 1
925 c if( CLBAD(INDMAX(ic)).eq.0 )fsc=f
926 fsc = clsigma(INDMAX(ic))/si
927 * --> signal of adjacent strips
928 sl1 = 0 !left 1
929 fsl1 = 1 !left 1
930 if(
931 $ (INDMAX(ic)-1).ge.INDSTART(ic)
932 $ )then
933 sl1 = CLSIGNAL(INDMAX(ic)-1)
934 c if( CLBAD(INDMAX(ic)-1).eq.0)fsl1=f
935 fsl1 = clsigma(INDMAX(ic)-1)/si
936 endif
937
938 sl2 = 0 !left 2
939 fsl2 = 1 !left 2
940 if(
941 $ (INDMAX(ic)-2).ge.INDSTART(ic)
942 $ )then
943 sl2 = CLSIGNAL(INDMAX(ic)-2)
944 c if(CLBAD(INDMAX(ic)-2).eq.0)fsl2=f
945 fsl2 = clsigma(INDMAX(ic)-2)/si
946 endif
947 sr1 = 0 !right 1
948 fsr1 = 1 !right 1
949 if(
950 $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1))
951 $ .or.
952 $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+1).le.TOTCLLENGTH)
953 $ )then
954 sr1 = CLSIGNAL(INDMAX(ic)+1)
955 c if(CLBAD(INDMAX(ic)+1).eq.0)fsr1=f
956 fsr1 = clsigma(INDMAX(ic)+1)/si
957 endif
958 sr2 = 0 !right 2
959 fsr2 = 1 !right 2
960 if(
961 $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1))
962 $ .or.
963 $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+2).le.TOTCLLENGTH)
964 $ )then
965 sr2 = CLSIGNAL(INDMAX(ic)+2)
966 c if(CLBAD(INDMAX(ic)+2).eq.0)fsr2=f
967 fsr2 = clsigma(INDMAX(ic)+2)/si
968 endif
969
970
971
972 ************************************************************
973 * COG2-3-4 computation
974 ************************************************************
975
976 c print*,sl2,sl1,sc,sr1,sr2
977
978 vCOG = cog(ncog,ic)!0.
979
980 if(ncog.eq.2)then
981 if(sl1.gt.sr1)then
982 c COG = -sl1/(sl1+sc)
983 fbad_cog = (fsl1*(-1-vCOG)**2+fsc*(-vCOG)**2)
984 fbad_cog = fbad_cog / ((-1-vCOG)**2+(-vCOG)**2)
985 elseif(sl1.le.sr1)then
986 c COG = sr1/(sc+sr1)
987 fbad_cog = (fsc*(-vCOG)**2+fsr1*(1-vCOG)**2)
988 fbad_cog = fbad_cog / ((-vCOG)**2+(1-vCOG)**2)
989 endif
990 elseif(ncog.eq.3)then
991 c COG = (sr1-sl1)/(sl1+sc+sr1)
992 fbad_cog =
993 $ (fsl1*(-1-vCOG)**2+fsc*(-vCOG)**2+fsr1*(1-vCOG)**2)
994 fbad_cog =
995 $ fbad_cog / ((-1-vCOG)**2+(-vCOG)**2+(1-vCOG)**2)
996 elseif(ncog.eq.4)then
997 if(sl2.gt.sr2)then
998 c COG = (sr1-sl1-2*sl2)/(sl2+sl1+sc+sr1)
999 fbad_cog =
1000 $ (fsl2*(-2-vCOG)**2+fsl1*(-1-vCOG)**2
1001 $ +fsc*(-vCOG)**2+fsr1*(1-vCOG)**2)
1002 fbad_cog =
1003 $ fbad_cog / ((-2-vCOG)**2+(-1-vCOG)**2
1004 $ +(-vCOG)**2+(1-vCOG)**2)
1005 elseif(sl2.le.sr2)then
1006 c COG = (2*sr2+sr1-sl1)/(sl2+sl1+sc+sr1)
1007 fbad_cog =
1008 $ (fsl1*(-1-vCOG)**2
1009 $ +fsc*(-vCOG)**2+fsr1*(1-vCOG)**2+fsr2*(2-vCOG)**2)
1010 fbad_cog =
1011 $ fbad_cog / ((-1-vCOG)**2
1012 $ +(-vCOG)**2+(1-vCOG)**2+(2-vCOG)**2)
1013 endif
1014 else
1015 print*,'function FBAD_COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG
1016 print*,' (NCOG must be <= 4)'
1017 c COG = 0.
1018 endif
1019
1020 elseif(ncog.eq.0)then
1021 * =========================
1022 * COG computation
1023 * =========================
1024
1025 vCOG = cog(0,ic)
1026
1027 iv = VIEW(ic)
1028 istart = INDSTART(IC)
1029 istop = TOTCLLENGTH
1030 if(ic.lt.NCLSTR1)istop = INDSTART(IC+1)-1
1031 SGN = 0.
1032 SNU = 0.
1033 SDE = 0.
1034 c$$$ do i=INDMAX(IC),istart,-1
1035 c$$$ ipos = i-INDMAX(ic)
1036 c$$$ cut = incut*CLSIGMA(i)
1037 c$$$ if(CLSIGNAL(i).gt.cut)then
1038 c$$$ COG = COG + ipos*CLSIGNAL(i)
1039 c$$$ SGN = SGN + CLSIGNAL(i)
1040 c$$$ else
1041 c$$$ goto 10
1042 c$$$ endif
1043 c$$$ enddo
1044 c$$$ 10 continue
1045 c$$$ do i=INDMAX(IC)+1,istop
1046 c$$$ ipos = i-INDMAX(ic)
1047 c$$$ cut = incut*CLSIGMA(i)
1048 c$$$ if(CLSIGNAL(i).gt.cut)then
1049 c$$$ COG = COG + ipos*CLSIGNAL(i)
1050 c$$$ SGN = SGN + CLSIGNAL(i)
1051 c$$$ else
1052 c$$$ goto 20
1053 c$$$ endif
1054 c$$$ enddo
1055 c$$$ 20 continue
1056 c$$$ if(SGN.le.0)then
1057 c$$$ print*,'fbad_cog(0,ic) --> ic, dedx ',ic,SGN
1058 c$$$ print*,(CLSIGNAL(i)/CLSIGMA(i),i=istart,istop)
1059 c$$$ print*,(CLSIGNAL(i),i=istart,istop)
1060 c$$$ print*,'fbad_cog(0,ic) --> NOT EVALUATED '
1061 c$$$ else
1062 c$$$ COG=COG/SGN
1063 c$$$ endif
1064
1065 do i=INDMAX(IC),istart,-1
1066 ipos = i-INDMAX(ic)
1067 cut = incut*CLSIGMA(i)
1068 if(CLSIGNAL(i).gt.cut)then
1069 fs = clsigma(i)/si
1070 SNU = SNU + fs*(ipos-vCOG)**2
1071 SDE = SDE + (ipos-vCOG)**2
1072 else
1073 goto 10
1074 endif
1075 enddo
1076 10 continue
1077 do i=INDMAX(IC)+1,istop
1078 ipos = i-INDMAX(ic)
1079 cut = incut*CLSIGMA(i)
1080 if(CLSIGNAL(i).gt.cut)then
1081 fs = clsigma(i)/si
1082 SNU = SNU + fs*(ipos-vCOG)**2
1083 SDE = SDE + (ipos-vCOG)**2
1084 else
1085 goto 20
1086 endif
1087 enddo
1088 20 continue
1089 if(SDE.ne.0)then
1090 FBAD_COG=SNU/SDE
1091 else
1092
1093 endif
1094
1095 else
1096
1097 FBAD_COG=0
1098 print*,'function FBAD_COG(NCOG,IC) ==> WARNING!! NCOG=',NCOG
1099 print*,' (NCOG must be >= 0)'
1100
1101
1102 endif
1103
1104
1105 fbad_cog = sqrt(fbad_cog)
1106
1107 return
1108 end
1109
1110
1111 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1112 real function fbad_cog0(ncog,ic)
1113 *-------------------------------------------------------
1114 * this function returns a factor that takes into
1115 * account deterioration of the spatial resolution
1116 * in the case BAD strips are included in the cluster.
1117 * This factor should multiply the nominal spatial
1118 * resolution.
1119 *
1120 * NB!!!
1121 * (this is the old version. It consider only the two
1122 * strips with the greatest signal. The new one is
1123 * fbad_cog(ncog,ic) )
1124 *
1125 *-------------------------------------------------------
1126
1127 include 'commontracker.f'
1128 include 'level1.f'
1129 include 'calib.f'
1130
1131 * --> signal of the central strip
1132 sc = CLSIGNAL(INDMAX(ic)) !center
1133
1134 * signal of adjacent strips
1135 * --> left
1136 sl1 = 0 !left 1
1137 if(
1138 $ (INDMAX(ic)-1).ge.INDSTART(ic)
1139 $ )
1140 $ sl1 = max(0.,CLSIGNAL(INDMAX(ic)-1))
1141
1142 sl2 = 0 !left 2
1143 if(
1144 $ (INDMAX(ic)-2).ge.INDSTART(ic)
1145 $ )
1146 $ sl2 = max(0.,CLSIGNAL(INDMAX(ic)-2))
1147
1148 * --> right
1149 sr1 = 0 !right 1
1150 if(
1151 $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+1).lt.INDSTART(ic+1))
1152 $ .or.
1153 $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+1).le.TOTCLLENGTH)
1154 $ )
1155 $ sr1 = max(0.,CLSIGNAL(INDMAX(ic)+1))
1156
1157 sr2 = 0 !right 2
1158 if(
1159 $ (ic.ne.NCLSTR1.and.(INDMAX(ic)+2).lt.INDSTART(ic+1))
1160 $ .or.
1161 $ (ic.eq.NCLSTR1.and.(INDMAX(ic)+2).le.TOTCLLENGTH)
1162 $ )
1163 $ sr2 = max(0.,CLSIGNAL(INDMAX(ic)+2))
1164
1165
1166 if(mod(int(VIEW(ic)),2).eq.1)then !Y-view
1167 f = 4.
1168 si = 8.4
1169 else !X-view
1170 f = 6.
1171 si = 3.9
1172 endif
1173
1174 fbad_cog = 1.
1175 f0 = 1
1176 f1 = 1
1177 f2 = 1
1178 f3 = 1
1179 if(sl1.gt.sr1.and.sl1.gt.0.)then
1180
1181 if(BAD(VIEW(ic),nvk(MAXS(ic)),nst(MAXS(ic)) ).eq.0)f0=f
1182 if(BAD(VIEW(ic),nvk(MAXS(ic)),nst(MAXS(ic)-1)).eq.0)f1=f
1183 c if(BAD(VIEW(ic),nvk(MAXS(ic)),nst(MAXS(ic)+1)).eq.0)f3=f
1184
1185 if(ncog.eq.2.and.sl1.ne.0)then
1186 fbad_cog = (f1**2*sc**2/sl1**2+f0**2)/(sc**2/sl1**2+1.)
1187 elseif(ncog.eq.3.and.sl1.ne.0.and.sr1.ne.0)then
1188 fbad_cog = 1.
1189 elseif(ncog.eq.4.and.sl1.ne.0.and.sr1.ne.0.and.sl2.ne.0)then
1190 fbad_cog = 1.
1191 else
1192 fbad_cog = 1.
1193 endif
1194
1195 elseif(sl1.le.sr1.and.sr1.gt.0.)then
1196
1197
1198 if(BAD(VIEW(ic),nvk(MAXS(ic)),nst(MAXS(ic)) ).eq.0)f0=f
1199 if(BAD(VIEW(ic),nvk(MAXS(ic)),nst(MAXS(ic)+1)).eq.0)f1=f
1200 c if(BAD(VIEW(ic),nvk(MAXS(ic)),nst(MAXS(ic)-1)).eq.0)f3=f
1201
1202 if(ncog.eq.2.and.sr1.ne.0)then
1203 fbad_cog = (f1**2*sc**2/sr1**2+f0**2)/(sc**2/sr1**2+1.)
1204 elseif(ncog.eq.3.and.sr1.ne.0.and.sl1.ne.0)then
1205 fbad_cog = 1.
1206 elseif(ncog.eq.4.and.sr1.ne.0.and.sl1.ne.0.and.sr2.ne.0)then
1207 fbad_cog = 1.
1208 else
1209 fbad_cog = 1.
1210 endif
1211
1212 endif
1213
1214 fbad_cog0 = sqrt(fbad_cog)
1215
1216 return
1217 end
1218
1219
1220
1221
1222 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1223
1224 FUNCTION risxeta2(x)
1225
1226 DOUBLE PRECISION V( 1)
1227 INTEGER NPAR, NDIM, IMQFUN, I, J
1228 DOUBLE PRECISION HQDJ, VV, VCONST
1229 DOUBLE PRECISION SIGVMI( 1), SIGVT( 1)
1230 DOUBLE PRECISION SIGV( 18, 1)
1231 DOUBLE PRECISION SIGDEL( 18)
1232 DOUBLE PRECISION SIGA( 18)
1233 DATA NPAR, NDIM, IMQFUN / 18, 1, 1/
1234 DATA VCONST / 0.000000000000 /
1235 DATA SIGVMI / -20.50000000000 /
1236 DATA SIGVT / 41.00000000000 /
1237 DATA SIGV / 0.6097560748458E-01
1238 +, 0.1097560971975
1239 +, 0.1341463327408
1240 +, 0.1829268187284
1241 +, 0.2317073047161
1242 +, 0.4268292486668
1243 +, 0.4756097495556
1244 +, 0.4999999701977
1245 +, 0.5243902206421
1246 +, 0.5731707215309
1247 +, 0.7682926654816
1248 +, 0.8170731663704
1249 +, 0.8658536076546
1250 +, 0.8902438879013
1251 +, 0.9390243291855
1252 +, 0.000000000000
1253 +, 1.000000000000
1254 +, 0.3658536374569
1255 +/
1256 DATA SIGDEL / 0.4878048598766E-01
1257 +, 0.4878048598766E-01
1258 +, 0.4878048598766E-01
1259 +, 0.4878048598766E-01
1260 +, 0.4878048598766E-01
1261 +, 0.4878048598766E-01
1262 +, 0.4878048598766E-01
1263 +, 0.4878048598766E-01
1264 +, 0.4878048598766E-01
1265 +, 0.4878048598766E-01
1266 +, 0.4878048598766E-01
1267 +, 0.4878048598766E-01
1268 +, 0.4878048598766E-01
1269 +, 0.4878048598766E-01
1270 +, 0.4878048598766E-01
1271 +, 0.1999999994950E-05
1272 +, 0.1999999994950E-05
1273 +, 0.9756097197533E-01
1274 +/
1275 DATA SIGA / 51.65899502118
1276 +, -150.4733247841
1277 +, 143.0468613786
1278 +, -16.56096738997
1279 +, 5.149319798083
1280 +, 21.57149712673
1281 +, -39.46652322782
1282 +, 47.13181632948
1283 +, -32.93197883680
1284 +, 16.38645317092
1285 +, 1.453688482992
1286 +, -10.00547244421
1287 +, 131.3517670587
1288 +, -140.6351538257
1289 +, 49.05515749582
1290 +, -23.00028974788
1291 +, -22.58470403729
1292 +, -3.824682486418
1293 +/
1294
1295 V(1)= abs(x)
1296 if(V(1).gt.20.)V(1)=20.
1297
1298 HQUADF = 0.
1299 DO 20 J = 1, NPAR
1300 HQDJ = 0.
1301 DO 10 I = 1, NDIM
1302 VV = (V (I) - SIGVMI (I)) / SIGVT (I)
1303 HQDJ = HQDJ + (VV - SIGV (J, I)) ** 2
1304 10 CONTINUE
1305 HQDJ = HQDJ + SIGDEL (J) ** 2
1306 HQDJ = SQRT (HQDJ)
1307 HQUADF = HQUADF + SIGA (J) * HQDJ
1308 20 CONTINUE
1309 IF (IMQFUN .EQ. 2) HQUADF = VCONST * EXP (HQUADF)
1310
1311 risxeta2=HQUADF* 1e-4
1312
1313 END
1314
1315 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1316 FUNCTION risxeta3(x)
1317 DOUBLE PRECISION V( 1)
1318 INTEGER NPAR, NDIM, IMQFUN, I, J
1319 DOUBLE PRECISION HQDJ, VV, VCONST
1320 DOUBLE PRECISION SIGVMI( 1), SIGVT( 1)
1321 DOUBLE PRECISION SIGV( 18, 1)
1322 DOUBLE PRECISION SIGDEL( 18)
1323 DOUBLE PRECISION SIGA( 18)
1324 DATA NPAR, NDIM, IMQFUN / 18, 1, 1/
1325 DATA VCONST / 0.000000000000 /
1326 DATA SIGVMI / -20.50000000000 /
1327 DATA SIGVT / 41.00000000000 /
1328 DATA SIGV / 0.6097560748458E-01
1329 +, 0.1097560971975
1330 +, 0.1341463327408
1331 +, 0.1829268187284
1332 +, 0.2317073047161
1333 +, 0.4756097495556
1334 +, 0.4999999701977
1335 +, 0.5243902206421
1336 +, 0.7682926654816
1337 +, 0.8170731663704
1338 +, 0.8658536076546
1339 +, 0.8902438879013
1340 +, 0.9390243291855
1341 +, 0.000000000000
1342 +, 1.000000000000
1343 +, 0.3658536374569
1344 +, 0.4146341383457
1345 +, 0.6097560524940
1346 +/
1347 DATA SIGDEL / 0.4878048598766E-01
1348 +, 0.4878048598766E-01
1349 +, 0.4878048598766E-01
1350 +, 0.4878048598766E-01
1351 +, 0.4878048598766E-01
1352 +, 0.4878048598766E-01
1353 +, 0.4878048598766E-01
1354 +, 0.4878048598766E-01
1355 +, 0.4878048598766E-01
1356 +, 0.4878048598766E-01
1357 +, 0.4878048598766E-01
1358 +, 0.4878048598766E-01
1359 +, 0.4878048598766E-01
1360 +, 0.1999999994950E-05
1361 +, 0.1999999994950E-05
1362 +, 0.9756097197533E-01
1363 +, 0.9756097197533E-01
1364 +, 0.9756097197533E-01
1365 +/
1366 DATA SIGA / 55.18284054458
1367 +, -160.3358431242
1368 +, 144.6939185763
1369 +, -20.45200854118
1370 +, 5.223570087108
1371 +,-0.4171476953945
1372 +, -27.67911907462
1373 +, 17.70327157495
1374 +, -1.867165491707
1375 +, -8.884458169181
1376 +, 124.3526608791
1377 +, -143.3309398345
1378 +, 50.80345027122
1379 +, -16.44454904415
1380 +, -15.73785568450
1381 +, -22.71810502561
1382 +, 36.86170101430
1383 +, 2.437918198452
1384 +/
1385
1386 V(1) = abs(x)
1387 if(V(1).gt.20.)V(1)=20.
1388
1389 HQUADF = 0.
1390 DO 20 J = 1, NPAR
1391 HQDJ = 0.
1392 DO 10 I = 1, NDIM
1393 VV = (V (I) - SIGVMI (I)) / SIGVT (I)
1394 HQDJ = HQDJ + (VV - SIGV (J, I)) ** 2
1395 10 CONTINUE
1396 HQDJ = HQDJ + SIGDEL (J) ** 2
1397 HQDJ = SQRT (HQDJ)
1398 HQUADF = HQUADF + SIGA (J) * HQDJ
1399 20 CONTINUE
1400 IF (IMQFUN .EQ. 2) HQUADF = VCONST * EXP (HQUADF)
1401
1402 risxeta3 = HQUADF* 1e-4
1403
1404 END
1405 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1406 FUNCTION risxeta4(x)
1407 DOUBLE PRECISION V( 1)
1408 INTEGER NPAR, NDIM, IMQFUN, I, J
1409 DOUBLE PRECISION HQDJ, VV, VCONST
1410 DOUBLE PRECISION SIGVMI( 1), SIGVT( 1)
1411 DOUBLE PRECISION SIGV( 18, 1)
1412 DOUBLE PRECISION SIGDEL( 18)
1413 DOUBLE PRECISION SIGA( 18)
1414 DATA NPAR, NDIM, IMQFUN / 18, 1, 1/
1415 DATA VCONST / 0.000000000000 /
1416 DATA SIGVMI / -20.50000000000 /
1417 DATA SIGVT / 41.00000000000 /
1418 DATA SIGV / 0.3658536449075E-01
1419 +, 0.6097560748458E-01
1420 +, 0.1097560971975
1421 +, 0.1341463327408
1422 +, 0.4756097495556
1423 +, 0.5243902206421
1424 +, 0.8658536076546
1425 +, 0.8902438879013
1426 +, 0.9390243291855
1427 +, 0.9634146094322
1428 +, 0.000000000000
1429 +, 1.000000000000
1430 +, 0.3658536374569
1431 +, 0.4146341383457
1432 +, 0.6097560524940
1433 +, 0.6585365533829
1434 +, 0.7560975551605
1435 +, 0.2439024299383
1436 +/
1437 DATA SIGDEL / 0.4878048598766E-01
1438 +, 0.4878048598766E-01
1439 +, 0.4878048598766E-01
1440 +, 0.4878048598766E-01
1441 +, 0.4878048598766E-01
1442 +, 0.4878048598766E-01
1443 +, 0.4878048598766E-01
1444 +, 0.4878048598766E-01
1445 +, 0.4878048598766E-01
1446 +, 0.4878048598766E-01
1447 +, 0.1999999994950E-05
1448 +, 0.1999999994950E-05
1449 +, 0.9756097197533E-01
1450 +, 0.9756097197533E-01
1451 +, 0.9756097197533E-01
1452 +, 0.9756097197533E-01
1453 +, 0.9756097197533E-01
1454 +, 0.1951219439507
1455 +/
1456 DATA SIGA / -43.61551887895
1457 +, 57.88466995373
1458 +, -92.04113299504
1459 +, 74.08166649890
1460 +, -9.768686062558
1461 +, -4.304496875334
1462 +, 72.62237333937
1463 +, -91.21920840618
1464 +, 56.75519978630
1465 +, -43.21115751243
1466 +, 12.79984505413
1467 +, 12.10074868595
1468 +, -6.238587250860
1469 +, 23.43447356326
1470 +, 17.98221401495
1471 +, -7.980332610975
1472 +, -3.426733307051
1473 +, -8.683439558751
1474 +/
1475
1476 V(1)=abs(x)
1477 if(V(1).gt.20.)V(1)=20.
1478
1479 HQUADF = 0.
1480 DO 20 J = 1, NPAR
1481 HQDJ = 0.
1482 DO 10 I = 1, NDIM
1483 VV = (V (I) - SIGVMI (I)) / SIGVT (I)
1484 HQDJ = HQDJ + (VV - SIGV (J, I)) ** 2
1485 10 CONTINUE
1486 HQDJ = HQDJ + SIGDEL (J) ** 2
1487 HQDJ = SQRT (HQDJ)
1488 HQUADF = HQUADF + SIGA (J) * HQDJ
1489 20 CONTINUE
1490 IF (IMQFUN .EQ. 2) HQUADF = VCONST * EXP (HQUADF)
1491
1492 risxeta4=HQUADF* 1e-4
1493
1494 END
1495 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1496 FUNCTION risyeta2(x)
1497 DOUBLE PRECISION V( 1)
1498 INTEGER NPAR, NDIM, IMQFUN, I, J
1499 DOUBLE PRECISION HQDJ, VV, VCONST
1500 DOUBLE PRECISION SIGVMI( 1), SIGVT( 1)
1501 DOUBLE PRECISION SIGV( 12, 1)
1502 DOUBLE PRECISION SIGDEL( 12)
1503 DOUBLE PRECISION SIGA( 12)
1504 DATA NPAR, NDIM, IMQFUN / 12, 1, 1/
1505 DATA VCONST / 0.000000000000 /
1506 DATA SIGVMI / -20.50000000000 /
1507 DATA SIGVT / 41.00000000000 /
1508 DATA SIGV / 0.1585365831852
1509 +, 0.4024389982224
1510 +, 0.4756097495556
1511 +, 0.5243902206421
1512 +, 0.5975609421730
1513 +, 0.8414633870125
1514 +, 0.000000000000
1515 +, 1.000000000000
1516 +, 0.2682926654816
1517 +, 0.3170731663704
1518 +, 0.7073170542717
1519 +, 0.7560975551605
1520 +/
1521 DATA SIGDEL / 0.4878048598766E-01
1522 +, 0.4878048598766E-01
1523 +, 0.4878048598766E-01
1524 +, 0.4878048598766E-01
1525 +, 0.4878048598766E-01
1526 +, 0.4878048598766E-01
1527 +, 0.1999999994950E-05
1528 +, 0.1999999994950E-05
1529 +, 0.9756097197533E-01
1530 +, 0.9756097197533E-01
1531 +, 0.9756097197533E-01
1532 +, 0.9756097197533E-01
1533 +/
1534 DATA SIGA / 14.57433603529
1535 +, -15.93532436156
1536 +, -13.24628335221
1537 +, -14.31193855410
1538 +, -12.67339684488
1539 +, 18.19876051780
1540 +, -5.270493486725
1541 +, -5.107670990828
1542 +, -9.553262933901
1543 +, 43.34150727448
1544 +, 55.91366786432
1545 +, -29.38037318563
1546 +/
1547
1548 v(1)= abs(x)
1549 if(V(1).gt.20.)V(1)=20.
1550
1551 HQUADF = 0.
1552 DO 20 J = 1, NPAR
1553 HQDJ = 0.
1554 DO 10 I = 1, NDIM
1555 VV = (V (I) - SIGVMI (I)) / SIGVT (I)
1556 HQDJ = HQDJ + (VV - SIGV (J, I)) ** 2
1557 10 CONTINUE
1558 HQDJ = HQDJ + SIGDEL (J) ** 2
1559 HQDJ = SQRT (HQDJ)
1560 HQUADF = HQUADF + SIGA (J) * HQDJ
1561 20 CONTINUE
1562 IF (IMQFUN .EQ. 2) HQUADF = VCONST * EXP (HQUADF)
1563
1564 risyeta2=HQUADF* 1e-4
1565
1566 END
1567 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1568
1569 FUNCTION risy_cog(x)
1570 DOUBLE PRECISION V( 1)
1571 INTEGER NPAR, NDIM, IMQFUN, I, J
1572 DOUBLE PRECISION HQDJ, VV, VCONST
1573 DOUBLE PRECISION SIGVMI( 1), SIGVT( 1)
1574 DOUBLE PRECISION SIGV( 10, 1)
1575 DOUBLE PRECISION SIGDEL( 10)
1576 DOUBLE PRECISION SIGA( 10)
1577 DATA NPAR, NDIM, IMQFUN / 10, 1, 1/
1578 DATA VCONST / 0.000000000000 /
1579 DATA SIGVMI / -20.50000000000 /
1580 DATA SIGVT / 41.00000000000 /
1581 DATA SIGV / 0.1585365831852
1582 +, 0.8414633870125
1583 +, 0.000000000000
1584 +, 1.000000000000
1585 +, 0.4634146094322
1586 +, 0.5121951103210
1587 +, 0.5609756112099
1588 +, 0.6585365533829
1589 +, 0.7073170542717
1590 +, 0.3414633870125
1591 +/
1592 DATA SIGDEL / 0.4878048598766E-01
1593 +, 0.4878048598766E-01
1594 +, 0.1999999994950E-05
1595 +, 0.1999999994950E-05
1596 +, 0.9756097197533E-01
1597 +, 0.9756097197533E-01
1598 +, 0.9756097197533E-01
1599 +, 0.9756097197533E-01
1600 +, 0.9756097197533E-01
1601 +, 0.1951219439507
1602 +/
1603 DATA SIGA / 23.73833445988
1604 +, 24.10182100013
1605 +, 1.865894323190
1606 +, 1.706006262931
1607 +, -1.075607857202
1608 +, -22.11489493403
1609 +, 1.663100707801
1610 +, 4.089852595440
1611 +, -4.314993873697
1612 +, -2.174479487744
1613 +/
1614
1615 V(1)=abs(x)
1616 if(V(1).gt.20.)V(1)=20.
1617
1618 HQUADF = 0.
1619 DO 20 J = 1, NPAR
1620 HQDJ = 0.
1621 DO 10 I = 1, NDIM
1622 VV = (V (I) - SIGVMI (I)) / SIGVT (I)
1623 HQDJ = HQDJ + (VV - SIGV (J, I)) ** 2
1624 10 CONTINUE
1625 HQDJ = HQDJ + SIGDEL (J) ** 2
1626 HQDJ = SQRT (HQDJ)
1627 HQUADF = HQUADF + SIGA (J) * HQDJ
1628 20 CONTINUE
1629 IF (IMQFUN .EQ. 2) HQUADF = VCONST * EXP (HQUADF)
1630
1631 risy_cog=HQUADF* 1e-4
1632
1633 END
1634 *** * * * *** * * * *** * * * *** * * * *** * * * *** * * * ***
1635 FUNCTION risx_cog(x)
1636 DOUBLE PRECISION V( 1)
1637 INTEGER NPAR, NDIM, IMQFUN, I, J
1638 DOUBLE PRECISION HQDJ, VV, VCONST
1639 DOUBLE PRECISION SIGVMI( 1), SIGVT( 1)
1640 DOUBLE PRECISION SIGV( 15, 1)
1641 DOUBLE PRECISION SIGDEL( 15)
1642 DOUBLE PRECISION SIGA( 15)
1643 DATA NPAR, NDIM, IMQFUN / 15, 1, 1/
1644 DATA VCONST / 0.000000000000 /
1645 DATA SIGVMI / -20.50000000000 /
1646 DATA SIGVT / 41.00000000000 /
1647 DATA SIGV / 0.6097560748458E-01
1648 +, 0.8536584675312E-01
1649 +, 0.1341463327408
1650 +, 0.2317073047161
1651 +, 0.2804878056049
1652 +, 0.3780487775803
1653 +, 0.6219512224197
1654 +, 0.7195121645927
1655 +, 0.7682926654816
1656 +, 0.8658536076546
1657 +, 0.9146341085434
1658 +, 0.9390243291855
1659 +, 0.000000000000
1660 +, 1.000000000000
1661 +, 0.5121951103210
1662 +/
1663 DATA SIGDEL / 0.4878048598766E-01
1664 +, 0.4878048598766E-01
1665 +, 0.4878048598766E-01
1666 +, 0.4878048598766E-01
1667 +, 0.4878048598766E-01
1668 +, 0.4878048598766E-01
1669 +, 0.4878048598766E-01
1670 +, 0.4878048598766E-01
1671 +, 0.4878048598766E-01
1672 +, 0.4878048598766E-01
1673 +, 0.4878048598766E-01
1674 +, 0.4878048598766E-01
1675 +, 0.1999999994950E-05
1676 +, 0.1999999994950E-05
1677 +, 0.9756097197533E-01
1678 +/
1679 DATA SIGA / 31.95672945139
1680 +, -34.23286209245
1681 +, -6.298459168211
1682 +, 10.98847700545
1683 +,-0.3052213535054
1684 +, 13.10517991464
1685 +, 15.60290821679
1686 +, -1.956118448507
1687 +, 12.41453816720
1688 +, -7.354056408553
1689 +, -32.32512668778
1690 +, 30.61116178966
1691 +, 1.418505329236
1692 +, 1.583492573619
1693 +, -18.48799977042
1694 +/
1695
1696 V(1)=abs(x)
1697 if(V(1).gt.20.)V(1)=20.
1698
1699 HQUADF = 0.
1700 DO 20 J = 1, NPAR
1701 HQDJ = 0.
1702 DO 10 I = 1, NDIM
1703 VV = (V (I) - SIGVMI (I)) / SIGVT (I)
1704 HQDJ = HQDJ + (VV - SIGV (J, I)) ** 2
1705 10 CONTINUE
1706 HQDJ = HQDJ + SIGDEL (J) ** 2
1707 HQDJ = SQRT (HQDJ)
1708 HQUADF = HQUADF + SIGA (J) * HQDJ
1709 20 CONTINUE
1710 IF (IMQFUN .EQ. 2) HQUADF = VCONST * EXP (HQUADF)
1711
1712 risx_cog = HQUADF * 1e-4
1713
1714 END

  ViewVC Help
Powered by ViewVC 1.1.23