forked from ge34zez/UFFA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnalysisScript.py
161 lines (144 loc) · 7.15 KB
/
AnalysisScript.py
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
import FemtoAnalysis as FA
from UFFAModes import UFFA
# import FemtoDreamReader as FDR
#import sys
# Current options include:
# "function": 'cf', 'syst', 'tf' -> for correlation function, systematics, template fits
# "pair": 'pp', 'pl' -> for q&a plots relevant for individual analyses
# "path": "string" -> full path to the root file, might include ~/ for home directory
# "file": "string" -> name of the root file
# "fullpath": "string" -> full path and file name equal to "path" + "file"
# "outDir": "string" -> output directory
# "rename": "string" -> rename output file
# "fileTDir": "string" -> root file directory: path to directory inside the root file
# "nameSE": "string" -> path + name of the se plot inside the provided "fileTDir" if given
# "nameME": "string" -> same as nameSE but for the ME distribution
# "newfile": 'new', 'recreate', 'update' -> same option as in ROOT, 'new' will rename if file already exists
# "mc": 'true', 'false' -> save monte carlo data from provided root file
# "mcTDir": "string" -> root file directory for the monte carlo data
# "bins": [list of floats] -> binning for differential analysis
# "diff3d": 'mt', 'mult' -> project 3D plots first in mt/mult 2D and after in mult/mt 1D or vice versa
# "bins3d": [list of floats] -> binning for 3D plots to 2D plots
# "yield": [GeV, Deviation] -> integrated analysis: include systematics inside deviation for the GeV range
# "rebin": int or [list of ints] -> rebin output plots
# for tf: int -> all dca/cpa rebinned with int
# or [list of ints] -> each int will correspond to one range of the binning if provided
# "atype": 'int', 'dif' -> integrated analysis or differential analysis
# "htype": 'k', 'mt', 'mult', 'mt3d', 'mult3d', 'mtmult', 'rew3d'
# 'k' -> k* - relative pair momentum distribution
# 'mt' -> mt vs k* distribution
# 'mult' -> multiplicity vs k* distribution
# 'mt3d' -> mt vs k* from 3D distribution but integrated in mult
# 'mult3d' -> mult vs k* from 3D distribution but integrated in mt
# 'mtmult' -> mult vs mt vs k* 3D distribution
# 'rew3d' -> mult vs mt vs k* 3D differentially in mt and reweighted in mult
# "tftype": 'dca', 'cpa' -> option for the template fit plots
# "templates": [list of th1 plots] -> list of dca/cpa plots for fitting
# "namelist": [list of strings] -> names of dca/cpa plots for fitting
# "fitrange": float -> fitrange for the template fitter
# "normalize": [float, float] -> normalization range for the correlation function
# "include": "string" or [list of strings] -> include these variations in the systematics
# "exclude": "string" or [list of strings] -> exclude these variations in the systematics
# "interactive": 'True', 'False' -> include/exclude interactively variations in terminal
# "debug": 'True', 'False' -> debug information in console
ipath = ""
opath = ""
Yield = [0.2,0.3]
Rebin = [2, 5, 10]
mtBins = [0, 1.2, 1.56, 4.5]
mtBins = [0,1.02,1.14,1.2,1.26,1.38,1.56,1.86,4.5]
multBins = [0, 11, 20, 200]
multBins = [0, 200]
filename = "root_input/pL_22all.root"
filename = "AnalysisResults_sqm.root"
filename = "maps.root"
templates = ""
namelist = ['prim', 'lam', 'sig', 'fake']
settings_cf = {
"function": 'cf',
"pair": 'pp',
# input file
"filepath": "./Final.root",
"SE_path": "femto-dream-pair-task-track-track_apBase/SameEvent/relPairDist", #path to the SE distr. in the input file
"ME_path": "femto-dream-pair-task-track-track_apBase/MixedEvent/relPairDist", #path to the ME distr. in the input file
# output file
"newfile": "recreate", #mode for output file
"outDir": opath,
"rename": "CF_Test",
# MC
"mc": None,
"mcTDir": "",
# input histogram
"dimension": 1, # dimension of the input histogram
"kstar_axis": 0, #axis labelling starts from 0
"reweighting_axis": 1, # if None, then no reweighting is happening
"reweighting_bins": [0, 11, 20, 200],
"reweighting_range": [0, 1.0],
"projection_axes": [[2, [0.1,0.2]]], #[axis_index, [projection range]]
#"diff3d": 'mt',
# "bins3d": mtBins,
# "bins": multBins,
"rebin_factors": [2, 5, 10],
# "rewrange": [0, 1.0],
"percentile": [0, 20],
"normalization_range": [0.24, 0.34], #if none given the default is [0.24, 0.34]
"debug": False
}
settings_tf = {
"function": 'tf',
"file": ipath + filename,
"fileTDir": "_base-tempFit",
"newfile": "new",
"templates": templates,
#"templates": mc_plots,
"mcTDir": "_base-tempFit",
"outDir": opath,
"rename": None,
"bins": [0.500, 0.678, 0.856, 1.033, 1.211, 1.388, 1.567, 1.743, 1.921, 2.099, 2.453, 2.986, 4.051],
"rebin": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4],
"tftype": 'dca',
"namelist": namelist,
"fitrange": 0.3,
"debug": False
}
settings_syst = {
"function": 'syst',
"file": filename,
"fileTDir": "",
"newfile": "new",
"outDir": opath,
"mc": None,
"mcTDir": "",
#"rename": "test.root",
"atype": 'dif',
"htype": 'mtmult',
"diff3d": 'mt',
"bins3d": mtBins,
"bins": multBins,
#"yield": [0.3, 0.2],
#"atype": "dif",
#"htype": "kmult",
#"bins": [0, 20, 40, 60],
#"bins": [0.5, 1.2, 2.5, 4],
#"rebin": 2,
"rebin": [2, 5, 10],
"yield": [0.2, 0.6],
"normalize": [0.24, 0.34],
#"exclude": '',
#"interactive": True,
"debug": True
}
settings_syst2 = {
"function": 'syst',
"file": filename,
"fileTDir": "",
"newfile": "recreate",
"outDir": opath,
"rename": "pp_mtDiff.root",
"atype": 'dif',
"htype": 'mt',
"bins": [0,1.02,1.26,1.86,4.5],
"rebin": 2,
"debug": True
}
UFFA.UFFA(settings_cf)