COSMOS v7.655  COSMOSv7655
(AirShowerMC)
ckf2cos.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine ckf2cos (kf, code, subcode, chg)
 
subroutine ccos2kf (code, subcode, chg, kf)
 
subroutine ckf2cosb (kf, p)
 
subroutine ccos2kfb (p, kf)
 

Function/Subroutine Documentation

◆ ccos2kf()

subroutine ccos2kf ( integer, intent(in)  code,
integer, intent(in)  subcode,
integer, intent(in)  chg,
integer, intent(out)  kf 
)

Definition at line 216 of file ckf2cos.f.

References cerrormsg(), k0l, kbomega, kdmes, kds, kelec, keta, ketap, kfbomega, kfd0, kfdmes, kfds, kfelec, kfeta, kfetap, kfgzai, kfgzai0, kfk0l, kfk0s, kfkaon, kflambda, kflambdac, kfmuon, kfneue, kfneumu, kfneutau, kfneutron, kfomega, kfphi, kfphoton, kfpi0, kfpion, kfproton, kfrho, kfrhoc, kfsigma0, kfsigmam, kfsigmap, kftau, kgnuc, kgzai, kkaon, klambda, klambdac, kmuon, kneue, kneumu, kneutau, knuc, komega, kphi, kphoton, kpion, krho, ksigma, and ktau.

Referenced by __codeconv.f__(), ccos2kfb(), and chanewlund().

