ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetUncertainties
testingMacros
InputScripts
Final2012
Final2012/ParseNonClosureInput.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2
3
from
ROOT
import
*
4
from
array
import
array
5
import
glob
6
import
re
7
import
math
8
import
ProviderHistoHelpers
9
10
11
SystematicNameDictionary = {
12
'AFIIunc'
:
'RelativeNonClosure_AFII'
13
}
14
15
jetDefDict = {
16
'4EM'
:
'AntiKt4Topo_EMJES'
,
17
'6EM'
:
'AntiKt6Topo_EMJES'
,
18
'4LC'
:
'AntiKt4Topo_LCJES'
,
19
'6LC'
:
'AntiKt6Topo_LCJES'
20
}
21
22
def
ReadNonClosureHistograms
(dirName):
23
if
not
dirName.endswith(
"/"
):
24
dirName = dirName +
"/"
25
26
# Run over each file (one per jet definition)
27
histos = {}
28
files = sorted(glob.glob(dirName+
"*.root"
))
29
for
aFileName
in
files:
30
# Determine the jet definition
31
jetDef =
""
32
for
aFileDef,aJetDef
in
jetDefDict.iteritems():
33
if
aFileDef
in
aFileName:
34
jetDef = aJetDef
35
break
36
if
jetDef ==
""
:
37
print
"Failed to determine jet definition for file:"
,aFileName
38
return
None
39
histos[jetDef] = {}
40
41
# Read in the histogram from the file
42
inFile = TFile(aFileName,
"READ"
)
43
for
aName,aSystName
in
SystematicNameDictionary.iteritems():
44
systematicName = aSystName +
"_"
+ jetDef
45
histo = inFile.Get(aName)
46
if
histo
is
None
:
47
print
"Failed to get histogram:"
,systematicName
48
return
None
49
50
histoSym =
ProviderHistoHelpers.SymmetrizeHistoInEta
(histo,systematicName)
51
histoSym.SetDirectory(0)
52
histos[jetDef][aSystName] = histoSym
53
54
# Also add a blank nonclosure histo for Pythia8
55
# Also add a blank Closeby histo for both AFII and Pythia8
56
etaBins = [
min
(
ProviderHistoHelpers.GetDefaultEtaBins
()),0,
max
(
ProviderHistoHelpers.GetDefaultEtaBins
())]
57
histos[jetDef][
"RelativeNonClosure_Pythia8"
] =
ProviderHistoHelpers.MakeProviderHisto
(
"RelativeNonClosure_Pythia8"
,ptBins=[15,1000,2500],etaBins=etaBins)
58
histos[jetDef][
"RelativeNonClosure_Pythia8"
].SetDirectory(0)
59
histos[jetDef][
"CloseBy_Pythia8"
] =
ProviderHistoHelpers.MakeProviderHisto
(
"CloseBy_Pythia8"
,ptBins=[15,1000,2500],etaBins=etaBins)
60
histos[jetDef][
"CloseBy_Pythia8"
].SetDirectory(0)
61
histos[jetDef][
"CloseBy_AFII"
] =
ProviderHistoHelpers.MakeProviderHisto
(
"CloseBy_AFII"
,ptBins=[15,1000,2500],etaBins=etaBins)
62
histos[jetDef][
"CloseBy_AFII"
].SetDirectory(0)
63
64
# Done reading, close the file
65
inFile.Close()
66
67
return
histos
min
#define min(a, b)
Definition
cfImp.cxx:40
max
#define max(a, b)
Definition
cfImp.cxx:41
ParseNonClosureInput.ReadNonClosureHistograms
ReadNonClosureHistograms(dirName)
Definition
Final2012/ParseNonClosureInput.py:22
ProviderHistoHelpers.GetDefaultEtaBins
GetDefaultEtaBins()
Definition
Final2012/ProviderHistoHelpers.py:18
ProviderHistoHelpers.SymmetrizeHistoInEta
SymmetrizeHistoInEta(histo, histoName)
Definition
Final2012/ProviderHistoHelpers.py:127
ProviderHistoHelpers.MakeProviderHisto
MakeProviderHisto(histoName, ptBins=GetDefaultPtBins(), etaBins=GetDefaultEtaBins())
Definition
Final2012/ProviderHistoHelpers.py:40
Generated on
for ATLAS Offline Software by
1.17.0