/
README
184 lines (128 loc) · 6.38 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
= HMS Monte Carlo physics reweighting framework
=
= Author: Eric Christy, christy@jlab.org
= Framework: Eric Pooser, pooser@jlab.org
=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
\--\--\--\--\--\--\
\ Eric C.'s How-To
\--\--\--\--\--\--\
To run the code requires the following:
1. A uniform generation MC ntuple (example c1_30_1.1.rzdat)
2. A file containing the radiative cross section on a grid in W^2, theta for the beam
energy of interest. The code assumes this file is named
"rc94.dat"
Be sure to link the proper file.
The format is:
Ebeam, W^2, theta, cross section, radiative correction factor
For inelastic kinematics a grid spacing of 1 degree is usually fine, but for QE and
resonance kinematics a finer spacing might be required for best results. I typically
use a E' spacing corresponding to a bin width in W^2 of 0.04 for a given Ebeam, theta.
3. mc_recon expects to read from an input file called
"input.data"
This should have the following format:
- input MC ntuple filename (example c1_30_1.1.rzdat)
- number of events to reweight (this can be less than the number in the original rzdat)
- the generation range in X' (this is given as the 1/2 range and assumed to be symmetric,
example 100. mrad)
- the generation range in Y'
- maximum generation range in dp/p in %
- minimum generation range in dp/p in %
- option to calculate charge-symmetric background weight factor (0 = no, 1 = yes)
- Option to calculate born cross section from interpolated file (0 = no, 1 = yes)
* Note that the charge-symmetric parametrization must be provided to the code for each
beam energy and angle.
** Note that the generation limits must be the same as used for generating the original
MC ntuple. The code will use this to calculate the generated phasespace for determining
the MC luminosity.
4. recon_mc requires a file called
"reconmc.in"
which contains the scaler information on target type, kinematics, beam charge, and
efficiencies. This is generated by running a perl script and supplying the run #, eg.
./get_scaler_info.prl 53214
-------------
There is a shell script which runs get_scaler_info.prl and then runs the code. It is called
"mc-reweight.sh"
-> To produce an physics weighted ntuple run the shell script a above. This should produce
the following:
1. weighted MC ntuple called mc"runnumber".rzdat (eg. mc53214.rzdat)
2. log file called "runnumber".log (eg. 53214.log)
The log file will contain a record of the scalar information, run options, and the MC scale
factor. The scale factor must be applied to the events in the reweighted ntuple for proper
normalization to the data.
-------------
-> There is a paw script called
"extract_cs.kumac"
which will plot the data versus the MC. In this file you will find the section for defining
the run number and scale factor. It should look like:
** C1 @ 2.3 at 30 deg **
runnum = 53214
mcscale = 0.00188994245
-> The MC events should be weighted by the factor
born/rci/rce*csback*[mcscale]
where
born: born cross section
rci: radiative correction factor (sig_born / sig_rad)
rce: not used any longer, should be = 1.0
csback: charge-symmetric background factor
A plot of the comparisons will be printed to a postscript file called
"mccomp53214.ps"
\--\--\--\--\--\--\
\ Eric P.'s README
\--\--\--\--\--\--\
This repository is a "container" for the framework to perform the mc-reweighting in
an orgainzed fashion. The only code in the repository is the source code
which has been customized to work in this particular framework and the paw macro
used to make histograms.
In order to run the example on the ifarm, you will need to unpack the
file /u/group/hallc/pooser/mc-reweight-example-data/input.tar.gz in
the top level directory via. the command:
tar -xvf /u/group/hallc/pooser/mc-reweight-example-data/input.tar.gz
This will overwrite your current input directory however, it will maintain
the structure and fill the directories with the input files needed
to run the example.
Prior to running the example you MUST define the explicit location of the report file gen53214.txt
in the perl script get_scaler_info.prl at line 29. This should be fixed!
To run the example in place simply do:
cd SRC
make
cd ../
./mc-reweight.sh 53214
cd paw/macros
paw++
exec extract_cs.kumac
/--/--/--/--/--/--/--/
/ Directroy structure
/--/--/--/--/--/--/--/
SRC: contains the source code to build the executable named "mc_recon"
build with make clean; make
To rebuild files not included in the Makefile use ./makemod.sh
input: contains the necessary input files to execute the mc-reweighting
hms-data: HMS data needed for the calculations, e.g. hms53214.rzdat
monte-carlo: Uniformly generated MC ntuple produced by single arm MC code, e.g. c1_30_1.1.rzdat
rad-corr: Radiative cross section grid, produced by rad-corr code, e.g. rc94_c1_2.3.dat
recon-mc: Input data file called by recon_mc.f, e.g. input_c1_30_1.1.dat
reports: Report file from hcana contains efficiencies, scalers, etc., e.g. gen53214.txt
target: Target input data file, called by recon_mc.f, e.g. targetdata.dat
output: contains the output from recon-mc
logs: contains the print out from recon_mc, e.g. 53214.log
mc-ntuples: contains the mc re-weighted ntuple produced by recon_mc, e.g. mc53214.rzdat
paw: contains the paw specific files
input: contains paw input specific files
scalers: contains parsed scaler info from get_scaler_info.prl, e.g. scalers.in
macros: contains paw macros, e.g. extract_cs.kumac
output: contains paw output specific files
data: contains output data files created by extract_cs.kumac, e.g. cskin.dat, sigma53214.dat
plots: contains plots produced by extract_cs.kumac, e.g. mccomp53214.ps
tables: contains tables produced by extract_cs.kumac, e.g. nhd.tbl1, nhd.tbl2
settings: contains paw settings, e.g. pawopts.kumac
get_scaler_info.prl: Perl script that parses report file as needed for mc-reweighting
mc-reweight.sh: Shell script to execute the mc-reweighting code, usuage: ./mc-reweight.sh 53214
|--|--|--|--|--|--|--|
| General Usage Notes
|--|--|--|--|--|--|--|
To execute the paw macro you must have PAW installed and the proper environment setup. Good luck!
Path of least resistance, do it on the farm...
On the ifarm do: setup cernlib
Descend into paw/macros and enter "paw++"
In the interactive session enter "exec extract_cs.kumac"