216 ! cosmos code to kf code;
217  implicit none
218 #include "Zcode.h"
219 #include "Zkfcode.h"
220  integer,intent(in):: code, subcode, chg ! cosmos code but not integer*2
221  integer,intent(out):: kf ! 0 means code is not in PDG
222 ! (say, kEdepo ...)
223  character*80 msg
224  if(code .eq. kelec) then
225  kf = sign(kfelec, -chg)
226  elseif(code .eq. kphoton) then
227  kf = kfphoton
228  elseif(code .eq. kpion) then
229  if(chg .eq. 0) then
230  kf = kfpi0
231  else
232  kf = sign(kfpion, chg)
233  endif
234  elseif(code .eq. kkaon) then
235  if(chg .eq. 0) then
236  if(abs(subcode) .eq. k0l) then
237  kf = sign( kfk0l, subcode)
238  else
239  kf =sign( kfk0s, subcode)
240  endif
241  else
242  kf = sign(kfkaon, chg)
243  endif
244  elseif(code .eq. knuc) then
245  if(chg .eq. 0) then
246  kf = sign( kfneutron, -subcode)
247  else
248  kf = sign(kfproton, chg)
249  endif
250  elseif(code .eq. kmuon) then
251  kf = sign(kfmuon, -chg)
252  elseif(code .eq. kneue ) then
253  kf = sign(kfneue, -subcode)
254  elseif(code .eq. kneumu) then
255  kf = sign(kfneumu, -subcode)
256  elseif(code .eq. kdmes) then
257  if(chg .eq. 0) then
258  kf = sign(kfd0, -subcode)
259  else
260  kf = sign(kfdmes, -chg)
261  endif
262  elseif(code .eq. klambda) then
263  kf = sign(kflambda, -subcode)
264  elseif(code .eq. kgnuc ) then
265  kf = 1000000000 + abs(chg)*10000 + subcode*10
266  kf = sign(kf, chg)
267  elseif( code == keta ) then
268  kf = kfeta
269  elseif( code == krho ) then
270  if( chg == 0) then
271  kf = kfrho
272  else
273  kf = sign(kfrhoc, chg)
274  endif
275  elseif( code == kdelta ) then
276  if( chg == 0 ) then
277  kf = kfdelta0
278  elseif( chg == 1 ) then
279  kf = kfdeltap
280  else
281  kf = kfdeltam
282  endif
283  elseif ( code == komega ) then
284  kf = kfomega
285  elseif( code == kphi ) then
286  kf = kfphi
287  elseif(code .eq. ksigma) then
288  if(chg .eq. 1) then
289  kf = sign(kfsigmap, -subcode)
290  elseif(chg .eq. 0) then
291  kf = sign(kfsigma0, -subcode)
292  else
293  kf = sign(kfsigmam, -subcode)
294  endif
295  elseif(code .eq. kgzai) then
296  if(chg .eq. 0) then
297  kf = sign(kfgzai0, -subcode)
298  else
299  kf = sign(kfgzai, -chg)
300  endif
301  elseif(code .eq. klambdac) then
302  kf =sign(kflambdac, chg)
303  elseif(code .eq. kbomega ) then
304  kf = sign(kfbomega, -chg)
305  elseif( code == kds ) then
306  kf = sign(kfds, -chg)
307  elseif( code == kxic ) then
308  kf = sign(kfxic, -chg)
309  elseif( code == komec0 ) then
310  kf = sign(kfomec0, -subcode)
311  elseif( code == ktau ) then
312  kf = sign(kftau, -subcode)
313  elseif( code == kneutau) then
314  kf = sign(kfneutau, -subcode)
315  elseif( code == ketap ) then
316  kf = kfetap
317  elseif( code <= 0 )then
318  kf = 0
319  else
320  write(msg, *) 'code, subcode, chg to ccos2kf=',
321  & code, subcode, chg
322  call cerrormsg(msg, 1)
323  call cerrormsg(' cannot be converted to kf code',1)
324  kf=0
325  endif
326 
327 
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
integer kfproton
Definition: Zkfcode.h:1
integer kfphi
Definition: Zkfcode.h:1
integer kfgzai0
Definition: Zkfcode.h:1
max ptcl codes in the kgzai
Definition: Zcode.h:2
max ptcl codes in the ketap
Definition: Zcode.h:2
integer kfneumu
Definition: Zkfcode.h:1
integer kfomega
Definition: Zkfcode.h:1
integer kfkaon
Definition: Zkfcode.h:1
integer * kfneue
Definition: Zkfcode.h:1
integer kfrho
Definition: Zkfcode.h:1
max ptcl codes in the kseethru ! subcode integer k0l
Definition: Zcode.h:2
max ptcl codes in the kdmes
Definition: Zcode.h:2
integer kfgzai
Definition: Zkfcode.h:1
max ptcl codes in the kgnuc
Definition: Zcode.h:2
integer kfpion
Definition: Zkfcode.h:1
max ptcl codes in the kphi
Definition: Zcode.h:2
const int kphoton
Definition: Zcode.h:6
max ptcl codes in the klambdac
Definition: Zcode.h:2
integer kfbomega
Definition: Zkfcode.h:1
max ptcl codes in the kkaon
Definition: Zcode.h:2
integer * kfsigmap
Definition: Zkfcode.h:1
integer kfdmes
Definition: Zkfcode.h:1
max ptcl codes in the kelec
Definition: Zcode.h:2
integer * kftau
Definition: Zkfcode.h:1
integer kfsigmam
Definition: Zkfcode.h:1
max ptcl codes in the kneue
Definition: Zcode.h:2
max ptcl codes in the kneutau
Definition: Zcode.h:2
max ptcl codes in the komega
Definition: Zcode.h:2
integer kfelec
Definition: Zkfcode.h:1
integer kfneutron
Definition: Zkfcode.h:1
integer kfd0
Definition: Zkfcode.h:1
integer kfpi0
Definition: Zkfcode.h:1
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
integer kfk0l
Definition: Zkfcode.h:1
max ptcl codes in the klambda
Definition: Zcode.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
max ptcl codes in the krho
Definition: Zcode.h:2
max ptcl codes in the kneumu
Definition: Zcode.h:2
integer kflambda
Definition: Zkfcode.h:1
integer * kfk0s
Definition: Zkfcode.h:1
integer kfds
Definition: Zkfcode.h:1
integer kfeta
Definition: Zkfcode.h:1
integer * kfrhoc
Definition: Zkfcode.h:1
max ptcl codes in the kds
Definition: Zcode.h:2
max ptcl codes in the ktau
Definition: Zcode.h:2
integer kfsigma0
Definition: Zkfcode.h:1
integer kfetap
Definition: Zkfcode.h:1
max ptcl codes in the keta
Definition: Zcode.h:2
integer kfneutau
Definition: Zkfcode.h:1
integer kfphoton
Definition: Zkfcode.h:1
integer * kflambdac
Definition: Zkfcode.h:1
max ptcl codes in the kpion
Definition: Zcode.h:2
max ptcl codes in the ksigma
Definition: Zcode.h:2
max ptcl codes in the kmuon
Definition: Zcode.h:2
max ptcl codes in the kbomega
Definition: Zcode.h:2
integer kfmuon
Definition: Zkfcode.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ccos2kfb()

subroutine ccos2kfb ( type(ptcl), intent(in)  p,
integer, intent(out)  kf 
)

Definition at line 344 of file ckf2cos.f.

References ccos2kf().

