22 |
|
|
23 |
include 'momanhough_init.f' |
include 'momanhough_init.f' |
24 |
|
|
25 |
logical DEBUG |
c logical DEBUG |
26 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
27 |
|
|
28 |
*------------------------------------------------------------------------------- |
*------------------------------------------------------------------------------- |
29 |
* STEP 1 |
* STEP 1 |
154 |
|
|
155 |
include 'momanhough_init.f' |
include 'momanhough_init.f' |
156 |
|
|
157 |
logical DEBUG |
c logical DEBUG |
158 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
159 |
|
|
160 |
logical FIMAGE ! |
logical FIMAGE ! |
161 |
|
|
237 |
* ************************** FIT *** FIT *** FIT *** FIT *** |
* ************************** FIT *** FIT *** FIT *** FIT *** |
238 |
* ********************************************************** |
* ********************************************************** |
239 |
do i=1,5 |
do i=1,5 |
240 |
AL(i)=dble(AL_STORE(i,icand)) |
AL(i)=dble(AL_STORE(i,icand)) |
241 |
enddo |
enddo |
242 |
|
IDCAND = icand !fitted track-candidate |
243 |
ifail=0 !error flag in chi2 computation |
ifail=0 !error flag in chi2 computation |
244 |
jstep=0 !# minimization steps |
jstep=0 !# minimization steps |
245 |
|
|
614 |
include 'common_xyzPAM.f' |
include 'common_xyzPAM.f' |
615 |
include 'common_resxy.f' |
include 'common_resxy.f' |
616 |
|
|
617 |
logical DEBUG |
c logical DEBUG |
618 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
619 |
|
|
620 |
integer icx,icy !X-Y cluster ID |
integer icx,icy !X-Y cluster ID |
621 |
integer sensor |
integer sensor |
1645 |
include 'calib.f' |
include 'calib.f' |
1646 |
include 'level1.f' |
include 'level1.f' |
1647 |
|
|
1648 |
logical DEBUG |
c logical DEBUG |
1649 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
1650 |
|
|
1651 |
* output flag |
* output flag |
1652 |
* -------------- |
* -------------- |
1860 |
include 'calib.f' |
include 'calib.f' |
1861 |
include 'level1.f' |
include 'level1.f' |
1862 |
|
|
1863 |
logical DEBUG |
c logical DEBUG |
1864 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
1865 |
|
|
1866 |
* output flag |
* output flag |
1867 |
* -------------- |
* -------------- |
2296 |
include 'calib.f' |
include 'calib.f' |
2297 |
include 'level1.f' |
include 'level1.f' |
2298 |
|
|
2299 |
logical DEBUG |
c logical DEBUG |
2300 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
2301 |
|
|
2302 |
* output flag |
* output flag |
2303 |
* -------------- |
* -------------- |
2518 |
include 'common_momanhough.f' |
include 'common_momanhough.f' |
2519 |
include 'momanhough_init.f' |
include 'momanhough_init.f' |
2520 |
|
|
2521 |
logical DEBUG |
c logical DEBUG |
2522 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
2523 |
|
|
2524 |
* output flag |
* output flag |
2525 |
* -------------- |
* -------------- |
2734 |
include 'common_momanhough.f' |
include 'common_momanhough.f' |
2735 |
include 'momanhough_init.f' |
include 'momanhough_init.f' |
2736 |
|
|
2737 |
logical DEBUG |
c logical DEBUG |
2738 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
2739 |
|
|
2740 |
* output flag |
* output flag |
2741 |
* -------------- |
* -------------- |
2948 |
include 'common_mech.f' |
include 'common_mech.f' |
2949 |
include 'momanhough_init.f' |
include 'momanhough_init.f' |
2950 |
|
|
2951 |
logical DEBUG |
c logical DEBUG |
2952 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
2953 |
|
|
2954 |
* output flag |
* output flag |
2955 |
* -------------- |
* -------------- |
3274 |
c****************************************************** |
c****************************************************** |
3275 |
cccccc 06/10/2005 modified by elena vannuccini ---> (1) |
cccccc 06/10/2005 modified by elena vannuccini ---> (1) |
3276 |
cccccc 31/01/2006 modified by elena vannuccini ---> (2) |
cccccc 31/01/2006 modified by elena vannuccini ---> (2) |
3277 |
|
cccccc 12/08/2006 modified by elena vannucicni ---> (3) |
3278 |
c****************************************************** |
c****************************************************** |
3279 |
|
|
3280 |
include 'commontracker.f' |
include 'commontracker.f' |
3286 |
include 'level1.f' |
include 'level1.f' |
3287 |
include 'calib.f' |
include 'calib.f' |
3288 |
|
|
3289 |
logical DEBUG |
c logical DEBUG |
3290 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
3291 |
|
|
3292 |
* flag to chose PFA |
* flag to chose PFA |
3293 |
character*10 PFA |
character*10 PFA |
3385 |
icx=clx(ip,icp) |
icx=clx(ip,icp) |
3386 |
icy=cly(ip,icp) |
icy=cly(ip,icp) |
3387 |
if(LADDER(icx).ne.nldt.or. !If the ladder number does not match |
if(LADDER(icx).ne.nldt.or. !If the ladder number does not match |
3388 |
$ cl_used(icx).eq.1.or. !or the X cluster is already used |
c $ cl_used(icx).eq.1.or. !or the X cluster is already used |
3389 |
$ cl_used(icy).eq.1.or. !or the Y cluster is already used |
c $ cl_used(icy).eq.1.or. !or the Y cluster is already used |
3390 |
|
$ cl_used(icx).ne.0.or. !or the X cluster is already used !(3) |
3391 |
|
$ cl_used(icy).ne.0.or. !or the Y cluster is already used !(3) |
3392 |
$ .false.)goto 1188 !then jump to next couple. |
$ .false.)goto 1188 !then jump to next couple. |
3393 |
* |
* |
3394 |
call xyz_PAM(icx,icy,ist, |
call xyz_PAM(icx,icy,ist, |
3460 |
if(LADDER(icx).ne.nldt)goto 11882 !if the ladder number does not match |
if(LADDER(icx).ne.nldt)goto 11882 !if the ladder number does not match |
3461 |
* !jump to the next couple |
* !jump to the next couple |
3462 |
*----- try cluster x ----------------------------------------------- |
*----- try cluster x ----------------------------------------------- |
3463 |
if(cl_used(icx).eq.1)goto 11881 !if the X cluster is already used |
c if(cl_used(icx).eq.1)goto 11881 !if the X cluster is already used |
3464 |
|
if(cl_used(icx).ne.0)goto 11881 !if the X cluster is already used !(3) |
3465 |
* !jump to the Y cluster |
* !jump to the Y cluster |
3466 |
call xyz_PAM(icx,0,ist, |
call xyz_PAM(icx,0,ist, |
3467 |
c $ 'ETA2','ETA2', |
c $ 'ETA2','ETA2', |
3488 |
endif |
endif |
3489 |
11881 continue |
11881 continue |
3490 |
*----- try cluster y ----------------------------------------------- |
*----- try cluster y ----------------------------------------------- |
3491 |
if(cl_used(icy).eq.1)goto 11882 !if the Y cluster is already used |
c if(cl_used(icy).eq.1)goto 11882 !if the Y cluster is already used |
3492 |
|
if(cl_used(icy).ne.0)goto 11882 !if the Y cluster is already used !(3) |
3493 |
* !jump to the next couple |
* !jump to the next couple |
3494 |
call xyz_PAM(0,icy,ist, |
call xyz_PAM(0,icy,ist, |
3495 |
c $ 'ETA2','ETA2', |
c $ 'ETA2','ETA2', |
3518 |
*----- single clusters ----------------------------------------------- |
*----- single clusters ----------------------------------------------- |
3519 |
do ic=1,ncls(ip) !loop on single clusters |
do ic=1,ncls(ip) !loop on single clusters |
3520 |
icl=cls(ip,ic) |
icl=cls(ip,ic) |
3521 |
if(cl_used(icl).eq.1.or. !if the cluster is already used |
c if(cl_used(icl).eq.1.or. !if the cluster is already used |
3522 |
|
if(cl_used(icl).ne.0.or. !if the cluster is already used !(3) |
3523 |
$ LADDER(icl).ne.nldt.or. !or the ladder number does not match |
$ LADDER(icl).ne.nldt.or. !or the ladder number does not match |
3524 |
$ .false.)goto 18882 !jump to the next singlet |
$ .false.)goto 18882 !jump to the next singlet |
3525 |
if(mod(VIEW(icl),2).eq.0)then!<---- X view |
if(mod(VIEW(icl),2).eq.0)then!<---- X view |
3603 |
* * |
* * |
3604 |
* * |
* * |
3605 |
************************************************** |
************************************************** |
3606 |
|
cccccc 12/08/2006 modified by elena ---> (1) |
3607 |
|
* |
3608 |
subroutine clean_XYclouds(ibest,iflag) |
subroutine clean_XYclouds(ibest,iflag) |
3609 |
|
|
3610 |
include 'commontracker.f' |
include 'commontracker.f' |
3611 |
include 'common_momanhough.f' |
include 'common_momanhough.f' |
3612 |
include 'momanhough_init.f' |
include 'momanhough_init.f' |
3613 |
|
include 'level2.f' !(1) |
3614 |
c include 'calib.f' |
c include 'calib.f' |
3615 |
c include 'level1.f' |
c include 'level1.f' |
3616 |
|
|
3617 |
logical DEBUG |
c logical DEBUG |
3618 |
common/dbg/DEBUG |
c common/dbg/DEBUG |
3619 |
|
|
3620 |
|
|
3621 |
do ip=1,nplanes !loop on planes |
do ip=1,nplanes !loop on planes |
3626 |
if(id.ne.0)then |
if(id.ne.0)then |
3627 |
iclx=clx(ip,icp_cp(id)) |
iclx=clx(ip,icp_cp(id)) |
3628 |
icly=cly(ip,icp_cp(id)) |
icly=cly(ip,icp_cp(id)) |
3629 |
cl_used(iclx)=1 !tag used clusters |
c cl_used(iclx)=1 !tag used clusters |
3630 |
cl_used(icly)=1 !tag used clusters |
c cl_used(icly)=1 !tag used clusters |
3631 |
|
cl_used(iclx)=ntrk !tag used clusters !(1) |
3632 |
|
cl_used(icly)=ntrk !tag used clusters !(1) |
3633 |
elseif(icl.ne.0)then |
elseif(icl.ne.0)then |
3634 |
cl_used(icl)=1 !tag used clusters |
c cl_used(icl)=1 !tag used clusters |
3635 |
|
cl_used(icl)=ntrk !tag used clusters !1) |
3636 |
endif |
endif |
3637 |
|
|
3638 |
c if(DEBUG)then |
c if(DEBUG)then |
3829 |
do it=1,NTRKMAX!NTRACKSMAX |
do it=1,NTRKMAX!NTRACKSMAX |
3830 |
IMAGE(IT)=0 |
IMAGE(IT)=0 |
3831 |
CHI2_nt(IT) = -100000. |
CHI2_nt(IT) = -100000. |
3832 |
BdL(IT) = 0. |
c BdL(IT) = 0. |
3833 |
do ip=1,nplanes |
do ip=1,nplanes |
3834 |
XM_nt(IP,IT) = 0 |
XM_nt(IP,IT) = 0 |
3835 |
YM_nt(IP,IT) = 0 |
YM_nt(IP,IT) = 0 |
3843 |
DEDX_X(IP,IT) = 0 |
DEDX_X(IP,IT) = 0 |
3844 |
DEDX_Y(IP,IT) = 0 |
DEDX_Y(IP,IT) = 0 |
3845 |
c****************************************************** |
c****************************************************** |
3846 |
|
cccccc 17/8/2006 modified by elena |
3847 |
|
CLTRX(IP,IT) = 0 |
3848 |
|
CLTRY(IP,IT) = 0 |
3849 |
enddo |
enddo |
3850 |
do ipa=1,5 |
do ipa=1,5 |
3851 |
AL_nt(IPA,IT) = 0 |
AL_nt(IPA,IT) = 0 |
3897 |
|
|
3898 |
|
|
3899 |
include 'commontracker.f' |
include 'commontracker.f' |
3900 |
|
include 'level1.f' |
3901 |
include 'level2.f' |
include 'level2.f' |
3902 |
include 'common_mini_2.f' |
include 'common_mini_2.f' |
3903 |
|
include 'common_momanhough.f' |
3904 |
real sinth,phi,pig !(4) |
real sinth,phi,pig !(4) |
3905 |
pig=acos(-1.) |
pig=acos(-1.) |
3906 |
|
|
3943 |
ayv_nt(ip,ntr) = sngl(ayv(ip)) |
ayv_nt(ip,ntr) = sngl(ayv(ip)) |
3944 |
c dedxp(ip,ntr) = sngl(dedxtrk(ip)) !(1) |
c dedxp(ip,ntr) = sngl(dedxtrk(ip)) !(1) |
3945 |
dedx_x(ip,ntr) = sngl(dedxtrk_x(ip)) !(2) |
dedx_x(ip,ntr) = sngl(dedxtrk_x(ip)) !(2) |
3946 |
dedx_y(ip,ntr) = sngl(dedxtrk_y(ip)) !(2) |
dedx_y(ip,ntr) = sngl(dedxtrk_y(ip)) !(2) |
3947 |
|
|
3948 |
|
id = CP_STORE(ip,IDCAND) |
3949 |
|
icl = CLS_STORE(ip,IDCAND) |
3950 |
|
if(id.ne.0)then |
3951 |
|
cltrx(ip,ntr) = clx(nplanes-ip+1,icp_cp(id)) |
3952 |
|
cltry(ip,ntr) = cly(nplanes-ip+1,icp_cp(id)) |
3953 |
|
c print*,ip,' ',cltrx(ip,ntr),cltry(ip,ntr) |
3954 |
|
elseif(icl.ne.0)then |
3955 |
|
if(mod(VIEW(icl),2).eq.0)cltrx(ip,ntr)=icl |
3956 |
|
if(mod(VIEW(icl),2).eq.1)cltry(ip,ntr)=icl |
3957 |
|
c print*,ip,' ',cltrx(ip,ntr),cltry(ip,ntr) |
3958 |
|
endif |
3959 |
|
|
3960 |
enddo |
enddo |
3961 |
c call CalcBdL(100,xxxx,IFAIL) |
c call CalcBdL(100,xxxx,IFAIL) |
3962 |
c if(ifps(xxxx).eq.1)BdL(ntr) = xxxx |
c if(ifps(xxxx).eq.1)BdL(ntr) = xxxx |
4000 |
nclsx = nclsx + 1 |
nclsx = nclsx + 1 |
4001 |
planex(nclsx) = ip |
planex(nclsx) = ip |
4002 |
sgnlxs(nclsx) = dedx(icl)/mip(VIEW(icl),LADDER(icl))!(2) |
sgnlxs(nclsx) = dedx(icl)/mip(VIEW(icl),LADDER(icl))!(2) |
4003 |
|
clsx(nclsx) = icl |
4004 |
do is=1,2 |
do is=1,2 |
4005 |
c call xyz_PAM(icl,0,is,'COG1',' ',0.,0.) |
c call xyz_PAM(icl,0,is,'COG1',' ',0.,0.) |
4006 |
call xyz_PAM(icl,0,is,PFAdef,' ',0.,0.) |
call xyz_PAM(icl,0,is,PFAdef,' ',0.,0.) |
4015 |
nclsy = nclsy + 1 |
nclsy = nclsy + 1 |
4016 |
planey(nclsy) = ip |
planey(nclsy) = ip |
4017 |
sgnlys(nclsy) = dedx(icl)/mip(VIEW(icl),LADDER(icl))!(2) |
sgnlys(nclsy) = dedx(icl)/mip(VIEW(icl),LADDER(icl))!(2) |
4018 |
|
clsy(nclsy) = icl |
4019 |
do is=1,2 |
do is=1,2 |
4020 |
c call xyz_PAM(0,icl,is,' ','COG1',0.,0.) |
c call xyz_PAM(0,icl,is,' ','COG1',0.,0.) |
4021 |
call xyz_PAM(0,icl,is,' ',PFAdef,0.,0.) |
call xyz_PAM(0,icl,is,' ',PFAdef,0.,0.) |
4029 |
endif |
endif |
4030 |
endif |
endif |
4031 |
c print*,icl,cl_used(icl),cl_good(icl),ip,VIEW(icl)!nclsx(ip),nclsy(ip) |
c print*,icl,cl_used(icl),cl_good(icl),ip,VIEW(icl)!nclsx(ip),nclsy(ip) |
4032 |
|
|
4033 |
|
***** LO METTO QUI PERCHE` NON SO DOVE METTERLO |
4034 |
|
whichtrack(icl) = cl_used(icl) |
4035 |
|
|
4036 |
enddo |
enddo |
4037 |
end |
end |
4038 |
|
|
4040 |
|
|
4041 |
|
|
4042 |
|
|
4043 |
|
|