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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Shaun Roe
athena
Commits
c27c25de
Commit
c27c25de
authored
5 years ago
by
Walter Lampl
Browse files
Options
Downloads
Patches
Plain Diff
Adjust CaloCellDFGetter.py: AlgTools used in AODCellProduction are now private
parent
cbe172ee
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/CaloCellDFGetter.py
+24
-82
24 additions, 82 deletions
...mework/DerivationFrameworkCalo/python/CaloCellDFGetter.py
with
24 additions
and
82 deletions
PhysicsAnalysis/DerivationFramework/DerivationFrameworkCalo/python/CaloCellDFGetter.py
+
24
−
82
View file @
c27c25de
...
...
@@ -62,8 +62,6 @@ class CaloCellDFGetter () :
self
.
_inputCellKey
=
inputCellKey
self
.
_outputType
=
"
CaloCellContainer
"
self
.
_sequence
=
Sequense
self
.
_tools
=
{}
self
.
_orders
=
{}
self
.
configure
()
def
configure
(
self
):
...
...
@@ -74,7 +72,6 @@ class CaloCellDFGetter () :
mlog
.
info
(
'
InputCellKey %s
'
,
self
.
inputCellKey
())
mlog
.
info
(
'
OutputCellKey %s
'
,
self
.
outputCellKey
())
from
AthenaCommon.AppMgr
import
ToolSvc
#Schedule the calo cell maker.
from
CaloRec.CaloRecConf
import
CaloConstCellMaker
...
...
@@ -87,62 +84,30 @@ class CaloCellDFGetter () :
#Add the needed tool instances, only if they do not exist already
#====================== CaloCellContainerFromClusterTool
if
not
hasattr
(
ToolSvc
,
'
CaloCellContainerFromClusterTool_
'
+
self
.
outputCellKey
()):
self
.
theCaloCellContainerFromClusterTool
=
self
.
GetTool
(
'
CaloCellContainerFromClusterTool_
'
+
self
.
outputCellKey
())
if
self
.
theCaloCellContainerFromClusterTool
is
None
:
from
CaloRec.CaloRecConf
import
CaloCellContainerFromClusterTool
self
.
theCaloCellContainerFromClusterTool
=
CaloCellContainerFromClusterTool
(
'
CaloCellContainerFromClusterTool_
'
+
self
.
outputCellKey
())
ToolSvc
+=
self
.
theCaloCellContainerFromClusterTool
self
.
AddTool
(
self
.
theCaloCellContainerFromClusterTool
,
order
=
1
)
self
.
theCaloCellContainerFromClusterTool
.
CaloCellName
=
self
.
inputCellKey
()
self
.
theCaloCellContainerFromClusterTool
.
AddSamplingCells
=
True
self
.
theCaloCellContainerFromClusterTool
.
SamplingCellsName
=
[
"
TileGap1
"
,
"
TileGap2
"
,
"
TileGap3
"
,
"
TileBar0
"
,
"
TileExt0
"
,
"
HEC0
"
]
mlog
.
info
(
'
CaloCellContainerFromClusterTool has been added
'
)
else
:
self
.
theCaloCellContainerFromClusterTool
=
getattr
(
ToolSvc
,
'
CaloCellContainerFromClusterTool_
'
+
self
.
outputCellKey
())
from
CaloRec.CaloRecConf
import
CaloCellContainerFromClusterTool
self
.
theCaloCellMaker
.
CaloCellMakerTools
+=
[
CaloCellContainerFromClusterTool
(
#'CaloCellContainerFromClusterTool_'+self.outputCellKey(),
CaloCellName
=
self
.
inputCellKey
(),
AddSamplingCells
=
True
,
SamplingCellsName
=
[
"
TileGap1
"
,
"
TileGap2
"
,
"
TileGap3
"
,
"
TileBar0
"
,
"
TileExt0
"
,
"
HEC0
"
],
),]
#====================== CaloCellFastCopyTool
if
not
hasattr
(
ToolSvc
,
'
CaloCellFastCopyTool_
'
+
self
.
outputCellKey
()):
self
.
theCaloCellFastCopyTool
=
self
.
GetTool
(
'
CaloCellFastCopyTool_
'
+
self
.
outputCellKey
())
if
self
.
theCaloCellFastCopyTool
is
None
:
from
CaloRec.CaloRecConf
import
CaloCellFastCopyTool
self
.
theCaloCellFastCopyTool
=
CaloCellFastCopyTool
(
'
CaloCellFastCopyTool_
'
+
self
.
outputCellKey
())
self
.
theCaloCellFastCopyTool
.
InputName
=
self
.
inputCellKey
()
self
.
theCaloCellFastCopyTool
.
AvoidDuplicates
=
True
self
.
theCaloCellFastCopyTool
.
IsFindCellFast
=
True
self
.
theCaloCellFastCopyTool
.
IncludeSamplings
+=
[
"
TileGap3
"
]
mlog
.
info
(
'
The sampling %s has been scheduled to be copied
'
,
"
TileGap3
"
)
ToolSvc
+=
self
.
theCaloCellFastCopyTool
self
.
AddTool
(
self
.
theCaloCellFastCopyTool
,
order
=
7
)
mlog
.
info
(
'
CaloCellFastCopyTool has been added
'
)
else
:
self
.
theCaloCellFastCopyTool
=
getattr
(
ToolSvc
,
'
CaloCellFastCopyTool_
'
+
self
.
outputCellKey
())
from
CaloRec.CaloRecConf
import
CaloCellFastCopyTool
self
.
theCaloCellMaker
.
CaloCellMakerTools
+=
[
CaloCellFastCopyTool
(
'
CaloCellFastCopyTool_
'
+
self
.
outputCellKey
(),
InputName
=
self
.
inputCellKey
(),
AvoidDuplicates
=
True
,
IsFindCellFast
=
True
,
IncludeSamplings
=
[
"
TileGap3
"
,
]
),]
#======================CaloCellContainerFinalizerTool
if
not
hasattr
(
ToolSvc
,
'
CaloCellContainerFinalizerTool_
'
+
self
.
outputCellKey
()):
self
.
theCaloCellContainerFinalizerTool
=
self
.
GetTool
(
'
CaloCellContainerFinalizerTool_
'
+
self
.
outputCellKey
())
if
self
.
theCaloCellContainerFinalizerTool
is
None
:
from
CaloRec.CaloRecConf
import
CaloCellContainerFinalizerTool
self
.
theCaloCellContainerFinalizerTool
=
CaloCellContainerFinalizerTool
(
'
CaloCellContainerFinalizerTool_
'
+
self
.
outputCellKey
())
ToolSvc
+=
self
.
theCaloCellContainerFinalizerTool
self
.
AddTool
(
self
.
theCaloCellContainerFinalizerTool
,
order
=
9
)
mlog
.
info
(
'
CaloCellContainerFinalizerTool has been added
'
)
else
:
self
.
theCaloCellContainerFinalizerTool
=
getattr
(
ToolSvc
,
'
CaloCellContainerFinalizerTool_
'
+
self
.
outputCellKey
())
from
CaloRec.CaloRecConf
import
CaloCellContainerFinalizerTool
self
.
theCaloCellMaker
.
CaloCellMakerTools
+=
[
CaloCellContainerFinalizerTool
(
'
CaloCellContainerFinalizerTool_
'
+
self
.
outputCellKey
()),]
#====================== CaloCellContainerCheckerTool
if
not
hasattr
(
ToolSvc
,
'
CaloCellContainerCheckerTool_
'
+
self
.
outputCellKey
()):
self
.
theCaloCellContainerCheckerTool
=
self
.
GetTool
(
'
CaloCellContainerCheckerTool_
'
+
self
.
outputCellKey
())
if
self
.
theCaloCellContainerCheckerTool
is
None
:
from
CaloRec.CaloRecConf
import
CaloCellContainerCheckerTool
self
.
theCaloCellContainerCheckerTool
=
CaloCellContainerCheckerTool
(
'
CaloCellContainerCheckerTool_
'
+
self
.
outputCellKey
())
ToolSvc
+=
self
.
theCaloCellContainerCheckerTool
self
.
AddTool
(
self
.
theCaloCellContainerCheckerTool
,
order
=
10
)
mlog
.
info
(
'
CaloCellContainerCheckerTool has been added
'
)
else
:
self
.
theCaloCellContainerCheckerTool
=
getattr
(
ToolSvc
,
'
CaloCellContainerCheckerTool_
'
+
self
.
outputCellKey
())
#======================
from
CaloRec.CaloRecConf
import
CaloCellContainerCheckerTool
self
.
theCaloCellMaker
.
CaloCellMakerTools
+=
[
CaloCellContainerCheckerTool
(
'
CaloCellContainerCheckerTool_
'
+
self
.
outputCellKey
()),]
#Algorithm to update cluster->cell links
from
CaloRec.CaloRecConf
import
CaloClusterCellLinksUpdater
self
.
theClusterUpdater
=
CaloClusterCellLinksUpdater
(
name
=
"
CaloClusterCellLinksUpdater_
"
+
self
.
outputCellKey
(),
...
...
@@ -150,9 +115,7 @@ class CaloCellDFGetter () :
self
.
_ClusterUpdateHandle
=
self
.
theClusterUpdater
for
inputname
in
self
.
inputClusterKeys
():
self
.
theCaloCellContainerFromClusterTool
.
CaloClusterNames
+=
[
inputname
]
self
.
AddClusterToUpdate
(
inputname
)
mlog
.
info
(
"
Add Clusters Collection %s to the %s CellCollection
"
,
inputname
,
self
.
outputCellKey
())
self
.
AddCluster
(
inputname
)
#======================
#Avoid scheduling the same algorithm instances twice
...
...
@@ -173,9 +136,6 @@ class CaloCellDFGetter () :
return
True
def
CaloCellMakerHandle
(
self
):
return
self
.
_CaloCellMakerHandle
def
outputCellKey
(
self
):
return
self
.
_outputCellKey
...
...
@@ -189,27 +149,9 @@ class CaloCellDFGetter () :
return
self
.
_outputType
def
AddCluster
(
self
,
name
):
self
.
theCaloCellContainerFromClusterTool
.
CaloClusterNames
+=
[
name
]
self
.
AddClusterToUpdate
(
name
)
mlog
.
info
(
"
Add Cluster Collection %s to the %s CellCollection
"
,
name
,
self
.
outputCellKey
())
def
GetTool
(
self
,
toolName
):
if
toolName
in
self
.
_tools
:
return
self
.
_tools
[
toolName
]
return
None
def
AddClusterToUpdate
(
self
,
clusterkey
):
self
.
_ClusterUpdateHandle
.
CaloClusterNames
+=
[
clusterkey
,]
return
None
def
AddTool
(
self
,
tool
,
order
):
if
tool
.
getName
()
in
self
.
_tools
:
return
False
self
.
_CaloCellMakerHandle
.
CaloCellMakerTools
+=
[
tool
]
self
.
_tools
[
tool
.
getName
()]
=
tool
self
.
_orders
[
tool
.
getName
()]
=
order
self
.
_CaloCellMakerHandle
.
CaloCellMakerTools
.
sort
(
key
=
lambda
t
:
self
.
_orders
[
t
.
getName
()])
return
True
self
.
_CaloCellMakerHandle
.
CaloCellMakerTools
[
0
].
CaloClusterNames
+=
[
name
,]
self
.
_ClusterUpdateHandle
.
CaloClusterNames
+=
[
name
,]
#mlog.info("Add Cluster Collection %s to the %s CellCollection ",name,self.outputCellKey())
#==========================================================================================
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