Commit e79adde9 authored by Christos Anastopoulos's avatar Christos Anastopoulos
Browse files

Add ForwardElectron,TruthAssociation in egammaConfig. Also first pass on running based on flags

parent fcb8ec64
......@@ -49,7 +49,15 @@ atlas_add_test( egammaTopoClusterCopierConfig_test
atlas_add_test( topoEgammaBuilderConfig_test
SCRIPT python -m egammaAlgs.topoEgammaBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test( egammaForwardBuilderConfig_test
SCRIPT python -m egammaAlgs.egammaForwardBuilderConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test( egammaTruthAssociationConfig_test
SCRIPT python -m egammaAlgs.egammaTruthAssociationConfig
POST_EXEC_SCRIPT nopost.sh)
atlas_add_test( egammaTrackSlimmerConfig_test
SCRIPT python -m egammaAlgs.egammaTrackSlimmerConfig
POST_EXEC_SCRIPT nopost.sh)
......
......@@ -59,3 +59,24 @@ def egammaForwardBuilderCfg(flags, name='egammaForwardElectron', **kwargs):
acc.addEventAlgo(fwdAlg)
return acc
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
from AthenaConfiguration.TestDefaults import defaultTestFiles
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
flags.Input.Files = defaultTestFiles.RDO
acc = MainServicesCfg(flags)
mlog = logging.getLogger("egammaForwardBuilderConfigTest")
mlog.info("Configuring egammaForwardBuilder: ")
acc.merge(egammaForwardBuilderCfg(flags))
printProperties(mlog,
acc.getEventAlgo("egammaForwardElectron"),
nestLevel=1,
printDefaults=True)
with open("egammaforwardbuilder.pkl", "wb") as f:
acc.store(f)
......@@ -44,9 +44,9 @@ if __name__ == "__main__":
flags.Input.Files = defaultTestFiles.RDO
acc = MainServicesCfg(flags)
acc.merge(egammaTopoClusterCopierCfg(flags))
mlog = logging.getLogger("egammaTopoClusterCopierConfigTest")
mlog.info("Configuring egammaTopoClusterCopier: ")
acc.merge(egammaTopoClusterCopierCfg(flags))
printProperties(mlog,
acc.getEventAlgo("egammaTopoClusterCopier"),
nestLevel=1,
......
......@@ -42,9 +42,9 @@ if __name__ == "__main__":
flags.Input.Files = defaultTestFiles.ESD
acc = MainServicesCfg(flags)
acc.merge(egammaTrackSlimmerCfg(flags))
mlog = logging.getLogger("egammaTrackSlimmerConfigTest")
mlog.info("Configuring egammaTrackSlimmer: ")
acc.merge(egammaTrackSlimmerCfg(flags))
printProperties(mlog,
acc.getEventAlgo("egammaTrackSlimmer"),
nestLevel=1,
......
......@@ -52,3 +52,24 @@ def egammaTruthAssociationCfg(flags, name='egammaTruthAssociation', **kwargs):
acc.addEventAlgo(egtruthAlg)
return acc
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
from AthenaConfiguration.TestDefaults import defaultTestFiles
from AthenaConfiguration.ComponentAccumulator import printProperties
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
flags.Input.Files = defaultTestFiles.RDO
acc = MainServicesCfg(flags)
mlog = logging.getLogger("egammaTruthAssociationConfigTest")
mlog.info("Configuring egammaTruthAssociation: ")
acc.merge(egammaTruthAssociationCfg(flags))
printProperties(mlog,
acc.getEventAlgo("egammaTruthAssociation"),
nestLevel=1,
printDefaults=True)
with open("egammatruthassociation.pkl", "wb") as f:
acc.store(f)
......@@ -11,3 +11,7 @@ atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_add_test( egammaConfigFlagsTest
SCRIPT python -m unittest -v egammaConfig.egammaConfigFlags
POST_EXEC_SCRIPT nopost.sh )
atlas_add_test( egammaBuilderConfigTest
SCRIPT python -m egammaConfig.egammaBuilderConfig
POST_EXEC_SCRIPT nopost.sh )
\ No newline at end of file
......@@ -2,6 +2,7 @@
__doc__ = """
Instantiate the full EGamma reconstruction.
Note that
egammaTopoClusterCopier is scheduled in TrackRecoConfig
"""
......@@ -16,26 +17,84 @@ def EGammaReconstructionCfg(flags, name="EGammaReconstruction"):
acc = ComponentAccumulator()
from egammaAlgs.egammaSelectedTrackCopyConfig import (
egammaSelectedTrackCopyCfg)
acc.merge(egammaSelectedTrackCopyCfg(flags))
from egammaAlgs.EMBremCollectionBuilderConfig import (
EMBremCollectionBuilderCfg)
acc.merge(EMBremCollectionBuilderCfg(flags))
from egammaAlgs.EMGSFCaloExtensionBuilderConfig import (
EMGSFCaloExtensionBuilderCfg)
acc.merge(EMGSFCaloExtensionBuilderCfg(flags))
from egammaAlgs.EMVertexBuilderConfig import EMVertexBuilderCfg
acc.merge(EMVertexBuilderCfg(flags))
from egammaAlgs.egammaRecBuilderConfig import egammaRecBuilderCfg
acc.merge(egammaRecBuilderCfg(flags))
from egammaAlgs.egammaSuperClusterBuilderConfig import (
electronSuperClusterBuilderCfg, photonSuperClusterBuilderCfg)
acc.merge(electronSuperClusterBuilderCfg(flags))
acc.merge(photonSuperClusterBuilderCfg(flags))
from egammaAlgs.topoEgammaBuilderConfig import topoEgammaBuilderCfg
acc.merge(topoEgammaBuilderCfg(flags))
# Depending on what is availabe we might want
# to disable certain things
# without calo no egamma
if not flags.Detector.EnableCalo:
flags.Egamma.enabled = False
flags.Egamma.doCaloSeeded = False
flags.Egamma.doForwardSeeded = False
# Tracking
if not flags.Detector.EnableID:
flags.Egamma.doGSF = False
flags.Egamma.doConversionBuilding = False
# MC Truth
if not flags.Input.isMC:
flags.Egamma.doTruthAssociation = False
# if not enabled add nothing
if not flags.Egamma.enabled:
return acc
# Add algorithms
if flags.Egamma.doGSF:
from egammaAlgs.egammaSelectedTrackCopyConfig import (
egammaSelectedTrackCopyCfg)
acc.merge(egammaSelectedTrackCopyCfg(flags))
from egammaAlgs.EMBremCollectionBuilderConfig import (
EMBremCollectionBuilderCfg)
acc.merge(EMBremCollectionBuilderCfg(flags))
from egammaAlgs.EMGSFCaloExtensionBuilderConfig import (
EMGSFCaloExtensionBuilderCfg)
acc.merge(EMGSFCaloExtensionBuilderCfg(flags))
if flags.Egamma.doConversionBuilding:
from egammaAlgs.EMVertexBuilderConfig import EMVertexBuilderCfg
acc.merge(EMVertexBuilderCfg(flags))
if flags.Egamma.doCaloSeeded:
from egammaAlgs.egammaRecBuilderConfig import egammaRecBuilderCfg
acc.merge(egammaRecBuilderCfg(flags))
from egammaAlgs.egammaSuperClusterBuilderConfig import (
electronSuperClusterBuilderCfg, photonSuperClusterBuilderCfg)
acc.merge(electronSuperClusterBuilderCfg(flags))
acc.merge(photonSuperClusterBuilderCfg(flags))
from egammaAlgs.topoEgammaBuilderConfig import topoEgammaBuilderCfg
acc.merge(topoEgammaBuilderCfg(flags))
if flags.Egamma.doForwardSeeded:
from egammaAlgs.egammaForwardBuilderConfig import (
egammaForwardBuilderCfg)
acc.merge(egammaForwardBuilderCfg(flags))
if flags.Egamma.doTruthAssociation:
from egammaAlgs.egammaTruthAssociationConfig import (
egammaTruthAssociationCfg)
acc.merge(egammaTruthAssociationCfg(flags))
mlog.info("EGamma reconstruction configured")
return acc
if __name__ == "__main__":
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior = True
from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags
from AthenaConfiguration.TestDefaults import defaultTestFiles
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
flags.Input.Files = defaultTestFiles.RDO
acc = MainServicesCfg(flags)
acc.merge(EGammaReconstructionCfg(flags))
acc.printConfig(withDetails=True,
printDefaults=True)
with open("egammabuilderconfig.pkl", "wb") as f:
acc.store(f)
......@@ -15,9 +15,6 @@ def createEgammaConfigFlags():
# do standard cluster-based egamma algorithm
egcf.addFlag("Egamma.doCaloSeeded", True)
# if true, do superculsers
egcf.addFlag("Egamma.doSuperclusters", True)
# do forward egamma
egcf.addFlag("Egamma.doForwardSeeded", True)
......@@ -60,7 +57,8 @@ def createEgammaConfigFlags():
egcf.addFlag("Egamma.Keys.Internal.ElectronSuperRecs",
'ElectronSuperRecCollection')
# These are the clusters that are used to determine which cells to write out to AOD
# These are the clusters that are used to determine
# which cells to write out to AOD
egcf.addFlag("Egamma.Keys.Output.EgammaLargeClusters", 'egamma711Clusters')
egcf.addFlag("Egamma.Keys.Output.EgammaLargeClustersSuppESD", '')
# don't define SuppAOD because the whole container is suppressed
......@@ -85,7 +83,8 @@ def createEgammaConfigFlags():
egcf.addFlag("Egamma.Keys.Output.ElectronsSuppESD", '')
egcf.addFlag("Egamma.Keys.Output.ElectronsSuppAOD",
"-e033.-e011.-e333.-e335.-e337.-e377."
"-EgammaCovarianceMatrix.-isEMLHLoose.-isEMLHTight.-isEMLHMedium."
"-EgammaCovarianceMatrix."
"-isEMLHLoose.-isEMLHTight.-isEMLHMedium."
"-isEMLoose.-isEMMedium.-isEMTight")
egcf.addFlag("Egamma.Keys.Input.ForwardTopoClusters",
......@@ -101,7 +100,8 @@ def createEgammaConfigFlags():
egcf.addFlag("Egamma.Keys.Output.ForwardClustersSuppAOD",
'-SisterCluster')
# These are the clusters that are used to determine which cells to write out to AOD
# These are the clusters that are used to determine
# which cells to write out to AOD
egcf.addFlag("Egamma.Keys.Output.EgammaLargeFWDClusters",
'egamma66FWDClusters')
egcf.addFlag("Egamma.Keys.Output.EgammaLargeFWDClustersSuppESD", '')
......@@ -114,9 +114,11 @@ def createEgammaConfigFlags():
egcf.addFlag("Egamma.Keys.Output.GSFTrackParticles", 'GSFTrackParticles')
egcf.addFlag("Egamma.Keys.Output.GSFTrackParticlesSuppESD",
'-caloExtension.-cellAssociation.-perigeeExtrapEta.-perigeeExtrapPhi')
"-caloExtension.-cellAssociation."
"-perigeeExtrapEta.-perigeeExtrapPhi")
egcf.addFlag("Egamma.Keys.Output.GSFTrackParticlesSuppAOD",
'-caloExtension.-cellAssociation.-perigeeExtrapEta.-perigeeExtrapPhi')
'-caloExtension.-cellAssociation.'
'-perigeeExtrapEta.-perigeeExtrapPhi')
# not xAOD
egcf.addFlag("Egamma.Keys.Output.GSFTracks", 'GSFTracks')
......
......@@ -21,14 +21,9 @@ def _configureClusterCorrections(flags, swTool):
Econv35='gam35_conv', Econv55='gam55_conv', Econv37='gam37_conv'
)
if flags.Egamma.doSuperclusters:
version = flags.Egamma.Calib.SuperClusterCorrectionVersion
suffix = 'EGSuperCluster'
attrPref = 'ClusterCorrectionToolsSuperCluster'
else:
version = flags.Egamma.Calib.ClusterCorrectionVersion
suffix = 'EG'
attrPref = 'ClusterCorrectionTools'
version = flags.Egamma.Calib.SuperClusterCorrectionVersion
suffix = 'EGSuperCluster'
attrPref = 'ClusterCorrectionToolsSuperCluster'
for attrName, clName in clusterTypes.items():
attrName = attrPref + attrName
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment