Skip to content
Snippets Groups Projects
Commit 0d3d45d7 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'fixATLASRECTS-5007' into 'master'

Adjust CaloCellDFGetter.py: AlgTools used in AODCellProduction are now private

Closes ATLASRECTS-5007

See merge request atlas/athena!24197
parents b314cd31 c27c25de
No related branches found
No related tags found
No related merge requests found
......@@ -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())
#==========================================================================================
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment