Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Lars Rickard Strom
athena
Commits
2c30a7a7
Commit
2c30a7a7
authored
7 years ago
by
Jean-Baptiste De Vivie De Regie
Committed by
Jovan Mitrevski
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cleaning isoAODFixGetter
Former-commit-id: 0482c440d901f38d0b4b1cf2695ef3570be1c7c5
parent
6c716a77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Reconstruction/AODFix/python/AODFix_r210.py
+0
-1
0 additions, 1 deletion
Reconstruction/AODFix/python/AODFix_r210.py
Reconstruction/RecoAlgs/IsolationAlgs/python/IsoAODFixGetter.py
+28
-144
28 additions, 144 deletions
...truction/RecoAlgs/IsolationAlgs/python/IsoAODFixGetter.py
with
28 additions
and
145 deletions
Reconstruction/AODFix/python/AODFix_r210.py
+
0
−
1
View file @
2c30a7a7
...
...
@@ -49,7 +49,6 @@ class AODFix_r210(AODFix_base):
self
.
egammaStrips_postSystemRec
(
topSequence
)
pass
###JB
if
"
elIso
"
not
in
oldMetadataList
:
self
.
elIso_postSystemRec
(
topSequence
)
pass
...
...
This diff is collapsed.
Click to expand it.
Reconstruction/RecoAlgs/IsolationAlgs/python/IsoAODFixGetter.py
+
28
−
144
View file @
2c30a7a7
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from
AthenaCommon.Constants
import
INFO
from
AthenaCommon.AppMgr
import
ToolSvc
from
AthenaCommon.Logging
import
logging
from
RecExConfig.RecFlags
import
rec
from
egammaRec.Factories
import
ToolFactory
,
AlgFactory
,
getPropertyValue
from
egammaRec.Factories
import
ToolFactory
,
AlgFactory
#---------------------------------------
...
...
@@ -14,68 +11,24 @@ from ParticlesInConeTools.ParticlesInConeToolsConf import xAOD__CaloClustersInCo
CaloClustersInConeTool
=
ToolFactory
(
xAOD__CaloClustersInConeTool
,
CaloClusterLocation
=
"
CaloCalTopoClusters
"
)
# configuration for ED computation
def
configureEDCorrection
(
tool
):
"""
Configure tools and algorithm for energy density correction
(only if doEnergyDensityCorrection = True)
"""
# Return if doEnergyDensityCorrection is false
if
not
getPropertyValue
(
tool
,
'
doEnergyDensityCorrection
'
):
return
if
1
:
print
'
JB do not need that for my tests
'
return
# Set OutputLevel to INFO or higher if tool has it too
OutputLevel
=
min
(
getPropertyValue
(
tool
,
'
OutputLevel
'
),
INFO
)
try
:
from
AthenaCommon.AppMgr
import
ToolSvc
from
AthenaCommon.AlgSequence
import
AlgSequence
from
EventShapeTools.EventDensityConfig
import
configEventDensityTool
,
EventDensityAlg
from
JetRec.JetRecStandard
import
jtm
topSequence
=
AlgSequence
()
if
not
hasattr
(
topSequence
,
'
EDtpIsoVeryForwardAlg
'
):
tfcc
=
configEventDensityTool
(
"
EDtpIsoVeryForwardTool
"
,
jtm
.
emget
,
radius
=
0.5
,
AbsRapidityMin
=
2.5
,
AbsRapidityMax
=
4.5
,
OutputContainer
=
"
TopoClusterIsoVeryForwardEventShape
"
,
OutputLevel
=
OutputLevel
)
ToolSvc
+=
tfcc
topSequence
+=
EventDensityAlg
(
"
EDtpIsoVeryForwardAlg
"
,
EventDensityTool
=
tfcc
)
except
Exception
:
print
'
\n
ERROR: could not get handle to ED
'
raise
# tool for the leakage correction (std calo iso)
from
IsolationCorrections.IsolationCorrectionsConf
import
CP__IsolationCorrectionTool
as
ict
leakTool
=
ict
(
name
=
"
LeakageCorrection
"
,
#CorrFile = "IsolationCorrections/isolation_ptcorrections_rel20_2.root") # in principle the default
)
#cannot locate it...
leakTool
=
ict
(
name
=
"
LeakageCorrection
"
)
ToolSvc
+=
leakTool
# too to compute the calo iso
from
CaloIdentifier
import
SUBCALO
from
IsolationTool.IsolationToolConf
import
xAOD__CaloIsolationTool
,
xAOD__TrackIsolationTool
CaloIsolationTool
=
ToolFactory
(
xAOD__CaloIsolationTool
,
name
=
"
CaloIsolationTool
"
,
postInit
=
[
configureEDCorrection
],
CaloFillRectangularClusterTool
=
None
,
ClustersInConeTool
=
CaloClustersInConeTool
,
PFlowObjectsInConeTool
=
None
,
#IsoLeakCorrectionTool = None,
IsoLeakCorrectionTool
=
leakTool
,
#saveOnlyRequestedCorrections = True,
saveOnlyRequestedCorrections
=
False
,
EMCaloNums
=
[],
HadCaloNums
=
[],
UseEMScale
=
True
,
addCaloExtensionDecoration
=
False
,
OutputLevel
=
3
)
TrackIsolationTool
=
ToolFactory
(
xAOD__TrackIsolationTool
,
name
=
'
TrackIsolationTool
'
)
from
AthenaCommon
import
CfgMgr
tit
=
CfgMgr
.
xAOD__TrackIsolationTool
(
'
TrackIsolationTool
'
)
tit
.
TrackSelectionTool
.
maxZ0SinTheta
=
3
tit
.
TrackSelectionTool
.
minPt
=
1000
tit
.
TrackSelectionTool
.
CutLevel
=
"
Loose
"
addCaloExtensionDecoration
=
False
)
import
ROOT
,
cppyy
# Need to be sure base dict is loaded first.
...
...
@@ -84,54 +37,19 @@ cppyy.loadDictionary('xAODPrimitivesDict')
isoPar
=
ROOT
.
xAOD
.
Iso
# The types to be computed
# a test
IsoTypesEl
=
[
[
isoPar
.
topoetcone20
,
isoPar
.
topoetcone30
,
isoPar
.
topoetcone40
]
]
IsoTypesPh
=
[
[
isoPar
.
topoetcone20
,
isoPar
.
topoetcone30
,
isoPar
.
topoetcone40
]
]
IsoTypesFe
=
[
[
isoPar
.
topoetcone20
,
isoPar
.
topoetcone30
,
isoPar
.
topoetcone40
]
]
IsoTypesMu
=
[
[
isoPar
.
topoetcone20
,
isoPar
.
topoetcone30
,
isoPar
.
topoetcone40
]
]
# And the corrections
IsoCorEg
=
[
[
isoPar
.
coreTrackPtr
]
]
IsoCorEl
=
[
[
isoPar
.
core57cells
,
isoPar
.
ptCorrection
,
isoPar
.
pileupCorrection
]
# For this fix, we recompute topoetconeXX for El, Ph, Fwd...
IsoTypesEG
=
[
[
isoPar
.
topoetcone20
,
isoPar
.
topoetcone30
,
isoPar
.
topoetcone40
]
]
IsoCorPh
=
[
# ...but the corrections are different for El/Ph vs Fwd
IsoCorEG
=
[
[
isoPar
.
core57cells
,
isoPar
.
ptCorrection
,
isoPar
.
pileupCorrection
]
]
IsoCorFe
=
[
[
isoPar
.
coreCone
,
isoPar
.
pileupCorrection
]
]
IsoCorMu
=
[
[
isoPar
.
coreCone
,
isoPar
.
pileupCorrection
]
]
#from IsolationCorrections.IsolationCorrectionsConf import CP__IsolationCorrectionTool as ict
#leakTool = ict(name = "LeakageCorrection",
# #CorrFile = "IsolationCorrections/isolation_ptcorrections_rel20_2.root") # in principle the default
# ) #cannot locate it...
#ToolSvc += leakTool
]
from
IsolationAlgs.IsolationAlgsConf
import
IsolationBuilder
isoAODFixBuilderElectron
=
AlgFactory
(
IsolationBuilder
,
...
...
@@ -141,21 +59,18 @@ isoAODFixBuilderElectron = AlgFactory(IsolationBuilder,
MuonCollectionContainerName
=
""
,
FwdElectronCollectionContainerName
=
""
,
CaloCellIsolationTool
=
None
,
#CaloTopoIsolationTool = None,
CaloTopoIsolationTool
=
CaloIsolationTool
,
PFlowIsolationTool
=
None
,
TrackIsolationTool
=
None
,
FeIsoTypes
=
[[]]
,
FeCorTypes
=
IsoCorFe
,
EgIsoTypes
=
IsoTypesE
l
,
EgCorTypes
=
IsoCorE
l
,
MuIsoTypes
=
[[]]
,
MuCorTypes
=
IsoCorMu
,
FeCorTypes
=
[[]]
,
EgIsoTypes
=
IsoTypesE
G
,
EgCorTypes
=
IsoCorE
G
,
MuIsoTypes
=
[[]],
MuCorTypes
=
[[]]
,
IsAODFix
=
True
,
#LeakageTool = leakTool,
LeakageTool
=
None
,
IsolateEl
=
True
,
OutputLevel
=
3
)
IsolateEl
=
True
)
isoAODFixBuilderPhoton
=
AlgFactory
(
IsolationBuilder
,
name
=
"
IsolationBuilderPhoton
"
,
...
...
@@ -164,45 +79,18 @@ isoAODFixBuilderPhoton = AlgFactory(IsolationBuilder,
MuonCollectionContainerName
=
""
,
FwdElectronCollectionContainerName
=
""
,
CaloCellIsolationTool
=
None
,
#CaloTopoIsolationTool = None,
CaloTopoIsolationTool
=
CaloIsolationTool
,
PFlowIsolationTool
=
None
,
#TrackIsolationTool = TrackIsolationTool,
TrackIsolationTool
=
None
,
FeIsoTypes
=
[[]]
,
FeCorTypes
=
IsoCorFe
,
EgIsoTypes
=
IsoTypes
Ph
,
EgCorTypes
=
IsoCor
Ph
,
MuIsoTypes
=
[[]]
,
MuCorTypes
=
IsoCorMu
,
FeCorTypes
=
[[]]
,
EgIsoTypes
=
IsoTypes
EG
,
EgCorTypes
=
IsoCor
EG
,
MuIsoTypes
=
[[]],
MuCorTypes
=
[[]]
,
IsAODFix
=
True
,
LeakageTool
=
leakTool
,
IsolateEl
=
False
,
OutputLevel
=
3
)
isoAODFixBuilderMuon
=
AlgFactory
(
IsolationBuilder
,
name
=
"
IsolationBuilderMuon
"
,
ElectronCollectionContainerName
=
""
,
PhotonCollectionContainerName
=
""
,
MuonCollectionContainerName
=
"
Muons
"
,
FwdElectronCollectionContainerName
=
""
,
CaloCellIsolationTool
=
None
,
#CaloTopoIsolationTool = CaloIsolationTool,
CaloTopoIsolationTool
=
None
,
PFlowIsolationTool
=
None
,
TrackIsolationTool
=
None
,
FeIsoTypes
=
[[]]
,
FeCorTypes
=
IsoCorFe
,
EgIsoTypes
=
[[]],
EgCorTypes
=
IsoCorEg
,
MuIsoTypes
=
IsoTypesMu
,
MuCorTypes
=
IsoCorMu
,
CustomConfigurationNameMu
=
'
Core0p05
'
,
IsAODFix
=
True
,
LeakageTool
=
None
,
IsolateEl
=
False
,
OutputLevel
=
3
)
IsolateEl
=
False
)
isoAODFixBuilderFwdElectron
=
AlgFactory
(
IsolationBuilder
,
name
=
"
IsolationBuilderForwardElectron
"
,
...
...
@@ -215,17 +103,15 @@ isoAODFixBuilderFwdElectron = AlgFactory(IsolationBuilder,
#CaloTopoIsolationTool = None,
PFlowIsolationTool
=
None
,
TrackIsolationTool
=
None
,
FeIsoTypes
=
IsoTypes
Fe
,
FeIsoTypes
=
IsoTypes
EG
,
FeCorTypes
=
IsoCorFe
,
EgIsoTypes
=
[[]],
EgCorTypes
=
IsoCorEg
,
EgCorTypes
=
[[]]
,
MuIsoTypes
=
[[]],
MuCorTypes
=
IsoCorMu
,
MuCorTypes
=
[[]]
,
IsAODFix
=
True
,
LeakageTool
=
None
,
IsolateEl
=
False
,
OutputLevel
=
3
)
IsolateEl
=
False
)
from
RecExConfig.Configured
import
Configured
class
isoAODFixGetter
(
Configured
)
:
...
...
@@ -245,8 +131,6 @@ class isoAODFixGetter ( Configured ) :
self
.
_isoBuilderHandle
=
isoAODFixBuilderPhoton
()
elif
self
.
type
==
"
ForwardElectrons
"
:
self
.
_isoBuilderHandle
=
isoAODFixBuilderFwdElectron
()
elif
self
.
type
==
"
Muons
"
:
self
.
_isoBuilderHandle
=
isoAODFixBuilderMuon
()
else
:
mlog
.
error
(
"
wrong object for IsolationBuilder
"
)
except
Exception
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment