/[PAMELA software]/eventviewer/ground/src/ptlevel1.for
ViewVC logotype

Contents of /eventviewer/ground/src/ptlevel1.for

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu Mar 9 15:50:54 2006 UTC (18 years, 8 months ago) by mocchiut
Branch: MAIN
CVS Tags: v9r03, HEAD
Changes since 1.1: +11 -6 lines
Added GUI, read tracker output from software v3r02, S4/ND in scale, many bugs fixed

1 subroutine ptlevel1()
2
3 c LOGICAL CHAIN
4 c CHARACTER*128 CFILE
5 c INTEGER IDNEVT,NCHEVT,ICHEVT
6 c REAL OBS(13)
7 *
8 c COMMON /PAWIDN/ IDNEVT,OBS
9 c COMMON /PAWCHN/ CHAIN, NCHEVT, ICHEVT
10 c COMMON /PAWCHC/ CFILE
11 *
12 *-- Ntuple Variable Declarations
13 *
14 REAL DEDX(500),CLSIGNAL(8500),CNEV(12,24)
15 INTEGER NEV1,NCLSTR1,VIEW(500),LADDER(500),MAXS(500),MULT(500)
16 & ,INDSTART(500),INDMAX(500),TOTCLLENGTH
17 LOGICAL GOOD1
18 *
19 integer ncl(2)
20 real clp(3,500)
21 real cls(2,500)
22 real clz(2,500)
23 real sigma_matrix(12,3072)
24 c
25 Integer pkt_type1
26 Integer pkt_num1
27 Integer obt1
28 c Integer which_calib1
29
30 c
31 c parameter(NWPAWC=8)
32 c common/pawc/hmem(NWPAWC)
33 c save/pawc/
34 c common/quest/iquest(1)
35 c save/quest/
36 c
37 c
38
39 LOGICAL crc1(12)
40 integer cpu_crc1
41 integer whic_calib1, swcode1
42 C
43
44 COMMON /PWCR4/ GOOD1,NEV1,whic_calib1,swcode1,crc1,
45 & pkt_type1,pkt_num1,obt1,cpu_crc1,
46 & NCLSTR1,VIEW,LADDER,MAXS,MULT,DEDX
47 & ,INDSTART,INDMAX,TOTCLLENGTH,CLSIGNAL,CNEV,
48 & ncl,clp,cls,clz,sigma_matrix
49 SAVE /PWCR4/
50
51 *
52
53 *-- Enter user code here
54 *
55 c integer ,nstripsview(12)
56 integer ind,ic,cllength,lows,highs,nstrips,is
57 c integer sflag(12,3072) !to avoid putting more than one time a
58 c strip in a histogram when a cluster is more than one time contained in
59 c clsignal array (usually these are the double peaked clusters)
60 real sign,noise,clinclcut
61
62 real zlevel(12)
63 data zlevel/22.28,22.28,13.38,13.38,4.48,4.48,
64 + -4.42,-4.42,-13.32,-13.32,-22.23,-22.23/
65
66 parameter(incut=5)
67 parameter(signcut=50.)
68
69 c parameter(traslys=2151)
70 parameter(traslys=2115) !INVERSIONE?????????????
71
72 c call hlimit(nwpawc)
73
74
75 * ***********
76
77 c PRINT *,'TRACKER: evento ',nev1
78 c event_num_trk(1) = nev1
79 c event_num_trk(1) = mod(nev1,1000000)
80 c
81 c do i = 1, 12
82 c do j = 1, 3072
83 c if ( sigma_matrix(i,j).ne.0. )
84 c & print *,'sigma(',i,',',j,') = ',sigma_matrix(i,j)
85 c enddo
86 c enddo
87 c print *,' nclstr = ',nclstr1
88 c do i = 1, nclstr1
89 c print *,' view(',i,') ',view(i)
90 c print *,' ladder(',i,') ',ladder(i)
91 c enddo
92 c
93
94 ind=0
95
96 nclx = 0
97 ncly = 0
98
99 c print*,'acidenti a me ',event_num_trk(1),nclstr1
100
101 do ic=1,nclstr1
102
103 if(ic.ne.nclstr1) then
104 cllength=indstart(ic+1)-indstart(ic)
105 else
106 cllength=(totCLlength+1)-indstart(ic)
107 endif
108
109 lows=maxs(ic)-(indmax(ic)-indstart(ic))
110 highs=lows+cllength-1
111
112 sign=0.
113 noise=0.
114 nstrips=0
115 posx = 0.
116 posy1 = 0.
117 posy2 = 0.
118 posz = 0.
119 pposx = 0.
120 pposy1 = 0.
121 pposy2 = 0.
122 pposz = 0.
123
124 C print *,'qua ',ic
125 do is=lows,highs
126 ind=ind+1
127 C print *,'qui view(ic) ',view(ic),' is ',is
128 C print *,'qui clsignal(ind) ',clsignal(ind),' ind ',is
129 clinclcut=incut*sigma_matrix(view(ic),is)
130 if (clsignal(ind).gt.clinclcut) then
131 C print *,'qua ci arrivo'
132 sign=sign+clsignal(ind)
133 noise=noise+sigma_matrix(view(ic),is)
134 nstrips=nstrips+1
135 posz = zlevel(view(ic))
136 C print *,'qua anche sign ',sign,' noise ',noise
137 if (mod(view(ic),2).eq.1) then !!! Y Y Y Y
138 if (view(ic).ne.11) then
139 str=float(mod(is-1,1024)+1) !Y
140 posy1 = -6.9541 + (str-1)*0.00665
141 posy2 = 0.1 + (str-1)*0.00665
142 else !??????????????????INVERSIONE??????????
143 str=float(mod(is-1,1024)+1) !Y11
144 c str=traslys-str
145 str=1024-str + 67
146 posy1 = -6.9541 + (str-1)*0.00665 !-0.5
147 posy2 = 0.1 + (str-1)*0.00665 !-0.5
148 endif
149 pposy1 = pposy1 + posy1*clsignal(ind)
150 pposy2 = pposy2 + posy2*clsignal(ind)
151 else
152 str=float(is) !X
153 srt = mod(is-1,1024)+1
154 lad = int((is-1)/1024) + 1
155 if(lad.eq.1) posx=-7.8798+(srt-1)*0.005
156 if(lad.eq.2) posx=-2.5575+(srt-1)*0.005
157 if(lad.eq.3) posx= 2.7648+(srt-1)*0.005
158 pposx = pposx + posx*clsignal(ind)
159 endif
160 endif
161 enddo
162 if(mod(view(ic),2).eq.1)then
163 C print *,'qui ci sono e pposy1 ',pposy1,' pposy2 ',pposy2,' sign ',sign
164 ncly = ncly + 1
165 clp(2,ncly) = pposy1/sign
166 clp(3,ncly) = pposy2/sign
167 clz(2,ncly) = posz
168 cls(2,ncly) = sign
169 else
170 nclx = nclx + 1
171 clp(1,nclx) = pposx/sign
172 clz(1,nclx) = posz
173 cls(1,nclx) = sign
174 c call hfill(99,posx,posz,sign)
175 endif
176 enddo
177 c do i = 1, 19
178 c print *,'cls(2,',i,') = ',cls(2,i)
179 c print *,'cls(1,',i,') = ',cls(1,i)
180 c enddo
181 ncl(1) = nclx
182 ncl(2) = ncly
183 c project_trk_level1 = 1
184 C print *,'****'
185 return
186 end

  ViewVC Help
Powered by ViewVC 1.1.23