1 |
************************************************************************* |
2 |
* |
3 |
* Subroutine fillpedsig.f |
4 |
* |
5 |
* - fills bad, pedestal and sigma variables with respective values from |
6 |
* level0 histograms, in order to perform cluster identification !??? |
7 |
* - fills bad, pedestal_t and sigma_t variables with respective truncated |
8 |
* values from level0 histograms, in order to perform data decompression |
9 |
* |
10 |
* needs: |
11 |
* - level0 pedestal, sigma and badstrip histograms |
12 |
* |
13 |
* output variables: |
14 |
* - bad |
15 |
* - pedestal |
16 |
* - pedestal_t |
17 |
* - sigma |
18 |
* - sigma_t |
19 |
* |
20 |
* to be called inside ./reduction.f |
21 |
* |
22 |
************************************************************************* |
23 |
|
24 |
|
25 |
subroutine fillpedsig |
26 |
|
27 |
include '../common/commontracker.f' |
28 |
include '../common/calib.f' |
29 |
|
30 |
external nvk |
31 |
external nst |
32 |
|
33 |
|
34 |
c------------------------------------------------------------------------ |
35 |
c |
36 |
c local variables |
37 |
c |
38 |
c------------------------------------------------------------------------ |
39 |
|
40 |
real content(nstrips_view) !temporary array |
41 |
|
42 |
c------------------------------------------------------------------------ |
43 |
c |
44 |
c loops on views filling badstrip, pedestal and sigma variables from |
45 |
c level0 histograms |
46 |
c |
47 |
c------------------------------------------------------------------------ |
48 |
|
49 |
do iv=1,nviews |
50 |
call HUNPAK(id_hi_bad+iv,content,' ',0) !puts histo contents in an array |
51 |
do is=1,nstrips_view !fills variables with array values |
52 |
bad(iv,nvk(is),nst(is))=INT(content(is)) |
53 |
enddo |
54 |
|
55 |
call HUNPAK(id_hi_ped+iv,content,' ',0) |
56 |
do is=1,nstrips_view |
57 |
pedestal(iv,nvk(is),nst(is))=content(is) |
58 |
pedestal_t(iv,nvk(is),nst(is))=AINT(content(is)) !truncated value |
59 |
enddo |
60 |
|
61 |
call HUNPAK(id_hi_sig+iv,content,' ',0) |
62 |
do is=1,nstrips_view |
63 |
sigma(iv,nvk(is),nst(is))=content(is) |
64 |
sigma_t(iv,nvk(is),nst(is))=ANINT(content(is)) !truncated value |
65 |
enddo |
66 |
|
67 |
do is=1,nstrips_view!inversione (a volte ritornano, quasi...) badstrip!??? |
68 |
if(bad(iv,nvk(is),nst(is)).eq.1) then |
69 |
bad(iv,nvk(is),nst(is))=0 |
70 |
else |
71 |
bad(iv,nvk(is),nst(is))=1 |
72 |
endif |
73 |
enddo |
74 |
|
75 |
enddo |
76 |
|
77 |
|
78 |
|
79 |
|
80 |
c$$$ C |
81 |
c$$$ C inversione vista 11: devo riinvertire i valori contenuti negli istogrammi |
82 |
c$$$ C per poter decomprimere i dati compressi (che sono stati messi a diritto |
83 |
c$$$ C nel vettore datatracker, senza inversione 11). quello che mi serve e' di |
84 |
c$$$ C riinvertire pedestal_t(11,nvk(is),nst(is)) e (anche se forse non lo uso) |
85 |
c$$$ C sigma_t(11,nvk(is),nst(is)) !??? |
86 |
c$$$ C |
87 |
c$$$ do is=1,nstrips_view |
88 |
c$$$ content(is) = pedestal_t(11,nvk(is),nst(is)) |
89 |
c$$$ enddo |
90 |
c$$$ |
91 |
c$$$ do is=1,nstrips_view |
92 |
c$$$ offset=5121 |
93 |
c$$$ if(is.le.2048) offset=3073 |
94 |
c$$$ if(is.le.1024) offset=1025 |
95 |
c$$$ iss=offset-is |
96 |
c$$$ |
97 |
c$$$ pedestal_t(11,nvk(iss),nst(iss)) = content(is) |
98 |
c$$$ enddo |
99 |
c$$$ |
100 |
c$$$ |
101 |
c$$$ do is=1,nstrips_view |
102 |
c$$$ content(is) = sigma_t(11,nvk(is),nst(is)) |
103 |
c$$$ enddo |
104 |
c$$$ |
105 |
c$$$ do is=1,nstrips_view |
106 |
c$$$ offset=5121 |
107 |
c$$$ if(is.le.2048) offset=3073 |
108 |
c$$$ if(is.le.1024) offset=1025 |
109 |
c$$$ iss=offset-is |
110 |
c$$$ |
111 |
c$$$ sigma_t(11,nvk(iss),nst(iss)) = content(is) |
112 |
c$$$ enddo |
113 |
c$$$ C |
114 |
c$$$ C fine inversione vista 11 !??? |
115 |
c$$$ C |
116 |
|
117 |
return |
118 |
end |