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

Go to the source code of this file.

Functions/Subroutines

subroutine setpcode (p, code)
 
subroutine getpcode (code, codex)
 

Function/Subroutine Documentation

◆ getpcode()

subroutine getpcode ( integer  code,
integer  codex 
)

Definition at line 30 of file setpcode.f.

Referenced by chookobs().

30  implicit none
31  integer code ! input.
32  integer codex ! output. 4: pi, 5: K, 7: anti p/n 6: p/n and others
33  logical kbitest
34  if(.not. kbitest(code, 2) ) then
35  if( .not. kbitest(code, 1) ) then
36  codex = 4
37  else
38  codex = 5
39  endif
40  else
41  if(.not. kbitest(code, 1) ) then
42  codex = 6
43  else
44  codex = 7
45  endif
46  endif
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
logical function kbitest(i, bit)
Definition: kmanbit.f:13
Here is the caller graph for this function:

◆ setpcode()

subroutine setpcode ( type(ptcl p,
integer  code 
)

Definition at line 2 of file setpcode.f.

References antip, charge, krsetbit(), ksetbit(), and subcode.

Referenced by chooknepint(), and cmemonode().

2  implicit none
3 #include "Zptcl.h"
4 #include "Zcode.h"
5  type(ptcl):: p
6  integer code
7 ! set parent particle code by using last bit
8 ! bit 2 bit 1
9 ! pi 0 0
10 ! K 0 1
11 ! p 1 0
12 ! pbar/nbar 1 1
13  if( p.code .eq. 4 ) then
14  call krsetbit(code, 1)
15  call krsetbit(code, 2)
16  elseif(p.code .eq. 5) then
17  call ksetbit(code, 1)
18  call krsetbit(code, 2)
19  elseif( (p.code .eq. 6 .and. p.charge .eq. -1 ) .or.
20  * (p.code .eq. 6 .and. p.charge .eq. 0 .and.
21  * p.subcode .eq. antip ) ) then
22  call ksetbit(code, 1)
23  call ksetbit(code, 2)
24  else
25  call krsetbit(code, 1)
26  call ksetbit(code, 2)
27  endif
subroutine krsetbit(i, bit)
Definition: kmanbit.f:53
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine ksetbit(i, bit)
Definition: kmanbit.f:36
*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
max ptcl codes in the kseethru ! subcode integer antip
Definition: Zcode.h:2
*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: