/[PAMELA software]/DarthVader/TrackerLevel2/inc/F77/common_momanhough.f
ViewVC logotype

Contents of /DarthVader/TrackerLevel2/inc/F77/common_momanhough.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Fri Oct 27 16:08:18 2006 UTC (18 years, 1 month ago) by pam-fi
Branch: MAIN
Changes since 1.3: +148 -8 lines
new version of the Hough transform

1
2 C These are the common blocks used in
3 C
4 C momanhough.f
5 C
6 C Author: Vannuccini Elena
7 C Date: 2004/2005
8 C
9
10 c include 'level1.f'
11 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
12 c SPEP 1 CLUSTERS ----> COUPLES and SINGLETS
13 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
14 c
15 c Variables to associate X and Y clusters in each plane
16 c according to
17 c * geometrical criteria
18 c * charge correlation
19 c
20 c------------------------------------------------------------------------
21
22 * maximum (total) number of stored clusters
23 parameter (nclstrmax_level2 = nclstrmax)
24 c parameter (nclstrmax_level2=10*nplanes)
25 c parameter (nclstrmax_level2=5*nplanes)
26
27 * -----------------------------------------------------------
28 * maximum number of cluster (per view) required to perform
29 * track serching with full Hough transform
30 parameter (nclustermax=6)
31
32 * -----------------------------------------------------------
33 * maximum number of couples per plane and total
34 * (only to dimension the vectors)
35 c parameter (ncouplemax=2*(nclstrmax_level2/nplanes)**2)
36 c parameter (ncouplemaxtot=ncouplemax*nplanes)
37 parameter (ncouplemax=nclustermax*nclustermax)
38 parameter (ncouplemaxtot=ncouplemax*nplanes)
39 * -----------------------------------------------------------
40 * maximum number of STORED couples
41 * (if the identified couples exceeds this number the
42 * track identification is not performed and the event is
43 * tagged as not good)
44 c parameter (ncp_max=10*nplanes)
45 c parameter (ncp_max=10*nplanes)
46 parameter (ncp_max=ncouplemaxtot)
47
48
49
50 * -----------------------------------------------------------
51 * mask of views
52 * 0 = ok
53 * 1 = n.clusters > nclustermax
54 integer mask_view(nviews)
55 common/maskview/mask_view
56
57
58 * -----------------------------------------------------------
59 * --- CLUSTERS ----------------------------------------------
60 * -----------------------------------------------------------
61 * mask for GOOD cluster
62 * 1 = good
63 * 0 = bad
64 * (- the three central strips should have BAD=0) NOT ANY MORE!
65 * - the charge should be greater than
66 * DEDX_X_MIN and DEDX_Y_MIN respectivelly
67 integer cl_good(nclstrmax_level2)
68 * -----------------------------------------------------------
69 * mask for clusters associated to a track
70 * 1 = used
71 * 0 = not used
72 integer cl_used(nclstrmax_level2)
73 integer ncl_view(nviews) !n.clusters per plane
74 * -----------------------------------------------------------
75 common/clusters/cl_good,cl_used,ncl_view
76
77 * -----------------------------------------------------------
78 * --- COUPLES -----------------------------------------------
79 * -----------------------------------------------------------
80 * Clusters are associated to form couples.
81 * The j-th couple on i-th plane is formed by
82 * clusters numbers CLX(i,j) and CLY(i,j)
83 integer clx(nplanes,ncouplemax),cly(nplanes,ncouplemax)
84 * number of couples
85 integer ncp_plane(nplanes) !per plane
86 integer ncp_tot !total
87 * -----------------------------------------------------------
88 * COMMENT:
89 * the REAL number of couples is NCP_TOT, however the VIRTUAL
90 * number of couples is 2*NCP_TOT becouse of the
91 * ambiguity in Y view (2 sensors)
92 * Each real couples has two images: one on sensor 1,
93 * the other on sensor 2
94 * -----------------------------------------------------------
95 common/couples/clx,cly,ncp_plane,ncp_tot
96 * -----------------------------------------------------------
97 * FUNCTIONS to retrieve couple info
98 *
99 * id_cp(ip,icp,is) -- returns a GLOBAL couple ID,
100 * given the plane, the sensor,
101 * and the couple id relative to the plane
102 * ID < 0 if sensor =1
103 * ID > 0 if sensor =2
104 *
105 * Given the global couple ID:
106 *
107 * ip_cp(id) -- returns the plane number
108 * is_cp(id) -- returns the plane number
109 * icp_cp(id) -- returns the id number relative to the plane
110 * -----------------------------------------------------------
111
112
113 * -----------------------------------------------------------
114 * --- SINGLETS ----------------------------------------------
115 * -----------------------------------------------------------
116 * single clusters, not associated in any couple
117 integer ncls(nplanes)
118 integer cls(nplanes,nclstrmax_level2)
119 * -----------------------------------------------------------
120 * mask for clusters not inlcuded in a couple
121 * 1 = single
122 * 0 = non single
123 integer cl_single(nclstrmax_level2)
124 * -----------------------------------------------------------
125 common/singlets/ncls,cls,cl_single
126
127
128 c+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
129 c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
130 c------------------------------------------------------------------------
131 c HOUGH-TRANSFORM parameters
132 c------------------------------------------------------------------------
133 c + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
134 c+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
135
136 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
137 c SPEP 2 COUPLES ----> DOUBLETS and TRIPLETS
138 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
139 c
140 c Variables to associate couples in
141 C
142 c DOUBLETS for Y-Z view
143 c TRIPLETS for X-Z view
144 c
145 c The 3D particle track can be approximated with a straight line
146 c in the Y-Z view and with a circle sector in the X-Z view.
147 c The Hough trasform is applied independently to the two views.
148 c The parameters of the projected tracks are evaluated for each
149 c combination of points (doublets in YZ and triplets in XZ).
150 c
151 c Hence track candidates will be identified by looking for
152 c "clusters" of points (CLOUDS) in the parameter space.
153 c
154 c------------------------------------------------------------------------
155 parameter (ndblt_max=5000) !maximum number of doublets
156 parameter (ntrpt_max=10*ndblt_max) !maximum number of triplets
157 * -----------------------------------------------------------
158 * number of doublets and triplets
159 integer ndblt,ntrpt
160 * -----------------------------------------------------------
161 * List of couple absolute IDs that form doublets and triplets
162 integer cpyz1(ndblt_max),cpyz2(ndblt_max)
163 integer cpxz1(ntrpt_max),cpxz2(ntrpt_max),cpxz3(ntrpt_max)
164 * -----------------------------------------------------------
165 * parameters of the projected tracks
166 real
167 $ alfayz1(ndblt_max), !Y0
168 $ alfayz2(ndblt_max) !tg theta-yz
169 real
170 $ alfaxz1(ntrpt_max), !X0
171 $ alfaxz2(ntrpt_max), !tg theta-xz
172 $ alfaxz3(ntrpt_max) !1/r
173 * -----------------------------------------------------------
174 common/hough_param/
175 $ alfayz1, !Y0
176 $ alfayz2, !tg theta-yz
177 $ alfaxz1, !X0
178 $ alfaxz2, !tg theta-xz
179 $ alfaxz3 !1/r
180 common/doublets/ndblt,cpyz1,cpyz2
181 common/triplets/ntrpt,cpxz1,cpxz2,cpxz3
182
183 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
184 c SPEP 3 DOUBLETS and TRIPLETS ----> YZ and XZ-CLOUDS
185 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
186 c
187 c Variables to group doublets and triplets in CLOUDS, according to
188 c their relative distance in parameter space.
189 c The association is done indipendently on YZ and XZ views.
190 c
191 c------------------------------------------------------------------------
192 parameter (ncloyz_max=200)!maximum number of clouds
193 parameter (ncloxz_max=200)! "
194 * -----------------------------------------------------------
195 * Number of YZ and XZ clouds
196 integer nclouds_yz,nclouds_xz
197 * -----------------------------------------------------------
198 * mask to store combinations of couples selected as clouds
199 * NOTATION:
200 * 0 = not selected
201 * 1 = selected couple image in SENSOR 1
202 * 2 = selected couple image in SENSOR 2
203 * 3 = selected both images
204 integer cpcloud_yz(ncloyz_max,ncouplemaxtot)
205 integer cpcloud_xz(ncloxz_max,ncouplemaxtot)
206 * -----------------------------------------------------------
207 * doublet and triplet ID in the selected clouds
208 integer db_cloud(ndblt_max)
209 integer tr_cloud(ntrpt_max)
210 * -----------------------------------------------------------
211 * number of points in the cloud
212 integer ptcloud_yz(ncloyz_max)
213 integer ptcloud_xz(ncloxz_max)
214 * -----------------------------------------------------------
215 * average parameters
216 real alfayz1_av(ncloyz_max),alfayz2_av(ncloyz_max)
217 real alfaxz1_av(ncloxz_max),alfaxz2_av(ncloxz_max)
218 $ ,alfaxz3_av(ncloxz_max)
219 common/clouds_yz/
220 $ nclouds_yz
221 $ ,alfayz1_av,alfayz2_av
222 $ ,ptcloud_yz,db_cloud,cpcloud_yz
223 common/clouds_xz/
224 $ nclouds_xz
225 $ ,alfaxz1_av,alfaxz2_av,alfaxz3_av
226 $ ,ptcloud_xz,tr_cloud,cpcloud_xz
227
228 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
229 c SPEP 4 YZ and XZ-CLOUDS ----> TRACK CANDIDATES
230 c+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
231 c
232 c Variables to store information about track-candidates,
233 c evaluated by combining YZ and XZ clouds.
234 c
235 c NB ! ! !
236 c
237 c While until now the plane number followed the mechanical notation
238 c (1 to 6, from bottom to top), variables related to the tracks
239 c are referred to the mini notation (1 to 6, from top to bottom)
240 c
241 c------------------------------------------------------------------------
242
243 * -----------------------------------------------------
244 * default p.f.a.
245 * used to fit track candidates
246 * -----------------------------------------------------
247 character*5 PFAdef
248 parameter (PFAdef='COG1')
249
250 c------------------------------------------------------------------------
251 c variable related to track selection and fitting
252 c------------------------------------------------------------------------
253
254 * track candidates
255 PARAMETER (NTRACKSMAX=ncloyz_max*ncloxz_max)
256 INTEGER NTRACKS !number of track candidates
257 REAL AL_STORE(5,NTRACKSMAX)
258 REAL XM_STORE(NPLANES,NTRACKSMAX)
259 REAL YM_STORE(NPLANES,NTRACKSMAX)
260 REAL ZM_STORE(NPLANES,NTRACKSMAX)
261 REAL RESX_STORE(NPLANES,NTRACKSMAX)
262 REAL RESY_STORE(NPLANES,NTRACKSMAX)
263 REAL XV_STORE(NPLANES,NTRACKSMAX)
264 REAL YV_STORE(NPLANES,NTRACKSMAX)
265 REAL ZV_STORE(NPLANES,NTRACKSMAX)
266 REAL AXV_STORE(NPLANES,NTRACKSMAX)
267 REAL AYV_STORE(NPLANES,NTRACKSMAX)
268 REAL XGOOD_STORE(NPLANES,NTRACKSMAX)
269 REAL YGOOD_STORE(NPLANES,NTRACKSMAX)
270 INTEGER CP_STORE(NPLANES,NTRACKSMAX)
271 INTEGER CLS_STORE(NPLANES,NTRACKSMAX)
272 REAL RCHI2_STORE(NTRACKSMAX)
273 common/track_candidates/NTRACKS,AL_STORE
274 $ ,XV_STORE,YV_STORE,ZV_STORE
275 $ ,XM_STORE,YM_STORE,ZM_STORE
276 $ ,RESX_STORE,RESY_STORE
277 $ ,AXV_STORE,AYV_STORE
278 $ ,XGOOD_STORE,YGOOD_STORE
279 $ ,CP_STORE,CLS_STORE,RCHI2_STORE
280
281
282 * best-candidate selection
283 PARAMETER (CHI2MAX=15)
284
285
286
287 c------------------------------------------------------------------------
288 c CUTS and other parameters
289 c------------------------------------------------------------------------
290 PARAMETER (PIGR=3.14) !159265359)!(1)
291 * -----------------------------------------------------
292 * cuts on cluster signal
293 * -----------------------------------------------------
294 parameter (dedx_x_min=0.)
295 parameter (dedx_y_min=0.)
296 * -----------------------------------------------------
297 * number of GOOD strips around MAXS
298 * (NB this cut has been removed in track fitting but
299 * not in calibration)
300 * -----------------------------------------------------
301 parameter (ngoodstr=2)
302 * -----------------------------------------------------
303 * first cuts on the parameters determined with
304 * the hough transform, in order to exclude from the
305 * analysis non physical dublets and triplets
306 * (out of the geometrical acceptance of the apparatus)
307 * -----------------------------------------------------
308 * geometrical acceptance whit 6 planes
309 c$$$ parameter (alfyz1_max=8.7) !Y0 (real acc+1cm)
310 c$$$ parameter (alfyz2_max=0.47) !tg theta-yz (18+7deg)
311 c$$$ parameter (alfxz1_max=9.5) !X0 (real acc+1cm)
312 c$$$ parameter (alfxz2_max=0.47) !tg theta-xz (18+7deg)
313
314 c$$$* geometrical acceptance whit the last 5 planes
315 c$$$ parameter (alfyz1_max=12.4) !Y0 (real acc+1cm)
316 c$$$ parameter (alfyz2_max=0.55) !tg theta-yz (22+7deg)
317 c$$$ parameter (alfxz1_max=13.7) !X0 (real acc+1cm)
318 c$$$ parameter (alfxz2_max=0.55) !tg theta-xz (22+7deg)
319 c$$$
320 c$$$* geometrical acceptance whit the last 4 planes
321 c$$$ parameter (alfyz1_max=18.6) !Y0 (real acc+1cm)
322 c$$$ parameter (alfyz2_max=0.70) !tg theta-yz (28+7deg)
323 c$$$ parameter (alfxz1_max=20.6) !X0 (real acc+1cm)
324 c$$$ parameter (alfxz2_max=0.70) !tg theta-xz (28+7deg)
325 c$$$
326 * geometrical acceptance whit the last 3 planes
327 parameter (alfyz1_max=31.0) !Y0 (real acc+1cm)
328 parameter (alfyz2_max=1.04) !tg theta-yz (39+7deg)
329 parameter (alfxz1_max=34.4) !X0 (real acc+1cm)
330 parameter (alfxz2_max=1.04) !tg theta-xz (39+7deg)
331 * -----------------------------------------------------
332 * cut on the position of the circle center:
333 * center inside the spectrometer volume is not physical
334 * ==> THE TRIPLET IS REJECTED
335 * -----------------------------------------------------
336 parameter (xclimit=8.) !cm
337 * -----------------------------------------------------
338 * Parameter normalization constants, needed to evaluate
339 * distances in parameter space
340 * -----------------------------------------------------
341 parameter (Dalfaxz3=1.)
342 parameter (Dalfayz1=0.8864e-1)
343 parameter (Dalfayz2=0.6204e-3)
344 parameter (Dalfaxz1=0.2909e-1)
345 parameter (Dalfaxz2=0.2759e-2)
346 * -----------------------------------------------------
347 * Cut on normalized distances in parameter space.
348 * Doublets/triplets are recursively included in a cloud
349 * if the distance from any of the points already included
350 * is less than this cut.
351 * -----------------------------------------------------
352 parameter(cutystart=0.3)
353 parameter(cutystep=0.3)
354 parameter(cutxstart=1.)
355 parameter(cutxstep=1.)
356 parameter(maxcuty=100.)
357 parameter(maxcutx=150.)
358
359 parameter(nstepx=50) !inclusion-cut increasing steps
360 parameter(nstepy=50)
361
362 real cutdistyz !y0 / tg theta_yz space
363 real cutdistxz !x0 / tg theta_xz space
364 common/cutdi/cutdistyz,cutdistxz
365 * (NB deflection is not considered in the selection criteria)
366 * --------------------------------------------------
367 * cloud selection
368 * --------------------------------------------------
369 parameter(x_min_start=4)
370 parameter(x_min_step=1)
371
372 integer ncpxz_min
373 integer nptxz_min !for a circle
374 integer nplxz_min !for a circle
375
376 common/cutxclouds/ncpxz_min,nptxz_min,nplxz_min
377
378 parameter(y_min_start=3)
379
380 integer ncpyz_min
381 integer nptyz_min !for a straight line
382 integer nplyz_min !for a circle
383 common/cutyclouds/ncpyz_min,nptyz_min,nplyz_min
384 * --------------------------------------------------
385
386 * -----------------------------------------------------
387 * minimum number of matching couples required to combine
388 * XZ-YZ clouds and perform the fit
389 * -----------------------------------------------------
390 parameter (ncpok=3)
391
392 * -----------------------------------------------------
393 * maximum value of deflection from Hough transform
394 * accepted in order to perform the track fit
395 * -----------------------------------------------------
396 parameter (defmax=10000.) !GV-1
397
398 * -----------------------------------------------------
399 * cut to include new couple or single clusters in the
400 * track fitting, after the first fit
401 * -----------------------------------------------------
402 parameter (clinc=10)
403
404
405

  ViewVC Help
Powered by ViewVC 1.1.23