COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cfixModel.f
Go to the documentation of this file.
1  subroutine cfixmodel( aPtcl )
2  implicit none
3 !
4 ! fix hadronic interaction model (including
5 ! photoproduction of hadrons, and possibly
6 ! muon nucear interaction).
7 ! and set ActiveMdl
8 !
9 #include "Zptcl.h"
10 #include "Zevhnp.h"
11 #include "Zevhnv.h"
12 #include "Zcode.h"
13 
14  type(ptcl)::aPtcl ! input. particle for hadronic interaction
15 
16  real*8 kepn
17  integer i
18  integer :: icon
19 
20  kepn= aptcl%fm%p(4)- aptcl%mass
21  if( aptcl%code .eq. kgnuc ) then
22  kepn = kepn / aptcl%subcode
23  endif
24 
25  do i = 1, noofmdls
26  if( kepn .lt. inteerg(i)) then
27  activemdl = modellist(i)
28  goto 10
29  endif
30  enddo
31 
32  call cerrormsg('IntModel list shown below is strange', 1)
33  call cerrormsg(intmodel, 1)
34  call cpdpmjetinp
35  write(0,*) ' current K%E/n=',kepn,
36  * ' code=',aptcl%code, ' subcode=',
37  * aptcl%subcode, ' charge=',aptcl%charge
38  write(0,*) ' NoOfMdls=', noofmdls
39  do i = 1, noofmdls
40  write(0,*) ' i=', i, ' InteErg(i)=',
41  * inteerg(i)
42  enddo
43  stop 12345
44  10 continue
45  do i = 1, noofmdls2
46  if( kepn .lt. inteerg2(i)) then
47  activemdl2 = modellist2(i) ! used only for mfp calc
48  goto 15
49  endif
50  enddo
51 
52  call cerrormsg('XsecModel list shown below is strange', 1)
53  call cerrormsg(xsecmodel, 1)
54  call cpdpmjetinp
55  write(0,*) ' current K%E/n=',kepn,
56  * ' code=',aptcl%code, ' subcode=',
57  * aptcl%subcode, ' charge=',aptcl%charge
58  write(0,*) ' NoOfMdls2=', noofmdls2
59  do i = 1, noofmdls2
60  write(0,*) ' i=', i, ' InteErg2(i)=',
61  * inteerg2(i)
62  enddo
63 !! stop 123456
64  stop 23456 !! jaxa length should be <=5
65  15 continue
66 
67  if( aptcl%code == knuc .and. aptcl%subcode == antip ) then
68  if(activemdl == "phits" ) then
69  ! ' for p-bar or n-bar, phits cannot be used'
70  call eprescue(icon)
71  if( icon /= 0 ) then
72  call eprescueerr('phits cannot be used for p-bar', aptcl)
73  stop
74  endif
75  endif
76  elseif(aptcl%code == kkaon ) then
77  if(activemdl == "phits" ) then
78  call eprescue(icon)
79  if( icon /= 0 ) then
80  call eprescueerr('phits cannot be used for Kaon', aptcl)
81  stop
82  endif
83  endif
84  endif
85  ! If photon or muon, they will be
86  ! managed in photon interaction routine
87  ! other hadronic particles,say, lambda0, will be decayed
88  ! if the model cannot cope with it. (cseeColPossible).
89  20 continue
90  end
91  subroutine eprescue(icon)
92  implicit none
93 !
94 ! fix hadronic interaction model (including
95 ! photoproduction of hadrons, and possibly
96 ! muon nucear interaction).
97 ! and set ActiveMdl
98 !
99 #include "Zptcl.h"
100 #include "Zevhnp.h"
101 #include "Zevhnv.h"
102 #include "Zcode.h"
103  integer,intent(out):: icon ! 0. rescuee could be set
104  ! 1. no resucee could be fount
105 ! see if jam or dpmjet3 can be used, if not error
106  integer::i
107 
108  icon = 0
109  do i = 1, noofmdls
110  if( modellist(i) == "dpmjet3") then
111  activemdl= "dpmjet3"
112  goto 20
113  elseif(modellist(i) == "jam") then
114  activemdl= "jam"
115  goto 20
116  elseif( modellist(i) == "nucrin") then
117  activemdl= "nucrin"
118  goto 20
119  endif
120  enddo
121  icon = 1
122  20 continue
123  end
124 
125  subroutine eprescueerr(msg, aPtcl)
126  implicit none
127 #include "Zptcl.h"
128  character(*),intent(in):: msg
129  type(ptcl)::aPtcl ! input. problematic ptcl
130 
131  write(0,'(a)') trim(msg),
132  * ' so that dpmjet3 or jam (or nucrin) must be given in ',
133  * ' the IntModel list as a rescuee: ',
134  * " If you don't want to use such a rescuee as a normal ",
135  * ' interaction model, you may specify it as follows:',
136  * " IntModel='"//'"abc" E1 "dpmjet3" E2 "xyz"',
137  * ' and set E1=E2, then, model abc is used below E1=E2. ',
138  * ' When energy is >= E1, model xyz is used. So dpmjet3 will',
139  * ' not be used at any energy. It will be used only as ',
140  * ' rescuee.',
141  * ' ',
142  * 'particle info: '
143  write(0,'(a, g13.4)') ' ptcl code=',aptcl%code,
144  * ' charge =',aptcl%charge,
145  * ' subcode =',aptcl%subcode,
146  * ' Ek =', aptcl%fm%p(4)-aptcl%mass, ' GeV'
147  end
148 !
149  subroutine cqactivemdl(model)
150  implicit none
151 !
152 ! inquire the current active model
153 !
154 #include "Zptcl.h"
155 #include "Zevhnv.h"
156 
157  character*16 model
158  model = activemdl
159  end
160  subroutine cqactivemdl2(model)
161  implicit none
162 #include "Zptcl.h"
163 #include "Zevhnv.h"
164 
165  character*16 model
166  model = activemdl2
167  end
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine eprescueerr(msg, aPtcl)
Definition: cfixModel.f:126
subroutine cqactivemdl(model)
Definition: cfixModel.f:150
subroutine eprescue(icon)
Definition: cfixModel.f:92
max ptcl codes in the kgnuc
Definition: Zcode.h:2
subroutine cfixmodel(aPtcl)
Definition: cfixModel.f:2
max ptcl codes in the kkaon
Definition: Zcode.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
subroutine cqactivemdl2(model)
Definition: cfixModel.f:161
Definition: Zptcl.h:75
max ptcl codes in the kseethru ! subcode integer antip
Definition: Zcode.h:2