344  implicit none
345 #include "Zptcl.h"
346  type(ptcl),intent(in):: p ! input; p%code, p%subcode and p%charge
347  integer,intent(out):: kf ! pdg code for p%code...
348 
349  integer:: code, subcode, charge
350 
351  code = p%code
352  subcode = p%subcode
353  charge = p%charge
354  call ccos2kf(code, subcode, charge, kf)
subroutine ccos2kf(code, subcode, chg, kf)
Definition: ckf2cos.f:216
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
Definition: Zptcl.h:75
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
Here is the call graph for this function:

◆ ckf2cos()

subroutine ckf2cos ( integer  kf,
integer  code,
integer  subcode,
integer  chg 
)

Definition at line 2 of file ckf2cos.f.

References antip, cerrormsg(), k0l, k0s, kbomega, kdmes, kds, kelec, keta, ketap, kfbomega, kfd0, kfdmes, kfds, kfelec, kfeta, kfetap, kfgzai, kfgzai0, kfk0, kfk0l, kfk0s, kfkaon, kflambda, kflambdac, kfmuon, kfneue, kfneumu, kfneutau, kfneutron, kfomega, kfphi, kfphoton, kfpi0, kfpion, kfproton, kfrho, kfrhoc, kfsigma0, kfsigmam, kfsigmap, kftau, kgnuc, kgzai, kkaon, klambda, klambdac, kmuon, kneue, kneumu, kneutron, kneutronb, knuc, komega, kphi, kphoton, kpion, krare, krho, ksigma, ktau, regptcl, and rndc().

Referenced by cexmprimsymb(), and ckf2cosb().

