Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
pyoper.f
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file pyoper.f
1
2
C*********************************************************************
3
4
C...PYOPER
5
C...Performs operations between histograms.
6
7
SUBROUTINE
pyoper
(ID1,OPER,ID2,ID3,F1,F2)
8
9
C...Double precision declaration.
10
IMPLICIT
DOUBLE PRECISION
(a-
h
, o-
z
)
11
IMPLICIT
INTEGER
(
i
-
n
)
12
C...Commonblock.
13
common/
pybins
/ihist(4),indx(1000),
bin
(20000)
14
SAVE
/
pybins
/
15
C...Character variable.
16
CHARACTER
oper*(*)
17
18
C...Find initial addresses in memory, and histogram size.
19
IF
(id1.LE.0.OR.id1.GT.ihist(1)) CALL
pyerrm
(28,
20
&
'(PYFACT:) not allowed histogram number'
)
21
is1=indx(id1)
22
is2=indx(min(ihist(1),
max
(1,id2)))
23
is3=indx(min(ihist(1),
max
(1,id3)))
24
nx
=nint(
bin
(is3+1))
25
IF
(oper.EQ.
'M'
.AND.id3.EQ.0)
nx
=nint(
bin
(is2+1))
26
27
C...Update info on number of histogram entries.
28
IF
(oper.EQ.
'+'
.OR.oper.EQ.
'-'
.OR.oper.EQ.
'*'
.OR.oper.EQ.
'/'
)
THEN
29
bin
(is3+5)=
bin
(is1+5)+
bin
(is2+5)
30
ELSEIF
(oper.EQ.
'A'
.OR.oper.EQ.
'S'
.OR.oper.EQ.
'L'
)
THEN
31
bin
(is3+5)=
bin
(is1+5)
32
ENDIF
33
34
C...Operations on pair of histograms: addition, subtraction,
35
C...multiplication, division.
36
IF
(oper.EQ.
'+'
)
THEN
37
DO
100 ix=6,8+
nx
38
bin
(is3+ix)=f1*
bin
(is1+ix)+
f2
*
bin
(is2+ix)
39
100
CONTINUE
40
ELSEIF
(oper.EQ.
'-'
)
THEN
41
DO
110 ix=6,8+
nx
42
bin
(is3+ix)=f1*
bin
(is1+ix)-
f2
*
bin
(is2+ix)
43
110
CONTINUE
44
ELSEIF
(oper.EQ.
'*'
)
THEN
45
DO
120 ix=6,8+
nx
46
bin
(is3+ix)=f1*
bin
(is1+ix)*
f2
*
bin
(is2+ix)
47
120
CONTINUE
48
ELSEIF
(oper.EQ.
'/'
)
THEN
49
DO
130 ix=6,8+
nx
50
fa2=
f2
*
bin
(is2+ix)
51
IF
(abs(fa2).LE.1d-20)
THEN
52
bin
(is3+ix)=0d0
53
ELSE
54
bin
(is3+ix)=f1*
bin
(is1+ix)/fa2
55
ENDIF
56
130
CONTINUE
57
58
C...Operations on single histogram: multiplication+addition,
59
C...square root+addition, logarithm+addition.
60
ELSEIF
(oper.EQ.
'A'
)
THEN
61
DO
140 ix=6,8+
nx
62
bin
(is3+ix)=f1*
bin
(is1+ix)+
f2
63
140
CONTINUE
64
ELSEIF
(oper.EQ.
'S'
)
THEN
65
DO
150 ix=6,8+
nx
66
bin
(is3+ix)=f1*sqrt(
max
(0d0,
bin
(is1+ix)))+
f2
67
150
CONTINUE
68
ELSEIF
(oper.EQ.
'L'
)
THEN
69
zmin=1d20
70
DO
160 ix=9,8+
nx
71
IF
(
bin
(is1+ix).LT.zmin.AND.
bin
(is1+ix).GT.1d-20)
72
& zmin=0.8d0*
bin
(is1+ix)
73
160
CONTINUE
74
DO
170 ix=6,8+
nx
75
bin
(is3+ix)=f1*log10(
max
(zmin,
bin
(is1+ix)))+
f2
76
170
CONTINUE
77
78
C...Operation on two or three histograms: average and
79
C...standard deviation.
80
ELSEIF
(oper.EQ.
'M'
)
THEN
81
DO
180 ix=6,8+
nx
82
IF
(abs(
bin
(is1+ix)).LE.1d-20)
THEN
83
bin
(is2+ix)=0d0
84
ELSE
85
bin
(is2+ix)=
bin
(is2+ix)/
bin
(is1+ix)
86
ENDIF
87
IF
(id3.NE.0)
THEN
88
IF
(abs(
bin
(is1+ix)).LE.1d-20)
THEN
89
bin
(is3+ix)=0d0
90
ELSE
91
bin
(is3+ix)=sqrt(
max
(0d0,
bin
(is3+ix)/
bin
(is1+ix)-
92
&
bin
(is2+ix)**2))
93
ENDIF
94
ENDIF
95
bin
(is1+ix)=f1*
bin
(is1+ix)
96
180
CONTINUE
97
ENDIF
98
99
RETURN
100
END
pythia6
blob
master
pythiaeRHIC
pythia
pyoper.f
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:42
using
1.8.2 with
sPHENIX GitHub integration