7 |
|
|
8 |
|
|
9 |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
*** * * * *** * * * *** * * * *** * * * *** * * * *** * * * *** |
10 |
real function pfa_eta(ic,angle) |
real function pfaeta(ic,angle) |
11 |
*-------------------------------------------------------------- |
*-------------------------------------------------------------- |
12 |
* this function returns the position (in strip units) |
* this function returns the position (in strip units) |
13 |
* it calls: |
* it calls: |
14 |
* - pfa_eta2(ic,angle) |
* - pfaeta2(ic,angle) |
15 |
* - pfa_eta3(ic,angle) |
* - pfaeta3(ic,angle) |
16 |
* - pfa_eta4(ic,angle) |
* - pfaeta4(ic,angle) |
17 |
* according to the angle |
* according to the angle |
18 |
*-------------------------------------------------------------- |
*-------------------------------------------------------------- |
19 |
include 'commontracker.f' |
include 'commontracker.f' |
20 |
c include 'calib.f' |
c include 'calib.f' |
21 |
include 'level1.f' |
include 'level1.f' |
22 |
|
|
23 |
pfa_eta = 0 |
pfaeta = 0 |
24 |
|
|
25 |
if(mod(int(VIEW(ic)),2).eq.1)then !Y-view |
if(mod(int(VIEW(ic)),2).eq.1)then !Y-view |
26 |
|
|
27 |
pfa_eta = pfa_eta2(ic,angle) |
pfaeta = pfaeta2(ic,angle) |
28 |
|
|
29 |
else !X-view |
else !X-view |
30 |
|
|
31 |
if(abs(angle).le.10.)then |
if(abs(angle).le.10.)then |
32 |
pfa_eta = pfa_eta2(ic,angle) |
pfaeta = pfaeta2(ic,angle) |
33 |
elseif(abs(angle).gt.10..and.abs(angle).le.15.)then |
elseif(abs(angle).gt.10..and.abs(angle).le.15.)then |
34 |
pfa_eta = pfa_eta3(ic,angle) |
pfaeta = pfaeta3(ic,angle) |
35 |
elseif(abs(angle).gt.15.)then |
elseif(abs(angle).gt.15.)then |
36 |
pfa_eta = pfa_eta4(ic,angle) |
pfaeta = pfaeta4(ic,angle) |
37 |
endif |
endif |
38 |
|
|
39 |
endif |
endif |
40 |
|
|
41 |
|
c print*,'pfaeta ',pfaeta, angle |
42 |
|
|
43 |
100 return |
100 return |
44 |
end |
end |
47 |
real function ris_eta(ic,angle) |
real function ris_eta(ic,angle) |
48 |
*-------------------------------------------------------------- |
*-------------------------------------------------------------- |
49 |
* this function returns the average spatial resolution |
* this function returns the average spatial resolution |
50 |
* (in cm) for the ETA algorithm (function pfa_eta(ic,angle)) |
* (in cm) for the ETA algorithm (function pfaeta(ic,angle)) |
51 |
* it calls: |
* it calls: |
52 |
* - risx_eta2(angle) |
* - risx_eta2(angle) |
53 |
* - risy_eta2(angle) |
* - risy_eta2(angle) |
130 |
c***************************************************** |
c***************************************************** |
131 |
cccccc 02/02/2006 modified by Elena Vannuccini --> (1) |
cccccc 02/02/2006 modified by Elena Vannuccini --> (1) |
132 |
c***************************************************** |
c***************************************************** |
133 |
c real function pfa_eta2(cog2,view,lad,angle) |
c real function pfaeta2(cog2,view,lad,angle) |
134 |
real function pfa_eta2(ic,angle) !(1) |
real function pfaeta2(ic,angle) !(1) |
135 |
*-------------------------------------------------------------- |
*-------------------------------------------------------------- |
136 |
* this function returns |
* this function returns |
137 |
* |
* |
150 |
real cog2,angle |
real cog2,angle |
151 |
integer iview,lad |
integer iview,lad |
152 |
|
|
153 |
logical DEBUG |
c logical DEBUG |
154 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
155 |
|
|
156 |
iview = VIEW(ic) !(1) |
iview = VIEW(ic) !(1) |
157 |
lad = nld(MAXS(ic),VIEW(ic)) !(1) |
lad = nld(MAXS(ic),VIEW(ic)) !(1) |
158 |
cog2 = cog(2,ic) !(1) |
cog2 = cog(2,ic) !(1) |
159 |
pfa_eta2=cog2 |
pfaeta2=cog2 |
160 |
|
|
161 |
* find angular bin |
* find angular bin |
162 |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
168 |
endif |
endif |
169 |
enddo |
enddo |
170 |
if(DEBUG) |
if(DEBUG) |
171 |
$ print*,'pfa_eta2 *** warning *** angle out of range: ',angle |
$ print*,'pfaeta2 *** warning *** angle out of range: ',angle |
172 |
if(angle.lt.angL(1))iang=1 |
if(angle.lt.angL(1))iang=1 |
173 |
if(angle.gt.angR(nangbin))iang=nangbin |
if(angle.gt.angR(nangbin))iang=nangbin |
174 |
98 continue !jump here if ok |
98 continue !jump here if ok |
178 |
c$$$ iflag=0 |
c$$$ iflag=0 |
179 |
c$$$* -------------------------------- |
c$$$* -------------------------------- |
180 |
c$$$ if(cog2.lt.eta2(1,iang).or.cog2.gt.eta2(netaval,iang))then |
c$$$ if(cog2.lt.eta2(1,iang).or.cog2.gt.eta2(netaval,iang))then |
181 |
c$$$c print*,'pfa_eta2 *** warning *** argument out of range: ',cog2 |
c$$$c print*,'pfaeta2 *** warning *** argument out of range: ',cog2 |
182 |
c$$$* goto 100 |
c$$$* goto 100 |
183 |
c$$$* ---------------------------------------------- |
c$$$* ---------------------------------------------- |
184 |
c$$$* non salto piu`, ma scalo di 1 o -1 |
c$$$* non salto piu`, ma scalo di 1 o -1 |
231 |
AA=(y2-y1)/(x2-x1) |
AA=(y2-y1)/(x2-x1) |
232 |
BB=y1-AA*x1 |
BB=y1-AA*x1 |
233 |
|
|
234 |
pfa_eta2 = AA*cog2+BB |
pfaeta2 = AA*cog2+BB |
235 |
pfa_eta2 = pfa_eta2 - iadd |
pfaeta2 = pfaeta2 - iadd |
236 |
|
|
237 |
c$$$ if(iflag.eq.1)then |
c$$$ if(iflag.eq.1)then |
238 |
c$$$ pfa_eta2=pfa_eta2-1. !temp |
c$$$ pfaeta2=pfaeta2-1. !temp |
239 |
c$$$ cog2=cog2-1. !temp |
c$$$ cog2=cog2-1. !temp |
240 |
c$$$ endif |
c$$$ endif |
241 |
c$$$ if(iflag.eq.-1)then |
c$$$ if(iflag.eq.-1)then |
242 |
c$$$ pfa_eta2=pfa_eta2+1. !temp |
c$$$ pfaeta2=pfaeta2+1. !temp |
243 |
c$$$ cog2=cog2+1. !temp |
c$$$ cog2=cog2+1. !temp |
244 |
c$$$ endif |
c$$$ endif |
245 |
|
|
246 |
if(DEBUG)print*,'ETA2 (ic ',ic,' ang',angle,')' |
if(DEBUG)print*,'ETA2 (ic ',ic,' ang',angle,')' |
247 |
$ ,cog2-iadd,' -->',pfa_eta2 |
$ ,cog2-iadd,' -->',pfaeta2 |
248 |
|
|
249 |
|
|
250 |
100 return |
100 return |
254 |
c***************************************************** |
c***************************************************** |
255 |
cccccc 02/02/2006 modified by Elena Vannuccini --> (1) |
cccccc 02/02/2006 modified by Elena Vannuccini --> (1) |
256 |
c***************************************************** |
c***************************************************** |
257 |
c real function pfa_eta3(cog3,view,lad,angle) |
c real function pfaeta3(cog3,view,lad,angle) |
258 |
real function pfa_eta3(ic,angle) !(1) |
real function pfaeta3(ic,angle) !(1) |
259 |
*-------------------------------------------------------------- |
*-------------------------------------------------------------- |
260 |
* this function returns |
* this function returns |
261 |
* |
* |
274 |
real cog3,angle |
real cog3,angle |
275 |
integer iview,lad |
integer iview,lad |
276 |
|
|
277 |
logical DEBUG |
c logical DEBUG |
278 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
279 |
|
|
280 |
|
|
281 |
iview = VIEW(ic) !(1) |
iview = VIEW(ic) !(1) |
282 |
lad = nld(MAXS(ic),VIEW(ic)) !(1) |
lad = nld(MAXS(ic),VIEW(ic)) !(1) |
283 |
cog3 = cog(3,ic) !(1) |
cog3 = cog(3,ic) !(1) |
284 |
pfa_eta3=cog3 |
pfaeta3=cog3 |
285 |
|
|
286 |
* find angular bin |
* find angular bin |
287 |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
293 |
endif |
endif |
294 |
enddo |
enddo |
295 |
if(DEBUG) |
if(DEBUG) |
296 |
$ print*,'pfa_eta3 *** warning *** angle out of range: ',angle |
$ print*,'pfaeta3 *** warning *** angle out of range: ',angle |
297 |
if(angle.lt.angL(1))iang=1 |
if(angle.lt.angL(1))iang=1 |
298 |
if(angle.gt.angR(nangbin))iang=nangbin |
if(angle.gt.angR(nangbin))iang=nangbin |
299 |
98 continue !jump here if ok |
98 continue !jump here if ok |
355 |
AA=(y2-y1)/(x2-x1) |
AA=(y2-y1)/(x2-x1) |
356 |
BB=y1-AA*x1 |
BB=y1-AA*x1 |
357 |
|
|
358 |
pfa_eta3 = AA*cog3+BB |
pfaeta3 = AA*cog3+BB |
359 |
pfa_eta3 = pfa_eta3 - iadd |
pfaeta3 = pfaeta3 - iadd |
360 |
|
|
361 |
c$$$ if(iflag.eq.1)then |
c$$$ if(iflag.eq.1)then |
362 |
c$$$ pfa_eta2=pfa_eta2-1. !temp |
c$$$ pfaeta2=pfaeta2-1. !temp |
363 |
c$$$ cog2=cog2-1. !temp |
c$$$ cog2=cog2-1. !temp |
364 |
c$$$ endif |
c$$$ endif |
365 |
c$$$ if(iflag.eq.-1)then |
c$$$ if(iflag.eq.-1)then |
366 |
c$$$ pfa_eta2=pfa_eta2+1. !temp |
c$$$ pfaeta2=pfaeta2+1. !temp |
367 |
c$$$ cog2=cog2+1. !temp |
c$$$ cog2=cog2+1. !temp |
368 |
c$$$ endif |
c$$$ endif |
369 |
|
|
370 |
if(DEBUG)print*,'ETA3 (ic ',ic,' ang',angle,')' |
if(DEBUG)print*,'ETA3 (ic ',ic,' ang',angle,')' |
371 |
$ ,cog3-iadd,' -->',pfa_eta3 |
$ ,cog3-iadd,' -->',pfaeta3 |
372 |
|
|
373 |
100 return |
100 return |
374 |
end |
end |
377 |
c***************************************************** |
c***************************************************** |
378 |
cccccc 02/02/2006 modified by Elena Vannuccini --> (1) |
cccccc 02/02/2006 modified by Elena Vannuccini --> (1) |
379 |
c***************************************************** |
c***************************************************** |
380 |
c real function pfa_eta4(cog4,view,lad,angle) |
c real function pfaeta4(cog4,view,lad,angle) |
381 |
real function pfa_eta4(ic,angle) !(1) |
real function pfaeta4(ic,angle) !(1) |
382 |
*-------------------------------------------------------------- |
*-------------------------------------------------------------- |
383 |
* this function returns |
* this function returns |
384 |
* |
* |
397 |
real cog4,angle |
real cog4,angle |
398 |
integer iview,lad |
integer iview,lad |
399 |
|
|
400 |
logical DEBUG |
c logical DEBUG |
401 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
402 |
|
|
403 |
iview = VIEW(ic) !(1) |
iview = VIEW(ic) !(1) |
404 |
lad = nld(MAXS(ic),VIEW(ic)) !(1) |
lad = nld(MAXS(ic),VIEW(ic)) !(1) |
405 |
cog4=cog(4,ic) !(1) |
cog4=cog(4,ic) !(1) |
406 |
pfa_eta4=cog4 |
pfaeta4=cog4 |
407 |
|
|
408 |
* find angular bin |
* find angular bin |
409 |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
* (in futuro possiamo pensare di interpolare anche sull'angolo) |
415 |
endif |
endif |
416 |
enddo |
enddo |
417 |
if(DEBUG) |
if(DEBUG) |
418 |
$ print*,'pfa_eta4 *** warning *** angle out of range: ',angle |
$ print*,'pfaeta4 *** warning *** angle out of range: ',angle |
419 |
if(angle.lt.angL(1))iang=1 |
if(angle.lt.angL(1))iang=1 |
420 |
if(angle.gt.angR(nangbin))iang=nangbin |
if(angle.gt.angR(nangbin))iang=nangbin |
421 |
98 continue !jump here if ok |
98 continue !jump here if ok |
477 |
AA=(y2-y1)/(x2-x1) |
AA=(y2-y1)/(x2-x1) |
478 |
BB=y1-AA*x1 |
BB=y1-AA*x1 |
479 |
|
|
480 |
pfa_eta4 = AA*cog4+BB |
pfaeta4 = AA*cog4+BB |
481 |
pfa_eta4 = pfa_eta4 - iadd |
pfaeta4 = pfaeta4 - iadd |
482 |
|
|
483 |
c$$$ if(iflag.eq.1)then |
c$$$ if(iflag.eq.1)then |
484 |
c$$$ pfa_eta2=pfa_eta2-1. !temp |
c$$$ pfaeta2=pfaeta2-1. !temp |
485 |
c$$$ cog2=cog2-1. !temp |
c$$$ cog2=cog2-1. !temp |
486 |
c$$$ endif |
c$$$ endif |
487 |
c$$$ if(iflag.eq.-1)then |
c$$$ if(iflag.eq.-1)then |
488 |
c$$$ pfa_eta2=pfa_eta2+1. !temp |
c$$$ pfaeta2=pfaeta2+1. !temp |
489 |
c$$$ cog2=cog2+1. !temp |
c$$$ cog2=cog2+1. !temp |
490 |
c$$$ endif |
c$$$ endif |
491 |
|
|
492 |
if(DEBUG)print*,'ETA4 (ic ',ic,' ang',angle,')' |
if(DEBUG)print*,'ETA4 (ic ',ic,' ang',angle,')' |
493 |
$ ,cog4-iadd,' -->',pfa_eta4 |
$ ,cog4-iadd,' -->',pfaeta4 |
494 |
|
|
495 |
100 return |
100 return |
496 |
end |
end |
614 |
include 'calib.f' |
include 'calib.f' |
615 |
include 'level1.f' |
include 'level1.f' |
616 |
|
|
617 |
logical DEBUG |
c logical DEBUG |
618 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
619 |
|
|
620 |
|
|
621 |
if (ncog.gt.0) then |
if (ncog.gt.0) then |
656 |
|
|
657 |
COG = 0. |
COG = 0. |
658 |
|
|
659 |
if(ncog.eq.2)then |
if(ncog.eq.1)then |
660 |
|
COG = 0. |
661 |
|
elseif(ncog.eq.2)then |
662 |
if(sl1.gt.sr1)then |
if(sl1.gt.sr1)then |
663 |
COG = -sl1/(sl1+sc) |
COG = -sl1/(sl1+sc) |
664 |
elseif(sl1.le.sr1)then |
elseif(sl1.le.sr1)then |
689 |
if(mod(iv,2).eq.1)incut=incuty |
if(mod(iv,2).eq.1)incut=incuty |
690 |
if(mod(iv,2).eq.0)incut=incutx |
if(mod(iv,2).eq.0)incut=incutx |
691 |
|
|
692 |
istart=INDSTART(IC) |
istart = INDSTART(IC) |
693 |
istop=TOTCLLENGTH |
istop = TOTCLLENGTH |
694 |
if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1 |
if(ic.lt.NCLSTR1)istop=INDSTART(IC+1)-1 |
695 |
COG=0 |
COG = 0 |
696 |
mu=0 |
mu = 0 |
697 |
do i=istart,istop |
do i = istart,istop |
698 |
ipos=i-INDMAX(ic) |
ipos = i-INDMAX(ic) |
699 |
ivk=nvk(MAXS(ic)+ipos) |
cc ivk = nvk(MAXS(ic)+ipos) |
700 |
is=nst(MAXS(ic)+ipos) |
cc is = nst(MAXS(ic)+ipos) |
701 |
* print*,'******************',istart,istop,ipos |
* print*,'******************',istart,istop,ipos |
702 |
* $ ,MAXS(ic)+ipos,iv,ivk,is |
* $ ,MAXS(ic)+ipos,iv,ivk,is |
703 |
cut=incut*SIGMA(iv,ivk,is) |
cc cut = incut*SIGMA(iv,ivk,is) |
704 |
|
cut = incut*CLSIGMA(i) |
705 |
|
c if(SIGMA(iv,ivk,is).ne.CLSIGMA(i)) |
706 |
|
c $ print*,'cog(0,ic) --> hai fatto qualche cazzata' |
707 |
if(CLSIGNAL(i).ge.cut)then |
if(CLSIGNAL(i).ge.cut)then |
708 |
COG = COG + ipos*CLSIGNAL(i) |
COG = COG + ipos*CLSIGNAL(i) |
709 |
mu = mu + 1 |
mu = mu + 1 |
710 |
c print*,ipos,CLSIGNAL(i),incut,cut |
c print*,ipos,CLSIGNAL(i),incut,cut |
711 |
endif |
endif |
712 |
enddo |
enddo |
713 |
COG=COG/DEDX(ic) |
if(DEDX(ic).le.0)then |
714 |
|
print*,'cog(0,ic) --> ic, dedx ',ic,DEDX(ic) |
715 |
|
print*,(CLSIGNAL(i)/CLSIGMA(i),i=istart,istop) |
716 |
|
print*,(CLSIGNAL(i),i=istart,istop) |
717 |
|
print*,'cog(0,ic) --> NOT EVALUATED ' |
718 |
|
else |
719 |
|
COG=COG/DEDX(ic) |
720 |
|
endif |
721 |
c if(DEBUG)print*,'COG (ic ',ic,' m',mu,')' |
c if(DEBUG)print*,'COG (ic ',ic,' m',mu,')' |
722 |
c $ ,cog |
c $ ,cog |
723 |
|
|