Skip to content
Snippets Groups Projects
Commit a96558a2 authored by Ahmed Tarek's avatar Ahmed Tarek
Browse files

Merge branch 'tstreble-24.0-patch-3248' into '24.0'

Clean up legacy LArG4 configs

See merge request atlas/athena!70724
parents cc6d1a23 f5240263
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
ServiceMgr.MessageSvc.OutputLevel = INFO
## Algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
## AthenaCommon flags
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
i = options['outevents']
athenaCommonFlags.EvtMax = i
athenaCommonFlags.PoolHitsOutput.set_Off()
from AthenaCommon.AppMgr import theApp
theApp.EvtMax = i
import AthenaCommon.AtlasUnixGeneratorJob
from TruthIO.TruthIOConf import HepMCReadFromFile
read = HepMCReadFromFile()
read.InputFile = options['outfile']
topSequence += read
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
outStream = AthenaPoolOutputStream("OutStream")
outStream.ItemList = ["EventInfo#*", "McEventCollection#*"]
outfile = options['outfile']
if outfile.endswith(".ascii") :
outfile = outfile[:-6]
outStream.OutputFile = outfile+".pool.root"
......@@ -22,5 +22,3 @@ atlas_add_library( LArG4H6SD
PRIVATE_INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS}
PRIVATE_LINK_LIBRARIES ${CORAL_LIBRARIES} ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} AtlasHepMCLib ${GEANT4_LIBRARIES} GaudiKernel CaloG4SimLib CaloSimEvent AthenaBaseComps AthenaKernel StoreGateLib GeoModelUtilities Identifier GeneratorObjects LArG4Code LArG4RunControl LArG4TBSimEvent LArReadoutGeometry LArSimEvent G4AtlasInterfaces G4AtlasToolsLib SimHelpers HitManagement MCTruth TBEvent PathResolver GeoModelInterfaces RDBAccessSvcLib )
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.Logging import logging
from RecExConfig.Configured import Configured
import traceback
#
# These should probably be in a common library.
#
def _makeconf (cls, name = None, **kwargs):
if name is not None:
x = cls(name)
else:
x = cls()
for (k,v) in kwargs.items():
setattr (x, k, v)
return x
class LArTBH6BeamInfoGetter (Configured):
# Must be set
#_name = xxx
#_suffix = xxx
def configure (self):
# Make a logger.
clsname = self.__class__.__name__
mlog = logging.getLogger ('%s:configure : ' % clsname)
# Create the configurable.
try:
from LArG4H6SD.LArG4H6SDConf import LArTBH6BeamInfo
theLArTBH6BeamInfo = LArTBH6BeamInfo()
except Exception:
mlog.error("could not import LArG4H6SD.LArTBH6BeamInfo")
mlog.error (traceback.format_exc())
return False
self._LArTBH6BeamInfoHandle = theLArTBH6BeamInfo
theLArTBH6BeamInfo.HitsContainer = ["LArTBFrontHitCollection"]
theLArTBH6BeamInfo.PrimaryTrackOnly = True
theLArTBH6BeamInfo.PrimaryParticle = 999
# now add algorithm to topSequence
from __main__ import topSequence
topSequence += theLArTBH6BeamInfo
return True
def handle(self):
return self._handle
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#=======================================================================
# File: LArG4H6SD/python/__init__.py
#=======================================================================
__version__ = '0.0.1'
__author__ = 'Pavol Strizenec '
__all__ = [ 'LArTBH6BeamInfoGetter' ]
__doc__ =""" - Python modules for the LArG4H6SD -
LArTBH6BeamInfo -> store H6BeamInfo in Ntuple
"""
__description__ ='Python interface for LArG4H6SD '
#
#=======================================================================
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from LArG4Validation.LArG4ValidationConf import AODReader
topSequence += AODReader()
topSequence.AODReader.OutputLevel = WARNING
AthenaEventLoopMgr = Service("AthenaEventLoopMgr")
AthenaEventLoopMgr.OutputLevel = ERROR
import AthenaPoolCnvSvc.ReadAthenaPool
ServiceMgr.EventSelector.InputCollections = args
theApp.Dlls += [ 'RootHistCnv' ]
theApp.HistogramPersistency = 'ROOT'
NTupleSvc = Service( "NTupleSvc" )
NTupleSvc.Output = [ "FILE DATAFILE=\'"+"ntuple.root"+"\' TYP='ROOT' OPT='NEW'" ]
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# get a handle to the default top-level algorithm sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
from LArG4Validation.LArG4ValidationConf import SingleTrackValidation
topSequence += SingleTrackValidation()
# The following lines are to construct our ntuple:
if "RootFileName" not in dir() :
RootFileName = "sp.tuple.root"
NtupleSvc = Service( "NTupleSvc" )
NtupleSvc.Output = [ "FILE DATAFILE=\'" + RootFileName + "\' OPT='NEW'" ]
theApp.Dlls += [ "RootHistCnv" ]
theApp.HistogramPersistency = "ROOT"
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