/[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.5 - (show annotations) (download)
Thu Nov 2 11:21:36 2006 UTC (18 years, 1 month ago) by pam-fi
Branch: MAIN
Changes since 1.4: +9 -3 lines
hough optimization

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

  ViewVC Help
Powered by ViewVC 1.1.23