TABLE OF CONTENTS
- 1. /histMP
- 1.1. histMP/histogramMP
- 1.2. histMP/AddHistMP
- 1.3. histMP/Map2HistMP
- 1.4. histMP/WriteHistMP_Names
- 1.5. histMP/histMPf90_Init
- 1.6. histMP/CreateHistMP
- 1.7. histMP/ClearHistMP
- 1.8. histMP/AddHistMP_IH
- 1.9. histMP/Map2HistMP_getN
- 1.10. histMP/WriteHistMP
- 1.11. histMP/sumHistMP
- 1.12. histMP/DumpHistMP
- 1.13. histMP/FetchHistMP
/histMP [ Modules ]
NAME
module histMP
PURPOSE
Encapsulate all routines and datas for multi-particle Histogramms.
Provides all features as histf90, but here the information is stored for many kinds of particles, as e.g. all pions, kaons etc at the same time. Output is in a gnuplot like multicolumn format
Features of Histograms provided by this module:
- store paramaters of the x-binning
- enable two y-values (y and y2)
- track keeping of under-/over-score the given extreme values of x.
- provide simple-to-understand output routines
- provide simple histogram arithmetic
- many others...
NOTES
Programming is fairly similar to "module histf90"
There are different sets of particles prepared:
- 1: pi, K, N
- 2: pi, rho, (div. mes.), K, N, Delta
- 3: pi, eta, omega, phi, J/psi, K, D
- 4: "all mesons"
- 5: "all stable hadrons": pi,K,N,Lambda,Sigma,Xi,Omega
INPUTS
...(This module needs no input)
histMP/histogramMP [ Types ]
NAME
type histogramMP
PURPOSE
Type definition to store all information for a multiparticle 1D Histogram.
SOURCE
type histogramMP real :: xMin ! smallest x-value real :: xMax ! largest x-value real :: xBin ! width of x-Bin real,allocatable :: xExtreme(:,:) ! extremes of used x-values ! (id), (min,max) character*(NameLength) :: Name ! name to be written real,allocatable :: yVal(:,:,:) ! histogramm values: ! (id), (x), (yy1,yy2,yy3...) ! x-bin 0,-1 : extreme values !!! integer :: iSet ! particle set end type histogramMP
histMP/AddHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine AddHistMP(H, ID,IC,anti, x,y,y2)
subroutine AddHistMP(H, Part, x,y,y2)
subroutine AddHistMP(H, KF, x,y,y2)
PURPOSE
Add to the given histogram at the given x-value the weight y (y2). If y2 is given, also the second column is filled.
INPUTS
- type(histogramMP) :: H -- Histogramm to be used
- integer :: ID,IC -- particle (ID and charge)
- logical :: anti -- particle (antiparticle)
- real :: x -- x-value
- real :: y -- weight to be added
- real :: y2 -- second weight to be added [OPTIONAL]
or:
- type(histogramMP) :: H -- Histogramm to be used
- type(particle) :: Part -- particle
- real :: x -- x-value
- real :: y -- weight to be added
- real :: y2 -- second weight to be added [OPTIONAL]
or:
- type(histogramMP) :: H -- Histogramm to be used
- integer :: KF -- particle (KF code)
- real :: x -- x-value
- real :: y -- weight to be added
- real :: y2 -- second weight to be added [OPTIONAL]
OUTPUT
H is changed
histMP/Map2HistMP [ Functions ]
[ Top ] [ histMP ] [ Functions ]
NAME
integer function Map2HistMP(ID,IC,anti, iSet)
integer function Map2HistMP(Part, iSet)
integer function Map2HistMP(KF, iSet)
PURPOSE
calculate the number of the histogram INPUTS:
or:
or:
- integer :: KF -- particle (KF code)
histMP/WriteHistMP_Names [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine WriteHistMP_Names(H,iFile)
subroutine WriteHistMP_Names(iSet,iFile)
PURPOSE
Write a Header line with the names of the particles
INPUTS
- type(histogramMP) :: H -- histogram to use
- integer :: iFile -- number of file to write to
or:
- integer :: iSet -- set of histogram
- integer :: iFile -- number of file to write to
histMP/histMPf90_Init [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine histMPf90_Init
PURPOSE
Init the module
histMP/CreateHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine CreateHistMP(H, HName,x1,x2,bin, iPartSet)
PURPOSE
This is the Constructor of a multi-particle 1D-Histogram! Allocate Memory for the entries and put additional variables to their default. The parameter iPartSet specifies, which particles should be included.
INPUTS
- type(histogramMP) :: H -- Histogramm to be created
- character*(*) :: HName -- Name of Histogram
- real :: x1,x2,bin -- Minimal/maximal value for x-coordinate to be considered, bin-width
- integer :: iPartSet -- particle set to consider
possible values for "iPartSet" are:
- 1: pions, kaons, nucleons (i.e. "stable" particles)
- 2: most mesons (except charm), nucleons, Deltas
- 3: stable/reconstructable mesons, no baryons
- 4: all non-strange mesons
- ... to be continued
OUTPUT
---
histMP/ClearHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine ClearHistMP(H)
PURPOSE
Sets the histogram to zero again
INPUTS
- type(histogramMP) :: H -- Histogram to be cleared
OUTPUT
H is changed
histMP/AddHistMP_IH [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine AddHistMP_IH(H, iH, x,y,y2)
PURPOSE
Add to the given histogram at the given x-value the weight y (y2). If y2 is given, also the second column is filled. ID and IC specify the particle.
INPUTS
- type(histogramMP) :: H -- Histogramm to be used
- integer :: iH -- nr of Histogram
- real :: x -- x-value
- real :: y -- weight to be added
- real :: y2 -- second weight to be added [OPTIONAL]
OUTPUT
H is changed
NOTES
this is an internal routine
histMP/Map2HistMP_getN [ Functions ]
[ Top ] [ histMP ] [ Functions ]
NAME
integer function Map2HistMP_getN(iSet)
PURPOSE
return the number of histograms for the given particle set. returns 0, if the particle set is invalid.
histMP/WriteHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine WriteHistMP(H,iFile,add,mul,iColumn,DoAve,maxVal,H2,file,dump)
PURPOSE
Write out the histogram.
The entries are multiplied by 'mul' and 'add' is added.
INPUTS
- type(histogramMP) :: H -- Histogramm to be used
- integer :: iFile -- File number output to redirect [OPTIONAL]
- real :: add -- factor to add [OPTIONAL]
- real :: mul -- factor to multiply [OPTIONAL]
- integer :: iColumn -- column to write [OPTIONAL]
- logical :: DoAve -- write "average" (cf Notes) [OPTIONAL]
- real :: maxVal -- value used instead "divide by zero" [OPTIONAL]
- type(histogram) :: H2 -- Histogramm to divide by [OPTIONAL]
- character*(*) :: file -- name of file to open and close [OPTIONAL]
- logical :: dump -- if true, also dump it binary to file [OPTIONAL]
OUTPUT
write to file number
NOTES
The Histogram Data is not affected!!!
If you select "DoAve", the average value (built by dividing column 3 by column 1) is printed instead of the value of column 3 or column 1. This behaviour differs from the behaviour in module histf90 and hist2Df90, where on additional column is inserted in teh output. Setting this flag overrides settings according iColumn, add and mul.
histMP/sumHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine sumHistMP(A, B, w, doCheck)
PURPOSE
Perform a summation of two histograms: A = A + B. If a weight 'w' is given, do a weighted summation: A = A + w*B
INPUTS
- type(histogramMP) :: A, B -- Histograms to be used
- real, optional :: w -- optional weighting factor
- logical, optional :: doCheck -- check array sizes or not
OUTPUT
A is changed.
histMP/DumpHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine DumpHistMP(H,file,iFile)
PURPOSE
Write all the histogram information unformatted (i.e. binary) to a file
INPUTS
- type(histogramMP) :: H -- Histogramm to be used
- character*(*) :: file -- name of file to open and close
- integer,OPTIONAL :: iFile -- File number output to redirect
- real,OPTIONAL :: add -- factor to add
- real,OPTIONAL :: mul -- factor to multiply
OUTPUT
H is written UNFORMATTED to the given file
histMP/FetchHistMP [ Subroutines ]
[ Top ] [ histMP ] [ Subroutines ]
NAME
subroutine FetchHistMP(H,file,iFile, add,mul, flagOK)
PURPOSE
Read in all the histogram information previously dumped unformatted (i.e. binary) to a file
INPUTS
- character*(*) :: file -- name of file to open and close
- integer,OPTIONAL:: iFile -- File number input to redirect
OUTPUT
- type(histogramMP) :: H -- Histogramm to be used
- real,OPTIONAL :: add -- factor to add
- real,OPTIONAL :: mul -- factor to multiply
- logical :: flagOK -- flag, if reading was okay
H is read UNFORMATTED from the given file. Sizes are calculated as in CreateHist, also memory is allocated.
NOTES