2 ! kf code to cosmos code.
3  implicit none
4 #include "Zcode.h"
5 #include "Zkfcode.h"
6 
7  integer kf ! input
8  integer code, subcode, chg ! output. For spectator kf, code=krare
9 ! for tau neutrio, code =krare
10  character*80 msg
11  real(8)::u
12  integer kfabs
13  kfabs = abs(kf)
14 ! special treatment for K0
15  if( kfabs == kfk0 ) then ! K0 : 50% K0s; 50 % K0L
16  call rndc(u)
17  if(u < 0.5 ) then
18  kfabs = kfk0s
19  else
20  kfabs = kfk0l
21  endif
22  endif
23 !
24  if(kfabs .eq. kfpion) then
25  code = kpion
26  subcode = sign(1, -kf)
27  chg = sign(1, kf)
28  elseif(kfabs .eq. kfpi0) then
29  code = kpion
30  subcode = 0
31  chg = 0
32  elseif( kfabs .eq. kfkaon ) then
33  code = kkaon
34  subcode =sign(1, -kf)
35  chg = sign(1, kf)
36  elseif(kfabs .eq. kfk0l) then
37  code =kkaon
38  subcode =sign( k0l, kf)
39  chg = 0
40  elseif(kfabs .eq. kfk0s) then
41  code = kkaon
42  subcode =sign( k0s, kf)
43  chg = 0
44  elseif(kfabs .eq. kfneutron) then
45  code =knuc
46  if(kf .gt. 0) then
48  else
50  endif
51  chg = 0
52  elseif(kfabs .eq. kfproton) then
53  code = knuc
54  if(kf .gt. 0) then
56  else
57  subcode = antip
58  endif
59  chg =sign(1, kf)
60 !cc elseif(kfabs .ge. 10000) then
61 !cc code = krare ! target spectator. neglect
62 ! p(i,5) has mass. kfabs-10000=Z
63 ! &&&&&&&&&&&&&&&&&&
64 ! write(msg, *) 'kf code=',kf, ' not treatable'
65 ! call cerrorMsg(msg, 1)
66 ! call cerrorMsg('the particle is neglected',1)
67 ! &&&&&&&&&&&&&&&&
68  elseif(kfabs .eq. kfeta) then
69  code= keta
70  subcode = 0
71  chg = 0
72  elseif(kfabs .eq. kfelec) then
73  code = kelec
74  subcode = sign(1, -kf)
75  chg = sign(1, -kf)
76  elseif( kf .eq. kfphoton ) then
77  code = kphoton
78  subcode = 0
79  chg = 0
80  elseif(kfabs .eq. kfmuon) then
81  code = kmuon
82  subcode = sign(1, -kf)
83  chg = sign(1, -kf)
84  elseif(kfabs .eq. kfneue) then
85  code = kneue
86  subcode =sign(1, -kf)
87  chg = 0
88  elseif(kfabs .eq. kfneumu) then
89  code = kneumu
90  subcode =sign(1, -kf)
91  chg = 0
92  elseif(kfabs .eq. kfdmes) then
93  code = kdmes
94  subcode = sign(1, -kf)
95  chg = sign(1, kf)
96  elseif(kfabs .eq. kfd0) then
97  code =kdmes
98  subcode = sign(1, -kf)
99  chg = 0
100  elseif(kfabs .eq. kflambda) then
101  code = klambda
102  subcode = sign(1, -kf)
103  chg = 0
104  elseif( kfabs .ge. 1000000020 .and. kfabs .le. 1000922350 ) then ! 2n system
105 ! nucleus is 10LZZZAAAI where L=0 (if not containing strangeness)
106 ! ZZZ is 3 digits of charge, AAA 3digits of mass no. I=0 for
107 ! gound state; so for our case, 1000010020 is minimum for deuteron
108 ! and 1000922350 is max for U(235)
109  if(kf .lt. 0) then
110  write(0,*) ' anti nuclues is not yet supported '
111  code = krare
112  else
113  code=kgnuc
114  subcode =( (kfabs/10)*10-(kfabs/10000)*10000 )/10
115  chg =( (kfabs/10000)*10000 - (kfabs/1000000)*1000000 )
116  * /10000
117  if( kfabs < 1000010020 ) then ! charge 0
118  code = krare
119  endif
120  endif
121  elseif(kfabs == kfdelta0) then
122  code = kdelta
123  subcode = -1
124  chg =0
125  elseif(kfabs == kfdeltap) then
126  code = kdelta
127  subcode = -1
128  chg = 1
129  elseif(kfabs == kfdeltam) then
130  code = kdelta
131  subcode = 1
132  chg = -1
133  elseif(kfabs .eq. kfsigma0) then
134  code = ksigma
135  subcode = sign(1, -kf)
136  chg = 0
137  elseif(kfabs .eq. kfsigmap) then
138  code = ksigma
139  subcode = sign(1, -kf)
140  chg = sign(1, kf)
141  elseif(kfabs .eq. kfsigmam) then
142  code = ksigma
143  subcode = sign(1, -kf)
144  chg = sign(1, -kf)
145  elseif(kfabs .eq. kfgzai0 ) then
146  code = kgzai
147  subcode = sign(1, -kf)
148  chg = 0
149  elseif(kfabs .eq. kfgzai ) then
150  code = kgzai
151  subcode = sign(1, -kf)
152  chg = sign(1, -kf)
153  elseif(kfabs .eq. kflambdac) then
154  code = klambdac
155  subcode = sign(1, -kf)
156  chg = sign(1, kf)
157  elseif(kfabs .eq. kfbomega ) then
158  code = kbomega
159  subcode = sign(1, -kf)
160  chg = sign(1, -kf)
161  elseif(kfabs .eq. kftau ) then
162  code = ktau
163  subcode = sign(1, -kf)
164  chg = sign(1, -kf)
165  elseif( kfabs == kfneutau )then
166  code = kfneutau
167  subcode = sign(1,-kf)
168  chg= 0
169  elseif(kfabs .eq. kfrho) then ! rho
170  code = krho
171  subcode = 0
172  chg = 0
173  elseif(kfabs == kfrhoc) then
174  code = krho
175  subcode = sign(1, -kf)
176  chg = sign(1, kf)
177  elseif(kfabs .eq. kfomega) then ! omega
178  code = komega
179  subcode = 0
180  chg = 0
181  elseif( kfabs .eq. kfphi ) then ! phi
182  code = kphi
183  subcode = 0
184  chg = 0
185  elseif( kfabs == kfds ) then ! Ds
186  code = kds
187  chg = sign(1, kf )
188  subcode = sign(1,-kf)
189  elseif( kfabs == kfxic ) then
190  code = kxic
191  chg = sign(1,kf)
192  subcode = sign(1,-kf)
193  elseif( kfabs == kfxic0 ) then
194  code = kxic0
195  chg =0
196  subcode =sign(1,-kf)
197  elseif( kfabs == kfomec0 ) then
198  code = komec0
199  chg = 0
200  subcode = sign(1,-kf)
201  elseif( kfabs == kfetap ) then
202  code = ketap
203  chg = 0
204  subcode = 0
205  else
206  code = krare
207  endif
208  if( code == krare ) then
209  write(msg, *) 'not implemented kf code=', kf
210  call cerrormsg(msg, 1)
211  call cerrormsg('we neglect this particle',1)
212  endif
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
integer kfproton
Definition: Zkfcode.h:1
integer kfphi
Definition: Zkfcode.h:1
integer kfgzai0
Definition: Zkfcode.h:1
max ptcl codes in the kgzai
Definition: Zcode.h:2
max ptcl codes in the ketap
Definition: Zcode.h:2
integer kfneumu
Definition: Zkfcode.h:1
integer kfomega
Definition: Zkfcode.h:1
integer kfkaon
Definition: Zkfcode.h:1
integer * kfneue
Definition: Zkfcode.h:1
integer kfrho
Definition: Zkfcode.h:1
max ptcl codes in the kseethru ! subcode integer k0l
Definition: Zcode.h:2
max ptcl codes in the kdmes
Definition: Zcode.h:2
integer kfgzai
Definition: Zkfcode.h:1
max ptcl codes in the kgnuc
Definition: Zcode.h:2
max ptcl codes in the kseethru ! subcode integer k0s
Definition: Zcode.h:2
integer kfpion
Definition: Zkfcode.h:1
max ptcl codes in the kphi
Definition: Zcode.h:2
const int kphoton
Definition: Zcode.h:6
max ptcl codes in the klambdac
Definition: Zcode.h:2
integer kfbomega
Definition: Zkfcode.h:1
max ptcl codes in the kkaon
Definition: Zcode.h:2
integer * kfsigmap
Definition: Zkfcode.h:1
integer kfdmes
Definition: Zkfcode.h:1
max ptcl codes in the kelec
Definition: Zcode.h:2
integer * kftau
Definition: Zkfcode.h:1
integer kfsigmam
Definition: Zkfcode.h:1
max ptcl codes in the kneue
Definition: Zcode.h:2
subroutine rndc(u)
Definition: rnd.f:91
max ptcl codes in the komega
Definition: Zcode.h:2
integer kfelec
Definition: Zkfcode.h:1
integer kfneutron
Definition: Zkfcode.h:1
max ptcl codes in the kseethru ! subcode integer regptcl
Definition: Zcode.h:2
max ptcl codes in the kseethru ! subcode integer kneutronb
Definition: Zcode.h:2
max ptcl codes in the kseethru ! subcode integer kneutron
Definition: Zcode.h:2
integer kfd0
Definition: Zkfcode.h:1
integer kfpi0
Definition: Zkfcode.h:1
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
integer kfk0l
Definition: Zkfcode.h:1
max ptcl codes in the klambda
Definition: Zcode.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
max ptcl codes in the krho
Definition: Zcode.h:2
max ptcl codes in the kneumu
Definition: Zcode.h:2
integer kflambda
Definition: Zkfcode.h:1
integer * kfk0s
Definition: Zkfcode.h:1
integer kfds
Definition: Zkfcode.h:1
integer kfeta
Definition: Zkfcode.h:1
integer * kfrhoc
Definition: Zkfcode.h:1
max ptcl codes in the kds
Definition: Zcode.h:2
integer kfk0
Definition: Zkfcode.h:1
max ptcl codes in the ktau
Definition: Zcode.h:2
integer kfsigma0
Definition: Zkfcode.h:1
integer kfetap
Definition: Zkfcode.h:1
max ptcl codes in the keta
Definition: Zcode.h:2
max ptcl codes in the kseethru ! subcode integer antip
Definition: Zcode.h:2
integer kfneutau
Definition: Zkfcode.h:1
integer kfphoton
Definition: Zkfcode.h:1
integer * kflambdac
Definition: Zkfcode.h:1
max ptcl codes in the kpion
Definition: Zcode.h:2
max ptcl codes in the ksigma
Definition: Zcode.h:2
max ptcl codes in the kmuon
Definition: Zcode.h:2
max ptcl codes in the kbomega
Definition: Zcode.h:2
max ptcl codes in the krare
Definition: Zcode.h:2
integer kfmuon
Definition: Zkfcode.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ckf2cosb()

subroutine ckf2cosb ( integer, intent(in)  kf,
type(ptcl p 
)

Definition at line 331 of file ckf2cos.f.

References ckf2cos().

331  implicit none
332 #include "Zptcl.h"
333  integer,intent(in):: kf ! pdg ptcl code
334  type(ptcl):: p ! output p%code p%sucode and p%charge are set
335 
336  integer:: code, subcode, charge
337  call ckf2cos(kf, code, subcode, charge)
338  p%code = code
339  p%subcode = subcode
340  p%charge = charge
subroutine ckf2cos(kf, code, subcode, chg)
Definition: ckf2cos.f:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
Definition: Zptcl.h:75
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
Here is the call graph for this function: