diff --git a/Calorimeter/CaloRec/share/CaloBCIDAvgAlgConfig_test.ref b/Calorimeter/CaloRec/share/CaloBCIDAvgAlgConfig_test.ref index b05239972687da15ed300f0e3ea1bc1259dc200a..9f65bc014b4c8af5c086cdfb8237bcabeff91808 100644 --- a/Calorimeter/CaloRec/share/CaloBCIDAvgAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/CaloBCIDAvgAlgConfig_test.ref @@ -1,5 +1,4 @@ --- data -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq @@ -36,7 +35,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO theApp properties --- mc -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq @@ -72,7 +70,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO theApp properties --- online -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Calorimeter/CaloRec/share/CaloBCIDCoeffsCondAlgConfig_test.ref b/Calorimeter/CaloRec/share/CaloBCIDCoeffsCondAlgConfig_test.ref index 35652e3ca793f8aaf56274837b578107fc1c665a..3af5738392e549323494205783209a4949c23c36 100644 --- a/Calorimeter/CaloRec/share/CaloBCIDCoeffsCondAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/CaloBCIDCoeffsCondAlgConfig_test.ref @@ -1,5 +1,4 @@ --- data -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq @@ -27,7 +26,6 @@ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO theApp properties IOVDbSvc: ['/TagInfo<metaOnly/>', '<db>COOLOFL_LAR/CONDBR2</db> /LAR/ElecCalibOfl/LArPileupShape<key>LArShape32</key>', '<db>COOLOFL_LAR/CONDBR2</db> /LAR/ElecCalibOfl/LArPileupAverage', '/LAR/ElecCalibFlat/OFC<db>COOLONL_LAR/CONDBR2</db>'] --- mc -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Calorimeter/CaloRec/share/CaloBCIDLumiCondAlgConfig_test.ref b/Calorimeter/CaloRec/share/CaloBCIDLumiCondAlgConfig_test.ref index 371a42ef8a4e921e1784b27dda61a21c55607fad..c9db94f7ddd2dfd52187df8307a268104a4a1e5b 100644 --- a/Calorimeter/CaloRec/share/CaloBCIDLumiCondAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/CaloBCIDLumiCondAlgConfig_test.ref @@ -1,5 +1,4 @@ --- data -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq @@ -31,7 +30,6 @@ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO theApp properties IOVDbSvc: ['/TagInfo<metaOnly/>', '<db>COOLOFL_LAR/CONDBR2</db> /LAR/ElecCalibOfl/LArPileupShape<key>LArShape32</key>', '<db>COOLOFL_LAR/CONDBR2</db> /LAR/ElecCalibOfl/LArPileupAverage', '/LAR/ElecCalibFlat/OFC<db>COOLONL_LAR/CONDBR2</db>', '<db>COOLOFL_TRIGGER/CONDBR2</db> /TRIGGER/OFLLUMI/OflPrefLumi', '<db>COOLONL_TDAQ/CONDBR2</db> /TDAQ/OLC/CALIBRATIONS'] --- mc -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Calorimeter/CaloRec/share/CaloCellContainerAliasAlgConfig_test.ref b/Calorimeter/CaloRec/share/CaloCellContainerAliasAlgConfig_test.ref index 9a1553a4d153ecca1e93d82e13aed94cf6d858d6..789bdc71d61ab138dd9a496e2b5a723fca0b2f11 100644 --- a/Calorimeter/CaloRec/share/CaloCellContainerAliasAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/CaloCellContainerAliasAlgConfig_test.ref @@ -1,5 +1,4 @@ Py:Athena INFO using release [?-21.0.0] [?] [?/?] -- built on [?] -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlgConfig_test.ref b/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlgConfig_test.ref index f93317f8c72fae5724189c1620bdbbbe75439ab9..cb675a65525e90ea2077187986a82abd28d34824 100644 --- a/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/CaloThinCellsByClusterAlgConfig_test.ref @@ -1,5 +1,4 @@ Py:Athena INFO using release [?-21.0.0] [?] [?/?] -- built on [?] -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlgConfig_test.ref b/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlgConfig_test.ref index 46042c23273e1b88f9d6b3341c38be5fe77d0b6e..f3e954ed7e1bbdb4dc80edf16762ea32a720e9d7 100644 --- a/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/CaloThinCellsBySamplingAlgConfig_test.ref @@ -1,5 +1,4 @@ Py:Athena INFO using release [?-21.0.0] [?] [?/?] -- built on [?] -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Calorimeter/CaloRec/share/ToolConstantsCondAlgConfig_test.ref b/Calorimeter/CaloRec/share/ToolConstantsCondAlgConfig_test.ref index d5bdf54edd73f4e4cc25a7130df3e97c9f458d41..92c4a3dc534d329704ebabf14a0cd4b698a6f33d 100644 --- a/Calorimeter/CaloRec/share/ToolConstantsCondAlgConfig_test.ref +++ b/Calorimeter/CaloRec/share/ToolConstantsCondAlgConfig_test.ref @@ -1,6 +1,5 @@ Py:Athena INFO using release [?-22.0.0] [?] [?/?] -- built on [?] --- detstore -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq @@ -18,7 +17,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO theApp properties --- cool -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index b6ab2068f9f2a691c521185ddfcd0b2a8d8c993d..05d0928157057a62dd737b73116c3db68f6f61c6 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -459,6 +459,11 @@ def initConfigFlags(): return createHIRecConfigFlags() _addFlagsCategory(acf, "HeavyIon", __hi, "HIRecConfig") + def __onlineED(): + from EventDisplaysOnline.EventDisplaysOnlineFlags import createOnlineEventDisplayFlags + return createOnlineEventDisplayFlags() + _addFlagsCategory(acf, "OnlineEventDisplays", __onlineED, 'EventDisplaysOnline' ) + def __dq(): from AthenaMonitoring.DQConfigFlags import createDQConfigFlags dqf = createDQConfigFlags() diff --git a/Control/AthenaConfiguration/python/ComponentAccumulator.py b/Control/AthenaConfiguration/python/ComponentAccumulator.py index b6e9d4248ee82934d355936850329bbdb0b66afa..5264bebe13bdbdf1a29e1d9b1de9db9ff7dbb504 100644 --- a/Control/AthenaConfiguration/python/ComponentAccumulator.py +++ b/Control/AthenaConfiguration/python/ComponentAccumulator.py @@ -220,10 +220,9 @@ class ComponentAccumulator(AccumulatorCachable): # in the list with a trailing `-', then only the name of the component # will be printed, not its properties. def printConfig(self, withDetails=False, summariseProps=False, - onlyComponents = [], printDefaults=False, printComponentsOnly=False, prefix=None): + onlyComponents = [], printDefaults=False, printComponentsOnly=False, printSequenceTreeOnly=False, prefix=None): msg = logging.getLogger(prefix) if prefix else self._msg - msg.info( "Event Inputs" ) msg.info( "Event Algorithm Sequences" ) def printSeqAndAlgs(seq, nestLevel = 0, @@ -256,6 +255,9 @@ class ComponentAccumulator(AccumulatorCachable): msg.info( "Top sequence %d", n ) printSeqAndAlgs(s, onlyComponents = onlyComponents) + if printSequenceTreeOnly: + return + self.printCondAlgs (summariseProps = summariseProps, onlyComponents = onlyComponents) msg.info( "Services" ) diff --git a/Control/DataModelAthenaPool/CMakeLists.txt b/Control/DataModelAthenaPool/CMakeLists.txt index 892d5b6a133e927ffd491df0029985047fd3e9f5..8350afdef1685183a4f7e8052d4f938edca32085 100644 --- a/Control/DataModelAthenaPool/CMakeLists.txt +++ b/Control/DataModelAthenaPool/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( DataModelAthenaPool ) @@ -25,10 +25,6 @@ atlas_add_dictionary( DataModelAthenaPoolDictDict DataModelAthenaPool/selection.xml LINK_LIBRARIES DataModelAthenaPoolLib ) -# Install files from the package: -atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/DataModelAthenaPool_jobOptions.py ) - # Tests in the package: function( _add_test name ) atlas_add_test( ${name} diff --git a/Control/DataModelAthenaPool/python/DataModelCompatSvc.py b/Control/DataModelAthenaPool/python/DataModelCompatSvc.py deleted file mode 100755 index 4cfc16a2d5020f80464e47ba8d3dca1b1cac8a8b..0000000000000000000000000000000000000000 --- a/Control/DataModelAthenaPool/python/DataModelCompatSvc.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# -# $Id: DataModelCompatSvc.py,v 1.2 2008-03-26 19:23:06 ssnyder Exp $ -# -# File: python/DataModelCompatSvc.py -# Author: scott snyder -# Date: Dec 2007, from previous JO version. -# Purpose: Set up backwards compatibility for DataModel. -# -# Just import this module to set up DataModelCompatSvc. -# - -from AthenaCommon.AppMgr import theApp -from AthenaCommon.AppMgr import ServiceMgr -from DataModelAthenaPool.DataModelAthenaPoolConf import DataModelCompatSvc - -# We need this service created explicitly, and we need to make -# sure that it is initialized before the input file is opened. -class DataModelCompatSvcCreate (DataModelCompatSvc): - def setup (self): - DataModelCompatSvc.setup (self) - theApp.getHandle()._svcmgr.addService ("", "DataModelCompatSvc", 5) - return -ServiceMgr += DataModelCompatSvcCreate("DataModelCompatSvc") - diff --git a/Control/DataModelAthenaPool/share/DataModelAthenaPool_jobOptions.py b/Control/DataModelAthenaPool/share/DataModelAthenaPool_jobOptions.py deleted file mode 100755 index 66d9dc89fb681f6aff0c485ed228e329d62463f0..0000000000000000000000000000000000000000 --- a/Control/DataModelAthenaPool/share/DataModelAthenaPool_jobOptions.py +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id: DataModelAthenaPool_jobOptions.py,v 1.5 2007-12-10 20:28:09 ssnyder Exp $ -# -# File: share/DataModelAthenaPool_jobOptions.py -# Author: scott snyder -# Date: Nov 2005 -# Purpose: Set up backwards compatibility for DataModel. -# - -include.block ( "DataModelAthenaPool/DataModelAthenaPool_jobOptions.py" ) - -from DataModelAthenaPool import DataModelCompatSvc diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/share/CondProxyProviderConfig_test.ref b/Database/AthenaPOOL/EventSelectorAthenaPool/share/CondProxyProviderConfig_test.ref index 0871bdd78e9bf574230f9f83fd7ce989877da594..f6d91e0de90927ad2fcb8bf9c1efa4c6abd2ebff 100644 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/share/CondProxyProviderConfig_test.ref +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/share/CondProxyProviderConfig_test.ref @@ -1,5 +1,4 @@ Py:Athena INFO using release [WorkDir-22.0.15] [x86_64-centos7-gcc8-opt] [config.EventSelectorAthenaPool-20200617/24fa4eb1a41] -- built on [2020-06-17T2014] -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq diff --git a/Event/xAOD/xAODBTaggingCnv/share/xAODBTaggingReader_jobOptions.py b/Event/xAOD/xAODBTaggingCnv/share/xAODBTaggingReader_jobOptions.py deleted file mode 100644 index e0b91ebccd2a8082f6b509528c265dfa3ab42983..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODBTaggingCnv/share/xAODBTaggingReader_jobOptions.py +++ /dev/null @@ -1,22 +0,0 @@ -# $Id: xAODBTaggingReader_jobOptions.py 583111 2014-02-13 17:31:49Z christos $ - -# Set up the reading of the input xAOD: -FNAME = "xAOD.pool.root" -import AthenaPoolCnvSvc.ReadAthenaPool -ServiceMgr.EventSelector.InputCollections = [ FNAME ] - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -# Add the xAOD reader algorithm(s): -from xAODBTaggingCnv.xAODBTaggingCnvConf import xAODReader__BTaggingReader - -alg = xAODReader__BTaggingReader() -alg.OutputLevel = DEBUG -theJob += alg - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000000 diff --git a/Event/xAOD/xAODBTaggingCnv/share/xAODTrigBjetConverter_jobOptions.py b/Event/xAOD/xAODBTaggingCnv/share/xAODTrigBjetConverter_jobOptions.py deleted file mode 100644 index a8fe82283c742e7090d588085a5b9a2c49a36e7e..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODBTaggingCnv/share/xAODTrigBjetConverter_jobOptions.py +++ /dev/null @@ -1,39 +0,0 @@ - -# $Id: xAODTrigBjetConverter_jobOptions.py 621657 2014-10-14 11:13:03Z lidiaz $ -# -# A small example of converting AOD style BjetTrig objects to xAOD style. -# - -# Set up the reading of a file: -#FNAME = "test.RAW" -#include ("AthenaPython/iread_file.py") -FNAME = "AOD.pool.root" -import AthenaPoolCnvSvc.ReadAthenaPool -ServiceMgr.EventSelector.InputCollections = [ FNAME ] - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -# Add the converter algorithm(s) to the job: -from xAODBTaggingCnv.xAODBTaggingCnvConf import * -alg = xAODMaker__TrigBjetCnvAlg() -alg.AODKey = "HLT_EFBjetFex" -alg.xAODKey = "TrigBjet" -alg.OutputLevel = VERBOSE -theJob += alg - -# Create an output file: -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -stream = MSMgr.NewPoolStream( "StreamAOD", "xAOD.pool.root" ) - -# Add the MET types to it: -stream.AddItem( "xAOD::BTaggingContainer_v1#*" ) -stream.AddItem( "xAOD::BTaggingAuxContainer_v1#*" ) - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -theApp.EvtMax = 10 -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000 -#ServiceMgr.StoreGateSvc.Dump = True diff --git a/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt b/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt index 8d540059fc08d57aa581dc70259311421040f727..989f98f890099ca7488a215dea7ab1a25624c93b 100644 --- a/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt +++ b/Event/xAOD/xAODCaloEventCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODCaloEventCnv ) @@ -16,6 +16,3 @@ atlas_add_component( xAODCaloEventCnv src/components/*.cxx LINK_LIBRARIES CaloInterfaceLib xAODCaloEventCnvLib xAODCaloEvent CaloEvent AthenaBaseComps AthenaKernel GaudiKernel ) -# Install files from the package: -atlas_install_joboptions( share/*.py ) - diff --git a/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_jobOptions.py b/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_jobOptions.py deleted file mode 100644 index 1c922bfed531f1a5462df706d9998949679f1302..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_jobOptions.py +++ /dev/null @@ -1,54 +0,0 @@ -# $Id: ClusterCreator_jobOptions.py 596346 2014-05-10 13:47:20Z krasznaa $ - -# Set up the reading of the input AOD: -FNAME = "AOD.pool.root" -#include( "AthenaPython/iread_file.py" ) - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -import AthenaPoolCnvSvc.ReadAthenaPool -svcMgr.EventSelector.InputCollections = [FNAME,] -# Add the xAOD container creator algorithm: -from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator, ClusterDumper -alg = ClusterCreator(AODContainerNames=["CaloCalTopoCluster"],OutputLevel=DEBUG) -#alg = ClusterCreator(OutputLevel=DEBUG) - -theJob += alg - -theJob+=ClusterDumper("TopoDumper",ContainerName="CaloCalTopoCluster",FileName="TopoCluster.txt") - -# Create a POOL output file with the StoreGate contents: -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -xaodStream = MSMgr.NewPoolStream( "StreamXAOD", "xAOD.pool.root" ) - -# Set up its contents: -xaodStream.AddItem( "xAOD::CaloClusterContainer_v1#*" ) -xaodStream.AddItem( "xAOD::CaloClusterAuxContainer_v1#*" ) -xaodStream.AddItem( "CaloCellContainer#AODCellContainer") -xaodStream.AddItem( "CaloClusterCellLinkContainer#*") - -#xaodStream.AddItem( "CaloClusterContainer#*"); -xaodStream.AddMetaDataItem( "xAOD::EventFormat_v1#*" ) -xaodStream.Print() - -# Split all branches: -ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ - "DEFAULT_SPLITLEVEL='99'" ] - -# Force POOL to just simply use the StoreGate keys as branch names: -ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = "<key>" - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -theApp.EvtMax = 5 -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000000 - -#ServiceMgr.StoreGateSvc.Dump=True -from AthenaServices.AthenaServicesConf import AthenaEventLoopMgr -ServiceMgr += AthenaEventLoopMgr(EventPrintoutInterval = 100) - -#ServiceMgr.AthenaPoolCnvSvc.OutputLevel=VERBOSE - diff --git a/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_test.py b/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_test.py deleted file mode 100644 index fa07f30e32b6ed0b856c333c38a67b317e2c1887..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_test.py +++ /dev/null @@ -1,35 +0,0 @@ -# -# $Id$ -# -# File: xAODCaloEventCnv/share/ClusterCreator_test.py -# Author: snyder@bnl.gov -# Date: Nov 2015 -# Purpose: Unit test for calo cluster aod -> xaod conversion. -# - -import AthenaCommon.AtlasUnixStandardJob -import AthenaPoolCnvSvc.ReadAthenaPool - -# Define input -import os -testdata = os.environ.get ('D3PDTESTDATA', - '/afs/cern.ch/atlas/maxidisk/d33/referencefiles') -svcMgr.EventSelector.InputCollections = [ testdata + '/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root' ] - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator, ClusterDumper -topSequence += ClusterCreator(AODContainerNames=["CaloCalTopoCluster"]) -topSequence += ClusterDumper("TopoDumper",ContainerName="CaloCalTopoCluster",FileName="TopoCluster.txt") - -def compare(): - import os - reffile = 'TopoCluster.txt.bz2' - refpath = '../test/%s' % reffile - if not os.path.exists (refpath): - refpath = '../../test/%s' % reffile - os.system ('bzdiff -u %s %s' % ('TopoCluster.txt', refpath)) -import atexit -atexit.register (compare) - diff --git a/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_test.ref b/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_test.ref deleted file mode 100644 index d1941382d78eefa8d4585326f6ac7fa4b3e675e1..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODCaloEventCnv/share/ClusterCreator_test.ref +++ /dev/null @@ -1,169 +0,0 @@ -Thu Oct 29 11:50:53 EDT 2015 -WARNING: TCMALLOCDIR not defined, will use libc malloc -Py:Athena INFO including file "AthenaCommon/Preparation.py" -Py:Athena INFO using release [?-?] [i686-slc5-gcc43-dbg] [?/?] -- built on [?] -Py:Athena INFO including file "AthenaCommon/Atlas.UnixStandardJob.py" -Warning in <TInterpreter::ReadRootmapFile>: class Event found in libG4AtlasControlDict.so is already in libzzllqq_matelemDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::Hep3Vector found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepDiagMatrix found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepGenMatrix found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepLorentzVector found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepMatrix found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepRandom found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepSymMatrix found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Warning in <TInterpreter::ReadRootmapFile>: class CLHEP::HepVector found in libAtlasSealCLHEPDict.so is already in libhitfitDict.so -Py:Athena INFO executing ROOT6Setup -Py:Athena INFO including file "AthenaCommon/Execution.py" -Py:Athena INFO including file "/home/sss/atlas/rootaccess/../share/ClusterCreator_test.py" -Py:ConfigurableDb INFO Read module info for 3785 configurables from 2 genConfDb files -Py:ConfigurableDb INFO No duplicates have been found: that's good ! -Py:Athena INFO including file "AthenaCommon/runbatch.py" -# setting LC_ALL to "C" -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level=0 -ApplicationMgr SUCCESS -==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v999r999) - running on karma on Thu Oct 29 11:50:56 2015 -==================================================================================================================================== -ApplicationMgr INFO Successfully loaded modules : AthenaServices -ApplicationMgr INFO Application Manager Configured successfully -ApplicationMgr INFO Updating Gaudi::PluginService::SetDebug(level) to level=0 -StatusCodeSvc INFO initialize -AthDictLoaderSvc INFO in initialize... -AthDictLoaderSvc INFO acquired Dso-registry -ClassIDSvc INFO Initializing ClassIDSvc - package version CLIDComps-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 2065 CLIDRegistry entries for module ALL -ChronoStatSvc INFO Number of skipped events for MemStat-1 -CoreDumpSvc INFO install f-a-t-a-l handler... (flag = -1) -CoreDumpSvc INFO Handling signals: 11(Segmentation fault) 7(Bus error) 4(Illegal instruction) 8(Floating point exception) -AthenaEventLoopMgr INFO Initializing AthenaEventLoopMgr - package version AthenaServices-00-00-00 -AthMasterSeq INFO Member list: AthSequencer/AthAlgSeq, AthSequencer/AthOutSeq, AthSequencer/AthRegSeq -AthAlgSeq INFO Member list: ClusterCreator, ClusterDumper/TopoDumper -ClusterCreator INFO Initializing - Package version: xAODCaloEventCnv-00-00-00 -ClusterCreator.... INFO Initializing - Package version: xAODCaloEventCnv-00-00-00 -ClusterCreator INFO Will convert CaloClusterContainer#CaloCalTopoCluster to xAOD::CaloClusterContainer#CaloCalTopoCluster -TopoDumper INFO Initializing - Package version: xAODCaloEventCnv-00-00-00 -TopoDumper INFO Writing to file TopoCluster.txt -StoreGateSvc INFO Initializing StoreGateSvc - package version StoreGate-00-00-00 -MetaDataSvc INFO Initializing MetaDataSvc - package version AthenaServices-00-00-00 -InputMetaDataStore INFO Initializing InputMetaDataStore - package version StoreGate-00-00-00 -MetaDataStore INFO Initializing MetaDataStore - package version StoreGate-00-00-00 -AthenaPoolCnvSvc INFO Initializing AthenaPoolCnvSvc - package version AthenaPoolCnvSvc-00-00-00 -PoolSvc INFO Initializing PoolSvc - package version PoolSvc-00-00-00 -PoolSvc INFO io_register[PoolSvc](xmlcatalog_file:PoolFileCatalog.xml) [ok] -PoolSvc INFO Set connectionsvc retry/timeout/IDLE timeout to 'ConnectionRetrialPeriod':300/ 'ConnectionRetrialTimeOut':3600/ 'ConnectionTimeOut':5 seconds with connection cleanup disabled -PoolSvc INFO Frontier compression level set to 5 -DBReplicaSvc INFO Read replica configuration from /home/sss/atlas/rootaccess/build/share/dbreplica.config -DBReplicaSvc INFO No specific match for domain found - use default fallback -DBReplicaSvc INFO Total of 1 servers found for host karma [atlas_dd ] -PoolSvc INFO Successfully setup replica sorting algorithm -PoolSvc INFO Re-initializing PoolSvc -PoolSvc INFO POOL WriteCatalog is xmlcatalog_file:PoolFileCatalog.xml -XMLFileCatalog Info Connecting to the catalog -PoolXMLFileCatalog Info Xerces-c initialization Number 0 -EventSelector INFO Initializing EventSelector - package version EventSelectorAthenaPool-00-00-00 -TagMetaDataStore INFO Initializing TagMetaDataStore - package version StoreGate-00-00-00 -EventSelector INFO reinitialization... -EventSelector INFO EventSelection with query -RootCollection Info Opening Collection File /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root in mode: READ -RootCollection Info File /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root opened -DbSession Info Open DbSession -Domain[ROOT_All] Info > Access DbDomain READ [ROOT_All] -Domain[ROOT_All] Info -> Access DbDatabase READ [ROOT_All] 01CDB931-513D-1C4A-8241-DD2C5A81FE52 -Domain[ROOT_All] Info /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root -RootDatabase.open Success /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root File version:53005 -ImplicitCollection Info Opened the implicit collection with connection string "PFN:/home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root" -ImplicitCollection Info and a name "POOLContainer(DataHeader)" -PoolSvc INFO Failed to find container MetaDataHdrDataHeader to get Token. -EventPersistenc... INFO Added successfully Conversion service:AthenaPoolCnvSvc -AthenaPoolAddre... INFO Initializing AthenaPoolAddressProviderSvc - package version EventSelectorAthenaPool-00-00-00 -ProxyProviderSvc INFO Initializing ProxyProviderSvc - package version SGComps-00-00-00 -HistogramPersis...WARNING Histograms saving not required. -AthenaEventLoopMgr INFO Setup EventSelector service EventSelector -ActiveStoreSvc INFO Initializing ActiveStoreSvc - package version StoreGate-00-00-00 -ApplicationMgr INFO Application Manager Initialized successfully -InputMetaDataStore INFO Start InputMetaDataStore -MetaDataStore INFO Start MetaDataStore -TagMetaDataStore INFO Start TagMetaDataStore -/home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root Info Database being retired... -Domain[ROOT_All] Info -> Deaccess DbDatabase READ [ROOT_All] 01CDB931-513D-1C4A-8241-DD2C5A81FE52 -Domain[ROOT_All] Info > Deaccess DbDomain READ [ROOT_All] -RootCollection Info Opening Collection File /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root in mode: READ -RootCollection Info File /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root opened -DbSession Info Open DbSession -Domain[ROOT_All] Info > Access DbDomain READ [ROOT_All] -Domain[ROOT_All] Info -> Access DbDatabase READ [ROOT_All] 01CDB931-513D-1C4A-8241-DD2C5A81FE52 -Domain[ROOT_All] Info /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root -RootDatabase.open Success /home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root File version:53005 -ImplicitCollection Info Opened the implicit collection with connection string "PFN:/home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root" -ImplicitCollection Info and a name "POOLContainer(DataHeader)" -StoreGateSvc INFO Start StoreGateSvc -ApplicationMgr INFO Application Manager Started successfully -PoolSvc INFO Failed to find container MetaDataHdrDataHeader to get Token. -AthenaEventLoopMgr INFO ===>>> start of run 105200 <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #1, run #105200 0 events processed so far <<<=== -ClassIDSvc INFO getRegistryEntries: read 20981 CLIDRegistry entries for module ALL -JobIDSvc INFO Initializing JobIDSvc - package version AthenaServices-00-00-00 -ClassIDSvc INFO getRegistryEntries: read 242 CLIDRegistry entries for module ALL -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #1, run #105200 1 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #2, run #105200 1 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #2, run #105200 2 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #3, run #105200 2 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #3, run #105200 3 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #4, run #105200 3 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #4, run #105200 4 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #5, run #105200 4 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #5, run #105200 5 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #6, run #105200 5 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #6, run #105200 6 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #7, run #105200 6 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #7, run #105200 7 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #8, run #105200 7 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #8, run #105200 8 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #9, run #105200 8 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #9, run #105200 9 events processed so far <<<=== -AthenaEventLoopMgr INFO ===>>> start processing event #10, run #105200 9 events processed so far <<<=== -TopoDumper INFO Found corresponding cell-link container with size 0 -AthenaEventLoopMgr INFO ===>>> done processing event #10, run #105200 10 events processed so far <<<=== -/home/sss/nobackup/referencefiles/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root Info Database being retired... -Domain[ROOT_All] Info -> Deaccess DbDatabase READ [ROOT_All] 01CDB931-513D-1C4A-8241-DD2C5A81FE52 -Domain[ROOT_All] Info > Deaccess DbDomain READ [ROOT_All] -AthenaEventLoopMgr INFO No more events in event selection -StoreGateSvc INFO Stop StoreGateSvc -StoreGateSvc INFO stop: setting service priority to 101 so that event stores get finalized and cleared before other stores -TagMetaDataStore INFO Stop TagMetaDataStore -MetaDataStore INFO Stop MetaDataStore -InputMetaDataStore INFO Stop InputMetaDataStore -ApplicationMgr INFO Application Manager Stopped successfully -AthAlgSeq INFO Finalizing AthAlgSeq... -AthOutSeq INFO Finalizing AthOutSeq... -AthRegSeq INFO Finalizing AthRegSeq... -AthMasterSeq INFO Finalizing AthMasterSeq... -StoreGateSvc INFO Finalizing StoreGateSvc - package version StoreGate-00-00-00 -TagMetaDataStore INFO Finalizing TagMetaDataStore - package version StoreGate-00-00-00 -PoolSvc INFO I/O finalization... -PoolXMLFileCatalog Info XercesC termination number 0 -MetaDataStore INFO Finalizing MetaDataStore - package version StoreGate-00-00-00 -InputMetaDataStore INFO Finalizing InputMetaDataStore - package version StoreGate-00-00-00 -AthDictLoaderSvc INFO in finalize... -ToolSvc INFO Removing all tools created by ToolSvc -*****Chrono***** INFO **************************************************************************************************** -*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered) -*****Chrono***** INFO **************************************************************************************************** -AthenaSealSvc::... INFO Time User : Tot= 10.7 [ms] #= 1 -ChronoStatSvc INFO Time User : Tot= 4.59 [s] #= 1 -*****Chrono***** INFO **************************************************************************************************** -ChronoStatSvc.f... INFO Service finalized successfully -ApplicationMgr INFO Application Manager Finalized successfully -ApplicationMgr INFO Application Manager Terminated successfully -Py:Athena INFO leaving with code 0: "successful run" -CORAL/Services/ConnectionService Info Deleting the ConnectionPool diff --git a/Event/xAOD/xAODCaloEventCnv/share/ClusterDumper_jobOptions.py b/Event/xAOD/xAODCaloEventCnv/share/ClusterDumper_jobOptions.py deleted file mode 100644 index 85b74aa64f3b4b75292a19253a789b05a3be0395..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODCaloEventCnv/share/ClusterDumper_jobOptions.py +++ /dev/null @@ -1,32 +0,0 @@ -# $Id: ClusterDumper_jobOptions.py 589289 2014-03-25 14:41:48Z wlampl $ - -# Set up the reading of the input AOD: -FNAME = "xAOD.pool.root" -#include( "AthenaPython/iread_file.py" ) - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -import AthenaPoolCnvSvc.ReadAthenaPool -svcMgr.EventSelector.InputCollections = [FNAME,] - - - -from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterDumper -#theJob+=ClusterDumper("EMDumper",ContainerName="LArClusterEM7_11Nocorr",FileName="SWclusterFromFile.txt") -theJob+=ClusterDumper("TopoDumper",ContainerName="CaloCalTopoCluster",FileName="TopClusterFromFile.txt") - - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -theApp.EvtMax = 5 -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000000 - -ServiceMgr.StoreGateSvc.Dump=True -from AthenaServices.AthenaServicesConf import AthenaEventLoopMgr -ServiceMgr += AthenaEventLoopMgr(EventPrintoutInterval = 1) - - - diff --git a/Event/xAOD/xAODMissingETCnv/CMakeLists.txt b/Event/xAOD/xAODMissingETCnv/CMakeLists.txt index 335f28d3431c756069efc72756652b1a2313d9cf..d0c6550c5a34438122358081cb12d659ead2b7cd 100644 --- a/Event/xAOD/xAODMissingETCnv/CMakeLists.txt +++ b/Event/xAOD/xAODMissingETCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODMissingETCnv ) @@ -14,6 +14,4 @@ atlas_add_component( xAODMissingETCnv src/*.cxx src/components/*.cxx LINK_LIBRARIES xAODMissingET GaudiKernel AthenaBaseComps MissingETEvent xAODMissingETCnvLib ) - -# Install files from the package: -atlas_install_joboptions( share/*.py ) + diff --git a/Event/xAOD/xAODMissingETCnv/share/xAODMissingETCnv_jobOptions.py b/Event/xAOD/xAODMissingETCnv/share/xAODMissingETCnv_jobOptions.py deleted file mode 100644 index 9d512ea399264cd5090fcbda66677ced58867d16..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODMissingETCnv/share/xAODMissingETCnv_jobOptions.py +++ /dev/null @@ -1,38 +0,0 @@ -# $Id: xAODMissingETCnv_jobOptions.py 586557 2014-03-06 17:56:05Z krasznaa $ -# -# A small example of converting AOD style MET objects to xAOD style. -# - -# Set up the reading of a file: -FNAME = "AOD.pool.root" -import AthenaPoolCnvSvc.ReadAthenaPool -ServiceMgr.EventSelector.InputCollections = [ FNAME ] - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -# Add the converter algorithm(s) to the job: -from xAODMissingETCnv.xAODMissingETCnvConf import * -alg = xAODMaker__MissingETCnvAlg() -alg.AODKeys = [ "MET_RefFinal" ] -alg.xAODKey = "MET_Ref" -alg.OutputLevel = VERBOSE -theJob += alg - -# Create an output file: -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -stream = MSMgr.NewPoolStream( "StreamAOD", "xAOD.pool.root" ) - -# Add the MET types to it: -stream.AddItem( "xAOD::MissingETContainer_v1#*" ) -stream.AddItem( "xAOD::MissingETAuxContainer_v1#*" ) -stream.AddItem( "xAOD::MissingETComponentMap_v1#*" ) -stream.AddItem( "xAOD::MissingETAuxComponentMap_v1#*" ) - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -theApp.EvtMax = 10 -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000 -#ServiceMgr.StoreGateSvc.Dump = True diff --git a/Event/xAOD/xAODTrigBphysCnv/CMakeLists.txt b/Event/xAOD/xAODTrigBphysCnv/CMakeLists.txt index dae581dc7675c970d3f40c18d57dbf2257a6d3d4..a631abf71ea0585e70311b246d6cd99d40ce5792 100644 --- a/Event/xAOD/xAODTrigBphysCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTrigBphysCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODTrigBphysCnv ) @@ -14,6 +14,3 @@ atlas_add_component( xAODTrigBphysCnv src/*.cxx src/components/*.cxx LINK_LIBRARIES AthenaBaseComps AthenaKernel TrigParticle xAODTrigBphysCnvLib ) - -# Install files from the package: -atlas_install_joboptions( share/*.py ) diff --git a/Event/xAOD/xAODTrigBphysCnv/share/xAODTrigBphysReader_jobOptions.py b/Event/xAOD/xAODTrigBphysCnv/share/xAODTrigBphysReader_jobOptions.py deleted file mode 100644 index 81d434bc9d4d98587030dfec61964cd768ec2607..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigBphysCnv/share/xAODTrigBphysReader_jobOptions.py +++ /dev/null @@ -1,53 +0,0 @@ -# $Id: xAODElectronReader_jobOptions.py 583111 2014-02-13 17:31:49Z christos $ - -# Set up the reading of the input xAOD: -#FNAME = "/afs/cern.ch/work/j/jwalder/data/forTrigger/mc12_14TeV.208214.Pythia8B_AU2_CTEQ6L1_bb_Jpsi_mu5p5mu5p5.recon.RDO.e2238_s1682_s1691_r4845_tid01332753_00/RDO.01332753._000009.pool.root.1" -FNAME = "/afs/cern.ch/work/j/jwalder/data/forTrigger/mc12_8TeV.208010.Pythia8B_AU2_CTEQ6L1_pp_Jpsimu6p5mu6p5.merge.AOD.e1966_a188_a180_r3549_tid01353548_00/AOD.01353548._001293.pool.root.1" - -import AthenaPoolCnvSvc.ReadAthenaPool -ServiceMgr.EventSelector.InputCollections = [ FNAME ] - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -# Add the xAOD reader algorithm(s): - -from xAODTrigBphysCnv.xAODTrigBphysCnvConf import xAODMaker__TrigEFBphysCnvAlg as efalg -from xAODTrigBphysCnv.xAODTrigBphysCnvConf import xAODMaker__TrigL2BphysCnvAlg as l2alg -from xAODTrigBphysCnv.xAODTrigBphysCnvConf import xAODMaker__TrigxAODBphysReaderAlg as xAODReader - - -#alg = xAODReader__ElectronReader() -#alg.OutputLevel = DEBUG -#theJob += alg - -AOD_containers_EF = ['HLT_EFBMuMuFex'] -AOD_containers_L2 = ['HLT_L2BMuMuFex','HLT_L2DiMuXFex'] - -for obj in AOD_containers_EF: - alg = efalg(name='TrigEFBphysCnvAlg_'+obj, - AODKey=obj, - xAODKey = 'xAOD'+obj, - OutputLevel = VERBOSE) - theJob += alg - - -for obj in AOD_containers_L2: - alg = l2alg(name='TrigL2BphysCnvAlg_'+obj, - AODKey=obj, - xAODKey = 'xAOD'+obj, - OutputLevel = VERBOSE) - theJob += alg - -for obj in AOD_containers_L2+AOD_containers_EF: - alg = xAODReader(name='BPhysReader_'+obj, - OutputLevel = VERBOSE, - xAODKey = 'xAOD'+obj - ) - theJob += alg - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000000 diff --git a/Event/xAOD/xAODTrigL1CaloCnv/CMakeLists.txt b/Event/xAOD/xAODTrigL1CaloCnv/CMakeLists.txt index b103636f63d29b9e264d99fb6ffe03a80e03b495..3d05c77eb6aba0ff2c86f6f50ab336c24d0658bb 100644 --- a/Event/xAOD/xAODTrigL1CaloCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTrigL1CaloCnv/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( xAODTrigL1CaloCnv ) @@ -17,5 +17,4 @@ atlas_add_component( xAODTrigL1CaloCnv # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.py ) diff --git a/Event/xAOD/xAODTrigL1CaloCnv/share/xAODTrigL1CaloCnv_jobOptions.py b/Event/xAOD/xAODTrigL1CaloCnv/share/xAODTrigL1CaloCnv_jobOptions.py deleted file mode 100644 index a4438468f313e3e2e61ed91be31f25b22da7ffd3..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODTrigL1CaloCnv/share/xAODTrigL1CaloCnv_jobOptions.py +++ /dev/null @@ -1,33 +0,0 @@ -# $Id: xAODTrigL1CaloCnv_jobOptions.py 575898 2013-12-17 13:58:54Z morrisj $ - -# Set up the reading of a file: -FNAME = "ESD.pool.root" -include( "AthenaPython/iread_file.py" ) - -# Access the algorithm sequence: -from AthenaCommon.AlgSequence import AlgSequence -theJob = AlgSequence() - -# Create a POOL output file with the StoreGate contents: -from OutputStreamAthenaPool.MultipleStreamManager import MSMgr -xaodStream = MSMgr.NewPoolStream( "StreamXAOD", "xAOD.pool.root" ) - -# Create the xAOD RoIs: -from xAODTrigL1CaloCnv.xAODTrigL1CaloCreator import xAODTrigL1CaloCreator -xAODTrigL1CaloCreator() - -# Check what happened to the stream: -xaodStream.Print() - -# Split all branches: -ServiceMgr.AthenaPoolCnvSvc.PoolAttributes += [ - "DEFAULT_SPLITLEVEL='1'" ] - -# Force POOL to just simply use the StoreGate keys as branch names: -ServiceMgr.AthenaPoolCnvSvc.SubLevelBranchName = "<key>" - -# Do some additional tweaking: -from AthenaCommon.AppMgr import theApp -theApp.EvtMax = -1 -ServiceMgr.MessageSvc.OutputLevel = INFO -ServiceMgr.MessageSvc.defaultLimit = 1000000 diff --git a/ForwardDetectors/ZDC/ZdcRec/test/test_data23hi_ZDCCalib.sh b/ForwardDetectors/ZDC/ZdcRec/test/test_data23hi_ZDCCalib.sh index d9145230ae8bf6264300a5b010d9032b37126d88..7fdaac59813cc6d546ba0676dbf3613664c9921c 100755 --- a/ForwardDetectors/ZDC/ZdcRec/test/test_data23hi_ZDCCalib.sh +++ b/ForwardDetectors/ZDC/ZdcRec/test/test_data23hi_ZDCCalib.sh @@ -8,7 +8,8 @@ export ATHENA_CORE_NUMBER=8 -athena ZdcRec/ZdcRecConfig.py --CA --filesInput /eos/atlas/atlascerngroupdisk/data-art/grid-input/ZdcRec/data23_hi.00463427.calibration_ZDCCalib.daq.RAW._lb0000._SFO-19._0001.data --evtMax=10 +#athena ZdcRec/ZdcRecConfig.py --CA --filesInput /eos/atlas/atlascerngroupdisk/data-art/grid-input/ZdcRec/data23_hi.00463427.calibration_ZDCCalib.daq.RAW._lb0000._SFO-19._0001.data --evtMax=10 +athena ZdcRec/ZdcRecConfig.py --CA --filesInput /cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ZdcRec/data23_hi.00463427.calibration_ZDCCalib.daq.RAW._lb0000._SFO-19._0001.data --evtMax=10 #Remember retval of transform as art result RES=$? diff --git a/LArCalorimeter/LArCalibTools/CMakeLists.txt b/LArCalorimeter/LArCalibTools/CMakeLists.txt index 10407f4a08766955df5ffdd3d723a5c1ae83d3dc..42f53570dd309745486fee4796ec7f56275b1678 100644 --- a/LArCalorimeter/LArCalibTools/CMakeLists.txt +++ b/LArCalorimeter/LArCalibTools/CMakeLists.txt @@ -16,7 +16,6 @@ atlas_add_component( LArCalibTools # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.py ) atlas_install_scripts( share/LArConditions2Ntuple.py ) diff --git a/LArCalorimeter/LArCalibTools/share/CaloCondBlob2Ntuple.py b/LArCalorimeter/LArCalibTools/share/CaloCondBlob2Ntuple.py deleted file mode 100644 index 74421ab3a6fddbd5b34063a2fb8f91bac89d18ec..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/CaloCondBlob2Ntuple.py +++ /dev/null @@ -1,86 +0,0 @@ -# you could specify 'sqlitefile' for reading the local file -# and 'tag' to specify the folder level tag to dump - -if not 'Folder' in dir(): - Folder="/LAR/CellCorrOfl/EnergyCorr" - -if not 'output' in dir(): - output="CellCondBlob.root" - -if not 'RunNumber' in dir(): - RunNumber=1000000000 - -if not 'GlobalTag' in dir(): - GlobalTag='COMCOND-BLKPA-006-06' - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaCommon.GlobalFlags import GlobalFlags -#GlobalFlags.DetGeo.set_commis() -#GlobalFlags.Luminosity.set_zero() -#GlobalFlags.DataSource.set_data() -#GlobalFlags.InputFormat.set_bytestream() - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource="data" -globalflags.InputFormat="bytestream" - - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) -svcMgr.IOVDbSvc.GlobalTag=GlobalTag -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -#include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = RunNumber - - -from LArCalibTools.LArCalibToolsConf import CaloCondBlob2Ntuple -theCaloCondBlobs2Ntuple=CaloCondBlob2Ntuple() -theCaloCondBlobs2Ntuple.Folder=Folder -theCaloCondBlobs2Ntuple.AddFEBTempInfo=False -theCaloCondBlobs2Ntuple.AddBadChannelInfo=False -topSequence+=theCaloCondBlobs2Ntuple - -if 'tag' in dir(): - tagstring="<tag>"+tag+"</tag>" -else: - tagstring="" -if 'sqlitefile' in dir(): - conddb.addFolder("",Folder+"<db>sqlite://;schema="+sqlitefile+";dbname=COMP200</db>"+tagstring) -else: - conddb.addFolder('LAR_ONL',Folder+tagstring) - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+output+"' OPT='NEW'" ] - - -#from GaudiSvc.GaudiSvcConf import THistSvc -#svcMgr+=THistSvc() -#svcMgr.THistSvc.Output = [ "FILE1 DATAFILE='CellGroup.root' OPT='RECREATE'" ] - -#svcMgr.DetectorStore.Dump=True -#svcMgr.MessageSvc.OutputLevel = DEBUG - diff --git a/LArCalorimeter/LArCalibTools/share/ConvertDSPThrePooltoCool.py b/LArCalorimeter/LArCalibTools/share/ConvertDSPThrePooltoCool.py deleted file mode 100644 index cf15c33934ec89a76800ac3668c63f2f3b4e76bd..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/ConvertDSPThrePooltoCool.py +++ /dev/null @@ -1,117 +0,0 @@ -if 'inputfolder' not in dir(): - inputfolder='/LAR/Configuration/DSPThreshold/Templates' - -if 'inputtag' not in dir(): - inputtag='Qt0-samp0' - -if 'outputtag' not in dir(): - outputtag='Qt0-samp0' - -if 'outputfolder' not in dir(): - outputfolder="/LAR/Configuration/DSPThresholdFlat/Templates" - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from string import split,join -from time import time -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource="data" -globalflags.InputFormat="bytestream" -globalflags.DatabaseInstance="CONDBR2" - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) -svcMgr.IOVDbSvc.GlobalTag="LARCALIB-000-02" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = 500000 -#svcMgr.EventSelector.RunNumber = 2147483647 -svcMgr.EventSelector.InitialTimeStamp=int(time()) -dbname="<db>COOLOFL_LAR/COMP200</db>" - -conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>") -conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>") -conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - -#conddb.addFolder("","/LAR/ElecCalibOnl/Pedestal<db>COOLONL_LAR/COMP200</db>") - -intag=join(inputfolder.split("/"),'')+"-"+inputtag -#intag=inputtag -conddb.addFolder("","/LAR/Configuration/DSPThreshold/Templates<db>COOLONL_LAR/COMP200</db><tag>"+intag+"</tag>") - -from LArCalibTools.LArCalibToolsConf import LArCompleteToFlat -theLArCompleteToFlat=LArCompleteToFlat() -theLArCompleteToFlat.ForceStop=False -theLArCompleteToFlat.DSPThresholdsInput="LArDSPThresholds" -theLArCompleteToFlat.NameOfSet = outputtag -topSequence+=theLArCompleteToFlat - - -#from LArCalibTools.LArCalibToolsConf import LArDSPThresholds2Ntuple -#LArDSPThresholds2Ntuple=LArDSPThresholds2Ntuple("LArDSPThresholds2Ntuple") -#LArDSPThresholds2Ntuple.DumpFlat=True -#LArDSPThresholds2Ntuple.DumpFlat=True -#topSequence+=LArDSPThresholds2Ntuple - - -svcMgr.PoolSvc.ReadCatalog += ['xmlcatalog_file:'+'/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml'] - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='flatDSPThresholds.root' OPT='NEW'" ] - - - -outtagspec=join(outputfolder.split("/"),'')+"-"+outputtag -folderspec="AthenaAttributeList#"+outputfolder -#outtagspec=join(outputfolder.split("/"),'')+"-"+outputtag -#folderspec="CondAttrListCollection#"+outputfolder - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","dummy.pool.root", - [folderspec],[outtagspec], - True) - - -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.IOVRegistrationSvc.SVFolder = False -#svcMgr.IOVRegistrationSvc.OverrideNames += [ "Pedestal","PedestalRMS","OFCa" ,"OFCb" ,"TimeOffset","RampVec","Shape","ShapeDer","HVScaleCorr","MphysOverMcal","DAC2uA","uA2MeV"] -svcMgr.IOVRegistrationSvc.OverrideNames += [ "tQThr", "samplesThr", "trigSumThr"] -#svcMgr.IOVRegistrationSvc.OverrideNames += [ "Pedestal", "PedestalRMS"] -types=[] -for i in range(len(svcMgr.IOVRegistrationSvc.OverrideNames)): - types.append("Blob16M"); -svcMgr.IOVRegistrationSvc.OverrideTypes += types; -svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=DSP_test.db;dbname=COMP200" - - -svcMgr.DetectorStore.Dump=True -svcMgr.StoreGateSvc.Dump = True -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.IOVDbSvc.DBInstance="" - diff --git a/LArCalorimeter/LArCalibTools/share/ConvertPoolToCoolInline.py b/LArCalorimeter/LArCalibTools/share/ConvertPoolToCoolInline.py deleted file mode 100644 index 86400ac8fbb27938c056fa97dad8d5a407c4edd2..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/ConvertPoolToCoolInline.py +++ /dev/null @@ -1,134 +0,0 @@ -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from string import split,join -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource="data" -globalflags.InputFormat="bytestream" -globalflags.DatabaseInstance="CONDBR2" - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) -svcMgr.IOVDbSvc.GlobalTag="COMCOND-BLKPA-006-07" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -#svcMgr.EventSelector.RunNumber = 210308 -svcMgr.EventSelector.RunNumber = 2147483647 -conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>") -conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>") - - -conddb.addFolder("","/LAR/ElecCalibOnl/uA2MeV<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/DAC2uA<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/MphysOverMcal<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/HVScaleCorr<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/Pedestal<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/Ramp<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/OFC<db>COOLONL_LAR/COMP200</db>") -conddb.addFolder("","/LAR/ElecCalibOnl/Shape<db>COOLONL_LAR/COMP200</db>") - - -from LArCalibTools.LArCalibToolsConf import LArCompleteToFlat -theLArCompleteToFlat=LArCompleteToFlat() - -theLArCompleteToFlat.uA2MeVInput="LAruA2MeV" -theLArCompleteToFlat.DAC2uAVInput="LArDAC2uA" -theLArCompleteToFlat.HVScaleCorrInput="LArHVScaleCorr" -theLArCompleteToFlat.PedestalInput="Pedestal" -theLArCompleteToFlat.RampInput="LArRamp" -theLArCompleteToFlat.MphysOverMcalInput="LArMphysOverMcal" -theLArCompleteToFlat.OFCInput="LArOFC" -theLArCompleteToFlat.ShapeInput="LArShape" -#theLArCompleteToFlat.DSPThresholdsInput="LArDSPThresholds" - -topSequence+=theLArCompleteToFlat - - -## from LArCalibTools.LArCalibToolsConf import LArPedestals2Ntuple -## LArPedestals2Ntuple=LArPedestals2Ntuple("LArPedestals2Ntuple") -## LArPedestals2Ntuple.AddFEBTempInfo=False -## LArPedestals2Ntuple.ContainerKey="PedestalFlat" -## topSequence+=LArPedestals2Ntuple - -## from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple -## LArOFCs2Ntuple=LArOFC2Ntuple("LArOFCs2Ntuple") -## LArOFCs2Ntuple.AddFEBTempInfo=False -## LArOFCs2Ntuple.ContainerKey="OFCFlat" -## topSequence+=LArOFCs2Ntuple - - - - - -svcMgr.PoolSvc.ReadCatalog += ['xmlcatalog_file:'+'/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml'] - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='flatPedestalOFC.root' OPT='NEW'" ] - - -folderlist=("/LAR/ElecCalibFlat/uA2MeV", - "/LAR/ElecCalibFlat/DAC2uA", - "/LAR/ElecCalibFlat/MphysOverMcal", - "/LAR/ElecCalibFlat/HVScaleCorr", - "/LAR/ElecCalibFlat/Pedestal", - "/LAR/ElecCalibFlat/Ramp", - "/LAR/ElecCalibFlat/OFC", - "/LAR/ElecCalibFlat/Shape", - ) - -folderspec=[] -tagspec=[] -for f in folderlist: - folderspec.append("CondAttrListCollection#"+f) - tagspec.append("".join(f.split("/"))+"-00") - pass - - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -OutputConditionsAlg=OutputConditionsAlg("OutputConditionsAlg","dummy.pool.root", - #["CondAttrListCollection#/LAR/ElecCalibFlat/Pedestal","CondAttrListCollection#/LAR/ElecCalibFlat/OFC",], - #["testped","testofc"], - folderspec,[], - True) - - -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.IOVRegistrationSvc.SVFolder = True -svcMgr.IOVRegistrationSvc.userTags = False - -svcMgr.IOVRegistrationSvc.OverrideNames += [ "Pedestal","PedestalRMS","OFCa" ,"OFCb" ,"TimeOffset","RampVec","Shape","ShapeDer","HVScaleCorr","MphysOverMcal","DAC2uA","uA2MeV"] -types=[] -for i in range(len(svcMgr.IOVRegistrationSvc.OverrideNames)): - types.append("Blob16M"); -svcMgr.IOVRegistrationSvc.OverrideTypes += types; -svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema=allConstantsSV_test.db;dbname=CONDBR2" - - -#svcMgr.DetectorStore.Dump=True -svcMgr.MessageSvc.OutputLevel = INFO - -svcMgr.IOVDbSvc.DBInstance="" diff --git a/LArCalorimeter/LArCalibTools/share/LArAccDigits2Ntuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArAccDigits2Ntuple_jobOptions.py deleted file mode 100755 index 657efb285ebf133e3ae50bdbedff1bab0cdbdfdc..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArAccDigits2Ntuple_jobOptions.py +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration -import os - - -if not 'SuperCells' in dir(): - SuperCells=False -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -else: SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0018660' ] - -if not 'BaseFileName' in dir(): - BaseFileName = "LArAccDigits" - - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber) - -if not 'OutputRootFileName' in dir(): - OutputRootFileName = BaseFileName+".root" - -if not 'OutputDir' in dir(): - OutputDir = os.getcwd() - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Ramp" - else : - FilePrefix = "data*" - -if not 'NSamples' in dir(): - NSamples=32 - -if not 'InputDir' in dir(): - InputDir = "/eos/atlas/atlastier0/rucio/data23_calib/" - -if not 'SCIgnoreBarrelChannels' in dir(): - SCIgnoreBarrelChannels=False - -if not 'SCIgnoreEndcapChannels' in dir(): - SCIgnoreEndcapChannels=False - -if not 'FullFileName' in dir(): - if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - if 'Partition' in dir(): - Trigger = "calibration_"+".*"+Partition - else: - Trigger = "calibration_"+"*" - - from LArCalibProcessing.GetInputFiles import GetInputFilesFromTokens,GetInputFiles - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - - -if not 'EvtMax' in dir(): - EvtMax=-1 - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'Gain' in dir(): - if SuperCells: - Gain = "SC" - else: - Gain = "HIGH" - -if SuperCells: - from AthenaCommon.GlobalFlags import globalflags - globalflags.DetGeo.set_Value_and_Lock('atlas') - globalflags.Luminosity.set_Value_and_Lock('zero') - globalflags.DataSource.set_Value_and_Lock('data') - globalflags.InputFormat.set_Value_and_Lock('bytestream') - globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') - - from AthenaCommon.JobProperties import jobproperties - jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01" - - from AthenaCommon.DetFlags import DetFlags - DetFlags.Calo_setOn() - DetFlags.ID_setOff() - DetFlags.Muon_setOff() - DetFlags.Truth_setOff() - DetFlags.LVL1_setOff() - DetFlags.digitize.all_setOff() - - #Set up GeoModel (not really needed but crashes without) - from AtlasGeoModel import SetGeometryVersion - from AtlasGeoModel import GeoModelInit - - #Get identifier mapping - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - include( "LArIdCnv/LArIdCnv_joboptions.py" ) - include( "ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py" ) -else: - include ("LArConditionsCommon/LArMinimalSetup.py") - -from LArCabling.LArCablingAccess import LArOnOffIdMapping,LArFebRodMapping,LArCalibIdMapping -LArOnOffIdMapping() -LArFebRodMapping() -LArCalibIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC, LArCalibIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - - -svcMgr.IOVDbSvc.GlobalTag=LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannels/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannels/MissingFEBs" - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLONL_LAR/" + conddb.dbname - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - RampLog.info( "No FullFileName! Please give a FullFileName list." ) - theApp.exit(-1) - -else : - svcMgr.EventSelector.Input=FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 - -svcMgr.ByteStreamCnvSvc.InitCnvs += [ "EventInfo"] - -theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc - -if SuperCells: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - theLArLATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - - from LArByteStream.LArByteStreamConf import LArRawSCCalibDataReadingAlg - LArRawSCCalibDataReadingAlg = LArRawSCCalibDataReadingAlg() - LArRawSCCalibDataReadingAlg.LArSCAccDigitKey = Gain - LArRawSCCalibDataReadingAlg.LATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.OutputLevel = WARNING - - topSequence+=LArRawSCCalibDataReadingAlg - -else: - # Need to debug the raw data reading algo for legacy - from LArByteStream.LArByteStreamConf import LArRawCalibDataReadingAlg - - theLArRawCalibDataReadingAlg=LArRawCalibDataReadingAlg() - theLArRawCalibDataReadingAlg.LArAccDigitKey=Gain - theLArRawCalibDataReadingAlg.LArFebHeaderKey="LArFebHeader" - #temporarily - theLArRawCalibDataReadingAlg.FailOnCorruption=False - - topSequence+=theLArRawCalibDataReadingAlg - -from LArCalibTools.LArCalibToolsConf import LArAccumulatedDigits2Ntuple - -LArAccDigits2Ntuple=LArAccumulatedDigits2Ntuple("LArAccDigits2Ntuple") - -LArAccDigits2Ntuple.ContainerKey = Gain -LArAccDigits2Ntuple.AddFEBTempInfo=False -if 'FTlist' in dir(): - LArAccDigits2Ntuple.FTlist=FTlist - -LArAccDigits2Ntuple.isSC = SuperCells - -#LArAccDigits2Ntuple.RealGeometry = True -LArAccDigits2Ntuple.OffId = True - -topSequence+= LArAccDigits2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputDir + "/" +OutputRootFileName+"' OPT='NEW'" ] - -theApp.EvtMax=EvtMax - diff --git a/LArCalorimeter/LArCalibTools/share/LArAutoCorr2Ntuple_POOL_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArAutoCorr2Ntuple_POOL_jobOptions.py deleted file mode 100755 index 0bea4d0049e3a7b7b2aeaeabb2fbe980e412811f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArAutoCorr2Ntuple_POOL_jobOptions.py +++ /dev/null @@ -1,97 +0,0 @@ -########################################################################### -# -# jobOptions to dump LAr AutoCorr POOL file content to ROOT ntuple -# -# rewritten in Nov. 2010, P. Strizenec -########################################################################### - -import commands - -AutoCorr2NtupleLog = logging.getLogger( "AutoCorr2NtupleLog" ) - -if not 'PoolFileName' in dir(): - AutoCorr2NtupleLog.fatal("Please setup the input POOL file ('PoolFileName')!") - theApp.exit(-1) - -if not 'RootFileName' in dir(): - RootFileName = "LArAutoCorr2Ntuple_POOL.root" - - -if not 'DBConnectionCOOL' in dir(): - #DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - DBConnectionCOOL = "COOLOFL_LAR/CONDBR2" - -if not 'RunNumber' in dir(): - RunNumber = 222222 - - -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -########################################################################### -# -# POOL -# -include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") -## define the DB Global Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.IOVDbSvc.forceRunNumber=RunNumber - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") - -if "ONL" in DBConnectionCOOL: - conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -else: - conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - include("LArCalibProcessing/LArCalib_BadChanTool.py") - -from AthenaCommon.ConfigurableDb import getConfigurable -svcMgr += getConfigurable( "ProxyProviderSvc" )() -svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -svcMgr += getConfigurable( "CondProxyProvider" )() -svcMgr.CondProxyProvider.InputCollections += [ PoolFileName ] - -# -# Dump AutoCorr folder to a ROOT ntuple -# -from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple -LArAutoCorr2Ntuple = LArAutoCorr2Ntuple( "LArAutoCorr2Ntuple" ) -LArAutoCorr2Ntuple.OutputLevel = INFO -LArAutoCorr2Ntuple.AddFEBTempInfo=False -topSequence += LArAutoCorr2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### -#svcMgr.MessageSvc.OutputLevel = INFO -#svcMgr.MessageSvc.defaultLimit = 10000 -#svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -#svcMgr += CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -########################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/LArAutoCorrFromStdNtuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArAutoCorrFromStdNtuple2Pool_jobOptions.py deleted file mode 100755 index cd16e63287a9df5e5f11bc78d3e67b1d2a7639a9..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArAutoCorrFromStdNtuple2Pool_jobOptions.py +++ /dev/null @@ -1,220 +0,0 @@ -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'AutoCorrPOOLFileOUT' in dir(): - AutoCorrPOOLFileOUT = "LArAutoCorr_new.pool.root" - -if not 'AutoCorrNTFileOUT' in dir(): - AutoCorrNTFileOUT = "LArAutoCorr_new.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'AutoCorrNTFileIN' in dir(): - AutoCorrNTFileIN = "LArAutoCorr.root" - -if not 'OutputKey' in dir(): - OutputKey = "LArAutoCorr" - -if not 'OutputFolder' in dir(): - OutputFolder="/LAR/ElecCalibMC/AutoCorr" - -if not 'OutputTag' in dir(): - OutputTag="-test" - -if not 'GroupingType' in dir(): - GroupingType = "SingleGroup" - -if not 'IsComplete' in dir(): - IsComplete = False - -if not 'DoSFcal' in dir(): - DoSFcal = True - -if not 'DBTag' in dir(): - DBTag = LArCalib_Flags.globalFlagDB - -if not 'GeomTag' in dir(): - GeomTag = "ATLAS-GEO-21-00-00" - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - if IsComplete: - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=COMP200" - else: - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=OFLP200" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -# this include doesn't work for MC case -## include( "LArCalibProcessing/LArCalib_MinimalSetup.py") -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -if IsComplete: - globalflags.DataSource.set_Value_and_Lock('data') - globalflags.InputFormat.set_Value_and_Lock('bytestream') - globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') -else: - globalflags.DataSource.set_Value_and_Lock('geant4') - globalflags.InputFormat.set_Value_and_Lock('pool') - - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = GeomTag - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() #Switched off to avoid geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -if IsComplete: - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -else: - include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" ) - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = DBTag -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000003.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000004.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - -from LArRecUtils.LArMCSymCondAlg import LArMCSymCondAlgDefault -LArMCSymCondAlgDefault() - - - - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### - -from LArCalibTools.LArCalibToolsConf import LArAutoCorrFromStdNtuple -LArAutoCorrFromTuple = LArAutoCorrFromStdNtuple() -LArAutoCorrFromTuple.FileNames = [ AutoCorrNTFileIN ] -LArAutoCorrFromTuple.StoreKey = OutputKey -LArAutoCorrFromTuple.GroupingType = GroupingType -LArAutoCorrFromTuple.isComplete = IsComplete -LArAutoCorrFromTuple.doSFcal = DoSFcal - -topSequence += LArAutoCorrFromTuple - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple - LArAutoCorr2Ntuple = LArAutoCorr2Ntuple( "LArAutoCorr2Ntuple" ) - LArAutoCorr2Ntuple.ContainerKey = OutputKey - LArAutoCorr2Ntuple.AddFEBTempInfo = False - LArAutoCorr2Ntuple.AddBadChannelInfo = False - - topSequence += LArAutoCorr2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+AutoCorrNTFileOUT+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - if ( IsComplete ): - OutputObjectSpecAutoCorr = "LArAutoCorrComplete#"+OutputKey+"#"+ OutputFolder - else: - OutputObjectSpecAutoCorr = "LArAutoCorrMC#"+OutputKey+"#"+ OutputFolder - OutputObjectSpecTagAutoCorr = LArCalibFolderTag(OutputFolder,OutputTag) - - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",AutoCorrPOOLFileOUT, - [OutputObjectSpecAutoCorr],[OutputObjectSpecTagAutoCorr],True) - - theOutputConditionsAlg.Run1 = 0 - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArAverages2Ntuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArAverages2Ntuple_jobOptions.py deleted file mode 100755 index 906697e46ddd925b0f770a44006ac4e79015e1ab..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArAverages2Ntuple_jobOptions.py +++ /dev/null @@ -1,239 +0,0 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration - -include ("LArCalibProcessing/GetInputFiles.py") - -if not 'SuperCells' in dir(): - SuperCells=False - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -else: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0018660' ] - -if not 'BaseFileName' in dir(): - BaseFileName = "LArAccCalibDigits" - - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber) - -if not 'OutputRootFileName' in dir(): - OutputRootFileName = BaseFileName+".root" - -if not 'OutputDir' in dir(): - OutputDir = commands.getoutput("pwd") - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Ramp" - else : - FilePrefix = "data*" - -if not 'NSamples' in dir(): - NSamples=32 - -if not 'InputDir' in dir(): - InputDir = "/eos/atlas/atlastier0/rucio/data23_calib/" - -if not 'SCIgnoreBarrelChannels' in dir(): - SCIgnoreBarrelChannels=False - -if not 'SCIgnoreEndcapChannels' in dir(): - SCIgnoreEndcapChannels=False - -if not 'FillSCDataBCID' in dir(): - FillSCDataBCID=-1 -if not 'FillLatomeSourceID' in dir(): - FillLatomeSourceID=-1 -if not 'OverwriteEventNumber' in dir(): - OverwriteEventNumber=False - -if not 'FullFileName' in dir(): - if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - if 'Partition' in dir(): - Trigger = "calibration_"+".*"+Partition - else: - Trigger = "calibration_"+"*" - - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - -if not 'Gain' in dir(): - Gain = "HIGH" - -if not 'EvtMax' in dir(): - EvtMax=-1 - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if SuperCells: - from AthenaCommon.GlobalFlags import globalflags - globalflags.DetGeo.set_Value_and_Lock('atlas') - globalflags.Luminosity.set_Value_and_Lock('zero') - globalflags.DataSource.set_Value_and_Lock('data') - globalflags.InputFormat.set_Value_and_Lock('bytestream') - globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') - - from AthenaCommon.JobProperties import jobproperties - jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01" - - from AthenaCommon.DetFlags import DetFlags - DetFlags.Calo_setOn() - DetFlags.ID_setOff() - DetFlags.Muon_setOff() - DetFlags.Truth_setOff() - DetFlags.LVL1_setOff() - DetFlags.digitize.all_setOff() - - #Set up GeoModel (not really needed but crashes without) - from AtlasGeoModel import SetGeometryVersion - from AtlasGeoModel import GeoModelInit - - #Get identifier mapping - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - include( "LArIdCnv/LArIdCnv_joboptions.py" ) - include( "ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py" ) -else: - include ("LArConditionsCommon/LArMinimalSetup.py") - -from LArCabling.LArCablingAccess import LArOnOffIdMapping,LArFebRodMapping,LArCalibIdMapping -LArOnOffIdMapping() -LArFebRodMapping() -LArCalibIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC, LArCalibIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - - - -svcMgr.IOVDbSvc.GlobalTag=LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannels/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannels/MissingFEBs" - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLONL_LAR/" + conddb.dbname - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - RampLog.info( "No FullFileName! Please give a FullFileName list." ) - theApp.exit(-1) - -else : - svcMgr.EventSelector.Input = FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 -svcMgr.ByteStreamCnvSvc.InitCnvs += [ "EventInfo"] - -theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc -theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - -if not SuperCells: - from LArByteStream.LArByteStreamConf import LArRodDecoder - svcMgr.ToolSvc += LArRodDecoder() - - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] - - # this will go outside SC loop - include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") - topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False - - from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher - theLArBadEventCatcher=LArBadEventCatcher() - theLArBadEventCatcher.CheckAccCalibDigitCont=False - theLArBadEventCatcher.CheckBSErrors=True - theLArBadEventCatcher.KeyList=[Gain] - theLArBadEventCatcher.StopOnError=False - topSequence+=theLArBadEventCatcher -else: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - theLArLATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - - from LArByteStream.LArByteStreamConf import LArRawSCCalibDataReadingAlg - LArRawSCCalibDataReadingAlg = LArRawSCCalibDataReadingAlg() - LArRawSCCalibDataReadingAlg.LArSCAccCalibDigitKey = Gain - LArRawSCCalibDataReadingAlg.LATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - LArRawSCCalibDataReadingAlg.LATOMEDecoder.OutputLevel = WARNING - - topSequence+=LArRawSCCalibDataReadingAlg - - - -from LArCalibTools.LArCalibToolsConf import LArAverages2Ntuple - -LArDigits2Ntuple=LArAverages2Ntuple("LArAverages2Ntuple") -LArDigits2Ntuple.ContainerKey = Gain -LArDigits2Ntuple.KeepOnlyPulsed=False -if 'FTlist' in dir(): - LArDigits2Ntuple.KeepFT=FTlist -LArDigits2Ntuple.isSC = SuperCells - -if SuperCells: - LArDigits2Ntuple.RealGeometry = False # not yet working - LArDigits2Ntuple.OffId = True - -topSequence+= LArDigits2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputDir + "/" +OutputRootFileName+"' OPT='NEW'" ] - -AthenaEventLoopMgr=Service("AthenaEventLoopMgr") - -theApp.EvtMax=EvtMax -svcMgr.MessageSvc.OutputLevel=WARNING - diff --git a/LArCalorimeter/LArCalibTools/share/LArCalib_Delay_OFC_2Ntuple_POOL_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArCalib_Delay_OFC_2Ntuple_POOL_jobOptions.py deleted file mode 100755 index 4dddc5afb64e15f6095adf351b23637d819f6f09..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArCalib_Delay_OFC_2Ntuple_POOL_jobOptions.py +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - -########################################################################### -# -# LArCalib_Delay_OFC_2Ntuple_POOL_jobOptions.py dumps the conntet of a -# CaliWave + OFC POOL files (from standard AP processing) -# to ROOT TTree. -# -# Author: Pavol Strizenec (pavol @ mail.cern.ch) -# -# Created: Nov. 2010 by merging existing Wave and OFC 2 Ntuple jO -# -########################################################################### - -CWOFC2NtupleLog = logging.getLogger( "CWOFC2NtupleLog" ) - -if not 'PoolFileName' in dir(): - CWOFC2NtupleLog.fatal("Please setup the input POOL file ('PoolFileName')!") - theApp.exit(-1) - -if not 'WaveType' in dir(): - WaveType = "Cali" # (Cali, Phys) - -if not 'ContainerKey' in dir(): - if (WaveType == "Cali"): - ContainerKey = "LArCaliWave" - if (WaveType == "Phys"): - ContainerKey = "LArPhysWave" - -if not 'DACSaturSkip' in dir(): - DACSaturSkip = False - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -if not 'CaliWaveRootFileName' in dir(): - CaliWaveRootFileName = "LArWaves2Ntuple_POOL.root" - -if not 'OFCRootFileName' in dir(): - OFCRootFileName = "LArWaves2Ntuple_POOL.root" - -if not 'RunNumber' in dir(): - RunNumber = 393960 - -if not 'SuperCells' in dir(): - SuperCells = False - -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() - -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -#from LArAlignmentAlgs.LArAlignmentAlgsConf import LArAlignCondAlg -#condSeq += LArAlignCondAlg("LArAlignCondAlg") -#from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloAlignCondAlg -#condSeq += CaloAlignCondAlg("CaloAlignCondAlg") - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "COOLONL_LAR/CONDBR2" - -## define the DB Global Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.IOVDbSvc.forceRunNumber=RunNumber - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") - -if 'InputBadChannelSQLiteFile' in dir(): - from string import * - InputDBConnectionBadChannel = "sqlite://;schema="+InputBadChannelSQLiteFile+";dbname=CONDBR2" -else: - InputDBConnectionBadChannel = DBConnectionCOOL - -if ( not 'InputBadChannelSQLiteFile' in dir()) and ("ONL" in DBConnectionCOOL): - if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannels/BadChannels" - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - MissingFEBsFolder="/LAR/BadChannels/MissingFEBs" - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="AthenaAttributeList") -else: - if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="AthenaAttributeList") - -from AthenaCommon.AlgSequence import AthSequencer -condSeq = AthSequencer("AthCondSeq") - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - -from AthenaCommon.ConfigurableDb import getConfigurable -svcMgr += getConfigurable( "ProxyProviderSvc" )() -svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -svcMgr += getConfigurable( "CondProxyProvider" )() -svcMgr.CondProxyProvider.InputCollections += [ PoolFileName ] - -if ( WaveType == "Cali" ): - - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = [ ContainerKey ] - LArCaliWaves2Ntuple.DACSaturSkip = DACSaturSkip - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - LArCaliWaves2Ntuple.AddFEBTempInfo = False - LArCaliWaves2Ntuple.RealGeometry = False - LArCaliWaves2Ntuple.OffId = True - LArCaliWaves2Ntuple.AddCalib = True - LArCaliWaves2Ntuple.OutputLevel = INFO - LArCaliWaves2Ntuple.isSC = SuperCells - LArCaliWaves2Ntuple.NtupleFile = "FILE1" - #if SuperCells: - # LArCaliWaves2Ntuple.CalibMapKey = "LArCalibIdMapSC" - # from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloSuperCellAlignCondAlg - # condSeq += CaloSuperCellAlignCondAlg("CaloSuperCellAlignCondAlg") - # LArCaliWaves2Ntuple.ExtraInputs += (('CaloSuperCellDetDescrManager', 'ConditionStore+CaloSuperCellDetDescrManager')) - - topSequence += LArCaliWaves2Ntuple - - -if ( WaveType == "Phys" ): - from LArCalibTools.LArCalibToolsConf import LArPhysWaves2Ntuple - LArPhysWaves2Ntuple = LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" ) - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - LArPhysWaves2Ntuple.KeyList = [ ContainerKey ] - LArPhysWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArPhysWaves2Ntuple.AddFEBTempInfo = False - LArPhysWaves2Ntuple.OutputLevel = INFO - LArPhysWaves2Ntuple.isSC = SuperCells - LArPhysWaves2Ntuple.RealGeometry = False - LArPhysWaves2Ntuple.OffId = True - LArPhysWaves2Ntuple.AddCalib = True - LArPhysWaves2Ntuple.NtupleFile = "FILE1" - #if SuperCells: - # LArPhysWaves2Ntuple.CalibMapKey = "LArCalibIdMapSC" - # from CaloAlignmentAlgs.CaloAlignmentAlgsConf import CaloSuperCellAlignCondAlg - # condSeq += CaloSuperCellAlignCondAlg("CaloSuperCellAlignCondAlg") - # LArPhysWaves2Ntuple.ExtraInputs += (('CaloSuperCellDetDescrManager', 'ConditionStore+CaloSuperCellDetDescrManager')) - - - topSequence += LArPhysWaves2Ntuple - -from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple -LArOFC2Ntuple = LArOFC2Ntuple( "LArOFC2Ntuple" ) -LArOFC2Ntuple.OutputLevel = INFO -LArOFC2Ntuple.NtupleFile = "FILE2" -LArOFC2Ntuple.isSC = SuperCells -topSequence += LArOFC2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+CaliWaveRootFileName+"' OPT='NEW'" ] -svcMgr.NTupleSvc.Output += [ "FILE2 DATAFILE='"+OFCRootFileName+"' OPT='NEW'" ] - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -#svcMgr.MessageSvc.OutputLevel = INFO -#svcMgr.MessageSvc.defaultLimit = 10000 -#svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -#svcMgr += CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -########################################################################### - -#from AthenaCommon.AppMgr import theAuditorSvc -#from AthenaCommon.ConfigurableDb import getConfigurable -#theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -#theAuditorSvc += getConfigurable("ChronoAuditor")() -#theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/LArCondComparionsExample.py b/LArCalorimeter/LArCalibTools/share/LArCondComparionsExample.py deleted file mode 100644 index dde7a664db26c752d1540a512a6e4f3c50cd5f9c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArCondComparionsExample.py +++ /dev/null @@ -1,105 +0,0 @@ -InputDB="sqlite://;schema=freshConstants.db;dbname=COMP200" -InputTag="LARElecCalibPedestalsPedestal-comm-08" - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - - -from AthenaCommon.GlobalFlags import GlobalFlags -GlobalFlags.DetGeo.set_commis() -GlobalFlags.Luminosity.set_zero() -GlobalFlags.DataSource.set_data() -GlobalFlags.InputFormat.set_bytestream() - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-Comm-00-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = 10000000 -svcMgr.IOVDbSvc.GlobalTag="COMCOND-004-01" -conddb.addFolder("LAR","/LAR/BadChannels/BadChannels") - - -# Pedestal: -conddb.addFolder("","/LAR/ElecCalib/Pedestals/Pedestal<db>"+InputDB+"</db><tag>LARElecCalibPedestalsPedestal-comm-08</tag>") -conddb.addFolder("LAR","/LAR/ElecCalib/Pedestals/Pedestal<key>PedestalRef</key>") -from LArCalibDataQuality.LArCalibDataQualityConf import LArPedestalValidationAlg -thePedestalValidationAlg=LArPedestalValidationAlg() -thePedestalValidationAlg.IgnoreBadChannels=True -thePedestalValidationAlg.ValidationKey="Pedestal" -thePedestalValidationAlg.ReferenceKey="PedestalRef" -thePedestalValidationAlg.MsgLevelForDeviations=INFO -thePedestalValidationAlg.ListOfDevFEBs="pedFebs.txt" -topSequence+=thePedestalValidationAlg - - - -# AutoCorr: -conddb.addFolder("","/LAR/ElecCalib/AutoCorr<db>"+InputDB+"</db><tag>LARElecCalibAutoCorr-comm-08</tag>") -conddb.addFolder("LAR","/LAR/ElecCalib/AutoCorr<key>LArAutoCorrRef</key>") -from LArCalibDataQuality.LArCalibDataQualityConf import LArAutoCorrValidationAlg -theAutoCorrValidationAlg=LArAutoCorrValidationAlg() -theAutoCorrValidationAlg.IgnoreBadChannels=True -theAutoCorrValidationAlg.ValidationKey="LArAutoCorr" -theAutoCorrValidationAlg.ReferenceKey="LArAutoCorrRef" -theAutoCorrValidationAlg.MsgLevelForDeviations=INFO -theAutoCorrValidationAlg.ListOfDevFEBs="ACFebs.txt" -topSequence+=theAutoCorrValidationAlg - - - -# Ramp: -conddb.addFolder("","/LAR/ElecCalib/Ramps/RampLinea<db>"+InputDB+"</db><tag>LARElecCalibRampsRampLinea-comm-08</tag>") -conddb.addFolder("LAR","/LAR/ElecCalib/Ramps/RampLinea<key>LArRampRef</key>") -from LArCalibDataQuality.LArCalibDataQualityConf import LArRampValidationAlg -theRampValidationAlg=LArRampValidationAlg() -theRampValidationAlg.IgnoreBadChannels=True -theRampValidationAlg.ValidationKey="LArRamp" -theRampValidationAlg.ReferenceKey="LArRampRef" -theRampValidationAlg.MsgLevelForDeviations=INFO -theRampValidationAlg.ListOfDevFEBs="rampFebs.txt" -topSequence+=theRampValidationAlg - - -from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple -ValRamps2Ntuple=LArRamps2Ntuple("ValRamps2Ntuple") -ValRamps2Ntuple.NtupleName = "VALRAMPS" -ValRamps2Ntuple.RawRamp = False -ValRamps2Ntuple.RampKey = "ThinRampsVal" -topSequence+=ValRamps2Ntuple - -RefRamps2Ntuple=LArRamps2Ntuple("RefRamps2Ntuple") -RefRamps2Ntuple.NtupleName = "REFRAMPS" -RefRamps2Ntuple.RawRamp = False -RefRamps2Ntuple.RampKey = "ThinRampsRef" -topSequence+=RefRamps2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='RampComparison.root' OPT='NEW'" ] - - - -svcMgr.DetectorStore.Dump=True - - diff --git a/LArCalorimeter/LArCalibTools/share/LArDSPConfig2Ntuple.py b/LArCalorimeter/LArCalibTools/share/LArDSPConfig2Ntuple.py deleted file mode 100644 index 64e05d590c97d3d3181ed8e882d19479152967b7..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArDSPConfig2Ntuple.py +++ /dev/null @@ -1,88 +0,0 @@ -if 'inputfolder' not in dir(): - inputfolder="/LAR/Configuration/DSPConfiguration" - -if 'inputtag' not in dir(): - inputtag="" - -if 'inputdb' not in dir(): - inputdb="COOLONL_LAR/CONDBR2" - -if 'RunNumber' not in dir(): - RunNumber=9999999 - -if 'OutputRootFile' not in dir(): - OutputRootFile="DSPConfig.root" - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from time import time -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') -globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2") -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) - -svcMgr.IOVDbSvc.GlobalTag="LARCALIB-RUN2-00" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.InitialTimeStamp=int(time()) -dbname="<db>COOLOFL_LAR/CONDBR2</db>" - -from LArBadChannelTool.LArBadChannelAccess import LArBadChannelAccess -LArBadChannelAccess() -conddb.addFolder("",inputfolder+"<db>"+inputdb+"</db>") - - -## for f in LArFebConfigFolders: -## conddb.addFolder("LAR_ONL",f) - - -from LArCalibTools.LArCalibToolsConf import LArDSPConfig2Ntuple -theLArDSPConfig2Ntuple=LArDSPConfig2Ntuple() -theLArDSPConfig2Ntuple.OutputLevel=DEBUG -theLArDSPConfig2Ntuple.AddFEBTempInfo=False -theLArDSPConfig2Ntuple.OffId=True -theLArDSPConfig2Ntuple.Folder=inputfolder - -topSequence+=theLArDSPConfig2Ntuple - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRootFile+"' OPT='NEW'" ] - -#svcMgr.DetectorStore.Dump=True -svcMgr.MessageSvc.OutputLevel = INFO - -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml", - ] - - -svcMgr.MessageSvc.debugLimit = 5000000 - -svcMgr.IOVDbSvc.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArCalibTools/share/LArDSPThresholds2Ntuple.py b/LArCalorimeter/LArCalibTools/share/LArDSPThresholds2Ntuple.py deleted file mode 100644 index ab95954480e7b87e7cdc14525ad84d7ad8468bbf..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArDSPThresholds2Ntuple.py +++ /dev/null @@ -1,93 +0,0 @@ -if 'inputfolder' not in dir(): - inputfolder="/LAR/Configuration/DSPThresholdFlat/Thresholds" - -if 'inputtag' not in dir(): - inputtag="" - -if 'inputdb' not in dir(): - inputdb="COOLONL_LAR/CONDBR2" - -if 'runNumber' not in dir(): - runNumber=500000 - -if 'RootFile' not in dir(): - RootFile='DSPthresholds.root' - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from time import time -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) - -svcMgr.IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2017-05" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = runNumber -svcMgr.EventSelector.InitialTimeStamp=int(time()) - -bchdbname="<db>COOLONL_LAR/CONDBR2</db>" -conddb.addFolder("","/LAR/BadChannels/BadChannels<key>/LAR/BadChannels/BadChannels</key><tag>LARBadChannelsBadChannels-RUN2-UPD1-00</tag>"+bchdbname,className='CondAttrListCollection') -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key><tag>LARBadChannelsMissingFEBs-RUN2-UPD1-01</tag>"+bchdbname,className='AthenaAttributeList') -conddb.addFolder("",inputfolder+"<tag>"+inputtag+"</tag><db>"+inputdb+"</db>",className="AthenaAttributeList") - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg -condSeq+=LArBadChannelCondAlg(ReadKey='/LAR/BadChannels/BadChannels') - - -## for f in LArFebConfigFolders: -## conddb.addFolder("LAR_ONL",f) - - -from LArCalibTools.LArCalibToolsConf import LArDSPThresholds2Ntuple -theLArDSPThresholds2Ntuple=LArDSPThresholds2Ntuple() -theLArDSPThresholds2Ntuple.OutputLevel=DEBUG -theLArDSPThresholds2Ntuple.AddFEBTempInfo=False -theLArDSPThresholds2Ntuple.OffId=True -if "Flat" in inputfolder: - theLArDSPThresholds2Ntuple.DumpFlat=True - theLArDSPThresholds2Ntuple.FlatFolder=inputfolder - -topSequence+=theLArDSPThresholds2Ntuple - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFile+"' OPT='NEW'" ] - -#svcMgr.DetectorStore.Dump=True -svcMgr.MessageSvc.OutputLevel = WARNING - -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml", - ] - - -svcMgr.MessageSvc.debugLimit = 5000000 - -#svcMgr.IOVDbSvc.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArCalibTools/share/LArDelayFromDB2NTuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArDelayFromDB2NTuple_jobOptions.py deleted file mode 100644 index 6ee8650612badce38ecbf17bbd34457ec07dd121..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArDelayFromDB2NTuple_jobOptions.py +++ /dev/null @@ -1,217 +0,0 @@ - -import commands -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to reconstruction a DELAY runs in all 3 gains -# -# Last update: 06/03/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'RunNumber' in dir(): - RunNumber = 88237 - -if not 'FilePrefix' in dir(): - FilePrefix = "daq.Delay" - -if not 'GainList' in dir(): - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedFeedThrough" - -if not 'ChannelSelection' in dir(): - # read all - ChannelSelection = "<channelSelection>35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,1005" - ## example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'SaveJitter' in dir(): - SaveJitter = True - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'Partition' in dir(): - Partition = "EB-EMB" - -####################################################### -# Delay output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = RunNumber - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200;user=ATLAS_COOL_READER" - -## Output - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputCaliWaveRootFileDir' in dir(): - OutputCaliWaveRootFileDir = commands.getoutput("pwd") - -if not 'KeyOutput' in dir(): - KeyOutput = "LArCaliWave" # Key of LArCaliWaveContainer saved in Pool file - -if not 'BaseFileName' in dir(): - BaseFileName = "LArCaliWave" - -if StripsXtalkCorr : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") +"_StripsXtalkCorr" -else : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputCaliWaveRootFileName' in dir(): - OutputCaliWaveRootFileName = BaseFileName+".root" - -if not 'OutputCaliWavePoolFileName' in dir(): - OutputCaliWavePoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecCaliWave' in dir(): - if StripsXtalkCorr: - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolderXtlk - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolderXtlk,LArCalibFolderOutputTag) - else: - OutputObjectSpecCaliWave = "LArCaliWaveContainer#"+KeyOutput+"#"+LArCalib_Flags.LArCaliWaveFolder - OutputTagSpecCaliWave = LArCalibFolderTag(LArCalib_Flags.LArCaliWaveFolder,LArCalibFolderOutputTag) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml"] - -## The reference is the Oracle DB -if StripsXtalkCorr: - conddb.addFolder("LAR",LArCalib_Flags.LArCaliWaveFolderXtlk+"<key>LArCaliWave</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) -else: - conddb.addFolder("LAR",LArCalib_Flags.LArCaliWaveFolder+"<key>LArCaliWave</key><dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ChannelSelection) - - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -########################################################################## -# # -# Output # -# # -########################################################################## - -if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - LArCaliWaves2Ntuple.KeyList = [ KeyOutput ] - - topSequence+=LArCaliWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName): - os.remove(OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputCaliWaveRootFileDir+"/"+OutputCaliWaveRootFileName+"' OPT='NEW'" ] - -########################################################################### - - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArDigits2Ntuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArDigits2Ntuple_jobOptions.py deleted file mode 100755 index 634952163c4d21f0aa5761882815994efc4575f6..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArDigits2Ntuple_jobOptions.py +++ /dev/null @@ -1,284 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -import os - - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'RunNumberList' in dir(): - RunNumberList = [ '0018660' ] - -if not 'BaseFileName' in dir(): - BaseFileName = "LArDigits" - - for RunNumber in RunNumberList : - BaseFileName = BaseFileName+"_"+str(RunNumber) - -if not 'OutputRootFileName' in dir(): - OutputRootFileName = BaseFileName+".root" - -if not 'OutputDir' in dir(): - OutputDir = os.getcwd() - -if not 'SCDecodeAllContainers' in dir(): - SCDecodeAllContainers=False - -if not 'SCProtectSourceId' in dir(): - SCProtectSourceId=False - -if not 'FilePrefix' in dir(): - if (int(RunNumberList[0]))<99800 : - FilePrefix = "daq.Ramp" - else : - FilePrefix = "data*" - -if not 'NSamples' in dir(): - NSamples=32 - -if not 'InputDir' in dir(): - InputDir = "/castor/cern.ch/grid/atlas/DAQ/lar/ElecCalib/2014/"+RunNumberList[0] - -if not 'FillLatomeSourceID' in dir(): - FillLatomeSourceID=-1 -if not 'OverwriteEventNumber' in dir(): - OverwriteEventNumber=False - -if not 'BSConverter_Add_BCID_LATOMEID' in dir(): - BSConverter_Add_BCID_LATOMEID=False - -if not 'SCIgnoreBarrelChannels' in dir(): - SCIgnoreBarrelChannels=False - -if not 'SCIgnoreEndcapChannels' in dir(): - SCIgnoreEndcapChannels=False - -if not 'FullFileName' in dir(): - if not 'Trigger' in dir(): - if (int(RunNumberList[0]))<99800 : - Trigger = "*"+Partition - else : - if 'Partition' in dir(): - Trigger = "calibration_"+".*"+Partition - else: - Trigger = "calibration_"+"*" - - from LArCalibProcessing.GetInputFiles import GetInputFilesFromTokens,GetInputFiles - FullFileName = [] - for RunNumber in RunNumberList : - FullFileName+=GetInputFilesFromTokens(InputDir,int(RunNumber),FilePrefix,Trigger) - - -if not 'EvtMax' in dir(): - EvtMax=-1 - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'SuperCells' in dir(): - SuperCells=False - -if not 'WithAccDigits' in dir(): - WithAccDigits=False - -if not 'GainList' in dir(): - if SuperCells: - GainList = ["SC"] - else: - GainList = [ "HIGH", "MEDIUM", "LOW" ] - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -else: include("LArCalibProcessing/LArCalib_FlagsSC.py") -include("LArCalibProcessing/GetInputFiles.py") - -if SuperCells: - from AthenaCommon.GlobalFlags import globalflags - globalflags.DetGeo.set_Value_and_Lock('atlas') - globalflags.Luminosity.set_Value_and_Lock('zero') - globalflags.DataSource.set_Value_and_Lock('data') - globalflags.InputFormat.set_Value_and_Lock('bytestream') - globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') - - from AthenaCommon.JobProperties import jobproperties - jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01" - - from AthenaCommon.DetFlags import DetFlags - DetFlags.Calo_setOn() - DetFlags.ID_setOff() - DetFlags.Muon_setOff() - DetFlags.Truth_setOff() - DetFlags.LVL1_setOff() - DetFlags.digitize.all_setOff() - - #Set up GeoModel (not really needed but crashes without) - from AtlasGeoModel import SetGeometryVersion - from AtlasGeoModel import GeoModelInit - - #Get identifier mapping - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - include( "LArIdCnv/LArIdCnv_joboptions.py" ) - include( "ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py" ) -else: - include ("LArConditionsCommon/LArMinimalSetup.py") - -from LArCabling.LArCablingAccess import LArOnOffIdMapping,LArFebRodMapping,LArCalibIdMapping -LArOnOffIdMapping() -LArFebRodMapping() -LArCalibIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC, LArCalibIdMappingSC,LArLATOMEMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - LArLATOMEMappingSC() - - -svcMgr.IOVDbSvc.GlobalTag=LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -if 'BadChannelsFolder' not in dir(): - BadChannelsFolder="/LAR/BadChannels/BadChannels" -if 'MissingFEBsFolder' not in dir(): - MissingFEBsFolder="/LAR/BadChannels/MissingFEBs" - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - if 'InputDBConnectionBadChannel' not in dir(): - InputDBConnectionBadChannel = "COOLOFL_LAR/" + conddb.dbname - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>", - className="CondAttrListCollection") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className="CondAttrListCollection") - - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='AthenaAttributeList') - - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=theLArBadFebCondAlg - -if SuperCells: - conddb.addFolder("","/LAR/IdentifierOfl/OnOffIdMap_SC<db>COOLOFL_LAR/OFLP200</db><tag>LARIdentifierOflOnOffIdMap_SC-000</tag>") - - - - - - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -theByteStreamInputSvc=svcMgr.ByteStreamInputSvc -if not 'FullFileName' in dir(): - RampLog.info( "No FullFileName! Please give a FullFileName list." ) - theApp.exit(-1) - -else : - svcMgr.EventSelector.Input=FullFileName - -svcMgr.EventSelector.MaxBadEvents = 0 - -svcMgr.ByteStreamCnvSvc.InitCnvs += [ "EventInfo"] - -theByteStreamAddressProviderSvc =svcMgr.ByteStreamAddressProviderSvc - -if not SuperCells: - from LArByteStream.LArByteStreamConf import LArRodDecoder - svcMgr.ToolSvc += LArRodDecoder() - theByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArDigitContainer/HIGH" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArDigitContainer/MEDIUM"] - theByteStreamAddressProviderSvc.TypeNames += [ "LArDigitContainer/LOW" ] - theByteStreamAddressProviderSvc.TypeNames += [ "LArDigitContainer/FREE" ] - - # this will go outside SC loop - include ("LArROD/LArFebErrorSummaryMaker_jobOptions.py") - topSequence.LArFebErrorSummaryMaker.CheckAllFEB=False - - from LArCalibDataQuality.LArCalibDataQualityConf import LArBadEventCatcher - theLArBadEventCatcher=LArBadEventCatcher() - theLArBadEventCatcher.CheckAccCalibDigitCont=False - theLArBadEventCatcher.CheckBSErrors=True - theLArBadEventCatcher.KeyList= GainList - theLArBadEventCatcher.StopOnError=False - topSequence+=theLArBadEventCatcher -else: - from LArByteStream.LArByteStreamConf import LArLATOMEDecoder - from LArByteStream.LArByteStreamConf import LArRawSCDataReadingAlg - LArRawSCDataReadingAlg = LArRawSCDataReadingAlg() - LArRawSCDataReadingAlg.LATOMEDecoder = LArLATOMEDecoder("LArLATOMEDecoder") - LArRawSCDataReadingAlg.LATOMEDecoder.DumpFile = SC_DumpFile - LArRawSCDataReadingAlg.LATOMEDecoder.RawDataFile = SC_RawDataFile - LArRawSCDataReadingAlg.LATOMEDecoder.ProtectSourceId = SCProtectSourceId - LArRawSCDataReadingAlg.LATOMEDecoder.IgnoreBarrelChannels = SCIgnoreBarrelChannels - LArRawSCDataReadingAlg.LATOMEDecoder.IgnoreEndcapChannels = SCIgnoreEndcapChannels - topSequence+=LArRawSCDataReadingAlg - -from LArCalibTools.LArCalibToolsConf import LArDigits2Ntuple - -LArDigits2Ntuple=LArDigits2Ntuple("LArDigits2Ntuple") -contkeys = GainList - -if 'rawChannels' not in dir(): - rawChannels = False -if rawChannels is True: - contkeys.append("LArRawChannels") - - -LArDigits2Ntuple.ContainerKey = contkeys[0] -LArDigits2Ntuple.AddFEBTempInfo=False -if 'FTlist' in dir(): - LArDigits2Ntuple.FTlist=FTlist - -LArDigits2Ntuple.isSC = SuperCells - -LArDigits2Ntuple.FillBCID = True - -LArDigits2Ntuple.RealGeometry = True -LArDigits2Ntuple.OffId = True - -if SuperCells: - LArDigits2Ntuple.AddBadChannelInfo = False - LArDigits2Ntuple.OverwriteEventNumber = OverwriteEventNumber -LArDigits2Ntuple.OutputLevel = DEBUG - - -topSequence+= LArDigits2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputDir + "/" +OutputRootFileName+"' OPT='NEW'" ] - -AthenaEventLoopMgr=Service("AthenaEventLoopMgr") -AthenaEventLoopMgr.OutputLevel=DEBUG - -theApp.EvtMax=EvtMax - - -svcMgr.MessageSvc.OutputLevel=DEBUG - -LArDigits2Ntuple.OutputLevel=DEBUG - -from AthenaCommon.AlgSequence import dumpSequence -dumpSequence(topSequence) - -svcMgr.StoreGateSvc.Dump = True; diff --git a/LArCalorimeter/LArCalibTools/share/LArFEBTemp2Ntuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArFEBTemp2Ntuple_jobOptions.py deleted file mode 100755 index 64c6ed260b7a23e3bfad9a52a3ac5ba8971cd9b9..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArFEBTemp2Ntuple_jobOptions.py +++ /dev/null @@ -1,89 +0,0 @@ -########################################################## -# Job options to dump the LAr FEB temperatures to ntuple.# -########################################################## - -RunNumber = 162903 - -COOL_folder = "/LAR/DCS/FEBTEMP" - -DBConnectionCOOL_OFL = "COOLOFL_DCS/COMP200" -DBConnectionCOOL_ONL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200;user=ATLAS_COOL_READER" - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/LArCalib_MinimalSetup.py") -include("LArCalibProcessing/GetInputFiles.py") -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -import IOVDbSvc.IOVDb - -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL_ONL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL_ONL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["prfile:poolcond/PoolCat_oflcond.xml", -"xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", -"xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml", -"xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", -"xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", -"xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml"] - -if ( len(PoolFileList)>0 ): - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -svcMgr.IOVDbSvc.OutputLevel = INFO -svcMgr.IOVDbSvc.dbConnection = DBConnectionCOOL_OFL - -svcMgr.ProxyProviderSvc.OutputLevel = INFO -svcMgr.AthenaPoolCnvSvc.OutputLevel = INFO - -#svcMgr.IOVDbSvc.OnlineMode = True - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -#svcMgr.EventSelector.EventsPerRun = 100 -#svcMgr.EventSelector.FirstEvent = 2 -#svcMgr.EventSelector.InitialTimeStamp = 1259163985 -svcMgr.EventSelector.InitialTimeStamp = 1283145454 -#svcMgr.EventSelector.TimeStampInterval = 1 - -theApp.Dlls += ["LArCalibTools"] -theApp.Dlls += [ "LArFEBTempTool" ] - -from LArCondUtils.LArCondUtilsConf import LArFEBTempTool -ToolSvc += LArFEBTempTool() -ToolSvc.LArFEBTempTool.FolderName = COOL_folder - -from LArCalibTools.LArCalibToolsConf import LArFEBTemp2Ntuple -topSequence += LArFEBTemp2Ntuple() -LArFEBTemp2Ntuple = LArFEBTemp2Ntuple() - -svcMgr.IOVDbSvc.Folders += [ COOL_folder ] - -theApp.Dlls += [ "RootHistCnv" ] -theApp.HistogramPersistency = "ROOT" -NTupleSvc = Service( "NTupleSvc" ) -NTupleSvc.Output = [ "FILE1 DATAFILE='FEBTemp.root' OPT='NEW'" ] - -AthenaEventLoopMgr=Service("AthenaEventLoopMgr") -AthenaEventLoopMgr.OutputLevel=INFO - -LArFEBTemp2Ntuple.OutputLevel=INFO -LArFEBTempTool.OutputLevel=INFO - -theApp.EvtMax=1 -MessageSvc.OutputLevel=INFO -svcMgr.IOVDbSvc.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArCalibTools/share/LArFillDSPConfig.py b/LArCalorimeter/LArCalibTools/share/LArFillDSPConfig.py deleted file mode 100644 index 0ecf2f490d4da44611cd9d6fdd954a3f0f95d0e4..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArFillDSPConfig.py +++ /dev/null @@ -1,53 +0,0 @@ -if not 'LowMu' in dir(): - LowMu=False - -if not 'OutputSqliteFile' in dir(): - OutputSqliteFile="dspconfig.db" - -DSPConfigFolder="/LAR/Configuration/DSPConfiguration" - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2") - -from AthenaCommon.AppMgr import theApp, ServiceMgr -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from IOVDbSvc.CondDB import conddb - -svcMgr.IOVDbSvc.GlobalTag = "LARCALIB-RUN2-00" -svcMgr.IOVDbSvc.DBInstance="" - - -from LArCalibTools.LArCalibToolsConf import LArFillDSPConfig - -topSequence+=LArFillDSPConfig(Foldername=DSPConfigFolder,isLowMu=LowMu) - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg","dummy.pool.root",["AthenaAttributeList#"+DSPConfigFolder,],["",],True) - -svcMgr.IOVDbSvc.dbConnection = "sqlite://;schema="+OutputSqliteFile+";dbname=CONDBR2" - - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.IOVRegistrationSvc.SVFolder = True - - -theApp.EvtMax = 1 - -from McEventSelector.McEventSelectorConf import McEventSelector -ServiceMgr += McEventSelector("EventSelector",RunNumber = 2147483647) -#svcMgr.EventSelector. -#svcMgr.EventSelector.EventsPerRun = 1 -#svcMgr.EventSelector.FirstEvent = 1 -#svcMgr.EventSelector.InitialTimeStamp = 0 -#svcMgr.EventSelector.TimeStampInterval = 1 diff --git a/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py b/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py deleted file mode 100644 index b18d70e36cc4e33259b2ad9ccf254c713bba047e..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArGainThresholds2Ntuple.py +++ /dev/null @@ -1,73 +0,0 @@ -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from string import split,join -from time import time -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2016-01-00-01" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) - -svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2017-04" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = 500000 -svcMgr.EventSelector.InitialTimeStamp=int(time()) -dbname="<db>COOLOFL_LAR/CONDBR2</db>" - -#conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>"+dbname) -#conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>"+dbname) -from LArBadChannelTool.LArBadChannelAccess import LArBadChannelAccess -LArBadChannelAccess() -#from LArBadChannelTool.LArBadFebAccess import LArBadFebAccess -#LArBadFebAccess() - -from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault -LArFebConfigCondAlgDefault() - -from LArCalibTools.LArCalibToolsConf import LArGainThresholds2Ntuple -theLArGainThresholds2Ntuple=LArGainThresholds2Ntuple() -theLArGainThresholds2Ntuple.OutputLevel=DEBUG -theLArGainThresholds2Ntuple.AddFEBTempInfo=False -theLArGainThresholds2Ntuple.isSC=False - -topSequence+=theLArGainThresholds2Ntuple - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='thresholds.root' OPT='NEW'" ] - -#svcMgr.DetectorStore.Dump=True -#svcMgr.MessageSvc.OutputLevel = DEBUG - -svcMgr.IOVDbSvc.DBInstance="" -#svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", -# "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml", -# ] - - -svcMgr.MessageSvc.debugLimit = 5000000 -svcMgr.IOVDbSvc.OutputLevel=DEBUG diff --git a/LArCalorimeter/LArCalibTools/share/LArMCConditions2Ntuple.py b/LArCalorimeter/LArCalibTools/share/LArMCConditions2Ntuple.py deleted file mode 100644 index 3357e59678793cc14f75dc93453dc216d29a2749..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArMCConditions2Ntuple.py +++ /dev/null @@ -1,173 +0,0 @@ -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from string import split,join -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -#Input Parameters: -# PoolFiles: sequence of pool files to read from though CondProxyProvider -# if not given, read from COOL -# -# RunNumber: Input to COOL IOV-DB if reading from -# -# RootFile: root file for the ntuple -# -# Objects: List of objects written to ntuple (PEDESTAL OFC, RAMP, -DBTag='OFLCOND-SDR-BS14T-IBL-06' - -if not 'InputDB' in dir(): - InputDB="COOLOFL_LAR/OFLP200" - -if not "OFCFolder" in dir(): - OFCFolder="5samples1phase" - -if not 'RunNumber' in dir(): - RunNumber=2147483647 - -if not "RootFile" in dir(): - RootFile="LArConditions.root" - -if not "Objects" in dir(): - Objects=["PEDESTAL","RAMP","OFC","MPHYSOVERMCAL","SHAPE","UA2MEV"] - -if not "DBTag" in dir(): - DBTag="LARCALIB-000-01" - - -def doObj(objName): - for o in Objects: - if o.upper().find(objName.upper())!=-1: - return True - return False - -def getDBFolderAndTag(folder): - if "TagSuffix" in dir(): - tag="<tag>"+join(split(folder, '/'),'') + TagSuffix+"</tag>" - else: - tag="" - return "<db>"+InputDB+"</db>"+folder+tag - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource="geant4" -globalflags.InputFormat="pool" - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-GEO-18-01-03" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) -svcMgr.IOVDbSvc.GlobalTag=DBTag -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = RunNumber - -conddb.addFolder("","<db>COOLOFL_LAR/OFLP200</db>/LAR/BadChannels/BadChannels<key>/LAR/BadChannels/BadChannels</key>") -conddb.addFolder("","<db>COOLOFL_LAR/OFLP200</db>/LAR/BadChannels/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>") - -conddb.addOverride('/LAR/Identifier/FebRodAtlas','FebRodAtlas-005') -conddb.addOverride('/LAR/Identifier/OnOffIdAtlas','OnOffIdAtlas-012') - - -if 'PoolFiles' in dir(): - from AthenaCommon.ConfigurableDb import getConfigurable - from AthenaCommon.AppMgr import ServiceMgr - ServiceMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - ServiceMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections=PoolFiles - -if 'PoolCat' in dir(): - svcMgr.PoolSvc.ReadCatalog+=["xmlcatalog_file:"+PoolCat] - -loadCastorCat=False - -if doObj("PEDESTAL"): - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/Pedestal")) - from LArCalibTools.LArCalibToolsConf import LArPedestals2Ntuple - LArPedestals2Ntuple=LArPedestals2Ntuple("LArPedestals2Ntuple") - LArPedestals2Ntuple.AddFEBTempInfo=False - topSequence+=LArPedestals2Ntuple - - -if doObj("AUTOCORR"): - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibOfl/AutoCorrs/AutoCorr")) - from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple - LArAutoCorr2Ntuple=LArAutoCorr2Ntuple("LArAutoCorr2Ntuple") - LArAutoCorr2Ntuple.AddFEBTempInfo=False - topSequence+=LArAutoCorr2Ntuple - - -if doObj("OFC"): - - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/HVScaleCorr")) - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/Noise")) - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/AutoCorr")) - - from LArRecUtils.LArOFCCondAlgDefault import LArOFCCondAlgDefault - LArOFCCondAlgDefault() - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntuple.AddFEBTempInfo=False - topSequence+=LArOFC2Ntuple - -if (doObj("SHAPE")): - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/Shape")) - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") - LArShape2Ntuple.ContainerKey = "LArShape" - LArShape2Ntuple.AddFEBTempInfo=False - LArShape2Ntuple.IsMC = True - topSequence+=LArShape2Ntuple - -if doObj("RAMP"): - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/Ramp")) - from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple - LArRamps2Ntuple=LArRamps2Ntuple("LArRamps2Ntuple") - LArRamps2Ntuple.NtupleName = "RAMPS" - LArRamps2Ntuple.RawRamp = False - LArRamps2Ntuple.IsMC = True - LArRamps2Ntuple.AddFEBTempInfo=False - topSequence+=LArRamps2Ntuple - -if (doObj("UA2MEV")): - print ('DAC2uA check : ',getDBFolderAndTag("/LAR/ElecCalibMC/DAC2uA")) - print ('uA2MeV check : ',getDBFolderAndTag("/LAR/ElecCalibMC/uA2MeV")) - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/DAC2uA")) - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/uA2MeV")) - from LArCalibTools.LArCalibToolsConf import LAruA2MeV2Ntuple - LAruA2MeV2Ntuple=LAruA2MeV2Ntuple("LAruA2MeV2Ntuple") - LAruA2MeV2Ntuple.AddFEBTempInfo=False - topSequence+=LAruA2MeV2Ntuple - -if (doObj("MPHYSOVERMCAL")): - conddb.addFolder("",getDBFolderAndTag("/LAR/ElecCalibMC/MphysOverMcal")) - from LArCalibTools.LArCalibToolsConf import LArMphysOverMcal2Ntuple - LArMphysOverMcal2Ntuple=LArMphysOverMcal2Ntuple("LArMphysOverMcal2Ntuple") - LArMphysOverMcal2Ntuple.AddFEBTempInfo=False - LArMphysOverMcal2Ntuple.IsMC=True - topSequence+=LArMphysOverMcal2Ntuple - -if loadCastorCat: - svcMgr.PoolSvc.ReadCatalog += ['xmlcatalog_file:'+'/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml'] - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFile+"' OPT='NEW'" ] - -svcMgr.MessageSvc.OutputLevel = DEBUG - -svcMgr.IOVDbSvc.DBInstance="OFLP200" diff --git a/LArCalorimeter/LArCalibTools/share/LArMphysOverMcalFromTuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArMphysOverMcalFromTuple_jobOptions.py deleted file mode 100755 index 4af386a4a3748f445c4774e7f947294cc639f43d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArMphysOverMcalFromTuple_jobOptions.py +++ /dev/null @@ -1,101 +0,0 @@ -# Last update: Caroline Collard 2009-03-31 - -IOVBegin=80000 - -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'MphysOverMcalPOOLFileOUT' in dir(): - MphysOverMcalPOOLFileOUT = "/tmp/collard/MphysOverMcal_88240_EMBC.pool.root" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include( "LArCalibProcessing/LArCalib_MinimalSetup.py") - -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -######################################################################################################### -# -# Reading Ntuple -######################################################################################################### -theApp.Dlls += ["LArRawUtils"] -theApp.Dlls += ["LArTools"] -theApp.Dlls += ["LArCalibUtils"] -theApp.Dlls += ["LArCalibTools"] - -theApp.TopAlg += [ "LArMphysOverMcalFromTuple" ] -LArMphysOverMcalFromTuple = Algorithm( "LArMphysOverMcalFromTuple" ) -LArMphysOverMcalFromTuple.FileNames = [ - "/tmp/collard/fpm_pulse_mini88240.root" -] -FPMKey = "LArMphysOverMcal" -LArMphysOverMcalFromTuple.StoreKey = FPMKey - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - FPMMphysFolder = "/LAR/ElecCalib/MphysOverMcal/FPM" - OutputObjectSpec = "LArMphysOverMcalComplete#"+FPMKey+"#"+FPMMphysFolder - LArMphysFolderOutputTag = LArCalib_Flags.tagSuffix - OutputObjectSpecTag = LArCalibFolderTag(FPMMphysFolder,LArMphysFolderOutputTag) - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg", MphysOverMcalPOOLFileOUT, - [OutputObjectSpec],[OutputObjectSpecTag],True) - theOutputConditionsAlg.Run1 = IOVBegin - - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - -svcMgr.IOVDbSvc.dbConnection="sqlite://;schema=myDB200.db;dbname=COMP200" - -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArOFC2Ntuple_POOL_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArOFC2Ntuple_POOL_jobOptions.py deleted file mode 100755 index 668cb721fa87983563889ed87df5f42a1250881b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArOFC2Ntuple_POOL_jobOptions.py +++ /dev/null @@ -1,97 +0,0 @@ -########################################################################### -# -# jobOptions to dump LAr OFC POOL file content to ROOT ntuple -# -# rewritten in Nov. 2010, P. Strizenec -########################################################################### - -import commands - -OFC2NtupleLog = logging.getLogger( "OFC2NtupleLog" ) - -if not 'PoolFileName' in dir(): - OFC2NtupleLog.fatal("Please setup the input POOL file ('PoolFileName')!") - theApp.exit(-1) - -if not 'RootFileName' in dir(): - RootFileName = "LArOFC2Ntuple_POOL.root" - - -if not 'DBConnectionCOOL' in dir(): - #DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - DBConnectionCOOL = "COOLOFL_LAR/CONDBR2" - -if not 'RunNumber' in dir(): - RunNumber = 222222 - - -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -########################################################################### -# -# POOL -# -include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") -## define the DB Global Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.IOVDbSvc.forceRunNumber=RunNumber - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -# Temperature folder -#conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") - -if "ONL" in DBConnectionCOOL: - conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -else: - conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - include("LArCalibProcessing/LArCalib_BadChanTool.py") - -from AthenaCommon.ConfigurableDb import getConfigurable -svcMgr += getConfigurable( "ProxyProviderSvc" )() -svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -svcMgr += getConfigurable( "CondProxyProvider" )() -svcMgr.CondProxyProvider.InputCollections += [ PoolFileName ] - -# -# Dump OFC folder to a ROOT ntuple -# -from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple -LArOFC2Ntuple = LArOFC2Ntuple( "LArOFC2Ntuple" ) -LArOFC2Ntuple.OutputLevel = INFO -LArOFC2Ntuple.AddFEBTempInfo=False -topSequence += LArOFC2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### -#svcMgr.MessageSvc.OutputLevel = INFO -#svcMgr.MessageSvc.defaultLimit = 10000 -#svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -#svcMgr += CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -########################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/LArOFCBinAlg.py b/LArCalorimeter/LArCalibTools/share/LArOFCBinAlg.py deleted file mode 100644 index 65ec0df8401b7fbda875ec6c87f9ff78afc2ad1e..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArOFCBinAlg.py +++ /dev/null @@ -1,100 +0,0 @@ -if 'RunNumber' not in dir(): - RunNumber=999999 - -if 'FebMG' not in dir(): - FebMG=True - -if 'FebCorr' not in dir(): - FebCorr=False - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from string import split,join -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') -globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2") - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-GEO-20-00-01" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) - -svcMgr.IOVDbSvc.GlobalTag="LARCALIB-RUN2-00" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = RunNumber - -dbname="<db>COOLOFL_LAR/CONDBR2</db>" - -conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>"+dbname) -conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>"+dbname) -#conddb.addFolder("","/LAR/ElecCalibOfl/PhysCaliTdiff<key>input</key><tag>LARElecCalibOflPhysCaliTdiff-gaincorr-01</tag>"+dbname) -conddb.addFolder("","/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts<key>input</key><tag>LARElecCalibOflOFCBinPhysWaveShifts-UPD3-00</tag>"+dbname) - - -from LArCalibTools.LArCalibToolsConf import LArOFCBinAlg -theLArOFCBinAlg=LArOFCBinAlg() -theLArOFCBinAlg.OutputLevel=DEBUG -theLArOFCBinAlg.AddFEBTempInfo=False -theLArOFCBinAlg.InputContainer="input" -theLArOFCBinAlg.OutputContainer="LArPhysWaveShift" -theLArOFCBinAlg.FileName="FebOffsets_gain.txt" -theLArOFCBinAlg.PerFebMGCorr=FebMG -theLArOFCBinAlg.PerFebCorr=FebCorr - -topSequence+=theLArOFCBinAlg - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='bindiff.root' OPT='NEW'" ] - -#svcMgr.DetectorStore.Dump=True -#svcMgr.MessageSvc.OutputLevel = DEBUG - -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml", - ] - - -#svcMgr.MessageSvc.debugLimit = 5000000 - - -OutputPoolFile="AdjustedOFCBin.pool.root" -outObject="LArOFCBinComplete#LArPhysWaveShift#/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts" -outTag="LARElecCalibOflOFCBinPhysWaveShifts-UPD3-00" - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputPoolFile, - [outObject],[outTag],True) - - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True - - -svcMgr.IOVDbSvc.dbConnection="sqlite://;schema=bindiff_run2.db;dbname=CONDBR2" diff --git a/LArCalorimeter/LArCalibTools/share/LArOFCBin_PhysCaliTdiffFromStdNtuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArOFCBin_PhysCaliTdiffFromStdNtuple2Pool_jobOptions.py deleted file mode 100755 index ac689f8c5f7de4ae1812c6b7f5dd9b4da1fa7d1c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArOFCBin_PhysCaliTdiffFromStdNtuple2Pool_jobOptions.py +++ /dev/null @@ -1,197 +0,0 @@ -# Last update: Caroline Collard 2009-03-31 - -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'POOLFileOUT' in dir(): - POOLFileOUT = "LArParams_0.pool.root" - -if not 'NTFileOUT' in dir(): - NTFileOUT = "LArParams_0_new.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'NTName' in dir(): - NTName = "PARAMS" - -if not 'NTFileIN' in dir(): - NTFileIN = "LArParams_0.root" - -if not 'StoreOFC' in dir(): - StoreOFC = True - -if StoreOFC: - if not 'OutputKey_OFCBin' in dir(): - OutputKey_OFCBin = "LArOFCPhase" - if not 'OutputFolder_OFCBin' in dir(): - OutputFolder_OFCBin="/LAR/ElecCalibOfl/OFCBin/Dummy" - - -if not 'StoreTdiff' in dir(): - StoreTdiff = True - -if StoreTdiff: - if not 'OutputKey_Tdiff' in dir(): - OutputKey_Tdiff = "LArPhysCaliTdiff" - if not 'OutputFolder_Tdiff' in dir(): - OutputFolder_Tdiff="/LAR/ElecCalibOfl/PhysCaliTdiff" - - -if not 'OutputTag' in dir(): - OutputTag="comm-08" - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include( "LArCalibProcessing/LArCalib_MinimalSetup.py") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=COMP200" - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000003.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000004.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - - - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### - -from LArCalibTools.LArCalibToolsConf import LArOFCBin_PhysCaliTdiffFromStdNtuple -LArParamsFromTuple = LArOFCBin_PhysCaliTdiffFromStdNtuple() -LArParamsFromTuple.NtupleName = NTName -LArParamsFromTuple.FileNames = [ NTFileIN ] -LArParamsFromTuple.Store_OFC = StoreOFC -LArParamsFromTuple.Store_Tdiff = StoreTdiff -if StoreOFC: - LArParamsFromTuple.StoreKey_OFC = OutputKey_OFCBin - -if StoreTdiff: - LArParamsFromTuple.StoreKey_Tdiff = OutputKey_Tdiff - -LArParamsFromTuple.GroupingType = GroupingType - -topSequence += LArParamsFromTuple - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple - LArParams2Ntuple = LArParams2Ntuple( "LArParams2Ntuple" ) - LArParams2Ntuple.NtupleName = "PARAMS" - LArParams2Ntuple.KeyList = ["LArOFCBinComplete", "LArPhysCaliTdiffComplete"] - LArParams2Ntuple.AllChannels2Ntuple = False - LArParams2Ntuple.DBKeysList = [ "", "", "LArPhysCaliTdiff", - "", "", "", "", "", "", "", "", "", "", "LArOFCPhase"] - - topSequence += LArParams2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+NTFileOUT+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - - if StoreOFC: - OutputObjectSpecOFC = "LArOFCBinComplete#"+OutputKey_OFCBin+"#"+ OutputFolder_OFCBin - OutputObjectSpecTagOFC = LArCalibFolderTag(OutputFolder_OFCBin,OutputTag) - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",POOLFileOUT, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],True) - theOutputConditionsAlg.Run1 = 0 - - if StoreTdiff: - OutputObjectSpecTdiff = "LArPhysCaliTdiffComplete#"+OutputKey_Tdiff+"#"+ OutputFolder_Tdiff - OutputObjectSpecTagTdiff = LArCalibFolderTag(OutputFolder_Tdiff,OutputTag) - theOutputConditionsAlg1 = OutputConditionsAlg("OutputConditionsAlg1",POOLFileOUT, - [OutputObjectSpecTdiff],[OutputObjectSpecTagTdiff],True) - theOutputConditionsAlg1.Run1 = 0 - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py deleted file mode 100644 index ed767650fffe15e493b8c9a76bc03933411aa60c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArParamsFromDB2NTuple_jobOptions.py +++ /dev/null @@ -1,167 +0,0 @@ -import os -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'RunNumber' in dir(): - RunNumber = 500000 - -if not ' GainList' in dir(): - GainList = ["HIGH", "MEDIUM", "LOW"] - -if not 'ChannelSelection' in dir(): - ChannelSelection="" - -if not 'LArInputTag' in dir(): - LArInputTag = "-UPD3-00" - -if not 'LArInputKey' in dir(): - LArInputKey = [""] - -if not 'AllChannels2Ntuple' in dir(): - AllChannels2Ntuple = False - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2" - -if not 'DBConnection' in dir(): - DBConnection = DBConnectionCOOL - -## Output - -if not 'OutputRootFileDir' in dir(): - OutputRootFileDir = os.getcwd() - -if not 'BaseFileName' in dir(): - BaseFileName = "LArParams" - -BaseFileName = BaseFileName+"_"+str(RunNumber) - -if not 'OutputRootFileName' in dir(): - OutputRootFileName = BaseFileName+".root" - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -if conddb.isMC: - include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" ) - conddb.addFolder("LAR_OFL","/LAR/BadChannels/BadChannels<tag>LArBadChannelsBadChannels-IOVDEP-06</tag>",className="CondAttrListCollection") -else: - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>",className="CondAttrListCollection") - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg() -theLArBadChannelCondAlg.ReadKey="/LAR/BadChannels/BadChannels" -condSeq+=theLArBadChannelCondAlg - - -## The reference is the Oracle DB -if 'LArCaliParamsFolder' in dir(): - if not 'InputTagSpecCali' in dir(): - InputTagSpecCali = LArCalibFolderTag(LArCaliParamsFolder,LArInputTag) - - conddb.addFolder("",LArCaliParamsFolder+"<tag>"+InputTagSpecCali+"</tag><dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection,className="LArCaliPulseParamsComplete") - - -if 'LArDetParamsFolder' in dir(): - if not 'InputTagSpecDet' in dir(): - InputTagSpecDet = LArCalibFolderTag(LArDetParamsFolder,LArInputTag) - - conddb.addFolder("",LArDetParamsFolder+"<tag>"+InputTagSpecDet+"</tag><dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection,className="LArDetCellParamsComplete") - -if 'LArOFCBinFolder' in dir(): - if not 'InputTagSpecDet' in dir(): - InputTagSpecDet = LArCalibFolderTag(LArOFCBinFolder,LArInputTag) - - conddb.addFolder("",LArOFCBinFolder+"<tag>"+InputTagSpecDet+"</tag><dbConnection>"+DBConnection+"</dbConnection><key>LArOFCBinComplete</key>"+ChannelSelection,className="LArOFCBinComplete") - -if 'LArHECPAFolder' in dir(): - if not 'InputTagSpecHECPA' in dir(): - InputTagSpecHECPA = LArCalibFolderTag(LArHECPAFolder,LArInputTag) - - conddb.addFolder("",LArHECPAFolder+"<tag>"+InputTagSpecHECPA+"</tag><dbConnection>"+DBConnection+"</dbConnection><key>LArRinjComplete</key>"+ChannelSelection,className="LArRinjComplete") - - -########################################################################## -# # -# Output # -# # -########################################################################## - -from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple -LArParams2Ntuple = LArParams2Ntuple( "LArParams2Ntuple" ) -LArParams2Ntuple.NtupleName = "PARAMS" -LArParams2Ntuple.KeyList = LArInputKey -LArParams2Ntuple.AllChannels2Ntuple = AllChannels2Ntuple - -topSequence+=LArParams2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -if os.path.exists(OutputRootFileDir+"/"+OutputRootFileName): - os.remove(OutputRootFileDir+"/"+OutputRootFileName) -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputRootFileDir+"/"+OutputRootFileName+"' OPT='NEW'" ] - -########################################################################### - - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - - -svcMgr.MessageSvc.OutputLevel = DEBUG -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - -StoreGateSvc = Service( "StoreGateSvc" ) -StoreGateSvc.OutputLevel=DEBUG -StoreGateSvc.Dump = True - diff --git a/LArCalorimeter/LArCalibTools/share/LArParamsFromStdNtuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArParamsFromStdNtuple2Pool_jobOptions.py deleted file mode 100755 index d90a41639f7876ece22478e3ed6ab5d3e91c7a50..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArParamsFromStdNtuple2Pool_jobOptions.py +++ /dev/null @@ -1,184 +0,0 @@ -# Last update: Caroline Collard 2009-03-31 - -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'POOLFileOUT' in dir(): - POOLFileOUT = "LArParams_0_HEC.pool.root" - -if not 'NTFileOUT' in dir(): - NTFileOUT = "LArParams_0_HEC_new.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'NTName' in dir(): - NTName = "PARAMS" - -if not 'NTFileIN' in dir(): - NTFileIN = "LArParams_0_HEC.root" - -if not 'OutputKey_Cali' in dir(): - OutputKey_Cali = "LArCaliPulseParams_RTM" - -if not 'OutputKey_Det' in dir(): - OutputKey_Det = "LArDetCellParams_RTM" - -if not 'OutputFolder_Cali' in dir(): - OutputFolder_Cali="/LAR/ElecCalibOfl/CaliPulseParams/RTM" - -if not 'OutputFolder_Det' in dir(): - OutputFolder_Det="/LAR/ElecCalibOfl/DetCellParams/RTM" - -if not 'OutputTag' in dir(): - OutputTag="comm-08" - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include( "LArCalibProcessing/LArCalib_MinimalSetup.py") - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=COMP200" - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000003.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000004.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - - - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### - -from LArCalibTools.LArCalibToolsConf import LArParamsFromStdNtuple -LArParamsFromTuple = LArParamsFromStdNtuple() -LArParamsFromTuple.NtupleName = NTName -LArParamsFromTuple.FileNames = [ NTFileIN ] -LArParamsFromTuple.StoreKey_Cali = OutputKey_Cali -LArParamsFromTuple.StoreKey_Det = OutputKey_Det -LArParamsFromTuple.GroupingType = GroupingType - -topSequence += LArParamsFromTuple - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple - LArParams2Ntuple = LArParams2Ntuple( "LArParams2Ntuple" ) - LArParams2Ntuple.NtupleName = "PARAMS" - LArParams2Ntuple.KeyList = ["LArCaliPulseParamsComplete", "LArDetCellParamsComplete"] - LArParams2Ntuple.AllChannels2Ntuple = False - LArParams2Ntuple.DBKeysList = ["LArCaliPulseParams_RTM","LArDetCellParams_RTM"] - - topSequence += LArParams2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+NTFileOUT+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - OutputObjectSpecCali = "LArCaliPulseParamsComplete#"+OutputKey_Cali+"#"+ OutputFolder_Cali - OutputObjectSpecTagCali = LArCalibFolderTag(OutputFolder_Cali,OutputTag) - - OutputObjectSpecDet = "LArDetCellParamsComplete#"+OutputKey_Det+"#"+ OutputFolder_Det - OutputObjectSpecTagDet = LArCalibFolderTag(OutputFolder_Det,OutputTag) - - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",POOLFileOUT, - [OutputObjectSpecCali],[OutputObjectSpecTagCali],True) - - theOutputConditionsAlg.Run1 = 0 - - theOutputConditionsAlg1 = OutputConditionsAlg("OutputConditionsAlg1",POOLFileOUT, - [OutputObjectSpecDet],[OutputObjectSpecTagDet],True) - - theOutputConditionsAlg1.Run1 = 0 - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArPedestal2Ntuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArPedestal2Ntuple_jobOptions.py deleted file mode 100755 index fddc73f8991884a99fd36b307cd281c1ee72f78b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArPedestal2Ntuple_jobOptions.py +++ /dev/null @@ -1,184 +0,0 @@ -########################################################################### -# -# LArCalib_Pedestal2Ntuple_jobOptions.py -# -# Last update: 21/11/2007 <Marco.Delmasytro@cern.ch> -# -# DO NOT MODIFY THIS JOBOPTIONS FILE, USE YOUR OWN TOPOPTIONS FILE! -# -########################################################################### - -if not 'ReadCOOL' in dir(): - ReadCOOL = True - -if not 'RunNumber' in dir(): - RunNumber = 0 - -if not 'ChannelSelection' in dir(): - ChannelSelection = " " - # example to read only Barrel C (Strips->Back) - #ChannelSelection = "<channelSelection>0,3:34</channelSelection>" - -if not 'PedestalFolder' in dir(): - PedestalFolder = "/LAR/ElecCalib/Pedestals/Pedestal" - -if not 'PedestalFolderTag' in dir(): - PedestalFolderTag = "-comm-05" - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "impl=cool;techno=oracle;schema=ATLAS_COOLONL_LAR;ATLAS_COOLPROD:COMP200:ATLAS_COOL_READER:" - -if not 'PoolFileDir' in dir(): - PoolFileDir = "/afs/cern.ch/user/l/larp3c/maxidisk/poolFiles/Barrel-22/29142_29143_29146" - -if not 'PoolFileName' in dir(): - PoolFileName = "LArPedestal_29142_EB-EMBA.pool.root" - -if not 'ContainerKey' in dir(): - #ContainerKey = "Pedestal" # deprecated, do not use! - ContainerKey = "LArPedestal" - -if not 'NtupleFileName' in dir(): - NtupleFileName = "LArPedestal2Ntuple.root" - -########################################################################### -# -# Global settings -# -########################################################################### - -if not "DetDescrVersion" in dir(): - DetDescrVersion = 'ATLAS-Comm-00-00-00' - -from AthenaCommon.GlobalFlags import GlobalFlags -GlobalFlags.DetGeo.set_commis() -GlobalFlags.Luminosity.set_zero() -GlobalFlags.DataSource.set_data() -GlobalFlags.InputFormat.set_bytestream() - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() # ON for geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -# Set up GeoModel (not really needed but crashes without) -include ("AtlasGeoModel/SetGeometryVersion.py") -include ("AtlasGeoModel/GeoModelInit.py") - -# Get identifier mapping -include("LArConditionsCommon/LArIdMap_comm_jobOptions.py") -include("LArIdCnv/LArIdCnv_joboptions.py") - -########################################################################### -# -# Algorithms sequencer -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -########################################################################### -# -# Read Pedestals from COOL(Oracle/SQLite) or POOL -# -########################################################################### - -from string import * - -def FolderTag(folder,tag): - return join(split(folder, '/'),'') + tag; - -def DBConnectionFile(sqlitefile): - return "impl=cool;techno=sqlite;schema="+sqlitefile+";X:XPTWK130"; - -if 'SQLiteFile' in dir(): - DBConnection = DBConnectionFile(SQLiteFile) -else: - DBConnection = DBConnectionCOOL - -if (ReadCOOL): - - include ("IOVDbSvc/IOVDbSvc_jobOptions.py") - - #if ( ReadCOOL and not 'SQLiteFile' in dir() ): - # PoolSvc = Service ( "PoolSvc" ) - # PoolSvc.ReadCatalog += [ "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml" ] - - PedestalTagSpec = FolderTag(PedestalFolder,PedestalFolderTag) - - IOVDbSvc.Folders += [ PedestalFolder+"<tag>"+PedestalTagSpec+"</tag>"+"<dbConnection>"+DBConnection+"</dbConnection>"+ChannelSelection ] - IOVDbSvc.OutputLevel = DEBUG - -else: - include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") - - EventPersistencySvc = Service( "EventPersistencySvc" ) - EventPersistencySvc.CnvServices += [ "AthenaPoolCnvSvc" ] - - ProxyProviderSvc = Service( "ProxyProviderSvc" ) - ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - CondProxyProvider = Service( "CondProxyProvider" ) - CondProxyProvider.InputCollections += [ PoolFileDir+"/"+PoolFileName ] - -########################################################################### -# -# Dump pedestal DB folder(s) to a ROOT ntuple -# -########################################################################### - -from LArCalibTools.LArCalibToolsConf import LArPedestals2Ntuple -LArPedestals2Ntuple = LArPedestals2Ntuple("LArPedestals2Ntuple") -LArPedestals2Ntuple.ContainerKey = ContainerKey -topSequence += LArPedestals2Ntuple - -########################################################################### -# -# Write out to ROOT file -# -########################################################################### - -theApp.Dlls += [ "RootHistCnv" ] -theApp.HistogramPersistency = "ROOT" -NTupleSvc = Service( "NTupleSvc" ) -NTupleSvc.Output = [ "FILE1 DATAFILE='"+NtupleFileName+"' OPT='NEW'" ] - -########################################################################### -# -# Use EventSelector to select IOV -# -########################################################################### - -if (ReadCOOL): - - EventSelector = Service( "EventSelector" ) - EventSelector.RunNumber = RunNumber - EventSelector.EventsPerRun = 1 - EventSelector.FirstEvent = 1 - EventSelector.InitialTimeStamp = 0 - EventSelector.TimeStampInterval = 1 - -########################################################################### - -theApp.EvtMax = 1 - -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = INFO - -########################################################################### - -StoreGateSvc = Service( "StoreGateSvc" ) -StoreGateSvc.Dump = True - -DetectorStore = Service( "DetectorStore" ) -DetectorStore.Dump = True - -ConditionStore = Service( "ConditionStore" ) -ConditionStore.Dump = True - -########################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/LArPhysCaliTDiffAlg.py b/LArCalorimeter/LArCalibTools/share/LArPhysCaliTDiffAlg.py deleted file mode 100644 index 85d386b65689ef6f4a666664df708cbe22ca7e5d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArPhysCaliTDiffAlg.py +++ /dev/null @@ -1,90 +0,0 @@ -if 'FebMG' not in dir(): - FebMG=False - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector -from string import split,join -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -from AthenaCommon.GlobalFlags import globalflags -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-GEO-20-00-01" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) - -svcMgr.IOVDbSvc.GlobalTag="LARCALIB-000-02" -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = 500000 - -dbname="<db>COOLOFL_LAR/COMP200</db>" - -conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<key>/LAR/BadChannels/BadChannels</key>"+dbname) -conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<key>/LAR/BadChannels/MissingFEBs</key>"+dbname) -conddb.addFolder("","/LAR/ElecCalibOfl/PhysCaliTdiff<key>input</key><tag>LARElecCalibOflPhysCaliTdiff-gaincorr-01</tag>"+dbname) - - -from LArCalibTools.LArCalibToolsConf import LArPhysCaliTDiffAlg -theLArPhysCaliTDiffAlg=LArPhysCaliTDiffAlg() -theLArPhysCaliTDiffAlg.OutputLevel=DEBUG -theLArPhysCaliTDiffAlg.AddFEBTempInfo=False -theLArPhysCaliTDiffAlg.InputContainer="input" -theLArPhysCaliTDiffAlg.FileName="FebOffsets_gain.txt" -theLArPhysCaliTDiffAlg.PerFebMGCorr=FebMG - -topSequence+=theLArPhysCaliTDiffAlg - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='timediff.root' OPT='NEW'" ] - -#svcMgr.DetectorStore.Dump=True -#svcMgr.MessageSvc.OutputLevel = DEBUG - -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/poolcond/PoolCat_comcond_castor.xml", - ] - - -#svcMgr.MessageSvc.debugLimit = 5000000 - - -OutputPoolFile="AdjustedTimeOffsets.pool.root" -outObject="LArPhysCaliTdiffComplete#LArPhysCaliTdiff#/LAR/ElecCalibOfl/PhysCaliTdiff" -outTag="LARElecCalibOflPhysCaliTdiff-gaincorr-02" - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputPoolFile, - [outObject],[outTag],True) - - -from AthenaCommon.AppMgr import ServiceMgr -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = True - - -svcMgr.IOVDbSvc.dbConnection="sqlite://;schema=tdiff_run2.db;dbname=CONDBR2" diff --git a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromDB2NTuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromDB2NTuple_jobOptions.py deleted file mode 100644 index 9081215093a171ff829c3d20f171597df4045744..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromDB2NTuple_jobOptions.py +++ /dev/null @@ -1,201 +0,0 @@ -import commands -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") -include("LArCalibProcessing/GetInputFiles.py") - -####################################################### -# Run properties -####################################################### - -if not 'RunNumber' in dir(): - RunNumber = 88237 - -if not ' GainList' in dir(): - GainList = ["HIGH", "MEDIUM", "LOW"] - -if not 'ChannelSelection' in dir(): - ChannelSelection="" - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = True - -if not 'StripsXtalkCorr' in dir(): - StripsXtalkCorr = True # Xtalk correction for strips - -if not 'Partition' in dir(): - Partition = "EB-EMB" - -if not 'LArInputWaveKey' in dir(): - LArInputWaveKey = "LArPhysWave" - -if not 'LArInputWaveTag' in dir(): - LArInputWaveTag = "" - -####################################################### -# Delay output name -####################################################### - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = RunNumber - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" - -if not 'DBConnectionWave' in dir(): - DBConnectionWave = DBConnectionCOOL - -## Output - -if not 'LArCalibFolderOutput' in dir(): - if StripsXtalkCorr: - LArCalibFolderOutput = LArCalib_Flags.LArPhysWaveFolderXtlk - else: - LArCalibFolderOutput = LArCalib_Flags.LArPhysWaveFolder -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = LArCalib_Flags.tagSuffix - -if not 'OutputPhysWaveRootFileDir' in dir(): - OutputPhysWaveRootFileDir = commands.getoutput("pwd") - -if not 'KeyOutput' in dir(): - KeyOutput = "LArPhysWave" # Key of LArPhysWaveContainer saved in Pool file - -if not 'BaseFileName' in dir(): - BaseFileName = "LArPhysWave" - -if StripsXtalkCorr : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") +"_StripsXtalkCorr" -else : - BaseFileName = BaseFileName+"_"+str(RunNumber)+"_"+Partition.replace("*","") - -if not 'OutputPhysWaveRootFileName' in dir(): - OutputPhysWaveRootFileName = BaseFileName+".root" - -if not 'OutputPhysWavePoolFileName' in dir(): - OutputPhysWavePoolFileName = BaseFileName+".pool.root" - -if not 'OutputObjectSpecPhysWave' in dir(): - OutputObjectSpecPhysWave = "LArPhysWaveContainer#"+KeyOutput+"#"+LArCalibFolderOutput - OutputTagSpecPhysWave = LArCalibFolderTag(LArCalibFolderOutput,LArCalibFolderOutputTag) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb - -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml"] - -## The reference is the Oracle DB -if not 'LArInputWaveFolder' in dir(): - if StripsXtalkCorr: - conddb.addFolder("",LArCalib_Flags.LArPhysWaveFolderXtlk+"<key>"+LArInputWaveKey+"</key><dbConnection>"+DBConnectionWave+"</dbConnection>"+ChannelSelection) - else: - conddb.addFolder("",LArCalib_Flags.LArPhysWaveFolder+"<key>"+LArInputWaveKey+"</key><dbConnection>"+DBConnectionWave+"</dbConnection>"+ChannelSelection) -else: - InputTagSpecPhysWave = LArCalibFolderTag(LArInputWaveFolder,LArInputWaveTag) - print ('Input tag: ',InputTagSpecPhysWave," in folder: ",LArInputWaveFolder) - conddb.addFolder("",LArInputWaveFolder+"<key>"+LArInputWaveKey+"</key><dbConnection>"+DBConnectionWave+"</dbConnection>"+ChannelSelection) - - -########################################################################## -# # -# Output # -# # -########################################################################## - -if (WriteNtuple): - from LArCalibTools.LArCalibToolsConf import LArPhysWaves2Ntuple - LArPhysWaves2Ntuple = LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" ) - LArPhysWaves2Ntuple.NtupleName = "PhysWave" - LArPhysWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArPhysWaves2Ntuple.KeyList = [ LArInputWaveKey ] - - topSequence+=LArPhysWaves2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName): - os.remove(OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputPhysWaveRootFileDir+"/"+OutputPhysWaveRootFileName+"' OPT='NEW'" ] - -########################################################################### - - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromNTuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromNTuple2Pool_jobOptions.py deleted file mode 100755 index aecb3e7bae0d7df6dbb823045ab43c1a88938688..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromNTuple2Pool_jobOptions.py +++ /dev/null @@ -1,150 +0,0 @@ -# Last update: Caroline Collard 2009-03-31 - -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'PhysWavePOOLFileOUT' in dir(): - PhysWavePOOLFileOUT = "/tmp/collard/PhysWaves_88240_EMBC.pool.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'PhysWaveNTFile' in dir(): - PhysWaveNTFile = "/tmp/collard/PhysWaves_88240_EMBC.root" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include( "LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200;user=ATLAS_COOL_READER" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000003.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000004.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - - - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### -theApp.Dlls += ["LArRawUtils"] -theApp.Dlls += ["LArTools"] -theApp.Dlls += ["LArCalibUtils"] -theApp.Dlls += ["LArCalibTools"] - -theApp.TopAlg += [ "LArPhysWaveFromTuple" ] -LArPhysWaveFromTuple = Algorithm( "LArPhysWaveFromTuple" ) -LArPhysWaveFromTuple.NPoints = 768 -LArPhysWaveFromTuple.SkipPoints = 4 -LArPhysWaveFromTuple.PrefixPoints = 25 -LArPhysWaveFromTuple.deltaT = (1./(40.08*1.e-3))/24. -LArPhysWaveFromTuple.LArWaveFlag = 20 -LArPhysWaveFromTuple.FileNames = [ - "/tmp/collard/fpm_pulse_mini88240.root" -] -LArPhysWaveFromTuple.StoreKey = "FROMTUPLE" - - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - from LArCalibTools.LArCalibToolsConf import LArPhysWaves2Ntuple - LArPhysWaves2Ntuple = LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" ) - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - # LArPhysWaves2Ntuple.ReadCaliWave = False - LArPhysWaves2Ntuple.KeyList = [ "FROMTUPLE" ] - LArPhysWaves2Ntuple.SaveDerivedInfo = False - LArPhysWaves2Ntuple.OutputLevel = VERBOSE - - topSequence += LArPhysWaves2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+PhysWaveNTFile+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - OutputObjectSpec = "LArPhysWaveContainer#FROMTUPLE" - #OutputObjectSpecTag = ??? - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",PhysWavePOOLFileOUT, - [OutputObjectSpec],[],False) - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromTuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromTuple_jobOptions.py deleted file mode 100644 index ec58a5d5a79940ca229d04251393c739f18ba904..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArPhysWaveFromTuple_jobOptions.py +++ /dev/null @@ -1,86 +0,0 @@ -########################################################################### -# -# LArPhysWaveFromTuple_jobOptions.py -# author: Alan Robinson <fbfree@interchange.ubc.ca> -# Converts formatted Root NTuple into a LArPhysWave ready for the -# conditions DB. Created for FCal wave shapes. -# -########################################################################### - -writePOOLfile = True -PhysWavePOOLFileOUT = "~/scratch0/poolFiles/FCalWave.pool.root" - -writeNTuple = True -PhysWaveNTFile = "~/scratch0/rootFiles/FCalCheck.root" - -InFile = "~/scratch0/FCalWave.root" - -NPoints = 189 -NSkipPoints = 23 # Shift peak to the 3rd sample if it is at 96ns - -########################################################################### -theApp.EvtMax = 1 - -ToolSvc = Service( "ToolSvc" ) - -include( "AthenaCommon/Atlas.UnixStandardJob.py" ) - -# the following works for release 13 but nor for rel 12 -#DetDescrVersion = "ATLAS-CSC-01-01-00" -#include( "RecExCond/RecExCommon_flags.py" ) -#DetFlags.detdescr.ID_setOff() -#DetFlags.detdescr.Tile_setOff() -#DetFlags.detdescr.Muon_setOff() -#include ("RecExCond/AllDet_detDescr.py") - -# use this for release 12 -include( "LArIdCnv/LArIdCnv_joboptions.py" ) -include( "CaloConditions/CaloConditions_jobOptions.py" ) - - -theApp.Dlls += ["LArRawUtils"] -theApp.Dlls += ["LArTools"] -theApp.Dlls += ["LArCalibUtils"] -theApp.Dlls += ["LArCalibTools"] - -theApp.TopAlg += [ "LArPhysWaveFromTuple" ] -LArPhysWaveFromTuple = Algorithm( "LArPhysWaveFromTuple" ) -LArPhysWaveFromTuple.NPoints = NPoints -LArPhysWaveFromTuple.SkipPoints = NSkipPoints -LArPhysWaveFromTuple.PrefixPoints = 0 -LArPhysWaveFromTuple.deltaT = 1. -LArPhysWaveFromTuple.LArWaveFlag = 3 # Code for "Master Waveform Normalized" -LArPhysWaveFromTuple.FileNames = [ InFile ] -LArPhysWaveFromTuple.StoreKey = "LArPhysWave" -LArPhysWaveFromTuple.GroupingType = "ExtendedFeedThrough" - - -AthenaEventLoopMgr=Service("AthenaEventLoopMgr") -AthenaEventLoopMgr.OutputLevel = INFO - -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = INFO -########################################################################### - -if ( writePOOLfile ) : - include( "AthenaPoolCnvSvc/AthenaPool_jobOptions.py" ) - include( "LArAthenaPool/LArAthenaPool_joboptions.py" ) - include( "LArCondAthenaPool/LArCondAthenaPool_joboptions.py" ) - - include("RegistrationServices/OutputConditionsAlg_jobOptions.py") - ToolSvc.ConditionsAlgStream.OutputFile = PhysWavePOOLFileOUT - - OutputConditionsAlg.ObjectList = [ "LArPhysWaveContainer#LArPhysWave#/LAR/ElecCalib/PhysWave" ] - -if ( writeNTuple ) : - theApp.Dlls += ["LArCalibTools"] - theApp.TopAlg += [ "LArWaves2Ntuple/LArPhysWaves2Ntuple"] - LArPhysWaves2Ntuple = Algorithm( "LArPhysWaves2Ntuple" ) - LArPhysWaves2Ntuple.NtupleName = "outfit" - LArPhysWaves2Ntuple.ReadCaliWave = False - LArPhysWaves2Ntuple.KeyList = [ "LArPhysWave" ] - theApp.Dlls += [ "RootHistCnv" ] - theApp.HistogramPersistency = "ROOT" - NTupleSvc = Service( "NTupleSvc" ) - NTupleSvc.Output = [ "FILE1 DATAFILE='"+PhysWaveNTFile+"' OPT='NEW'" ] - diff --git a/LArCalorimeter/LArCalibTools/share/LArRamp2Ntuple_POOL_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArRamp2Ntuple_POOL_jobOptions.py deleted file mode 100755 index 8ca41eb48cf3b0cca357e0620c8bca9255917803..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArRamp2Ntuple_POOL_jobOptions.py +++ /dev/null @@ -1,107 +0,0 @@ -############################################################## -# Job options read a LArRampComplete object from a POOL file # -# and dump it to an ROOT ntuple # -############################################################## - -import commands -Ramp2NtupleLog = logging.getLogger( "Ramp2NtupleLog" ) - -if not 'PoolFileNameList' in dir(): - Ramp2NtupleLog.fatal("Please setup the input POOL file list ('PoolFileNameList')!") - theApp.exit(-1) - -if not 'RootFileName' in dir(): - RootFileName = "LArRamp2Ntuple_POOL_root" - -if not 'SaveRawRamp' in dir(): - SaveRawRamp = True - -if not 'SaveAllSamples' in dir(): - SaveAllSamples = False - -if not 'RunNumber' in dir(): - RunNumber=165983 - -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200;" - #DBConnectionCOOL = "COOLONL_LAR/COMP200" - -## define the DB Global Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.IOVDbSvc.forceRunNumber=RunNumber - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -# Temperature folder -conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") - -if 'InputBadChannelSQLiteFile' in dir(): - from string import * - InputDBConnectionBadChannel = "sqlite://;schema="+InputBadChannelSQLiteFile+";dbname=COMP200" -else: - InputDBConnectionBadChannel = DBConnectionCOOL - - -if ('InputBadChannelSQLiteFile' in dir()) or ("OFL" in DBConnectionCOOL): - conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else: - conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -include("LArCalibProcessing/LArCalib_BadChanTool.py") - -from AthenaCommon.ConfigurableDb import getConfigurable -svcMgr += getConfigurable( "ProxyProviderSvc" )() -svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -svcMgr += getConfigurable( "CondProxyProvider" )() -svcMgr.CondProxyProvider.InputCollections += PoolFileNameList - - -from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple -LArRamps2Ntuple=LArRamps2Ntuple("LArRamps2Ntuple") -LArRamps2Ntuple.ContainerKey = ["HIGH","MEDIUM","LOW"] -LArRamps2Ntuple.RawRamp=SaveRawRamp -LArRamps2Ntuple.SaveAllSamples=SaveAllSamples - -topSequence+= LArRamps2Ntuple - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - - -AthenaEventLoopMgr=Service("AthenaEventLoopMgr") -AthenaEventLoopMgr.OutputLevel=ERROR - -theApp.EvtMax=1 -svcMgr.MessageSvc.OutputLevel=DEBUG - -#StoreGateSvc=Service("StoreGateSvc"); -#StoreGateSvc.dump=TRUE - -#DetStore=Service("DetectorStore"); -#DetStore.dump=TRUE diff --git a/LArCalorimeter/LArCalibTools/share/LArRampPool2Ntuple_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArRampPool2Ntuple_jobOptions.py deleted file mode 100755 index 7a032b7c17360722c9f67661552352ba202860d9..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArRampPool2Ntuple_jobOptions.py +++ /dev/null @@ -1,71 +0,0 @@ -############################################################## -# Job options read a LArRampComplete object from a POOL file # -# and dump it to an ROOT ntuple # -# modified for commissioning # -############################################################## - -PoolFileNameList = ["RampPoolFileToRead.pool.root"] - -from AthenaCommon.DetFlags import DetFlags -DetFlags.all_setOff() -DetFlags.em_setOn() - -from AthenaCommon.GlobalFlags import GlobalFlags -GlobalFlags.DataSource.set_data() -GlobalFlags.DetGeo.set_commis() -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -include( "AthenaCommon/Atlas.UnixStandardJob.py" ) - -# the Tile, LAr and Calo detector description package -DetDescrVersion = "ATLAS-CommNF-03-00-00" -include ("AtlasGeoModel/SetGeometryVersion.py") -include( "AtlasGeoModel/GeoModelInit.py" ) -include( "CaloIdCnv/CaloIdCnv_joboptions.py" ) -include( "TileIdCnv/TileIdCnv_jobOptions.py" ) -include( "LArDetDescr/LArDetDescr_joboptions.py" ) - -theApp.EvtMax = 1 - -CondProxyProvider = Service( "CondProxyProvider" ) -ProxyProviderSvc = Service( "ProxyProviderSvc" ) -ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -EventPersistencySvc = Service( "EventPersistencySvc" ) -EventPersistencySvc.CnvServices += [ "AthenaPoolCnvSvc" ] -CondProxyProvider.InputCollections += PoolFileNameList - - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - - -from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple -LArRamps2Ntuple=LArRamps2Ntuple("LArRamps2Ntuple") -LArRamps2Ntuple.ContainerKey = ["HIGH","MEDIUM","LOW"] -LArRamps2Ntuple.RawRamp=False -LArRamps2Ntuple.SaveAllSamples=False - -topSequence+= LArRamps2Ntuple - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='LArRampFromPool.root' OPT='NEW'" ] - - -AthenaEventLoopMgr=Service("AthenaEventLoopMgr") -AthenaEventLoopMgr.OutputLevel=ERROR - -theApp.EvtMax=1 -svcMgr.MessageSvc.OutputLevel=DEBUG - -#StoreGateSvc=Service("StoreGateSvc"); -#StoreGateSvc.dump=TRUE - -#DetStore=Service("DetectorStore"); -#DetStore.dump=TRUE diff --git a/LArCalorimeter/LArCalibTools/share/LArReadParamsFromFile_P3C_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArReadParamsFromFile_P3C_jobOptions.py deleted file mode 100644 index 45af92352d7719b7883deee22cc83514958b2c57..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArReadParamsFromFile_P3C_jobOptions.py +++ /dev/null @@ -1,250 +0,0 @@ -import commands -########################################################################### -# -# <Marco.Delmastro@cern.ch> -# -# Example jobOptions to put params in a poolfile+SQLite file -# -# Last update: 07/03/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -########################################################################### -# -# * Read parameters from ascii file into the appropriate conditions object -# -# FILE FORMAT: -# ----------- -# * Each record in the file refers to a channel, which can be identified using -# * either offline coordinates or online coordinates. -# -# *------------------------------------------------------------------------------------------ -# * File record format for OFFLINE coordinates (for readout channels only): -# * det subdet barrel_ec layer region eta phi parameters... (using offline channel id) -# * > det = 4 for LAr Calorimeter -# * > subdet = 1(EMB+EMEC) , 2(HEC) , 3(FCAL) -# * > barrel_ec = +/-1(barrel) , +/-2(emec outer wheel) , +/-3(emec inner wheel) -# * > region,eta,phi: see explanation in CaloIdentifier/LArEM_ID LArHEC_ID and LArFCAL_ID. -# * > parameters: values to be set for each channel -# *------------------------------------------------------------------------------------------ -# * File record format for ONLINE coordinates (for readout and calibration channels): -# * barrel_ec posneg feedthrough slot channel parameters... (using online channel id) -# * > barrel_ec = 0(barrel) , 1(em+had+fcal endcap) -# * > posneg = 0(neg.eta,C) , 1(pos.eta,A) -# * > feedthrough: see explanation in LArIdentifier/LArOnlineID.h -# * > parameters: values to be set for each channel -# *------------------------------------------------------------------------------------------ -# -########################################################################### -# -# define here the name of data structure to be read and saved to POOL. -# you need to set DataStructure (the name of the transient data class to fill) -# and DetStoreKey (the key to record/retrieve to/from detector store) -# -# Possible data structures are: -# -# - LArCaliPulseParamsComplete -# - LArDetCellParamsComplete -# - LArPhysCaliTdiffComplete -# - LArTdriftComplete -# - LArMphysOverMcalComplete -# - LArRinjComplete -# - LArTshaperComplete -# - LArEMEC_CphiComplete -# - LArEMEC_HValphaComplete -# - LArEMEC_HVbetaComplete -# - LArCableLengthComplete -# - LArCableAttenuationComplete -# - LArCaliPulseParamsVsCalib -# -# DetStoreKey must the same as DataStructure, without 'Complete' or 'VsCalib' -# -########################################################################### - - - -#DataStructure = "MyData" # used by LArReadParamsFromFile and LArParams2Ntuple -#DetStoreKey = "Key" # used to extract collections from det.store and save to POOL -#AsciiFileName = "MyAsciiFile" # input ascii file -#ChannelIdType = "OfflineID" # file uses 'offline coordinates' (readout only) -#ChannelIdType = "OnlineID" # file uses 'online coordinates' (readout channels) -#ChannelIdType = "OnlineCalibID" # file uses 'online coordinates' (calibration lines) - -# An example for 'Complete' conditions object: -#-------------------------------------------- - -if not 'DataStructure' in dir(): - DataStructure = "LArDetCellParamsComplete" - -if not 'DetStoreKey' in dir(): - DetStoreKey = "LArDetCellParams" - -if not 'AsciiFileName' in dir(): - AsciiFileName = "/users/carolina/rootFiles/pascal/lcmeas/new_detinner_Ccold.dat" - -if not 'ChannelIdType' in dir(): - ChannelIdType = "OfflineID" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=COMP200" - -# output POOL file: -if not 'WritePoolFile' in dir(): - WritePoolFile = True - -if not 'PoolFileName' in dir(): - PoolFileName = "LArParams.pool.root" - -if not 'GroupingType' in dir(): - GroupingType = "FeedThroughGrouping" - -if not 'WriteIOV' in dir(): - WriteIOV = True - -if not 'IOVBegin' in dir(): - IOVBegin = 0 - -if not 'IOVEnd' in dir(): - IOVEnd = 0 - -if not 'LArCalibFolderOutputTag' in dir(): - LArCalibFolderOutputTag = "-comm-08" - -if not 'OutputDB' in dir(): - OutputDB = "sqlite://;schema=myDB200.db;dbname=COMP200" - -if 'OutputSQLiteFile' in dir(): - print ('OutputSQLiteFile',OutputSQLiteFile ) - OutputDB = DBConnectionFile(OutputSQLiteFile) - print ('OutputDB',OutputDB ) - -if not 'ParamsFolderName' in dir(): - ParamsFolderName = "/LAR/ElecCalib/DetCellParams" - -if not 'WriteNT' in dir(): - WriteNT = True - -if not 'RootFileName' in dir(): - RootFileName = "LArParams.root" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -include("LArCalibProcessing/LArCalib_Flags.py") -# define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB - -######################################################################################################### -# -# Reading ASCII file... - -######################################################################################################### - -# Example import statement for templated algorithms -#from LArCalibTools.LArCalibToolsConf import LArReadParamsFromFile_LArTdriftComplete_ as LArReadFile - -ImportStatement = "from LArCalibTools.LArCalibToolsConf import LArReadParamsFromFile_"+DataStructure+"_ as LArReadFile" -exec(ImportStatement) - -LArReadFile = LArReadFile("LArReadFile") -LArReadFile.File = AsciiFileName -LArReadFile.ChannelIdType = ChannelIdType -LArReadFile.GroupingType = GroupingType -if 'CustomKey' in dir(): - LArReadFile.CustomKey = CustomKey - -topSequence += LArReadFile - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( WriteNT ): - - from LArCalibTools.LArCalibToolsConf import LArParams2Ntuple - LArParams2Ntuple = LArParams2Ntuple("LArParams2Ntuple") - LArParams2Ntuple.KeyList += [ DataStructure ] - # the following jOs act on ALL LAr readout channels! (~190000, also empty ones) and should be used for test only! - #LArParams2Ntuple.AllChannels2Ntuple = True # all channels to ntuple (also those with no params set) - #LArParams2Ntuple.DumpAllOnlineChannels = "dumpChannels.txt" # all channels identifiers to ascii file (for mapping tests) - if 'DetStoreSuffix' in dir(): - LArParams2Ntuple.DetStoreSuffix = DetStoreSuffix - - topSequence += LArParams2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -from string import * -def LArCalibFolderTag(folder,tag=LArCalibFolderOutputTag): - return join(split(folder, '/'),'') + tag - -if ( WritePoolFile ): - - OutputObjectSpec = DataStructure + "#" + DetStoreKey + "#" + ParamsFolderName - OutputObjectSpecTag = LArCalibFolderTag(ParamsFolderName, LArCalibFolderOutputTag) - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",PoolFileName, - [OutputObjectSpec],[OutputObjectSpecTag],WriteIOV) - theOutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - theOutputConditionsAlg.Run2 = IOVEnd - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from AthenaCommon.AppMgr import ServiceMgr - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArSFcalFromFcalFromStdNtuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArSFcalFromFcalFromStdNtuple2Pool_jobOptions.py deleted file mode 100755 index 21a45e4d323dc919c18f15f7e5d75b9a08157244..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArSFcalFromFcalFromStdNtuple2Pool_jobOptions.py +++ /dev/null @@ -1,289 +0,0 @@ -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'POOLFileOUT' in dir(): - POOLFileOUT = "LArMC_new.pool.root" - -if not 'NTFileIN' in dir(): - NTFileIN = "LArMC.root" - -if not 'NTFileOUT' in dir(): - NTFileOUT = "LArMC_new.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'OutputTag' in dir(): - OutputTag="-test" - -if not 'GroupingType' in dir(): - GroupingType = "SingleGroup" - -if not 'DBTag' in dir(): - DBTag = LArCalib_Flags.globalFlagDB - -if not 'GeomTag' in dir(): - GeomTag = "ATLAS-GEO-21-00-00" - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=OFLP200" - -if 'DoRamp' not in dir(): - DoRamp=True - -if 'DoADC2MEV' not in dir(): - DoADC2MEV=True - -if 'DoNoise' not in dir(): - DoNoise=True - -if 'DoFsampl' not in dir(): - DoFsampl=True - -if 'DoMinbias' not in dir(): - DoMinbias=True - -if 'DoHvscale' not in dir(): - DoHvscale=True - -if 'DoAcorr' not in dir(): - DoAcorr=True - -if 'DoShape' not in dir(): - DoShape=True - -## Fixes.... -if 'FixFsampl' not in dir(): - FixFsampl=False - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -# this include doesn't work for MC case -## include( "LArCalibProcessing/LArCalib_MinimalSetup.py") -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('geant4') -globalflags.InputFormat.set_Value_and_Lock('pool') - - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = GeomTag - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() #Switched off to avoid geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" ) - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = DBTag -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### - -from LArCalibTools.LArCalibToolsConf import LArSFcalFromFcalFromStdNtuple -LArSFcalFromFcalFromTuple = LArSFcalFromFcalFromStdNtuple() -LArSFcalFromFcalFromTuple.FileName = NTFileIN -LArSFcalFromFcalFromTuple.GroupingType = GroupingType -LArSFcalFromFcalFromTuple.DoRamp = DoRamp -LArSFcalFromFcalFromTuple.DoADC2MEV = DoADC2MEV -LArSFcalFromFcalFromTuple.DoNoise = DoNoise -LArSFcalFromFcalFromTuple.DoFsampl = DoFsampl -LArSFcalFromFcalFromTuple.DoHvscale = DoHvscale -LArSFcalFromFcalFromTuple.DoMinbias = DoMinbias -LArSFcalFromFcalFromTuple.DoAcorr = DoAcorr -LArSFcalFromFcalFromTuple.DoShape = DoShape -LArSFcalFromFcalFromTuple.FixFsampl = FixFsampl - - -topSequence += LArSFcalFromFcalFromTuple - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - if DoRamp: - from LArCalibTools.LArCalibToolsConf import LArRamps2Ntuple - LArRamps2Ntuple = LArRamps2Ntuple( "LArRamps2Ntuple" ) - LArRamps2Ntuple.ContainerKey = ["LArRamp"] - LArRamps2Ntuple.AddFEBTempInfo = False - LArRamps2Ntuple.AddBadChannelInfo = False - topSequence += LArRamps2Ntuple - - if DoADC2MEV: - from LArCalibTools.LArCalibToolsConf import LAruA2MeV2Ntuple - LAruA2MeV2Ntuple=LAruA2MeV2Ntuple("LAruA2MeV2Ntuple") - LAruA2MeV2Ntuple.AddFEBTempInfo=False - topSequence+=LAruA2MeV2Ntuple - - - if DoNoise: - from LArCalibTools.LArCalibToolsConf import LArNoise2Ntuple - LArNoise2Ntuple=LArNoise2Ntuple("LArNoise2Ntuple") - LArNoise2Ntuple.AddFEBTempInfo=False - topSequence+=LArNoise2Ntuple - - if DoFsampl: - from LArCalibTools.LArCalibToolsConf import LArfSampl2Ntuple - LArfSampl2Ntuple=LArfSampl2Ntuple("LArfSampl2Ntuple") - LArfSampl2Ntuple.AddFEBTempInfo=False - topSequence+=LArfSampl2Ntuple - - if DoHvscale: - from LArCalibTools.LArCalibToolsConf import LArHVScaleCorr2Ntuple - theLArHVScaleCorr2Ntuple = LArHVScaleCorr2Ntuple("LArHVScaleCorr2Ntuple") - theLArHVScaleCorr2Ntuple.AddFEBTempInfo = False - topSequence += theLArHVScaleCorr2Ntuple - - if DoMinbias: - from LArCalibTools.LArCalibToolsConf import LArMinBias2Ntuple - LArMinBias2Ntuple=LArMinBias2Ntuple("LArMinBias2Ntuple") - LArMinBias2Ntuple.AddFEBTempInfo=False - topSequence+=LArMinBias2Ntuple - - if DoAcorr: - from LArCalibTools.LArCalibToolsConf import LArAutoCorr2Ntuple - LArAutoCorr2Ntuple=LArAutoCorr2Ntuple("LArAutoCorr2Ntuple") - LArAutoCorr2Ntuple.AddFEBTempInfo=False - LArAutoCorr2Ntuple.ContainerKey="LArAutoCorr" - topSequence+=LArAutoCorr2Ntuple - - if DoShape: - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") - LArShape2Ntuple.ContainerKey = "LArShape" - LArShape2Ntuple.AddFEBTempInfo=False - topSequence+=LArShape2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+NTFileOUT+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - OutputObjectSpec = [] - OutputObjectSpecTag = [] - - if DoRamp: - OutputObjectSpec += ["LArRampMC#LArRamp#/LAR/ElecCalibMC/Ramp"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/Ramp",OutputTag)] - - if DoADC2MEV: - OutputObjectSpec += ["LArDAC2uAMC#LArDAC2uA#/LAR/ElecCalibMC/DAC2uA", "LAruA2MeVMC#LAruA2MeV#/LAR/ElecCalibMC/uA2MeV"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/DAC2uA",OutputTag), LArCalibFolderTag("/LAR/ElecCalibMC/uA2MeV",OutputTag)] - - if DoNoise: - OutputObjectSpec += ["LArNoiseMC#LArNoise#/LAR/ElecCalibMC/Noise"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/Noise",OutputTag)] - - if DoFsampl: - OutputObjectSpec += ["LArfSamplMC#LArfSampl#/LAR/ElecCalibMC/fSampl"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/fSampl",OutputTag)] - - if DoHvscale: - OutputObjectSpec += ["LArHVScaleCorrComplete#LArHVScaleCorr#/LAR/ElecCalibMC/HVScaleCorr"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/HVScaleCorr",OutputTag)] - - if DoMinbias: - OutputObjectSpec += ["LArMinBiasMC#LArMinBias#/LAR/ElecCalibMC/MinBias", "LArMinBiasAverageMC#LArMinBiasAverage#/LAR/ElecCalibMC/MinBiasAverage"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/MinBias",OutputTag), LArCalibFolderTag("/LAR/ElecCalibMC/MinBiasAverage",OutputTag)] - - if DoAcorr: - OutputObjectSpec += ["LArAutoCorrMC#LArAutoCorr#/LAR/ElecCalibMC/AutoCorr"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/AutoCorr",OutputTag)] - - if DoShape: - OutputObjectSpec += ["LArShape32MC#LArShape#/LAR/ElecCalibMC/Shape"] - OutputObjectSpecTag += [LArCalibFolderTag("/LAR/ElecCalibMC/Shape",OutputTag)] - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",POOLFileOUT, - OutputObjectSpec,OutputObjectSpecTag,True) - - theOutputConditionsAlg.Run1 = 0 - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArShape2Ntuple_POOL_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArShape2Ntuple_POOL_jobOptions.py deleted file mode 100755 index c92cccba0823613cd0e8b8fe0b83ebdc23b7c87d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArShape2Ntuple_POOL_jobOptions.py +++ /dev/null @@ -1,84 +0,0 @@ -########################################################################### -# -# LArShape2Ntuple_POOL_jobOptions.py dumps the contet of a Wave POOL files -# to ROOT TTree. -# -# Author: Marco Delmastro <Marco.Delmastro@cern.ch> -# -# Last update: 2008-06-18 -# -########################################################################### - -import commands - -Shape2NtupleLog = logging.getLogger( "Shape2NtupleLog" ) - -if not 'PoolFileName' in dir(): - Shape2NtupleLog.fatal("Please setup the input POOL file ('PoolFileName')!") - theApp.exit(-1) - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if not 'RootFileName' in dir(): - RootFileName = "LArShape2Ntuple_POOL.root" - -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -########################################################################### - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from AthenaCommon.ConfigurableDb import getConfigurable -svcMgr += getConfigurable( "ProxyProviderSvc" )() -svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -svcMgr += getConfigurable( "CondProxyProvider" )() -svcMgr.CondProxyProvider.InputCollections += [ PoolFileName ] - -from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - -LArShape2Ntuple = LArShape2Ntuple("LArShape2Ntuple") -LArShape2Ntuple.ContainerKey = ShapeKey - -topSequence += LArShape2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -#svcMgr.MessageSvc.OutputLevel = INFO -#svcMgr.MessageSvc.defaultLimit = 10000 -#svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -#svcMgr += CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -########################################################################### - -#from AthenaCommon.AppMgr import theAuditorSvc -#from AthenaCommon.ConfigurableDb import getConfigurable -#theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -#theAuditorSvc += getConfigurable("ChronoAuditor")() -#theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/LArShapeFromStdNtuple2Pool_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArShapeFromStdNtuple2Pool_jobOptions.py deleted file mode 100755 index 5bdae31a7b80a866bc3341f658a17eaf75df0046..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArShapeFromStdNtuple2Pool_jobOptions.py +++ /dev/null @@ -1,222 +0,0 @@ -# Last update: Caroline Collard 2009-03-31 - -import commands -########################################################################### -include("LArCalibProcessing/LArCalib_Flags.py") - -# output POOL file: -if not 'writePOOLfile' in dir(): - writePOOLfile = True - -if not 'ShapePOOLFileOUT' in dir(): - ShapePOOLFileOUT = "LArShape_new.pool.root" - -if not 'ShapeNTFileOUT' in dir(): - ShapeNTFileOUT = "LArShape_new.root" - -if not 'writeNTuple' in dir(): - writeNTuple = True - -if not 'ShapeNTFileIN' in dir(): - ShapeNTFileIN = "LArShape.root" - -if not 'OutputKey' in dir(): - OutputKey = "LArShape" - -if not 'OutputFolder' in dir(): - OutputFolder="/LAR/ElecCalibMC/Shape" - -if not 'OutputTag' in dir(): - OutputTag="-test" - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'IsComplete' in dir(): - IsComplete = False - -if not 'DBTag' in dir(): - DBTag = LArCalib_Flags.globalFlagDB - -if not 'GeomTag' in dir(): - GeomTag = "ATLAS-GEO-21-00-00" - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - if IsComplete: - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=COMP200" - else: - OutputDB = "sqlite://;schema="+OutputSQLiteFile+";dbname=OFLP200" - -########################################################################### -# -# Global settings -# -########################################################################### - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -# this include doesn't work for MC case -## include( "LArCalibProcessing/LArCalib_MinimalSetup.py") -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -if IsComplete: - globalflags.DataSource.set_Value_and_Lock('data') - globalflags.InputFormat.set_Value_and_Lock('bytestream') - globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') -else: - globalflags.DataSource.set_Value_and_Lock('geant4') - globalflags.InputFormat.set_Value_and_Lock('pool') - - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = GeomTag - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() #Switched off to avoid geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -if IsComplete: - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -else: - include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" ) - -########################################################################### -# # -# Input conditions data (CaliWave) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = DBTag -svcMgr.IOVDbSvc.DBInstance="" - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200" -conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:/afs/cern.ch/user/l/larcalib/w0/stableConds/PoolCat_stable.xml", - "prfile:poolcond/PoolCat_oflcond.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_diskbuffer_afs.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_cond08_data.000001.lar.COND_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000003.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000004.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000005.lar_conditions.recon.pool.v0000_castor.xml", - "xmlcatalog_file:/afs/cern.ch/atlas/conditions/poolcond/catalogue/fragments/PoolCat_comcond.000006.lar_conditions.recon.pool.v0000_castor.xml"] - - -from LArRecUtils.LArMCSymCondAlg import LArMCSymCondAlgDefault -LArMCSymCondAlgDefault() - - - -######################################################################################################### -# -# Reading Ntuple ... -######################################################################################################### - -from LArCalibTools.LArCalibToolsConf import LArShapeFromStdNtuple -LArShapeFromTuple = LArShapeFromStdNtuple() -LArShapeFromTuple.SkipPoints = 0 -LArShapeFromTuple.PrefixPoints = 0 -LArShapeFromTuple.FileNames = [ ShapeNTFileIN ] -LArShapeFromTuple.StoreKey = OutputKey -LArShapeFromTuple.GroupingType = GroupingType -LArShapeFromTuple.isComplete = IsComplete - -topSequence += LArShapeFromTuple - -########################################################################### -# -# Writing to Ntuple... -# -########################################################################### - -if ( writeNTuple ): - - from LArCalibTools.LArCalibToolsConf import LArShape2Ntuple - LArShape2Ntuple = LArShape2Ntuple( "LArShape2Ntuple" ) - LArShape2Ntuple.NtupleName = "SHAPE" - # LArShape2Ntuple.ReadCaliWave = False - LArShape2Ntuple.ContainerKey = OutputKey - LArShape2Ntuple.isComplete = IsComplete - LArShape2Ntuple.AddFEBTempInfo = False - LArShape2Ntuple.AddBadChannelInfo = False - - topSequence += LArShape2Ntuple - - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+ShapeNTFileOUT+"' OPT='NEW'" ] - - -########################################################################### -# -# writing to POOL file... -# -########################################################################### - -if ( writePOOLfile ): - - if ( IsComplete ): - OutputObjectSpecShape = "LArShapeComplete#"+OutputKey+"#"+ OutputFolder - else: - OutputObjectSpecShape = "LArShape32MC#"+OutputKey+"#"+ OutputFolder - OutputObjectSpecTagShape = LArCalibFolderTag(OutputFolder,OutputTag) - - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",ShapePOOLFileOUT, - [OutputObjectSpecShape],[OutputObjectSpecTagShape],True) - - theOutputConditionsAlg.Run1 = 0 - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.RecreateFolders = True - -########################################################################## - -theApp.EvtMax = 2 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = INFO -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = INFO) - -########################################################################### - diff --git a/LArCalorimeter/LArCalibTools/share/LArWaves2Ntuple_POOL_jobOptions.py b/LArCalorimeter/LArCalibTools/share/LArWaves2Ntuple_POOL_jobOptions.py deleted file mode 100755 index 3abba2622a70f14d5ade12d14da25083791d6127..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/LArWaves2Ntuple_POOL_jobOptions.py +++ /dev/null @@ -1,143 +0,0 @@ -########################################################################### -# -# LArWave2Ntuple_POOL_jobOptions.py dumps the contet of a Wave POOL files -# to ROOT TTree. Works with LArCaliWaveContainer and LAPhysWaveContainer. -# -# Author: Marco Delmastro <Marco.Delmastro@cern.ch> -# -# Last update: 2008-04-19 -# -########################################################################### - -import commands - -Waves2NtupleLog = logging.getLogger( "Waves2NtupleLog" ) - -if not 'PoolFileName' in dir(): - Waves2NtupleLog.fatal("Please setup the input POOL file ('PoolFileName')!") - theApp.exit(-1) - -if not 'WaveType' in dir(): - WaveType = "Cali" # (Cali, Phys) - -if not 'ContainerKey' in dir(): - if (WaveType == "Cali"): - ContainerKey = "LArCaliWave" - if (WaveType == "Phys"): - ContainerKey = "LArPhysWave" - -if not 'DACSaturSkip' in dir(): - DACSaturSkip = False - -if not 'SaveDerivedInfo' in dir(): - SaveDerivedInfo = False - -if not 'SaveJitter' in dir(): - SaveJitter = False - -if not 'RootFileName' in dir(): - RootFileName = "LArWaves2Ntuple_POOL.root" - -if not 'RunNumber' in dir(): - RunNumber = 165983 - -########################################################################### - -#include("LArConditionsCommon/LArMinimalSetup.py") - -include("LArCalibProcessing/LArCalib_Flags.py") - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=COMP200;" - #DBConnectionCOOL = "COOLONL_LAR/COMP200" - -## define the DB Global Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.IOVDbSvc.forceRunNumber=RunNumber - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -# Temperature folder -conddb.addFolder("DCS_OFL","/LAR/DCS/FEBTEMP") - -if "ONL" in DBConnectionCOOL: - conddb.addFolder("","/LAR/BadChannels/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannels/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") -else: - conddb.addFolder("","/LAR/BadChannelsOfl/BadChannels<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<dbConnection>"+DBConnectionCOOL+"</dbConnection>") - include("LArCalibProcessing/LArCalib_BadChanTool.py") - -from AthenaCommon.ConfigurableDb import getConfigurable -svcMgr += getConfigurable( "ProxyProviderSvc" )() -svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] -svcMgr += getConfigurable( "CondProxyProvider" )() -svcMgr.CondProxyProvider.InputCollections += [ PoolFileName ] - -if ( WaveType == "Cali" ): - - from LArCalibTools.LArCalibToolsConf import LArCaliWaves2Ntuple - LArCaliWaves2Ntuple = LArCaliWaves2Ntuple( "LArCaliWaves2Ntuple" ) - LArCaliWaves2Ntuple.NtupleName = "CALIWAVE" - LArCaliWaves2Ntuple.KeyList = [ ContainerKey ] - LArCaliWaves2Ntuple.DACSaturSkip = DACSaturSkip - LArCaliWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArCaliWaves2Ntuple.SaveJitter = SaveJitter - LArCaliWaves2Ntuple.OutputLevel = INFO - - topSequence += LArCaliWaves2Ntuple - - -if ( WaveType == "Phys" ): - from LArCalibTools.LArCalibToolsConf import LArPhysWaves2Ntuple - LArPhysWaves2Ntuple = LArPhysWaves2Ntuple( "LArPhysWaves2Ntuple" ) - LArPhysWaves2Ntuple.NtupleName = "PHYSWAVE" - LArPhysWaves2Ntuple.KeyList = [ ContainerKey ] - LArPhysWaves2Ntuple.SaveDerivedInfo = SaveDerivedInfo - LArPhysWaves2Ntuple.OutputLevel = INFO - - topSequence += LArPhysWaves2Ntuple - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+RootFileName+"' OPT='NEW'" ] - -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -#svcMgr.MessageSvc.OutputLevel = INFO -#svcMgr.MessageSvc.defaultLimit = 10000 -#svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -#svcMgr += CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -########################################################################### - -#from AthenaCommon.AppMgr import theAuditorSvc -#from AthenaCommon.ConfigurableDb import getConfigurable -#theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -#theAuditorSvc += getConfigurable("ChronoAuditor")() -#theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/TestCaloCellGroup.py b/LArCalorimeter/LArCalibTools/share/TestCaloCellGroup.py deleted file mode 100644 index ee5147d0949d9ad9805e6e33a3c6f97ed7343fb9..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/TestCaloCellGroup.py +++ /dev/null @@ -1,60 +0,0 @@ -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -from AthenaCommon.GlobalFlags import GlobalFlags -GlobalFlags.DetGeo.set_commis() -GlobalFlags.Luminosity.set_zero() -GlobalFlags.DataSource.set_data() -GlobalFlags.InputFormat.set_bytestream() - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-Comm-00-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping (needed by LArConditionsContainer) -svcMgr.IOVDbSvc.GlobalTag='COMCOND-006-01' -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -theApp.EvtMax = 1 -svcMgr.EventSelector.RunNumber = 1 - - -from LArCalibTools.LArCalibToolsConf import CaloCellGroup2Ntuple -theCaloCellGroups2Ntuple=CaloCellGroup2Ntuple() -theCaloCellGroups2Ntuple.AddBadChannelInfo=False -theCaloCellGroups2Ntuple.group=["0, 21.1", - "[EMB,EMECIW,EMECOW/C/*/*/*/*] 1, 22.2", # - "[FCAL/A/*/*/*/*] 2, 24.4", #1 - "[EMB/C/1/0/0-32/*] 3, 32.2", #2 - "[EMECIW/*/1/0/3/4] 4, 42.2", #3 - ] -topSequence+=theCaloCellGroups2Ntuple - - -theApp.HistogramPersistency = "ROOT" -from GaudiSvc.GaudiSvcConf import NTupleSvc -svcMgr += NTupleSvc() -svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='CellGroup.root' OPT='NEW'" ] - - -#from GaudiSvc.GaudiSvcConf import THistSvc -#svcMgr+=THistSvc() -#svcMgr.THistSvc.Output = [ "FILE1 DATAFILE='CellGroup.root' OPT='RECREATE'" ] - -#svcMgr.DetectorStore.Dump=True -#svcMgr.MessageSvc.OutputLevel = DEBUG - diff --git a/LArCalorimeter/LArCalibTools/share/TopOptsExample_ReadParamsFromFile.py b/LArCalorimeter/LArCalibTools/share/TopOptsExample_ReadParamsFromFile.py deleted file mode 100644 index d54f1125f73fe79c17cd0030fbaea183d8125054..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/TopOptsExample_ReadParamsFromFile.py +++ /dev/null @@ -1,47 +0,0 @@ -DataStructure = "LArCaliPulseParamsVsCalib" -DetStoreKey = "LArCaliPulseParams" -ChannelIdType = "OnlineCalibID" - -AsciiFileName = "/afs/cern.ch/user/m/mdelmast/scratch0/Athena/p3c/params/AllBoards.dat" - -PoolFileName = "LArCaliPulseParamsVsCalib_AllBoards.pool.root" -RootFileName = "LArCaliPulseParamsVsCalib_AllBoards.root" - -IOVBegin = 0 - -ParamsFolderName = "/LAR/ElecCalib/CaliPulseParams/Measured" -#ParamsFolderName = "/LAR/ElecCalib/CaliPulseParams/MeasuredCorrected" - -OutputSQLiteFile = "LArCaliPulseParamsVsCalib_AllBoards.db" - -include("LArCalibTools/LArReadParamsFromFile_jobOptions.py") - -LArReadFile.OutputLevel = VERBOSE - -#------------ -# Message -#------------ -#svcMgr.MessageSvc.defaultLimit = 9999999 # all messages -#svcMgr.MessageSvc.OutputLevel = VERBOSE - -#from StoreGate.StoreGateConf import StoreGateSvc -#---------------- -# Dump StoreGate -#---------------- -#sgStore = StoreGateSvc("StoreGateSvc") -#sgStore.Dump = True -#sgStore.OutputLevel = DEBUG - -#-------------------- -# Dump DetectorStore -#-------------------- -#dtStore = StoreGateSvc("DetectorStore") -#dtStore.Dump = True -#dtStore.OutputLevel = DEBUG - -#---------------------- -# Dump ConditionStore -#---------------------- -#cdStore = StoreGateSvc("ConditionStore") -#cdStore.Dump = True -#cdStore.OutputLevel = DEBUG diff --git a/LArCalorimeter/LArCalibTools/share/TopOptsExample_Shape2Ntuple_POOL.py b/LArCalorimeter/LArCalibTools/share/TopOptsExample_Shape2Ntuple_POOL.py deleted file mode 100644 index 2a38b9411458d2a56cb43fac99dca1b725e4839f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/TopOptsExample_Shape2Ntuple_POOL.py +++ /dev/null @@ -1,26 +0,0 @@ -##################################################################### -# -# Dont' forget to insert your POOL file in the local XML catalog! -# -##################################################################### - -PoolFileDir = "/tmp" -PoolFileName = PoolFileDir+"/"+"LArShapePhys_29142_EB-EMBA_5samples.pool.root" - -# Output file location and name - -RootFileName = "/tmp/LArShape2Ntuple_POOL.root" - -##################################################################### - -include("LArCalibTools/LArShape2Ntuple_POOL_jobOptions.py") - -##################################################################### - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -##################################################################### diff --git a/LArCalorimeter/LArCalibTools/share/TopOptsExample_Waves2Ntuple_POOL.py b/LArCalorimeter/LArCalibTools/share/TopOptsExample_Waves2Ntuple_POOL.py deleted file mode 100644 index fe255d244b6be0664240c71dcbe318b85d82338d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCalibTools/share/TopOptsExample_Waves2Ntuple_POOL.py +++ /dev/null @@ -1,31 +0,0 @@ -##################################################################### -# -# Dont' forget to insert your POOL file in the local XML catalog! -# -##################################################################### - -PoolFileDir = "/afs/cern.ch/user/l/larcalib/w0/data/WorkingDirectory/0088263_0088265_0088267_Barrel-EMB_HIGH_26_15.0.0_1/poolFiles" -PoolFileName = PoolFileDir+"/"+"LArCaliWave_0088265_EB-EMBA_StripsXtalkCorr.pool.root" -WaveType = "Cali" - -## swicth these to 'True' if you want the Wave derived quantities -## (Baseline, TmaxAmp, MaxAmp, Width, T0, PosLobe) and Jitter info in the TTree -SaveDerivedInfo = True -SaveJitter = True # works only with CaliWave - -## Output file location and name -RootFileName = "/tmp/LArWaves2Ntuple_POOL.root" - -##################################################################### - -include("LArCalibTools/LArWaves2Ntuple_POOL_jobOptions.py") - -##################################################################### - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -##################################################################### diff --git a/LArCalorimeter/LArDetDescr/CMakeLists.txt b/LArCalorimeter/LArDetDescr/CMakeLists.txt index e8aeab4b07bf01d264337ac3b66a311444ac79e1..2f88d81da1ed1bf50f63d0b1fabad9ea0c1c5f12 100644 --- a/LArCalorimeter/LArDetDescr/CMakeLists.txt +++ b/LArCalorimeter/LArDetDescr/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name. atlas_subdir( LArDetDescr ) @@ -14,5 +14,3 @@ atlas_add_component( LArDetDescr CaloDetDescrLib CaloGeoHelpers RDBAccessSvcLib StoreGateLib CaloIdentifier GeoModelInterfaces GeoModelUtilities GeoPrimitives ) -# Install files from the package. -atlas_install_joboptions( share/*.py ) diff --git a/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py b/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py deleted file mode 100755 index 011089c79ac6ebb27fd8cca99d746319d6df914a..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArDetDescr/share/LArDetDescr_joboptions.py +++ /dev/null @@ -1,24 +0,0 @@ -printfunc ("now initializing the LAr readout geometry : standard Atlas flavour") - -# ------------------------------------------------ -# FIXME : setup online identifier & mapping -# ( should be done somewhere else ) -# ------------------------------------------------ -include( "CaloConditions/CaloConditions_jobOptions.py" ) - -from AthenaCommon.GlobalFlags import globalflags -from RecExConfig.RecFlags import rec - -if not rec.doAODMerging(): - if globalflags.DataSource() == 'geant4' : - include( "LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py" ) - include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" ) - elif globalflags.DataSource() == 'data' : - include( "LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py" ) - include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - else : - raise RunTimeError (" from LArDetDescr_joboptions.py: DataSource not supported") - -# must be included once only : -include.block ("LArDetDescr/LArDetDescr_joboptions.py") - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt b/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt index 45f6054b1146c212d01eaf954bd9377a086c3449..203c6105ec8659efb5d11ba9007b33d0e5e6a0c4 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt +++ b/LArCalorimeter/LArExample/LArCalibProcessing/CMakeLists.txt @@ -8,5 +8,4 @@ find_package( cx_Oracle ) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/LArCalib_*.py share/GetInputFiles.py share/LArHVCool2Ntuple_jobOptions.py share/LArTimePhysPrediction_jobOptions.py share/UseLArExtendedSubDetGrouping.py ) atlas_install_scripts( share/LAr_updateHVcalib_online.sh share/LAr_updateHVcalibNoise.sh share/LArNewCalib_*.py share/LArSC2NtupleDumper.py share/LArDigits2NtupleDumper.py share/LArNoiseCorrelationMon.py python/LArCalib_postProcessingConfig.py python/LArCalib_ToCoolInlineConfig.py ) diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/GetInputFiles.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/GetInputFiles.py deleted file mode 100644 index 28d6901eb512a34486cffdb0b9fd6b5cc9a509c9..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/GetInputFiles.py +++ /dev/null @@ -1,4 +0,0 @@ -#backward compatiblity with 'include' ... - -from LArCalibProcessing.GetInputFiles import GetInputFiles, GetInputFilesFromTokens - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CalibrationPatterns.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CalibrationPatterns.py deleted file mode 100644 index 03c803ba0d22604c59f8c8d2ff6efc6360f90993..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_CalibrationPatterns.py +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################################# -# Fabien.Tarrade@cern.ch # -# # -# this is a OLD jobOptions which can maybe work but only for the barrel # -# can be used as a skeleton if needed but # -# need to be updated for the barrel and the patterns for EMEC, HEC and FCAL need to be add # -# # -############################################################################################# - -from LArCalibUtils.LArCalibUtilsConf import LArCalibDigitMaker -LArCalibDigitMaker = LArCalibDigitMaker("LArCalibDigitMaker") -LArCalibDigitMaker.KeyList += GainList -LArCalibDigitMaker.KeyList += ["FREE"] -LArCalibDigitMaker.DontRun = False - -from LArROD.LArRODConf import LArCalibDigitsAccumulator -LArCalibDigitsAccumulator = LArCalibDigitsAccumulator("LArCalibDigitsAccumulator") -LArCalibDigitsAccumulator.KeyList += GainList - -# DelayScale example: in CTB 2004 240 TTCrx steps in a sampling period -LArCalibDigitsAccumulator.DelayScale = (25./240.)*ns - -LArCalibDigitMaker.BoardIDs += [ 1007091712, 1007616000, 1008140288, 1008664576, 1009188864, 1009713152, 1010237440, 1010761728, 1011286016, 1011810304, 1012334592, 1012858880, 1013383168, 1013907456, - 1014431744, 1014956032, 1015480320, 1016004608, 1016528896, 1017053184, 1017577472, 1018101760, 1018626048, 1019150336, 1019674624, 1020198912, 1020723200, 1021247488, - 021771776, 1022296064, 1022820352, 1023344640, 1023868928, 1024393216, 1024917504, 1025441792, 1025966080, 1026490368, 1027014656, 1027538944, 1028063232, 1028587520, - 1029111808, 1029636096, 1030160384, 1030684672, 1031208960, 1031733248, 1032257536, 1032781824, 1033306112, 1033830400, 1034354688, 1034878976, 1035403264, 1035927552, - 1036451840, 1036976128, 1037500416, 1038024704, 1038548992, 1039073280, 1039597568, 1040121856, 1040646144, 1041170432, 1041825792, 1041858560, 1042120704, 1042743296, - 1043267584, 1043824640, 1044316160, 1044840448, 1045495808, 1045528576, 1045790720, 1046413312, 1046937600, 1047461888, 1047986176, 1048641536, 1048674304, 1048936448, - 1049559040, 1050083328, 1050607616, 1051131904, 1051787264, 1051820032, 1052082176, 1052704768, 1053229056, 1057423360, 1057947648, 1058603008, 1058635776, 1058897920, - 1059520512, 1060044800, 1060601856, 1061093376, 1061617664, 1062273024, 1062305792, 1062567936, 1063190528, 1063714816, 1064239104, 1064763392, 1065418752, 1065451520, - 1065713664, 1066336256, 1066860544, 1067384832, 1067909120, 1068564480, 1068597248, 1068859392, 1069481984, 1070006272 ] - -# -# Calibration patterns -# - -LArCalibDigitMaker.NTrigger = 100 -LArCalibDigitMaker.DAC += DACs -LArCalibDigitMaker.Delay += Delays -LArCalibDigitMaker.Pattern += [0x10001,0x10001,0x10001,0x0000001] -LArCalibDigitMaker.Pattern += [0x20002,0x20002,0x20002,0x0000002] -LArCalibDigitMaker.Pattern += [0x40004,0x40004,0x40004,0x0000004] -LArCalibDigitMaker.Pattern += [0x80008,0x80008,0x80008,0x0000008] -LArCalibDigitMaker.Pattern += [0x100010,0x100010,0x100010,0x10010] -LArCalibDigitMaker.Pattern += [0x200020,0x200020,0x200020,0x20020] -LArCalibDigitMaker.Pattern += [0x400040,0x400040,0x400040,0x40040] -LArCalibDigitMaker.Pattern += [0x800080,0x800080,0x800080,0x80080] -LArCalibDigitMaker.Pattern += [0x1000100,0x1000100,0x1000100,0x100100] -LArCalibDigitMaker.Pattern += [0x2000200,0x2000200,0x2000200,0x200200] -LArCalibDigitMaker.Pattern += [0x4000400,0x4000400,0x4000400,0x400400] -LArCalibDigitMaker.Pattern += [0x8000800,0x8000800,0x8000800,0x800800] -LArCalibDigitMaker.Pattern += [0x10001000,0x10001000,0x10001000,0x0001000] -LArCalibDigitMaker.Pattern += [0x20002000,0x20002000,0x20002000,0x0002000] -LArCalibDigitMaker.Pattern += [0x40004000,0x40004000,0x40004000,0x0004000] -LArCalibDigitMaker.Pattern += [0x80008000,0x80008000,0x80008000,0x0008000] - -topSequence += LArCalibDigitMaker -topSequence += LArCalibDigitsAccumulator - -svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/HIGH"] -svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/MEDIUM"] -svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArDigitContainer/LOW"] -svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/HIGH" ] -svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/MEDIUM"] -svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "LArAccumulatedCalibDigitContainer/LOW" ] -svcMgr.ByteStreamAddressProviderSvc.TypeNames += ["LArFebHeaderContainer/LArFebHeader"] - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Flags.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Flags.py deleted file mode 100644 index 1aa216001cc76419d85d8754a8ecbe416f6afd9e..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Flags.py +++ /dev/null @@ -1,75 +0,0 @@ -include.block("LArCalibProcessing/LArCalib_Flags.py") - -from string import * -from AthenaCommon.GlobalFlags import globalflags - -class LArCalib_Flags: - - if globalflags.DatabaseInstance() == 'COMP200': - globalFlagDB = "LARCALIB-000-02" - else: - globalFlagDB = "LARCALIB-RUN2-00" - - OutputDB = "sqlite://;schema=myDB200.db;dbname=CONDBR2" - InputDB = OutputDB - - WritePoolFile = True - WriteNtuple = True - WriteIOV = True - - LArPedestalFolder = "/LAR/ElecCalibOfl/Pedestals/Pedestal" - LArAutoCorrFolder = "/LAR/ElecCalibOfl/AutoCorrs/AutoCorr" - LArPhysAutoCorrFolder = "/LAR/ElecCalibOfl/AutoCorrs/PhysicsAutoCorr" - - LArCaliWaveFolder = "/LAR/ElecCalibOfl/CaliWaves/CaliWave" -# LArCaliWaveFolderXtlk = "/LAR/ElecCalibOfl/CaliWaves/CaliWaveXtalkCorr" - LArCaliWaveFolderXtlk = "/LAR/ElecCalibOfl/CaliWaves/CaliWave" - - LArPhysWaveFolder = "/LAR/ElecCalibOfl/PhysWaves/RTM" - LArMphysOverMcalFolder = "/LAR/ElecCalibOfl/MphysOverMcal/RTM" - - LArPhysCaliTdiffFolder = "/LAR/ElecCalibOfl/PhysCaliTdiff" - - LArOFCPhysFolder = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/" - LArOFCCaliFolder = "/LAR/ElecCalibOfl/OFC/CaliWave" -# LArOFCCaliFolderXtlk = "/LAR/ElecCalibOfl/OFC/CaliWaveXtalkCorr" - LArOFCCaliFolderXtlk = "/LAR/ElecCalibOfl/OFC/CaliWave" - LArOFCMasterWaveFolder = "/LAR/ElecCalibOfl/OFC/MasterWave" -# LArOFCMasterWaveFolderXtlk = "/LAR/ElecCalibOfl/OFC/MasterWaveXtalkCorr" - LArOFCMasterWaveFolderXtlk = "/LAR/ElecCalibOfl/OFC/MasterWave" - - LArShapeFolder = "/LAR/ElecCalibOfl/Shape/RTM/" - LArShapeCaliWaveFolder = "/LAR/ElecCalibOfl/Shape/CaliWave" - LArShapeCaliWaveFolderXtlk = "/LAR/ElecCalibOfl/Shape/CaliWaveXtalkCorr" - LArShapeMasterWaveFolder = "/LAR/ElecCalibOfl/Shape/MasterWave" - LArShapeMasterWaveFolderXtlk = "/LAR/ElecCalibOfl/Shape/MasterWaveXtalkCorr" - - #LArRampFolder = "/LAR/ElecCalibOfl/Ramps/Ramp" - LArRampFolder = "/LAR/ElecCalibOfl/Ramps/RampLinea" - - ## Parameters - ## these parameters are not ready for all layer : - LArCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/Measured" - LArDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/Measured" - - ## extracted using RTM methode : - #LArCaliPulseParamsFolder = "/LAR/ElecCalibOfl/CaliPulseParams/RTM" - #LArDetCellParamsFolder = "/LAR/ElecCalibOfl/DetCellParams/RTM" - - LArDTimeFolder = "/LAR/ElecCalibOfl/Tdrift/Computed" - - PhysWaveShiftFolder = "/LAR/ElecCalibOfl/OFCBin/PhysWaveShifts" - OFCBinFolder = "/LAR/ElecCalibOfl/OFCBin/Dummy" - ShapeResidualsFolder = "/LAR/ElecCalibOfl/Shape/Residuals/5samples" - - IOVBegin=0 - IOVEnd=0 - - -def LArCalibFolderTag(folder,tag): - return ''.join(folder.split('/')) + tag - - -# backward compatiblity with 'include' ... -from LArCalibProcessing.utils import FolderTagResolver as FolderTagResover -FolderTagResover._globalTag=LArCalib_Flags.globalFlagDB diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_FlagsSC.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_FlagsSC.py deleted file mode 100644 index 17efee8a3b098f365c1c9592f4b909ad99af378d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_FlagsSC.py +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -include.block("LArCalibProcessing/LArCalib_FlagsSC.py") - -from string import * - -class LArCalib_Flags: - - globalFlagDB = "LARCALIB-RUN2-00" - OutputDB = "sqlite://;schema=myDB200.db;dbname=CONDBR2" - InputDB = OutputDB - - WritePoolFile = True - WriteNtuple = True - WriteIOV = True - - LArPedestalFolder = "/LAR/ElecCalibOflSC/Pedestals/Pedestal" - LArAutoCorrFolder = "/LAR/ElecCalibOflSC/AutoCorrs/AutoCorr" - LArPhysAutoCorrFolder = "/LAR/ElecCalibOflSC/AutoCorrs/PhysicsAutoCorr" - - LArCaliWaveFolder = "/LAR/ElecCalibOflSC/CaliWaves/CaliWave" - LArCaliWaveFolderXtlk = "/LAR/ElecCalibOflSC/CaliWaves/CaliWave" - - LArPhysWaveFolder = "/LAR/ElecCalibOflSC/PhysWaves/RTM" - LArMphysOverMcalFolder = "/LAR/ElecCalibOflSC/MphysOverMcal/RTM" - - LArPhysCaliTdiffFolder = "/LAR/ElecCalibOflSC/PhysCaliTdiff" - - LArOFCPhysFolder = "/LAR/ElecCalibOflSC/OFC/PhysWave/RTM/4samples" # 5samples - LArOFCCaliFolder = "/LAR/ElecCalibOflSC/OFC/CaliWave" - LArOFCCaliFolderXtlk = "/LAR/ElecCalibOflSC/OFC/CaliWave" - LArOFCMasterWaveFolder = "/LAR/ElecCalibOflSC/OFC/MasterWave" - LArOFCMasterWaveFolderXtlk = "/LAR/ElecCalibOflSC/OFC/MasterWave" - - LArShapeFolder = "/LAR/ElecCalibOflSC/Shape/RTM/" - LArShapeCaliWaveFolder = "/LAR/ElecCalibOflSC/Shape/CaliWave" - LArShapeCaliWaveFolderXtlk = "/LAR/ElecCalibOflSC/Shape/CaliWaveXtalkCorr" - LArShapeMasterWaveFolder = "/LAR/ElecCalibOflSC/Shape/MasterWave" - LArShapeMasterWaveFolderXtlk = "/LAR/ElecCalibOflSC/Shape/MasterWaveXtalkCorr" - LArShapeRTMSamplesFolder = "/LAR/ElecCalibOflSC/Shape/RTM/4samples" - - LArRampFolder = "/LAR/ElecCalibOflSC/Ramps/RampLinea" - - ## Parameters - ## these parameters are not ready for all layer : - #LArCaliPulseParamsFolder = "/LAR/ElecCalibOflSC/CaliPulseParams/Measured" - #LArDetCellParamsFolder = "/LAR/ElecCalibOflSC/DetCellParams/Measured" - - ## extracted using RTM methode : - LArCaliPulseParamsFolder = "/LAR/ElecCalibOflSC/CaliPulseParams/RTM" - LArDetCellParamsFolder = "/LAR/ElecCalibOflSC/DetCellParams/RTM" - - LArDTimeFolder = "/LAR/ElecCalibOflSC/Tdrift/Computed" - - PhysWaveShiftFolder = "/LAR/ElecCalibOflSC/OFCBin/PhysWaveShifts" - OFCBinFolder = "/LAR/ElecCalibOflSC/OFCBin/Dummy" - ShapeResidualsFolder = "/LAR/ElecCalibOflSC/Shape/Residuals/4samples" - - - IOVBegin=0 - IOVEnd=0 - - -def LArCalibFolderTag(folder,tag): - return "".join(folder.split('/')) + tag - - -class FolderTagResover: - def __init__(self,dbname="COOLOFL_LAR/CONDBR2"): - from PyCool import cool - dbSvc = cool.DatabaseSvcFactory.databaseService() - self._db = dbSvc.openDatabase(dbname) - return - - def __del__(self): - self._db.closeDatabase() - return - - def getFolderTag(self,foldername,globalTag=LArCalib_Flags.globalFlagDB): - try: - folder=self._db.getFolder(foldername); - return folder.resolveTag(globalTag) - except: - # new folder, should "create a tag" - if "BadChannels" in foldername: - # we only store bad SCs in UPD4 - print("USING BAD CHANNELS FOLDER", "".join(foldername.split('/')) + '-UPD4-00') - return "".join(foldername.split('/')) + '-UPD4-00' - else: - return "".join(foldername.split('/')) + '-UPD3-00' - - - def getFolderTagSuffix(self,foldername,globalTag=LArCalib_Flags.globalFlagDB): - ft=self.getFolderTag(foldername,globalTag) - p=ft.find("-") - if p==-1: - return "-Default" - else: - return ft[p:] - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_GeomSetup.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_GeomSetup.py deleted file mode 100644 index 472fa568788eee5bf4397998dd00720495c94059..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_GeomSetup.py +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################## -# -# LArCalib_MinimalSetup.py -# -# Minimal setup for electronic calibration jobs that do not need to read event -# data but only conditions data (e.g. OFC computation). It is equivalent to -# LArConditionsCommons/LArMinimalSetup.py, but skip the ByteStream part. -# -# Last update: 06/03/2008 <Fabien.Tarrade@cern.ch> -# -############################################################################## -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') -globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -#include( "LArIdCnv/LArIdCnv_joboptions.py" ) - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Merge.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Merge.py deleted file mode 100644 index 9fcf7f0aa3fde1dc21f32eeb774f5529589f0a5b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Merge.py +++ /dev/null @@ -1,127 +0,0 @@ -########################################################################### -# -# TopOptions to copy a complete set of conditions for a given run to -# one POOL file and one sqlite file -# -# Walter.Lampl@cern.ch -# -########################################################################### - - -import shutil, os -from LArCalibProcessing.extractFolderInfo import * - -if 'dbname' not in dir(): - dbname="CONDBR2" - -if 'sqliteIn' not in dir(): - sqliteIn="freshConstants.db" - -if 'sqliteOut' not in dir(): - sqliteOut=sqliteIn+".out" - -inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname -outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname - -folderInfo=extractFolderInfo(inputDB) - -#ccs="<channelSelection>3:238</channelSelection>" - -if 'mergeFolders' not in dir(): - mergeFolders=["/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples", - "/LAR/ElecCalibOfl/Shape/RTM/5samples" - ] - -if 'fileName' not in dir(): - fileName="LArConditions" - -shutil.copyfile(sqliteIn,sqliteOut) - - - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -#FIXME: Remove the following 2 lines as soon as AP has migrated to CONDBR2 -from AthenaCommon.GlobalFlags import globalflags -globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -theApp.EvtMax = 1 -conddb.setGlobalTag("LARCALIB-RUN2-00") #For id mapping -svcMgr.IOVDbSvc.DBInstance="" - -svcMgr.PoolSvc.SortReplicas=False - -if 'IOVBegin' in dir(): - runNoForFileName=IOVBegin -else: - runNoForFileName=2147483647 - -outObjects=[] -outTags=[] - -if 'keySuffix' not in dir(): - keySuffix="_1ns" - -for f in folderInfo: - fn=f[0] - type=f[1] - key=f[2] - tag=f[3] - since=f[4] - until=f[5] - printfunc ("Working on folder",fn,"IOV:",since,"-",until) - #if since == 0: - # printfunc ("ERROR: Found IOV begin = 0") - #sys.exit(-1) - if 'OFC' in fn and not 'mu_20' in tag: - continue - if fn in mergeFolders: - if since>0 and since<runNoForFileName and 'IOVBegin' not in dir(): - runNoForFileName=since - if len(keySuffix)>0 and key.endswith(keySuffix): - key=key[:-len(keySuffix)] - outObjects+=["#".join((type,key,fn))] - outTags+=[tag] - conddb.addFolder("",fn+"<tag>"+tag+"</tag><db>"+inputDB+"</db><key>"+key+"</key>") - -svcMgr.EventSelector.RunNumber = 2147483647 - -OutputFileRec=fileName+"_"+str(runNoForFileName)+".pool.root" -if os.access(OutputFileRec,os.F_OK): - printfunc ("File",OutputFileRec,"exists already, removing ....") - os.remove(OutputFileRec) - -printfunc (svcMgr.IOVDbSvc.Folders) - -printfunc ("============ Output objects =============") -printfunc (outObjects) -printfunc (outTags) - -from LArCalibTools.LArCalibToolsConf import LArBlockCorrections -topSequence+=LArBlockCorrections() - -from LArCalibTools.LArCalibToolsConf import ForceLoadCondObj -topSequence+=ForceLoadCondObj(ObjectList=outObjects) - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlgRec=OutputConditionsAlg("OutputConditionsAlgRec",OutputFileRec, - outObjects,outTags,True) - - -svcMgr.IOVDbSvc.dbConnection = outputDB -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.RecreateFolders = True -if 'IOVBegin' in dir(): - svcMgr.IOVRegistrationSvc.BeginRun=IOVBegin - -svcMgr.DetectorStore.Dump=True - - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_MinimalSetup.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_MinimalSetup.py deleted file mode 100644 index 900d9656566682655ee0589601f2e133bb28e290..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_MinimalSetup.py +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################## -# -# LArCalib_MinimalSetup.py -# -# Minimal setup for electronic calibration jobs that do not need to read event -# data but only conditions data (e.g. OFC computation). It is equivalent to -# LArConditionsCommons/LArMinimalSetup.py, but skip the ByteStream part. -# -# Last update: 06/03/2008 <Fabien.Tarrade@cern.ch> -# -############################################################################## -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') -globalflags.DatabaseInstance.set_Value_and_Lock('CONDBR2') - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOff() #Switched off to avoid geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -#Get identifier mapping -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) -#include( "LArIdCnv/LArIdCnv_joboptions.py" ) - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_Run2.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_Run2.py deleted file mode 100644 index c4ecf0ba59ecb5cf14a2ca5e931b5b59ec5e42af..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_OFC_Phys_Run2.py +++ /dev/null @@ -1,423 +0,0 @@ - -include("LArCalibProcessing/LArCalib_Flags.py") - -if not 'IOVEnd' in dir(): - IOVEnd = 2147483647 - -if not 'RunNumber' in dir(): - RunNumber=2147483647 - -if not 'OutputPoolFileDir' in dir(): - OutputPoolFileDir = os.getcwd() - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArOFCShapePhys" - - -if not "NColl" in dir(): - NColl=20 - -if not 'InputKey' in dir(): - InputKey = "LArPhysWave" # no shift applied to the PhysWave - -if not 'TimeShiftGuardRegion' in dir(): - TimeShiftGuardRegion = 12 - -if not "ChannelSelection" in dir(): - ChannelSelection="" - -if not "GroupingType" in dir(): - GroupingType = "ExtendedSubDetector" - -if not "RunThreaded" in dir(): - RunThreaded=False - -##Picking -if not 'DefaultPhase' in dir(): - DefaultPhase = 4 - -if not 'TimeOffsetCorrection' in dir(): - TimeOffsetCorrection = 12 - - -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - - -########################################################################### -# OFC properties (2 instances in total) -########################################################################### - -from LArCalibProcessing.OFCDefinitions import OFCDefs - - -#input folders: -if "AutoCorrFolder" not in dir(): - AutoCorrFolder = LArCalib_Flags.LArAutoCorrFolder -if "PhysAutoCorrFolder" not in dir(): - PhysAutoCorrFolder = LArCalib_Flags.LArPhysAutoCorrFolder - -#Shift (can be output or input) -if "PhysWaveShiftFolder" not in dir(): - PhysWaveShiftFolder= LArCalib_Flags.PhysWaveShiftFolder - -#if "OFCBinFolder" not in dir(): -# OFCBinFolder=LArCalib_Flags.OFCBinFolder - -if "ShapeResidualsFolder" not in dir(): - ShapeResidualsFolder=LArCalib_Flags.ShapeResidualsFolder - - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) -else: - OutputDB= DBConnectionFile("freshOFCs.db") - -DBConnectionCOOL = "COOLOFL_LAR/CONDBR2" - -if "InputAutoCorrPhysSQLiteFile" in dir(): - InputDBConnectionAutoCorrPhys = DBConnectionFile(InputAutoCorrPhysSQLiteFile) -else: - InputDBConnectionAutoCorrPhys = DBConnectionCOOL -if 'InputAutoCorrSQLiteFile' in dir(): - InputDBConnectionAutoCorr = DBConnectionFile(InputAutoCorrSQLiteFile) -else: - InputDBConnectionAutoCorr = DBConnectionCOOL - -if 'InputPhysWaveSQLiteFile' in dir(): - InputDBConnectionPhysWave = DBConnectionFile(InputPhysWaveSQLiteFile) -else: - InputDBConnectionPhysWave = DBConnectionCOOL - - -if not "InputDBConnectionPhysWaveShift" in dir(): - InputDBConnectionPhysWaveShift = DBConnectionCOOL - -#if not "InputDBConnectionOFCBin" in dir(): -# InputDBConnectionOFCBin = DBConnectionCOOL - -if not "InputDBConnectionShapeResidual" in dir(): - InputDBConnectionShapeResidual = DBConnectionCOOL - - -#Try to get IOV start from input physWave: -if not 'IOVBegin' in dir(): - IOVBegin = 0 - from LArCalibProcessing.extractFolderInfo import * - folderinfo=extractFolderInfo(dbname=InputDBConnectionPhysWave,checkFolders=[LArCalib_Flags.LArPhysWaveFolder,], - selection="3:7,9:13,15:19,21:25,27:31,33:37") #Exclude FCAL channels that have infinete IOV - printfunc (folderinfo) - if len(folderinfo)==1: - IOVBegin=folderinfo[0][4] - printfunc ("IOVStart taken from input PhysWave:", IOVBegin) - else: - printfunc ("Failed to extract IOV start of input PhysWave") - pass - pass - - - - - - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -OFCLog.info( " Output DB = "+OutputDB ) -OFCLog.info( " PhysWave DB = "+InputDBConnectionPhysWave) -OFCLog.info( " AutoCorr DB = "+InputDBConnectionAutoCorr) -OFCLog.info( " AutoCorrPhys DB = "+InputDBConnectionAutoCorrPhys) -OFCLog.info( " PhysWaveShift DB = "+InputDBConnectionPhysWaveShift) -#OFCLog.info( " OFCBin DB = "+InputDBConnectionOFCBin) -OFCLog.info( " Shape residual DB = "+InputDBConnectionShapeResidual) - -OFCLog.info( " IOV Start = "+str(IOVBegin)) -OFCLog.info( " IOV End = "+str(IOVEnd)) - - -OFCLog.info( " ======================================================== " ) - - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DetGeo.set_Value_and_Lock('atlas') -globalflags.Luminosity.set_Value_and_Lock('zero') -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock('bytestream') -globalflags.DatabaseInstance.set_Value_and_Lock("CONDBR2") - -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-R2-2015-04-00-00" - -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() #Switched off to avoid geometry -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() -#DetFlags.Print() - -#Set up GeoModel (not really needed but crashes without) -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit -from AtlasGeoModel import SetupRecoGeometry - -#Get identifier mapping -include( "LArConditionsCommon/LArIdMap_comm_jobOptions.py" ) - -from IOVDbSvc.CondDB import conddb -svcMgr.IOVDbSvc.GlobalTag = "LARCALIB-RUN2-00" #LArCalib_Flags.globalFlagDB -svcMgr.IOVDbSvc.DBInstance="" -svcMgr.IOVDbSvc.dbConnection = OutputDB - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat - - -#Input Database Folders: -#Assuming a tag-hierarchy in the input sqlite file! - - -#input PhysWave -InputDBConnectionPhysWave="<db>%s</db>" % InputDBConnectionPhysWave -conddb.addFolder("",LArCalib_Flags.LArPhysWaveFolder+InputDBConnectionPhysWave+ ChannelSelection) - -#input AutoCorr -atag="" -if "AutoCorrFolderTag" in dir(): - atag+="<tag>%s</tag>" %AutoCorrFolderTag -InputDBConnectionAutoCorr="<db>%s</db>" % InputDBConnectionAutoCorr -conddb.addFolder("",LArCalib_Flags.LArAutoCorrFolder+InputDBConnectionAutoCorr+atag+ChannelSelection) - -#input PhysicsAutoCorr: -#rs=FolderTagResover(InputDBConnectionAutoCorrPhys) -if "PhysAutoCorrFolderTag" not in dir(): - PhysAutoCorrFolderTag=LArCalibFolderTag(PhysAutoCorrFolder,"_mu_"+str(NColl)+"-RUN2-UPD3-00") -InputDBConnectionAutoCorrPhys="<db>%s</db>" %InputDBConnectionAutoCorrPhys -conddb.addFolder("",PhysAutoCorrFolder+"<tag>"+PhysAutoCorrFolderTag+"</tag>"+InputDBConnectionAutoCorrPhys+"<key>LArPhysAutoCorr</key>") -#del rs - -#input PhysWaveShift (usually from oracle) -InputDBConnectionPhysWaveShift="<db>%s</db>" % InputDBConnectionPhysWaveShift -conddb.addFolder("",PhysWaveShiftFolder+InputDBConnectionPhysWaveShift) - -#InputDBConnectionOFCBin="<db>%s</db>" % InputDBConnectionOFCBin -#conddb.addFolder("",OFCBinFolder+InputDBConnectionOFCBin) - -InputDBConnectionShapeResidual="<db>%s</db>" % InputDBConnectionShapeResidual -conddb.addFolder("",ShapeResidualsFolder+InputDBConnectionShapeResidual) - - -#Decoder Tool for electronic-noise only autocorrelation -from LArCalibUtils.LArCalibUtilsConf import LArAutoCorrDecoderTool -theLArAutoCorrDecoderTool = LArAutoCorrDecoderTool() -theLArAutoCorrDecoderTool.UseAlwaysHighGain=True -ToolSvc += theLArAutoCorrDecoderTool - -#Decoder Tool for pile-up autocorrelation -theLArPhysAutoCorrDecoderTool = LArAutoCorrDecoderTool("LArPhysAutoCorrDecoderTool") -theLArPhysAutoCorrDecoderTool.DecodeMode=1 -theLArPhysAutoCorrDecoderTool.UseAlwaysHighGain=True -theLArPhysAutoCorrDecoderTool.KeyAutoCorr="LArPhysAutoCorr" -ToolSvc += theLArPhysAutoCorrDecoderTool - - -#Instantiate LArOFCAlgos - -from LArCalibUtils.LArCalibUtilsConf import LArOFCAlg -from LArCalibUtils.LArCalibUtilsConf import LArOFPhasePicker - -for ofcdef in OFCDefs: - if ofcdef == 0: continue - LArPhysOFCAlg=LArOFCAlg(ofcdef.Algoname) - LArPhysOFCAlg.RunThreaded=RunThreaded - LArPhysOFCAlg.ReadCaliWave = False - LArPhysOFCAlg.KeyList = [ InputKey ] - LArPhysOFCAlg.Normalize = True - LArPhysOFCAlg.Verify = True - LArPhysOFCAlg.FillShape = True - LArPhysOFCAlg.GroupingType = GroupingType - - LArPhysOFCAlg.Nphase = ofcdef.Nphase - LArPhysOFCAlg.Dphase = ofcdef.Dphase - LArPhysOFCAlg.Ndelay = 24 - LArPhysOFCAlg.Nsample = ofcdef.Nsamples - - LArPhysOFCAlg.AddTimeOffset = -1.0*TimeShiftGuardRegion - LArPhysOFCAlg.LArPhysWaveBinKey ="LArPhysWaveShift" - - LArPhysOFCAlg.KeyShape = ofcdef.KeyShape - - LArPhysOFCAlg.UseDelta = ofcdef.useDelta[0] - LArPhysOFCAlg.KeyOFC = ofcdef.KeyOFC[0] - if ofcdef.PhysAutoCorr[0]: - LArPhysOFCAlg.DecoderTool = theLArPhysAutoCorrDecoderTool - else: - LArPhysOFCAlg.DecoderTool = theLArAutoCorrDecoderTool - - if len(ofcdef.PhysAutoCorr)==2: #Second OFC flavor defined - LArPhysOFCAlg.ComputeOFCV2=True - LArPhysOFCAlg.UseDeltaV2 = ofcdef.useDelta[1] - LArPhysOFCAlg.KeyOFCV2 = ofcdef.KeyOFC[1] - if ofcdef.PhysAutoCorr[1]: - LArPhysOFCAlg.DecoderToolV2 = theLArPhysAutoCorrDecoderTool - else: - LArPhysOFCAlg.DecoderToolV2 = theLArAutoCorrDecoderTool - - if ofcdef.Nsamples==4: - LArPhysOFCAlg.ReadDSPConfig = ofcdef.ReadDSPConfig - LArPhysOFCAlg.DSPConfigFolder = ofcdef.DSPConfigFolder - conddb.addFolder("LAR_ONL","/LAR/Configuration/DSPConfiguration") - #conddb.addFolder("","<db>sqlite://;schema=/afs/cern.ch/atlas/maxidisk/d20/Automation/AtlasProduction-20.1.0.2/run/dspconfig_std.db;dbname=CONDBR2</db>/LAR/Configuration/DSPConfiguration") - #conddb.addFolder("","<db>sqlite://;schema=/afs/cern.ch/atlas/maxidisk/d20/Automation/AtlasProduction-20.1.0.2/run/dspconfig_run1.db;dbname=CONDBR2</db>/LAR/Configuration/DSPConfiguration") - - LArPhysOFCAlg.OutputLevel=WARNING - - topSequence+=LArPhysOFCAlg - - LArOFPhasePick=LArOFPhasePicker(ofcdef.Algoname+"Picker") - LArOFPhasePick.KeyPhase = "" - LArOFPhasePick.KeyOFC = ofcdef.KeyOFC[0] - LArOFPhasePick.KeyOFC_new = ofcdef.KeyOFC[0]+"_picked" - LArOFPhasePick.KeyShape = ofcdef.KeyShape - LArOFPhasePick.KeyShape_new = ofcdef.KeyShape+"_picked" - #LArOFPhasePick.OutputLevel=VERBOSE - LArOFPhasePick.GroupingType = GroupingType - LArOFPhasePick.DefaultPhase = DefaultPhase - LArOFPhasePick.TimeOffsetCorrection = TimeOffsetCorrection - topSequence += LArOFPhasePick - - if len(ofcdef.PhysAutoCorr)==2: #Second OFC flavor defined - LArOFPhasePick2=LArOFPhasePicker(ofcdef.Algoname+"Picker2") - #LArOFPhasePick2.OutputLevel=VERBOSE - LArOFPhasePick2.KeyPhase = "" - LArOFPhasePick2.KeyOFC = ofcdef.KeyOFC[1] - LArOFPhasePick2.KeyOFC_new = ofcdef.KeyOFC[1]+"_picked" - LArOFPhasePick2.doShape=False - LArOFPhasePick2.GroupingType = GroupingType - LArOFPhasePick2.DefaultPhase = DefaultPhase - LArOFPhasePick2.TimeOffsetCorrection = TimeOffsetCorrection - topSequence += LArOFPhasePick2 - pass - - #Shape residual correction - from LArCalibUtils.LArCalibUtilsConf import LArShapeCorrector - theLArShapeCorrector=LArShapeCorrector("ShapeCorr_"+ofcdef.Algoname) - theLArShapeCorrector.KeyShape=ofcdef.KeyShape+"_picked" - theLArShapeCorrector.KeyShape_newcorr=ofcdef.KeyShape+"_picked_corr" - topSequence+=theLArShapeCorrector - pass #end of loop over OFC definitions - - - - -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - -#Output Folders: -suffix="-RUN2-UPD3-00" #Hardcode for now -for ofcdef in OFCDefs: - if ofcdef == 0: continue - PoolFile=OutputPoolFileDir+"/"+OutputPoolFileName+ofcdef.Algoname+".pool.root" - if os.path.exists(PoolFile): os.remove(PoolFile) - - OutputObjectSpec=["LArShapeComplete#"+ofcdef.KeyShape+"#"+ofcdef.FolderShape,] - OutputTagSpec=[LArCalibFolderTag(ofcdef.FolderShape,suffix),] - #OutputTagSpec=["LArShapeComplete#"+ofcdef.KeyShape+"#"+ofcdef.FolderShape,] - for i in range(len(ofcdef.KeyOFC)): - OutputObjectSpec.append("LArOFCComplete#"+ofcdef.KeyOFC[i]+"#"+ofcdef.FolderOFC) - if ofcdef.PhysAutoCorr[i]: - OutputTagSpec.append(LArCalibFolderTag(ofcdef.FolderOFC,"-mu-"+str(NColl)+suffix)) - else: - OutputTagSpec.append(LArCalibFolderTag(ofcdef.FolderOFC,suffix)) - - outAlg=OutputConditionsAlg("Output"+ofcdef.Algoname,PoolFile,OutputObjectSpec,OutputTagSpec) - outAlg.Run1 = IOVBegin - if IOVEnd>0: - outAlg.Run2 = IOVEnd - pass - - #Now the same of the picked OFCs/Shape (+corr shape): - PoolFilePicked=OutputPoolFileDir+"/"+OutputPoolFileName+ofcdef.Algoname+"_picked.pool.root" - if os.path.exists(PoolFilePicked): os.remove(PoolFilePicked) - - OutputObjectSpec=["LArShapeComplete#"+ofcdef.KeyShape+"_picked#"+ofcdef.FolderShapePicked, - "LArShapeComplete#"+ofcdef.KeyShape+"_picked_corr#"+ofcdef.FolderShapePicked - ] - OutputTagSpec=[LArCalibFolderTag(ofcdef.FolderShapePicked,suffix), - LArCalibFolderTag(ofcdef.FolderShapePicked,"-corr"+suffix), - ] - - for i in range(len(ofcdef.KeyOFC)): - OutputObjectSpec.append("LArOFCComplete#"+ofcdef.KeyOFC[i]+"_picked#"+ofcdef.FolderOFCPicked) - if ofcdef.PhysAutoCorr[i]: - OutputTagSpec.append(LArCalibFolderTag(ofcdef.FolderOFCPicked,"-mu-"+str(NColl)+suffix)) - else: - OutputTagSpec.append(LArCalibFolderTag(ofcdef.FolderOFCPicked,suffix)) - pass - - outAlgPicked=OutputConditionsAlg("Output"+ofcdef.Algoname+"Picked",PoolFilePicked,OutputObjectSpec,OutputTagSpec) - outAlgPicked.Run1 = IOVBegin - if IOVEnd>0: - outAlgPicked.Run2 = IOVEnd - pass - - -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -#svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG -svcMgr.IOVRegistrationSvc.RecreateFolders = False - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = RunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -#svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 100000000 -#svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -#svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -#theAuditorSvc += getConfigurable("ChronoAuditor")() -#theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PickOFCOnePhase.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PickOFCOnePhase.py deleted file mode 100644 index 9822ef9d43e82ddc348a3ff12174173d22968cd1..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PickOFCOnePhase.py +++ /dev/null @@ -1,425 +0,0 @@ -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Fabien.Tarrade@cern.ch> -# -# Example jobOptions to pickup OFC phys one phase -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -include("LArCalibProcessing/LArCalib_Flags.py") - -########################################################################### -# Input selection (OFC Phys) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## OFC Phys - -if not 'ReadOFCFromCOOL' in dir(): - ReadOFCFromCOOL = True - -if not 'InputPoolDir' in dir(): - InputPoolDir = subprocess.getoutput("pwd") - -if not 'InputPoolFileName' in dir(): - InputPoolFileName = "LArOFCShapePhys.pool.root" - -## Shape Phys -if not 'ReadShapeFromCOOL' in dir(): - ReadShapeFromCOOL = True - -if not 'InputShapePoolDir' in dir(): - InputShapePoolDir = subprocess.getoutput("pwd") - - -## COOL Channel selection -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties # -########################################################################### - -if not 'TimeOffsetCorrection' in dir(): - TimeOffsetCorrection = 0 - -if not 'DefaultPhase' in dir(): - DefaultPhase = 1 - -if not 'OFCFolder' in dir() : - OFCFolder = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples3bins17phases" - #OFCFolder = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples" - -if not 'ShapeFolder' in dir() : - ShapeFolder = "/LAR/ElecCalibOfl/Shape/RTM/5samples3bins17phases" - #ShapeFolder = "/LAR/ElecCalibOfl/Shape/RTM/5samples" - -if not 'OFCKey' in dir() : - OFCKey = "LArOFC" - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if not 'FillShape' in dir(): - FillShape = True # Do not fill a LArShapeComplete object for calibration OFC! - -########################################################################### -# OFC output # -########################################################################### - -if not 'GroupingType' in dir(): - GroupingType = "ExtendedSubDetector" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputPoolFileDir' in dir(): - OutputPoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -OFCFileTag += "_5samples_Picked" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCPhys_"+OFCFileTag + ".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArOFCShapePhys_"+OFCFileTag + ".pool.root" - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -#inputs - - -#outputs -if not 'FolderShapeOutput' in dir(): - FolderShapeOutput = "/LAR/ElecCalibOfl/Shape/RTM/5samples1phase" -if not 'FolderOFCOutput' in dir(): - FolderOFCOutput = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/5samples1phase" - -rs=FolderTagResover() - -#inputs -if not 'OFCFolderTag' in dir(): - OFCFolderTag=rs.getFolderTagSuffix(OFCFolder) - OFCFolderTagSpec= LArCalibFolderTag(OFCFolder,OFCFolderTag) - -if not 'ShapeFolderTag' in dir(): - ShapeFolderTag=rs.getFolderTagSuffix(ShapeFolder) - ShapeFolderTagSpec= LArCalibFolderTag(ShapeFolder,ShapeFolderTag) - - -#outputs -if not 'LArOFCFolderOutputTag' in dir(): - LArOFCFolderOutputTag=rs.getFolderTagSuffix(FolderOFCOutput) - -if not 'LArShapeFolderOutputTag' in dir(): - LArShapeFolderOutputTag=rs.getFolderTagSuffix(FolderShapeOutput) - -del rs #Close database connection - - -if not 'OutputObjectSpecOFC' in dir(): - OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+FolderOFCOutput - OutputObjectSpecTagOFC = LArCalibFolderTag(FolderOFCOutput,LArOFCFolderOutputTag) - -if not 'OutputObjectSpecShape' in dir(): - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+FolderShapeOutput - OutputObjectSpecTagShape = LArCalibFolderTag(FolderShapeOutput,LArShapeFolderOutputTag) - - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if ( ReadOFCFromCOOL ): - if 'InputOFCSQLiteFile' in dir(): - InputDBConnectionOFC = DBConnectionFile(InputOFCSQLiteFile) - else: - InputDBConnectionOFC = DBConnectionCOOL - -if ( ReadShapeFromCOOL ): - if 'InputShapeSQLiteFile' in dir(): - InputDBConnectionShape = DBConnectionFile(InputShapeSQLiteFile) - else: - InputDBConnectionShape = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# Print summary -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadOFCFromCOOL ): - OFCLog.info( " InputDBConnectionOFC = "+InputDBConnectionOFC ) -else : - OFCLog.info( " InputPoolFileName = "+InputFileName ) -if 'OFCLArCalibFolderTag' in dir() : - OFCLog.info( " OFCLArCalibFolderTag = "+OFCLArCalibFolderTag ) -if ( ReadOFCFromCOOL and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputPoolFullFileName = "+OutputPoolFileDir+"/"+OutputPoolFileName ) -OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (OFC) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -include ("LArCalibProcessing/LArCalib_BadChanTool.py") - -if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") -else : - OFCLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") -else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>") - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadOFCFromCOOL ): - if not ('InputOFCSQLiteFile') in dir(): - OFCLog.info( "Read OFC from Oracle" ) - else : - OFCLog.info( "Read OFC from SQLite file" ) - -if ( ReadOFCFromCOOL ): - conddb.addFolder("",OFCFolder+"<tag>"+OFCFolderTagSpec+"</tag><key>LArOFCIn</key><dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ ChannelSelection) - -else: - if 'InputPoolFileName' in dir(): - OFCLog.info( "Read OFC and Shape from POOL file") - PoolFileList += [ InputPoolDir+"/"+InputPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing OFC or read from COOL." ) - theApp.exit(-1) - - - -if ( ReadShapeFromCOOL ): - if not ('InputShapeSQLiteFile') in dir(): - OFCLog.info( "Read Shape from Oracle" ) - else : - OFCLog.info( "Read Shape from SQLite file" ) - -if ( ReadShapeFromCOOL ): - conddb.addFolder("",ShapeFolder+"<tag>"+ShapeFolderTagSpec+"</tag><key>LArShapeIn</key><dbConnection>"+InputDBConnectionShape+"</dbConnection>"+ ChannelSelection) - - -conddb.addFolder("","/LAR/ElecCalibOfl/OFCBin/Dummy<dbConnection>"+DBConnectionCOOL+"</dbConnection>"+ ChannelSelection) - - - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -########################################################################### -# pickup one phase OFC # -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArOFPhasePicker -LArOFPhasePicker = LArOFPhasePicker("LArOFPhasePicker") -LArOFPhasePicker.KeyPhase = "LArOFCPhase" -LArOFPhasePicker.KeyOFC_new = OFCKey -LArOFPhasePicker.KeyOFC = "LArOFCIn" -LArOFPhasePicker.KeyShape_new = ShapeKey -LArOFPhasePicker.KeyShape = "LArShapeIn" -LArOFPhasePicker.GroupingType = GroupingType -LArOFPhasePicker.DefaultPhase = DefaultPhase -LArOFPhasePicker.TimeOffsetCorrection = TimeOffsetCorrection -topSequence += LArOFPhasePicker - -########################################################################### - -if ( WriteNtuple ) : - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - LArOFC2Ntuple = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntuple.ContainerKey = OFCKey - LArOFC2Ntuple.AddFEBTempInfo = False - topSequence+=LArOFC2Ntuple - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputPoolFileDir+"/"+OutputPoolFileName) - OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - if ( FillShape ): - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape] - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from AthenaCommon.AppMgr import ServiceMgr - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = DEBUG - svcMgr.IOVRegistrationSvc.RecreateFolders = True -# svcMgr.IOVRegistrationSvc.SVFolder = True - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -svcMgr.EventSelector.RunNumber = 10000000 # not runNumberRunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = DEBUG) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PickOFCOnePhase_WithPileup.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PickOFCOnePhase_WithPileup.py deleted file mode 100644 index f5aff27ab97dbe5cf62d3115f4691c9f7e09e60f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_PickOFCOnePhase_WithPileup.py +++ /dev/null @@ -1,490 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from future import standard_library -standard_library.install_aliases() -import subprocess - -########################################################################### -# -# <Fabien.Tarrade@cern.ch> -# -# Example jobOptions to pickup OFC phys one phase -# -# Last update: 09/12/2008 <Fabien.Tarrade@cern.ch> -# -########################################################################### - -if not "SuperCells" in dir(): - SuperCells=False - -if not SuperCells: include("LArCalibProcessing/LArCalib_Flags.py") -if SuperCells: include("LArCalibProcessing/LArCalib_FlagsSC.py") - -########################################################################### -# Input selection (OFC Phys) -########################################################################### - -# RunNumber trigger IOV if reading from COOL is eneabled -if not 'RunNumber' in dir(): - RunNumber = '0000000' - -if not 'SubDet' in dir(): - SubDet = "Barrel" - -if not 'Partition' in dir(): - if (SubDet=='EndCap'): - Partition = "EB-EC*" - else: - Partition = "EB-EMB*" - -## OFC Phys - -if not 'ReadOFCFromCOOL' in dir(): - ReadOFCFromCOOL = True - -if not 'InputPoolDir' in dir(): - InputPoolDir = subprocess.getoutput("pwd") - -if not 'InputPoolFileName' in dir(): - InputPoolFileName = "LArOFCShapePhys.pool.root" - -## Shape Phys -if not 'ReadShapeFromCOOL' in dir(): - ReadShapeFromCOOL = True - -if not 'InputShapePoolDir' in dir(): - InputShapePoolDir = subprocess.getoutput("pwd") - - -## COOL Channel selection -if not 'ChannelSelection' in dir(): - # Read all - ChannelSelection = " " - ## Example to read only cool for Barrel C : Strips->Back - #ChannelSelection = "<channelSelection>0,35:66</channelSelection>" - -from string import * -def DBConnectionFile(sqlitefile): - return "sqlite://;schema="+sqlitefile+";dbname=CONDBR2" - -########################################################################### -# OFC properties # -########################################################################### - -if not 'TimeOffsetCorrection' in dir(): - TimeOffsetCorrection = 0 - -if not 'DefaultPhase' in dir(): - DefaultPhase = 1 - -if not 'Nsamples' in dir(): - Nsamples = 5 - -if not 'OFCFolder' in dir() : - if not SuperCells: - OFCFolder = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+str(Nsamples)+"samples3bins17phases" - else: - OFCFolder = "/LAR/ElecCalibOflSC/OFC/PhysWave/RTM/"+str(Nsamples)+"samples3bins17phases" - -if not 'ShapeFolder' in dir() : - if not SuperCells: - ShapeFolder = "/LAR/ElecCalibOfl/Shape/RTM/"+str(Nsamples)+"samples3bins17phases" - else: - ShapeFolder = "/LAR/ElecCalibOflSC/Shape/RTM/"+str(Nsamples)+"samples3bins17phases" - -if not 'OFCKey' in dir() : - OFCKey = "LArOFC" - -if not 'ShapeKey' in dir(): - ShapeKey = "LArShape" - -if not 'FillShape' in dir(): - FillShape = True # Do not fill a LArShapeComplete object for calibration OFC! - -########################################################################### -# OFC output # -########################################################################### - -if not 'GroupingType' in dir(): - if not SuperCells: GroupingType = "ExtendedSubDetector" - if SuperCells: GroupingType = "SuperCells" - -if not 'WriteNtuple' in dir(): - WriteNtuple = LArCalib_Flags.WriteNtuple - -if not 'WritePoolFile' in dir(): - WritePoolFile = LArCalib_Flags.WritePoolFile - -if not 'WriteIOV' in dir(): - WriteIOV = LArCalib_Flags.WriteIOV - -if not 'IOVBegin' in dir(): - IOVBegin = int(RunNumber) - -if not 'IOVEnd' in dir(): - IOVEnd = LArCalib_Flags.IOVEnd - -if not 'OutputOFCRootFileDir' in dir(): - OutputOFCRootFileDir = subprocess.getoutput("pwd") - -if not 'OutputOFCPoolFileDir' in dir(): - OutputOFCPoolFileDir = subprocess.getoutput("pwd") - -OFCFileTag = str(RunNumber)+"_"+Partition.replace("*","") - -OFCFileTag += str(Nsamples)+"samples_Picked" - -if not 'OutputOFCRootFileName' in dir(): - OutputOFCRootFileName = "LArOFCPhys_"+OFCFileTag + ".root" - -if not 'OutputPoolFileName' in dir(): - OutputPoolFileName = "LArOFCShapePhys_"+OFCFileTag + ".pool.root" - -if not 'OutputDB' in dir(): - OutputDB = LArCalib_Flags.OutputDB - -if 'OutputSQLiteFile' in dir(): - OutputDB = DBConnectionFile(OutputSQLiteFile) - -#outputs -if not 'FolderShapeOutput' in dir(): - if not SuperCells: FolderShapeOutput = "/LAR/ElecCalibOfl/Shape/RTM/"+str(Nsamples)+"samples1phase" - else: FolderShapeOutput = "/LAR/ElecCalibOflSC/Shape/RTM/"+str(Nsamples)+"samples1phase" -if not 'FolderOFCOutput' in dir(): - if not SuperCells: FolderOFCOutput = "/LAR/ElecCalibOfl/OFC/PhysWave/RTM/"+str(Nsamples)+"samples1phase" - else: FolderOFCOutput = "/LAR/ElecCalibOflSC/OFC/PhysWave/RTM/"+str(Nsamples)+"samples1phase" - -rs=FolderTagResover() - -#inputs -if not 'OFCFolderTag' in dir(): - OFCFolderTag=rs.getFolderTagSuffix(OFCFolder) - -OFCFolderTagSpec= LArCalibFolderTag(OFCFolder,OFCFolderTag) - -if NColl > 0 and not 'OFCFolderTagmu' in dir(): - OFCFolderTagmu=rs.getFolderTagSuffix(OFCFolder) - -if NColl > 0: - OFCFolderTagSpecmu=LArCalibFolderTag(OFCFolder,"-mu-"+str(NColl)+OFCFolderTag) - -if not 'ShapeFolderTag' in dir(): - ShapeFolderTag=rs.getFolderTagSuffix(ShapeFolder) - ShapeFolderTagSpec= LArCalibFolderTag(ShapeFolder,ShapeFolderTag) - - -#outputs -if not 'LArOFCFolderOutputTag' in dir(): - LArOFCFolderOutputTag=rs.getFolderTagSuffix(FolderOFCOutput) - -if not 'LArShapeFolderOutputTag' in dir(): - LArShapeFolderOutputTag=rs.getFolderTagSuffix(FolderShapeOutput) - -del rs #Close database connection - - -if not 'OutputObjectSpecOFC' in dir(): - OutputObjectSpecOFC = "LArOFCComplete#"+OFCKey+"#"+FolderOFCOutput - OutputObjectSpecTagOFC = LArCalibFolderTag(FolderOFCOutput,LArOFCFolderOutputTag) - -if NColl > 0 and not 'OutputObjectSpecOFCmu' in dir(): - OutputObjectSpecOFCmu = "LArOFCComplete#"+OFCKey+"_mu"+"#"+FolderOFCOutput - OutputObjectSpecTagOFCmu = LArCalibFolderTag(FolderOFCOutput,"-mu-"+str(NColl)+LArOFCFolderOutputTag) - -if not 'OutputObjectSpecShape' in dir(): - OutputObjectSpecShape = "LArShapeComplete#"+ShapeKey+"#"+FolderShapeOutput - OutputObjectSpecTagShape = LArCalibFolderTag(FolderShapeOutput,LArShapeFolderOutputTag) - - -if not 'DBConnectionCOOL' in dir(): - DBConnectionCOOL = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_LAR;dbname=CONDBR2;" - -if ( ReadOFCFromCOOL ): - if 'InputOFCSQLiteFile' in dir(): - InputDBConnectionOFC = DBConnectionFile(InputOFCSQLiteFile) - else: - InputDBConnectionOFC = DBConnectionCOOL - -if ( ReadShapeFromCOOL ): - if 'InputShapeSQLiteFile' in dir(): - InputDBConnectionShape = DBConnectionFile(InputShapeSQLiteFile) - else: - InputDBConnectionShape = DBConnectionCOOL - -## Bad Channel - -if not 'ReadBadChannelFromCOOL' in dir(): - ReadBadChannelFromCOOL = True - -if ( ReadBadChannelFromCOOL ): - if 'InputBadChannelSQLiteFile' in dir(): - InputDBConnectionBadChannel = DBConnectionFile(InputBadChannelSQLiteFile) - else: - #InputDBConnectionBadChannel = "oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_LAR;dbname=CONDBR2;" - InputDBConnectionBadChannel = "COOLOFL_LAR/CONDBR2" - -########################################################################### -# print(summary) -########################################################################### - -OFCLog = logging.getLogger( "OFCLog" ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " *** LAr OFC summary *** " ) -OFCLog.info( " ======================================================== " ) -OFCLog.info( " RunNumber = "+str(RunNumber) ) -if ( ReadOFCFromCOOL ): - OFCLog.info( " InputDBConnectionOFC = "+InputDBConnectionOFC ) -else : - OFCLog.info( " InputPoolFileName = "+InputFileName ) -if 'OFCLArCalibFolderTag' in dir() : - OFCLog.info( " OFCLArCalibFolderTag = "+OFCLArCalibFolderTag ) -if ( ReadOFCFromCOOL and ChannelSelection != " " ): - OFCLog.info( " ChannelSelection = "+ChannelSelection ) -OFCLog.info( " OutputOFCRootFullFileName = "+OutputOFCRootFileDir+"/"+OutputOFCRootFileName ) -OFCLog.info( " OutputPoolFullFileName = "+OutputOFCPoolFileDir+"/"+OutputPoolFileName ) -OFCLog.info( " OutputObjectSpecOFC = "+str(OutputObjectSpecOFC) ) -OFCLog.info( " OutputObjectSpecTagOFC = "+str(OutputObjectSpecTagOFC) ) -OFCLog.info( " IOVBegin = "+str(IOVBegin) ) -OFCLog.info( " IOVEnd = "+str(IOVEnd) ) -OFCLog.info( " LArCalibOutputDB = "+OutputDB ) -OFCLog.info( " ======================================================== " ) - -########################################################################### -# -# Global settings -# -########################################################################### - -include("AthenaCommon/Atlas_Gen.UnixStandardJob.py") - -# -# Provides ByteStreamInputSvc name of the data file to process in the offline context -# - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc -from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) - -include("LArCalibProcessing/LArCalib_MinimalSetup.py") - -########################################################################### -# # -# Input conditions data (OFC) for COOL and/or POOL # -# # -########################################################################### - -include("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") -include("LArCondAthenaPool/LArCondAthenaPool_joboptions.py") - -from IOVDbSvc.CondDB import conddb -PoolFileList = [] - -if not 'InputBadChannelSQLiteFile' in dir(): - OFCLog.info( "Read Bad Channels from Oracle DB") -else : - OFCLog.info( "Read Bad Channels from SQLite file") - -if 'BadChannelsLArCalibFolderTag' in dir() : - BadChannelsTagSpec = LArCalibFolderTag (BadChannelsFolder,BadChannelsLArCalibFolderTag) - conddb.addFolder("",BadChannelsFolder+"<tag>"+BadChannelsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') -else : - conddb.addFolder("",BadChannelsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg, LArBadFebCondAlg -theLArBadChannelCondAlg=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) -condSeq+=theLArBadChannelCondAlg - -if not SuperCells: - if 'MissingFEBsLArCalibFolderTag' in dir() : - MissingFEBsTagSpec = LArCalibFolderTag (MissingFEBsFolder,MissingFEBsLArCalibFolderTag) - conddb.addFolder("",MissingFEBsFolder+"<tag>"+MissingFEBsTagSpec+"</tag>"+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') - else : - conddb.addFolder("",MissingFEBsFolder+"<dbConnection>"+InputDBConnectionBadChannel+"</dbConnection>",className='CondAttrListCollection') - - theLArBadFebCondAlg=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) - condSeq+=theLArBadFebCondAlg - -## define the DB Gobal Tag : -svcMgr.IOVDbSvc.GlobalTag = LArCalib_Flags.globalFlagDB -try: - svcMgr.IOVDbSvc.DBInstance="" -except: - pass - - -from LArCalibProcessing.LArCalibCatalogs import larCalibCatalogs -svcMgr.PoolSvc.ReadCatalog += larCalibCatalogs - -if ( ReadOFCFromCOOL ): - if not ('InputOFCSQLiteFile') in dir(): - OFCLog.info( "Read OFC from Oracle" ) - else : - OFCLog.info( "Read OFC from SQLite file" ) - -if ( ReadOFCFromCOOL ): - conddb.addFolder("",OFCFolder+"<tag>"+OFCFolderTagSpec+"</tag><key>LArOFCIn</key><dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ ChannelSelection) - if NColl > 0: - conddb.addFolder("",OFCFolder+"<tag>"+OFCFolderTagSpecmu+"</tag><key>LArOFCInmu</key><dbConnection>"+InputDBConnectionOFC+"</dbConnection>"+ ChannelSelection) - -else: - if 'InputPoolFileName' in dir(): - OFCLog.info( "Read OFC and Shape from POOL file") - PoolFileList += [ InputPoolDir+"/"+InputPoolFileName ] - else: - OFCLog.info( "No PoolFileList found! Please list the POOL files containing OFC or read from COOL." ) - theApp.exit(-1) - - - -if ( ReadShapeFromCOOL ): - if not ('InputShapeSQLiteFile') in dir(): - OFCLog.info( "Read Shape from Oracle" ) - else : - OFCLog.info( "Read Shape from SQLite file" ) - -if ( ReadShapeFromCOOL ): - conddb.addFolder("",ShapeFolder+"<tag>"+ShapeFolderTagSpec+"</tag><key>LArShapeIn</key><dbConnection>"+InputDBConnectionShape+"</dbConnection>"+ ChannelSelection) - - -if ( len(PoolFileList)>0 ): - - from AthenaCommon.ConfigurableDb import getConfigurable - svcMgr += getConfigurable( "ProxyProviderSvc" )() - svcMgr.ProxyProviderSvc.ProviderNames += [ "CondProxyProvider" ] - - svcMgr += getConfigurable( "CondProxyProvider" )() - svcMgr.CondProxyProvider.InputCollections += PoolFileList - -########################################################################### -# pickup one phase OFC # -########################################################################### - -from LArCalibUtils.LArCalibUtilsConf import LArOFPhasePicker -LArOFPhasePick = LArOFPhasePicker("LArOFPhasePicker") -if not SuperCells: - LArOFPhasePick.KeyPhase = "LArOFCPhase" -LArOFPhasePick.KeyOFC_new = OFCKey -LArOFPhasePick.KeyOFC = "LArOFCIn" -LArOFPhasePick.KeyShape_new = ShapeKey -LArOFPhasePick.KeyShape = "LArShapeIn" -LArOFPhasePick.GroupingType = GroupingType -LArOFPhasePick.DefaultPhase = DefaultPhase -LArOFPhasePick.TimeOffsetCorrection = TimeOffsetCorrection -LArOFPhasePick.isSC = SuperCells -topSequence += LArOFPhasePick - -if NColl > 0: - LArOFPhasePickermu = LArOFPhasePicker("LArOFPhasePickermu") - if not SuperCells: - LArOFPhasePickermu.KeyPhase = "LArOFCPhase" - LArOFPhasePickermu.KeyOFC_new = OFCKey+"_mu" - LArOFPhasePickermu.KeyOFC = "LArOFCInmu" - LArOFPhasePickermu.doShape = False - LArOFPhasePickermu.GroupingType = GroupingType - LArOFPhasePickermu.DefaultPhase = DefaultPhase - LArOFPhasePickermu.TimeOffsetCorrection = TimeOffsetCorrection - LArOFPhasePickermu.isSC = SuperCells - topSequence += LArOFPhasePickermu - -########################################################################### - -if ( WriteNtuple ) : - - if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC - LArOnOffIdMappingSC() - LArCalibIdMappingSC() - else: - from LArCabling.LArCablingAccess import LArOnOffIdMapping - LArOnOffIdMapping() - - from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple - LArOFC2Ntup = LArOFC2Ntuple("LArOFC2Ntuple") - LArOFC2Ntup.ContainerKey = OFCKey - LArOFC2Ntup.AddFEBTempInfo = False - LArOFC2Ntup.isSC = SuperCells - topSequence+=LArOFC2Ntup - - if NColl > 0: - LArOFC2Ntuplemu = LArOFC2Ntuple("LArOFC2Ntuplemu") - LArOFC2Ntuplemu.ContainerKey = OFCKey+"_mu" - LArOFC2Ntuplemu.NtupleName="OFC_mu" - LArOFC2Ntuplemu.AddFEBTempInfo = False - LArOFC2Ntuplemu.isSC = SuperCells - topSequence+=LArOFC2Ntuplemu - - theApp.HistogramPersistency = "ROOT" - from GaudiSvc.GaudiSvcConf import NTupleSvc - if os.path.exists(OutputOFCRootFileDir+"/"+OutputOFCRootFileName): - os.remove(OutputOFCRootFileDir+"/"+OutputOFCRootFileName) - svcMgr += NTupleSvc() - svcMgr.NTupleSvc.Output = [ "FILE1 DATAFILE='"+OutputOFCRootFileDir+"/"+OutputOFCRootFileName+"' OPT='NEW'" ] - - -if ( WritePoolFile ) : - - from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg - if os.path.exists(OutputOFCPoolFileDir+"/"+OutputPoolFileName): - os.remove(OutputOFCPoolFileDir+"/"+OutputPoolFileName) - OutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",OutputOFCPoolFileDir+"/"+OutputPoolFileName, - [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV) - OutputConditionsAlg.Run1 = IOVBegin - if IOVEnd>0: - OutputConditionsAlg.Run2 = IOVEnd - - if ( FillShape ): - OutputConditionsAlg.ObjectList += [OutputObjectSpecShape] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagShape] - - if NColl > 0: - OutputConditionsAlg.ObjectList += [OutputObjectSpecOFCmu] - OutputConditionsAlg.IOVTagList += [OutputObjectSpecTagOFCmu] - - svcMgr.IOVDbSvc.dbConnection = OutputDB - - from AthenaCommon.AppMgr import ServiceMgr - from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc - svcMgr += IOVRegistrationSvc() - svcMgr.IOVRegistrationSvc.OutputLevel = WARNING - svcMgr.IOVRegistrationSvc.RecreateFolders = False -# svcMgr.IOVRegistrationSvc.SVFolder = True - -########################################################################### -# Use EventSelector to select IOV # -########################################################################### - -from McEventSelector.McEventSelectorConf import McEventSelector -svcMgr += McEventSelector("EventSelector") -#svcMgr.EventSelector.RunNumber = 10000000 # not runNumberRunNumber -svcMgr.EventSelector.RunNumber = int(RunNumber) # not runNumberRunNumber -svcMgr.EventSelector.EventsPerRun = 1 -svcMgr.EventSelector.FirstEvent = 1 -svcMgr.EventSelector.InitialTimeStamp = 0 -svcMgr.EventSelector.TimeStampInterval = 1 - -########################################################################## -# don't remove otherwise infinite loop # -########################################################################## - -theApp.EvtMax = 1 - -########################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING -svcMgr.MessageSvc.defaultLimit = 10000 -svcMgr.MessageSvc.Format = "% F%20W%S%7W%R%T %0W%M" - -svcMgr+=CfgMgr.AthenaEventLoopMgr(OutputLevel = VERBOSE) - -from AthenaCommon.AppMgr import theAuditorSvc -from AthenaCommon.ConfigurableDb import getConfigurable -theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel = WARNING) -theAuditorSvc += getConfigurable("ChronoAuditor")() -theAuditorSvc += getConfigurable("NameAuditor")() - -########################################################################### - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RecomputeOFCs.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RecomputeOFCs.py deleted file mode 100644 index d654a248ec500c6d89b9c11028b3f2d4a6145e5b..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_RecomputeOFCs.py +++ /dev/null @@ -1,89 +0,0 @@ -#Example topOptions to re-run OFC computation & picking from the database - - -#INPUTS: -#RunNumber=180383 -#IOVBegin=180383 -#IOVEnd=2147483647 -#partition=["EMBA","EMBAPS"]#,"EMBC"]#,"EMBAPS","EMBCPS"] -#gain=[0]#,1,2] - -#Technicalities: -#OutputOFCRootFileDir = '.' -#OutputPoolFileDir = '.' - -WriteNtuple = False - -include ("LArCalibProcessing/LArCalib_Flags.py") - -# -# Common LArPhysWaveShifter settings -# - -ShiftMode = 3 -Nsamplings = 2 -TimeShiftGuardRegion = 12 - -# -# Dphase = 3 -# - -OFCKey = "LArOFC" -ShapeKey = "LArShape" -OFCTreeName = "OFC" -ShapeTreeName = "SHAPE" - -Nsamples = 5 -Dphases = 3 # 3x1.04 ns binning -Nphases = 8 - - -#Nsamples = 5 -#Dphases = 1 # 1.04 ns binning -#Nphases = 24 - - -isFCAL=False - -for p in partition: - if p.startswith("FCAL"): isFCAL=True - - -# -# PhysCaliTdiff -# -UsePhysCaliTdiff = True -ReadPhysCaliTdiffFromCOOL = True -PhysCaliTdiffLArCalibFolderTag="-gaincorr-01" - - -#Picking: -doOFCPicker=True -DefaultPhase = 1 -FillShapeCorr=False -#TimeOffsetCorrection = 0 -TimeOffsetCorrection = 12 -ShapeKeyCorr = "LArShapeCorr" - - - -OutputOFCRootFileName="LArOFCPhys_"+str(RunNumber)+"_"+"_".join(partition)+"_Gain_"+str(gain[0])+".root" -OutputPoolFileName="LArOFCPhys_"+str(RunNumber)+"_"+"_".join(partition)+"_Gain_"+str(gain[0])+".pool.root" -OutputSQLiteFile=OutputPoolFileDir+"/myDB"+str(RunNumber)+"_"+"_".join(partition)+"_Gain_"+str(gain[0])+".db" - -#include ( "/afs/cern.ch/user/l/larcalib/w0/DEV/Reconstruction/toolbox/UseLArExtendedSubDetGrouping.py" ) -from LArConditionsCommon.LArExtendedSubDetGrouping import LArExtendedSubDetGrouping -LArExtendedSubDetGrouping = LArExtendedSubDetGrouping() -GroupingType="ExtendedSubDetector" -selection = LArExtendedSubDetGrouping.getChannelSelection(partition,gain) -ChannelSelection='<channelSelection>'+selection+'</channelSelection>' -printfunc (ChannelSelection) -printfunc ("CoolChannel Selection for ", partition, " and ",gain, " gain. ") - -#svcMgr.PoolSvc.ReadCatalog+=["prfile:poolcond/PoolCat_comcond_castor.xml" ] - -#include ( "LArCalibProcessing/LArCalib_OFC_Phys_TwoFolders_jobOptions.py" ) - -include ( "LArCalibProcessing/LArCalib_OFC_Phys_jobOptions.py") - -svcMgr.MessageSvc.OutputLevel = INFO diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py deleted file mode 100644 index 591cf950caa5d5cb898157a6f188eacaf7f34fa7..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_ToCoolInline.py +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -########################################################################### -# -# TopOptions to copy a complete set of conditions for a given run to -# one POOL file and one sqlite file -# -# Walter.Lampl@cern.ch -# -########################################################################### - - -import os - -if not "SuperCells" in dir(): - SuperCells=False - - - -if not SuperCells: - include("LArCalibProcessing/LArCalib_Flags.py") -else: - include("LArCalibProcessing/LArCalib_FlagsSC.py") - -if 'dbname' not in dir(): - dbname="CONDBR2" -inputDB="sqlite://;schema="+sqliteIn+";dbname="+dbname -outputDB="sqlite://;schema="+sqliteOut+";dbname="+dbname - -if 'foldertag' not in dir(): - if SuperCells: - foldertag = '-UPD3-01' - else: - foldertag = '-UPD3-00' - -if 'foldertag' not in dir(): - if SuperCells: - foldertag = '-UPD3-01' - else: - foldertag = '-UPD3-00' -if 'sqliteIn' not in dir(): - sqliteIn="freshConstants.db" - -if 'sqliteOut' not in dir(): - sqliteOut=sqliteIn+"Inline.out" - -if "globalTag" not in dir(): - globalTag = "CONDBR2-BLKPA-RUN2-03" - - -if "inputFolders" not in dir(): - inputFolders=[ (LArCalib_Flags.LArPedestalFolder, LArCalibFolderTag(LArCalib_Flags.LArPedestalFolder, foldertag), "LArPedestal"), - (LArCalib_Flags.LArRampFolder, LArCalibFolderTag(LArCalib_Flags.LArRampFolder, foldertag), "LArRamp"), - #(LArCalib_Flags.LArMphysOverMcalFolder, LArCalibFolderTag(LArCalib_Flags.LArMphysOverMcalFolder, foldertag.replace("-01","-00")), "LArMphysOverMcal"), - (LArCalib_Flags.LArOFCCaliFolder, LArCalibFolderTag(LArCalib_Flags.LArOFCCaliFolder, foldertag), "LArOFCCali"), - #(LArCalib_Flags.LArShapeRTMSamplesFolder, LArCalibFolderTag(LArCalib_Flags.LArShapeRTMSamplesFolder, foldertag.replace("-01","-00")), "LArShape"), - ] - - -if os.access(sqliteOut,os.F_OK): - printfunc ("File",sqliteOut,"exists already, removing ....") - os.remove(sqliteOut) - - -import AthenaCommon.AtlasUnixGeneratorJob #use MC event selector - -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource="data" -globalflags.InputFormat="bytestream" -globalflags.DatabaseInstance=dbname - -## get a handle to the default top-level algorithm sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -online=True -include ("LArConditionsCommon/LArMinimalSetup.py") -from LArCabling.LArCablingAccess import LArOnOffIdMapping -LArOnOffIdMapping() -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC,LArCalibIdMappingSC - LArOnOffIdMappingSC() - - -theApp.EvtMax = 1 -conddb.setGlobalTag(globalTag) #For id mapping - -svcMgr.PoolSvc.SortReplicas=False - -svcMgr.EventSelector.RunNumber = 999999 - -from LArCalibTools.LArCalibToolsConf import LArCompleteToFlat -theLArCompleteToFlat=LArCompleteToFlat() -theLArCompleteToFlat.FakeEMBPSLowGain=True -theLArCompleteToFlat.isSC = SuperCells - -outTypes = [] -overrides = [] -for (fldr,tag,key,classtype) in inputFolders: - if "Pedestal" in fldr: - outTypes.append("Pedestal") - theLArCompleteToFlat.PedestalInput=key - overrides.extend(["Pedestal", "PedestalRMS"]) - elif "Ramp" in fldr: - outTypes.append("Ramp") - theLArCompleteToFlat.RampInput=key - overrides.extend(["RampVec"]) - elif "OFC" in fldr: - outTypes.append("OFC") - theLArCompleteToFlat.OFCInput=key - overrides.extend(["OFCa", "OFCb","TimeOffset"]) - elif "MphysOverMcal" in fldr: - outTypes.append("MphysOverMcal") - theLArCompleteToFlat.MphysOverMcalInput=key - overrides.extend(["MphysOverMcal"]) - elif "Shape" in fldr: - outTypes.append("Shape") - theLArCompleteToFlat.ShapeInput=key - overrides.extend(["Shape"]) - if len(tag): - conddb.addFolder("","<db>"+inputDB+"</db>"+fldr+"<tag>"+tag+"</tag>",className=classtype) - else: - conddb.addFolder("","<db>"+inputDB+"</db>"+fldr,className=classtype) - pass - -topSequence+=theLArCompleteToFlat - -flatName="ElecCalibFlat" -if SuperCells: - flatName+="SC" -if "outObjects" not in dir(): - outObjects=["CondAttrListCollection#/LAR/"+flatName+"/"+ot for ot in outTypes] - -outTags=[] -from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg -theOutputConditionsAlgRec=OutputConditionsAlg("OutputConditionsAlgInline","dummy.root", outObjects,outTags,True) - - -svcMgr.IOVDbSvc.dbConnection = outputDB -svcMgr.IOVDbSvc.DBInstance="" - -from RegistrationServices.RegistrationServicesConf import IOVRegistrationSvc -svcMgr += IOVRegistrationSvc() -svcMgr.IOVRegistrationSvc.RecreateFolders = True -svcMgr.IOVRegistrationSvc.SVFolder=True -print("OVERRIDES ARE:",overrides) -svcMgr.IOVRegistrationSvc.OverrideNames = overrides -types=[] -for i in range(len(svcMgr.IOVRegistrationSvc.OverrideNames)): - types.append("Blob16M"); -svcMgr.IOVRegistrationSvc.OverrideTypes = types; - -svcMgr.DetectorStore.Dump=True - -svcMgr.PoolSvc.ReadCatalog += ["xmlcatalog_file:PoolFileCatalog.xml"] - -if 'poolcat' in dir(): - svcMgr.PoolSvc.WriteCatalog="xmlcatalog_file:"+poolcat - -svcMgr.MessageSvc.defaultLimit=99999999 diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/UseLArExtendedSubDetGrouping.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/UseLArExtendedSubDetGrouping.py deleted file mode 100644 index 326c0061198fab897f4d6b924ff74d1ac78e81ee..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/UseLArExtendedSubDetGrouping.py +++ /dev/null @@ -1,80 +0,0 @@ -printfunc ('LArExtendedSubDetGrouping') - -from LArConditionsCommon.LArExtendedSubDetGrouping import LArExtendedSubDetGrouping -LArExtendedSubDetGrouping = LArExtendedSubDetGrouping() -LArExtendedSubDetGrouping.setWithCorr(False) - -## defined gain : - -## HIGH -if ( Gain=="HIGH" ): - gain= [0] - -## MEDIUM -elif ( Gain=="MEDIUM" ) : - gain= [1] - -## LOW -elif ( Gain=="LOW" ) : - gain= [2] - -else: - gain=[0,1,2] - -## defined partition - -if (int(RunNumberFlag)<100000) : - ## EMB + EMBPS A 64 (32+32) - if ( Partition=='EB-EMBA' and ( Gain=="HIGH" or Gain=="MEDIUM" ) ) : - partition =['EMBAPS','EMBA'] - printfunc ('EMBA+EMBAPS partition') - elif ( Partition=='EB-EMBC' and ( Gain=="HIGH" or Gain=="MEDIUM" ) ) : - partition =['EMBCPS','EMBC'] - printfunc ('EMBC+EMBCPS partition') - elif ( Partition=='EB-EMBA' and Gain=="LOW" ) : - partition =['EMBA'] - printfunc ('EMBA partition') - elif ( Partition=='EB-EMBC' and Gain=="LOW" ) : - partition =['EMBC'] - printfunc ('EMBC partition') - -else : - ## EMB A+C - if ( Partition=='EB-EMBA' and ( PartitionTypeGeneric!='EMBPS' ) ) : - partition =['EMBA'] - printfunc ('EMBA partition') - elif ( Partition=='EB-EMBC' and ( PartitionTypeGeneric!='EMBPS' ) ) : - partition =['EMBC'] - printfunc ('EMBC partition') - - ## EMBPS A+C - if ( Partition=='EB-EMBA' and ( PartitionTypeGeneric=='EMBPS' ) ) : - partition =['EMBAPS'] - printfunc ('EMBAPS partition') - elif ( Partition=='EB-EMBC' and ( PartitionTypeGeneric=='EMBPS' ) ) : - partition =['EMBCPS'] - printfunc ('EMBCPS partition') - - -## EMEC + PS A 44 -if ( Partition=='EB-EMECA' ) : - partition =['EMECAPS','EMECA'] -elif ( Partition=='EB-EMECC' ) : - partition =['EMECCPS','EMECC'] - -## HEC A + C 8 (4+4) -elif ( PartitionType=='HEC'): - partition =['HECA','HECC'] - -## FCAL A + C 2 (1+1) -elif ( PartitionType=='FCAL') : - partition =['FCALA','FCALC'] - -selection = LArExtendedSubDetGrouping.getChannelSelection(partition,gain) -ChannelSelection='<channelSelection>'+selection+'</channelSelection>' -printfunc (ChannelSelection) -printfunc ("CoolChannel Selection for ", partition, " and ",gain, " gain. ") - - - - diff --git a/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4FSStartPointFilterBody.py b/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4FSStartPointFilterBody.py deleted file mode 100755 index de3c1e8e8877eab79ed4d4ce3c2516b9efb10758..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4/LArG4GenShowerLib/share/LArG4FSStartPointFilterBody.py +++ /dev/null @@ -1,32 +0,0 @@ -# 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" diff --git a/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt b/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt index 190a2296666a1454e1fe273220ce204ae4205229..3004ca9ed017cc71901dbf3cf2252a3a47951cd8 100644 --- a/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt +++ b/LArCalorimeter/LArG4/LArG4H6SD/CMakeLists.txt @@ -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} ) diff --git a/LArCalorimeter/LArG4/LArG4H6SD/python/LArTBH6BeamInfoGetter.py b/LArCalorimeter/LArG4/LArG4H6SD/python/LArTBH6BeamInfoGetter.py deleted file mode 100644 index 32d7ff5e4ec188d3d9bb61fa2c83b73c79301f85..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4/LArG4H6SD/python/LArTBH6BeamInfoGetter.py +++ /dev/null @@ -1,53 +0,0 @@ -# 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 - - diff --git a/LArCalorimeter/LArG4/LArG4H6SD/python/__init__.py b/LArCalorimeter/LArG4/LArG4H6SD/python/__init__.py deleted file mode 100644 index 8860c71335c1b6066affc4363f9e5164ee187ebf..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4/LArG4H6SD/python/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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 ' - -# -#======================================================================= - diff --git a/LArCalorimeter/LArG4/LArG4Validation/share/AODElectronContainerReaderBody.py b/LArCalorimeter/LArG4/LArG4Validation/share/AODElectronContainerReaderBody.py deleted file mode 100755 index f68e0dcebc35fbabdcd3fdd56dfef51a6163ebb0..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4/LArG4Validation/share/AODElectronContainerReaderBody.py +++ /dev/null @@ -1,22 +0,0 @@ -# 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'" ] diff --git a/LArCalorimeter/LArG4/LArG4Validation/share/postInclude.SingleTrackValidation.py b/LArCalorimeter/LArG4/LArG4Validation/share/postInclude.SingleTrackValidation.py deleted file mode 100644 index f57902df7202b5a30ce521baa8eaf68611f52009..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4/LArG4Validation/share/postInclude.SingleTrackValidation.py +++ /dev/null @@ -1,18 +0,0 @@ -# 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" diff --git a/LArCalorimeter/LArG4TB/H6G4Sim/CMakeLists.txt b/LArCalorimeter/LArG4TB/H6G4Sim/CMakeLists.txt index 3c9b06cbaee12276c2521f690c40220f90633391..d12eee818e5c87f379c0718c4c54908a8bb25b4a 100644 --- a/LArCalorimeter/LArG4TB/H6G4Sim/CMakeLists.txt +++ b/LArCalorimeter/LArG4TB/H6G4Sim/CMakeLists.txt @@ -7,6 +7,4 @@ atlas_subdir( H6G4Sim ) # Install files from the package: atlas_install_python_modules( python/h6prod_getxy.py python/__init__.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-ignore=F401,F403,F405,F821 ) atlas_install_runtime( G4macros/*.mac ) -atlas_install_scripts( share/cbtG4_trf.py ) diff --git a/LArCalorimeter/LArG4TB/H6G4Sim/share/cbtG4_trf.py b/LArCalorimeter/LArG4TB/H6G4Sim/share/cbtG4_trf.py deleted file mode 100755 index f420e5c37705ef21e032ed1fa403f00e19899687..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4TB/H6G4Sim/share/cbtG4_trf.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -__doc__ = """Run Geant4 simulation on generated events and produce a HITS file.""" - -from PyJobTransformsCore.trf import * -import PyJobTransformsCore.basic_trfarg as trfarg -from PyJobTransformsCore.full_trfarg import * -from PyJobTransformsCore.trfutil import * - -class BoolCTBArg(trfarg.BoolArg): - """Options for boolean switches""" - def __init__(self,help,name='BoolCTBArg'): - trfarg.BoolArg.__init__(self,help,name) - - def isFullArgument(self): - return True - - def jobOrTask(self): - return 'job' - -class CTBH62004G4JobTransform( JobTransform ): - def __init__(self): - JobTransform.__init__(self, - authors = [ Author('Denis Salihagic', 'Denis.Salihagic@cern.ch'), - Author('Pavol Strizenec', 'pavol@mail.cern.ch') ] , - skeleton='H6G4Sim/skeleton_G4TB_LArH6-2004.py' , - help = __doc__ , - ) - - #add arguments - self.add( OutputHitsFileArg() ) - self.add( MaxEventsArg(), default=10 ) - self.add( RandomSeedArg('random seed for simulation'), default=1234 ) - self.add( RandomSeedArg(name = 'genSeed1', help = 'random seed 1 for GenSeed'), default=2000160768. ) - self.add( RandomSeedArg(name = 'genSeed2', help = 'random seed 2 for GenSeed'), default=643921183. ) - self.add( GeometryVersionArg(), default='ATLAS-H6-2004-00' ) - self.add( RandomSeedArg(name = 'xCryo', help = 'X position of cryostat'), default=0. ) - self.add( RandomSeedArg(name = 'yTable', help = 'Y position of moveable table'), default=0.) - self.add( RandomSeedArg(name = 'xSmear', help = 'Beam smear in X'), default=25.0 ) - self.add( RandomSeedArg(name = 'ySmear', help = 'Beam smear in Y'), default=25.0 ) - self.add( RandomSeedArg(name = 'beamParticle', help = 'Beam particle'), default = 211 ) - self.add( ConditionsTagArg(name = 'beamEnergy', help = 'Energy of beam'), default = str(40000.) ) - self.add( BasicStringArg(name = 'PhysicsList', help = 'Which physics list to use'), default='QGSP_BERT') - self.add( BoolCTBArg(name = 'IsSingleRun', help = 'Is this for single run ?'), default=True ) - self.add( BoolCTBArg(name = 'DoFiltering', help = 'Do a geometrical filter ?'), default=True ) - self.add( BoolCTBArg(name = 'DoBirk', help = 'Do a BirkLaw ?'), default=True ) -# self.add( atlasG4Config.IgnoreConfigErrorArg(), default=False ) - # avoid sqlite nfs lock problems - self.add( SQLiteSupport() ) - -# def runJob(self): - #install the DBRelease 'by hand' (needed since preRunAction()'s are not called) - #self.getArgument('DBRelease').install() - # get the list of arguments to be used in sub-transforms - #argDict = self.argumentOriginalDict() - # no need to re-install the DBRelease in sub-transforms - #argDict['DBRelease'] = 'NONE' - # - # AtlasG4 phase - # -# g4 = CTBH62004G4JobTransform() -# g4.setJobReportOptions('None') -# report = JobReport() -# report.setProducer(self.name(),self.version()) -# report.addReport( g4.exeSysArgs() ) - -# return report - - -# execute it if not imported -if __name__ == '__main__': - trf = CTBH62004G4JobTransform() - sys.exit(trf.exeSysArgs().exitCode()) - - diff --git a/LArCalorimeter/LArG4TB/H6G4Sim/share/jobOptions.H6G4Sim.py b/LArCalorimeter/LArG4TB/H6G4Sim/share/jobOptions.H6G4Sim.py deleted file mode 100755 index d849942d2f10239c948c70ace9bf06f732cd0692..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4TB/H6G4Sim/share/jobOptions.H6G4Sim.py +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -#============================================================== -# -# Job options file for Geant4 Simulations -# -#============================================================== -theApp.setup( MONTECARLO ) -include( "NovaCnvSvc/NovaCnvSvc_jobOptions.py" ) - -include( "NovaConverters/NovaConverters_jobOptions.py" ) - -include( "PartPropSvc/PartPropSvc.py" ) - -# hit athenapool converter -# Remove this comment if you want to write out the hits -include( "AtlasG4Sim/HitAthenaPoolWriteOptions.py" ) - -# instanciate explicitely the DetDescr manager here -include ("DetDescrCnvSvc/DetStore_joboptions.py") - -DetDescrCnvSvc = Service( "DetDescrCnvSvc" ) -DetDescrCnvSvc.DecodeIdDict = True -include( "CaloIdCnv/CaloIdCnv_joboptions.py" ) - -include( "G4Svc/jobOptions.G4Svc.py" ) - -# GeoModel initialization -include( "AtlasGeoModel/GeoModelCommon.py" ) - -# OUTPUT PRINTOUT LEVEL -# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) -# you can override this for individual modules if necessary -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = 4 -#-------------------------------------------------------------- -# Event related parameters -#-------------------------------------------------------------- -# Number of events to be processed (default is 10) -theApp.EvtMax = 100 -#------------------------------------------------------------- -# Configure algorithms and services -#------------------------------------------------------------- -# G4Svc -# ----- -G4Svc = Service( "G4Svc" ) -G4Svc.PhysicsList = "none" -G4Svc.SaveHits = False -G4Svc.Visualize = False -G4Svc.RunVerbosity = 2 -G4Svc.EventVerbosity = 0 -G4Svc.TrackingVerbosity = 0 -G4Svc.Listener = False -G4Svc.InteractiveG4 = False -G4Svc.FADSMacro = "env.mac:H6G4LArCal.mac:PhysicsList.mac:Filters.mac" -# ParticleGun -# ----------------- -import AthenaCommon.AtlasUnixGeneratorJob -include("GeneratorUtils/StdEvgenSetup.py") -import ParticleGun as PG -try: - ParticleGeneratorPDG=' constant '+ParticlePDG - particl = int(ParticlePDG) -except ValueError: - log.warning('tbH6Generator: You are running geantino') - ParticleGeneratorPDG=' constant 999' - particl = 999 -# - Energy -try: - ParticleGeneratorEnergy=' constant '+ repr(Energy) - energy = float(Energy) -except ValueError: - log.warning('Unknown energy. Set 200 GeV') - ParticleGeneratorEnergy=' constant 200000' - energy = 200000. - -pg = PG.ParticleGun() -ps = PG.ConstEnergySampler(pid=particl, energy=energy, eta=PG.UniformSampler(-6.0, 6.0)) -pg.samplers.append(ps) -topSeq += pg -#-------------------------------------------------------------- diff --git a/LArCalorimeter/LArG4TB/H6G4Sim/share/jobOptions_2002.H6G4Sim.py b/LArCalorimeter/LArG4TB/H6G4Sim/share/jobOptions_2002.H6G4Sim.py deleted file mode 100755 index 2f96ac5caf270d193bf61ff6e42873b0afd4a6c6..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4TB/H6G4Sim/share/jobOptions_2002.H6G4Sim.py +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -#============================================================== -# -# Job options file for Geant4 Simulations -# -#============================================================== -theApp.setup( MONTECARLO ) -include( "NovaCnvSvc/NovaCnvSvc_jobOptions.py" ) - -include( "NovaConverters/NovaConverters_jobOptions.py" ) - -include( "PartPropSvc/PartPropSvc.py" ) - -# hit athenapool converter -# Remove this comment if you want to write out the hits -include( "AtlasG4Sim/HitAthenaPoolWriteOptions.py" ) - - -# instanciate explicitely the DetDescr manager here -include ("DetDescrCnvSvc/DetStore_joboptions.py") - -DetDescrCnvSvc = Service( "DetDescrCnvSvc" ) -DetDescrCnvSvc.DecodeIdDict = TRUE -include( "CaloIdCnv/CaloIdCnv_joboptions.py" ) - -include( "G4Svc/jobOptions.G4Svc.py" ) - -# GeoModel initialization -include( "AtlasGeoModel/GeoModelCommon.py" ) - - - -theApp.ExtSvc += ["AtRndmGenSvc"] -from RngComps.RngCompsConf import AtRndmGenSvc -RndmGenSvc = AtRndmGenSvc() -RndmGenSvc.Seeds = ["SINGLE 2040160768 443921183"] -ServiceMgr += RndmGenSvc - -# OUTPUT PRINTOUT LEVEL -# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) -# you can override this for individual modules if necessary -MessageSvc = Service( "MessageSvc" ) -MessageSvc.OutputLevel = 3 -#-------------------------------------------------------------- -# Event related parameters -#-------------------------------------------------------------- -# Number of events to be processed (default is 10) -theApp.EvtMax = 1 - -# ----------------- -# ----------------- -# ParticleGenerator -# ----------------- - -#ParticleGenerator = Algorithm("ParticleGenerator") - -#ParticleGenerator.orders = [ -# "pdgcode: constant 211", -# "energy: constant 100000", -# -# "vertX: flat -5.0 5.0", -# "vertY: flat -5.0 5.0", -# "vertZ: constant -21600.0", - -# "t: constant -21600.0", -# -# "momX: fixed 0", -# "momY: fixed 0", -# "momZ: fixed 1" -# -# ] -#------------------------------------------------------------- -# Configure algorithms and services -#------------------------------------------------------------- -# G4Svc -# ----- -G4Svc = Service( "G4Svc" ) -G4Svc.PhysicsList = "none" -G4Svc.SaveHits = False -G4Svc.Visualize = False -G4Svc.RunVerbosity = 2 -G4Svc.EventVerbosity = 0 -G4Svc.TrackingVerbosity = 0 -G4Svc.Listener = False -G4Svc.InteractiveG4 = False -G4Svc.FADSMacro = "H6G4LArCal2002.mac:PhysicsList.mac" - -#-------------------------------------------------------------- diff --git a/LArCalorimeter/LArG4TB/H6G4Sim/share/skeleton_G4TB_LArH6-2004.py b/LArCalorimeter/LArG4TB/H6G4Sim/share/skeleton_G4TB_LArH6-2004.py deleted file mode 100755 index 724406189cdb2010f813788d42280f5cd899e8ab..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArG4TB/H6G4Sim/share/skeleton_G4TB_LArH6-2004.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -# get the logger -from AthenaCommon.Logging import * -ctbG4log = logging.getLogger('ctbG4') - -ctbG4log.info('****************** STARTING CTB H6 G4 ******************') -#============================================================== -# Job definition parameters: -#============================================================== -from AthenaCommon.AthenaCommonFlags import jobproperties -#Jobs should stop if an include fails. -jobproperties.AthenaCommonFlags.AllowIgnoreConfigError=True - - -PoolHitsOutput = runArgs.outputHitsFile -SingleRun = runArgs.IsSingleRun -doFilter = runArgs.DoFiltering -doBirk = runArgs.DoBirk -ctbG4log.info( "*** IsSingleRun: "+str(SingleRun)) -ctbG4log.info( "*** doFiletring: "+str(doFilter)) -ctbG4log.info( "*** doBirkLaw: "+str(doBirk)) - -if SingleRun: - XCryo = float(runArgs.xCryo) - YTable = float(runArgs.yTable) - BeamE = float(runArgs.beamEnergy) - EvtMax = runArgs.maxEvents - ctbG4log.info( "*** XCryo: "+str(XCryo)) - ctbG4log.info( "*** YTable: "+str(YTable)) - ctbG4log.info( "*** Energy: "+str(BeamE)) -else: - from H6G4Sim.h6prod_getxy import * - iCryo = runArgs.xCryo - 1 - if iCryo < 0: - ctbG4log.info( "*** Negative iCryo! ") - iCryo = 0 - x,y,nevt = getXYInPolygon(iCryo, runArgs.maxEvents) - XCryo = float(x) - YTable = float(y) - BeamE = str(runArgs.beamEnergy) - EvtMax = nevt - ctbG4log.info( "*** XCryo: "+str(iCryo)+" "+str(XCryo)) - ctbG4log.info( "*** YTable: "+str(iCryo)+" "+str(YTable)) - ctbG4log.info( "*** Energy: "+str(BeamE)) - -XSmear = float(runArgs.xSmear) -YSmear = float(runArgs.ySmear) -G4Seed = runArgs.randomSeed -GSeed1 = str(runArgs.genSeed1) -GSeed2 = str(runArgs.genSeed2) -ParticlePDG = str(runArgs.beamParticle) -PhysicsList = runArgs.PhysicsList - -ctbG4log.info( "*** Events: "+str(EvtMax)) -ctbG4log.info( "*** Part.: "+ParticlePDG) -ctbG4log.info( "*** PhysList: "+PhysicsList) -ctbG4log.info( "*** XSmear: "+str(XSmear)) -ctbG4log.info( "*** YSmear: "+str(YSmear)) -ctbG4log.info( "*** GSeed1: "+GSeed1) -ctbG4log.info( "*** GSeed2: "+GSeed2) -ctbG4log.info( "*** G4Seed: "+str(G4Seed)) -ctbG4log.info( "*** PoolHitsOutput: "+PoolHitsOutput) - - -include("H6G4Sim/jobOptions.G4TB_LArH6-2004-prod.py") - diff --git a/LArCalorimeter/LArMonitoring/python/LArDigitalTriggMonAlg.py b/LArCalorimeter/LArMonitoring/python/LArDigitalTriggMonAlg.py index cde24917c034b988f3b5a615e110c9a834a3f468..d91fd677d084a739201bff6b1d22fcc45ef9c6d6 100644 --- a/LArCalorimeter/LArMonitoring/python/LArDigitalTriggMonAlg.py +++ b/LArCalorimeter/LArMonitoring/python/LArDigitalTriggMonAlg.py @@ -442,6 +442,16 @@ def LArDigitalTriggMonConfig(flags,larLATOMEBuilderAlg, nsamples=32, streamTypes ybins=partybins, pattern=[(part)]) + + partGroup_sc.defineHistogram('SC_part_time;OfflineLATOMEtime_'+thisSel, + title='LATOME #tau from Offline Computation '+selStrPart[thisSel]+';#tau [ns]; Evts;', + type='TH1F', + cutmask='SC_part_'+thisSel, + path=thisTopPath, + xbins=100,xmin=-25,xmax=25, + pattern=[(part)]) + + if not flags.Common.isOnline: continue # Skip the remaining histos if we are running offline #### HERE - plots which should only be booked for the nominal selection if thisSel != "passSCNom": continue @@ -481,13 +491,6 @@ def LArDigitalTriggMonConfig(flags,larLATOMEBuilderAlg, nsamples=32, streamTypes xbins=200,xmin=-10,xmax=10, pattern=[(part)]) - partGroup_sc.defineHistogram('SC_part_time;OfflineLATOMEtime_'+thisSel, - title='LATOME #tau from Offline Computation '+selStrPart[thisSel]+';#tau [ns]; Evts;', - type='TH1F', - cutmask='SC_part_'+thisSel, - path=thisTopPath, - xbins=100,xmin=-25,xmax=25, - pattern=[(part)]) partGroup_sc.defineHistogram('SC_part_et_onl;SC_ET_Onl_'+thisSel, title='SC eT [GeV] '+selStrPart[thisSel], @@ -553,8 +556,6 @@ if __name__=='__main__': from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg cfg.merge(LArBadChannelCfg(flags, isSC=True)) - - #from AthenaCommon.AppMgr import (ServiceMgr as svcMgr,ToolSvc) from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg SCData_acc = LArRawSCDataReadingCfg(flags) SCData_acc.OutputLevel=WARNING diff --git a/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.cxx b/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.cxx index c43f87a8afc31053f780f4785352e0e74398e74e..c1de8ebde8d12b2965a241f25d2b0ee538a3a1ff 100755 --- a/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.cxx +++ b/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.cxx @@ -326,6 +326,7 @@ StatusCode LArDigitalTriggMonAlg::fillHistograms(const EventContext& ctx) const auto& lvaluemap_digi = digiMonValueVec[iLyr]; auto& lvaluemap_digi_ALL = digiMonValueVec.back(); + // Determine to which partition this channel belongs to const int ThisPartition=whatPartition(id,side); Digi_partition = ThisPartition; // Fill the monitored variable diff --git a/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.h b/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.h index 96ed3b0ed6c425bb569020b0c1377f9605304fb5..086b47a26cdedbee8acc19fcaa84d173dc7aedc3 100755 --- a/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.h +++ b/LArCalorimeter/LArMonitoring/src/LArDigitalTriggMonAlg.h @@ -104,8 +104,8 @@ private: EMECPNS, //CALOSAMPLING(PreSamplerE, 0, 1) // 4 EMEC1NS, //CALOSAMPLING(EME1, 0, 1) // 5 EMEC2NS, //CALOSAMPLING(EME2, 0, 1) // 6 - EMEC2NS, //CALOSAMPLING(EME3, 0, 1) // 7 - EMEC2NS, //CALOSAMPLING(HEC0, 0, 1) // 8 + EMEC3NS, //CALOSAMPLING(EME3, 0, 1) // 7 + HEC0NS, //CALOSAMPLING(HEC0, 0, 1) // 8 HEC1NS, //CALOSAMPLING(HEC1, 0, 1) // 9 HEC2NS, //CALOSAMPLING(HEC2, 0, 1) // 10 HEC3NS, //CALOSAMPLING(HEC3, 0, 1) // 11 diff --git a/LArCalorimeter/LArRecUtils/CMakeLists.txt b/LArCalorimeter/LArRecUtils/CMakeLists.txt index 8d1368cd2c7993db29cae60e361605fbfa3e581f..f61d863c35a958b1bc7fb3a26a81ed08f1450865 100644 --- a/LArCalorimeter/LArRecUtils/CMakeLists.txt +++ b/LArCalorimeter/LArRecUtils/CMakeLists.txt @@ -25,7 +25,6 @@ atlas_add_component( LArRecUtils # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} --extend-ignore=F401,F821 ) # Test(s) in the package: atlas_add_test( LArFCalTowerBuilderTool diff --git a/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py deleted file mode 100644 index 5b7b807b8d2b0ed521f04c106bd8cda5a9103ece..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArADC2MeVCondAlgDefault.py +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Include import include -from IOVDbSvc.CondDB import conddb - -if conddb.isMC: - include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") -else: - include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") -if "SuperCells" not in dir(): - SuperCells = False -from LArRecUtils.LArRecUtilsConf import LArADC2MeVCondAlg -from AthenaCommon.AlgSequence import AthSequencer - -if SuperCells: - from LArCabling.LArCablingAccess import LArOnOffIdMappingSC -else: - from LArCabling.LArCablingAccess import LArOnOffIdMapping - -condSeq = AthSequencer("AthCondSeq") - - -def LArADC2MeVCondAlgDefault(): - - if SuperCells: - LArOnOffIdMappingSC() - else: - LArOnOffIdMapping() - - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArADC2MeVCondAlg"): - return getattr(condSeq,"LArADC2MeVCondAlg") - - theADC2MeVCondAlg=LArADC2MeVCondAlg(LArADC2MeVKey = 'LArADC2MeV') - - if conddb.isMC: - from LArConditionsCommon.LArCondFlags import larCondFlags - if not larCondFlags.hasMphys(): - theADC2MeVCondAlg.LArMphysOverMcalKey="" #No MphysOVerMcal - else: - theADC2MeVCondAlg.LArMphysOverMcalKey="LArMphysOverMcalSym" - - if not larCondFlags.hasHVCorr(): - theADC2MeVCondAlg.LArHVScaleCorrKey="" - - theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSym" - theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASym" - theADC2MeVCondAlg.LArRampKey="LArRampSym" - - - theADC2MeVCondAlg.UseFEBGainTresholds=False - else: # not MC: - from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault - LArFebConfigCondAlgDefault() - if 'COMP200' in conddb.GetInstance(): # Run1 case - theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSym" - theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASym" - - condSeq+=theADC2MeVCondAlg - return theADC2MeVCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArADC2MeVSCCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArADC2MeVSCCondAlgDefault.py deleted file mode 100644 index 33faa1d9b165ebcdff283e3869867fda7c0e9f7d..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArADC2MeVSCCondAlgDefault.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from LArRecUtils.LArRecUtilsConf import LArADC2MeVCondAlg -from AthenaCommon.AlgSequence import AthSequencer -from LArCabling.LArCablingAccess import LArOnOffIdMappingSC -from IOVDbSvc.CondDB import conddb - -def addLArFlatFolder (db, obj, calg, folder_base='/LAR/ElecCalibFlat/',qual=''): - from AthenaCommon.AlgSequence import AthSequencer - condSequence = AthSequencer("AthCondSeq") - - folder = folder_base + obj - if not conddb.folderRequested(folder): - conddb.addFolder(db, folder + qual, - className = 'CondAttrListCollection') - condSequence += calg (ReadKey=folder, WriteKey='LAr'+obj+'SC') - return - -def LArADC2MeVSCCondAlgDefault(isMC=True): - - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArADC2MeVSCCondAlg"): - return getattr(condSeq,"LArADC2MeVSCCondAlg") - - LArOnOffIdMappingSC() - condSeq = AthSequencer("AthCondSeq") - - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArRampSC_ as LArRampCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LAruA2MeVSC_ as LAruA2MeVCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArDAC2uASC_ as LArDAC2uACondAlg - addLArFlatFolder ('LAR_OFL', 'Ramp', LArRampCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'uA2MeV', LAruA2MeVCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'DAC2uA', LArDAC2uACondAlg,'/LAR/ElecCalibMCSC/') - - - theADC2MeVCondAlg=LArADC2MeVCondAlg("LArADC2MeVSCCondAlg",LArADC2MeVKey = 'LArADC2MeVSC',isSuperCell=True,LArOnOffIdMappingKey='LArOnOffIdMapSC') - - if isMC: - theADC2MeVCondAlg.LArMphysOverMcalKey="" #No MphysOVerMcal - - theADC2MeVCondAlg.LArHVScaleCorrKey="" - - theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSC" - theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASC" - theADC2MeVCondAlg.LArRampKey="LArRampSC" - - - theADC2MeVCondAlg.UseFEBGainTresholds=False - - condSeq+=theADC2MeVCondAlg - return theADC2MeVCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArADC2MeVSCToolDefault.py b/LArCalorimeter/LArRecUtils/python/LArADC2MeVSCToolDefault.py deleted file mode 100644 index 54ddf930cb851e26b154d32c0ddc3bfdf0f5516c..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArADC2MeVSCToolDefault.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - - -from AthenaCommon.Include import include -from IOVDbSvc.CondDB import conddb - -if conddb.isMC: - include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") -else: - include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py") - -from LArRecUtils.LArRecUtilsConf import LArADC2MeVCondAlg -from AthenaCommon.AlgSequence import AthSequencer -from LArCabling.LArCablingAccess import LArOnOffIdMappingSC -condSeq = AthSequencer("AthCondSeq") - - -def LArADC2MeVSCCondAlgDefault (name="LArADC2MeVSCCondAlgDefault"): - - LArOnOffIdMappingSC() - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArADC2MeVSCCondAlg"): - return getattr(condSeq,"LArADC2MeVSCCondAlg") - - - theADC2MeVCondAlg=LArADC2MeVCondAlg(LArADC2MeVKey = 'LArADC2MeVSC',isSuperCell=True) - - if conddb.isMC: - from LArConditionsCommon.LArCondFlags import larCondFlags - if not larCondFlags.hasMphys(): - theADC2MeVCondAlg.LArMphysOverMcalKey="" #No MphysOVerMcal - else: - theADC2MeVCondAlg.LArMphysOverMcalKey="LArMphysOverMcalSym" - - if not larCondFlags.hasHVCorr(): - theADC2MeVCondAlg.LArHVScaleCorrKey="" - - theADC2MeVCondAlg.LAruA2MeVKey="LAruA2MeVSC" - theADC2MeVCondAlg.LArDAC2uAKey="LArDAC2uASC" - theADC2MeVCondAlg.LArRampKey="LArRampSC" - - theADC2MeVCondAlg.UseFEBGainTresholds=False - - else: # not MC - from LArRecUtils.LArFebConfigCondAlgDefault import LArFebConfigCondAlgDefault - LArFebConfigCondAlgDefault() - - condSeq+=theADC2MeVCondAlg - return theADC2MeVCondAlg - - - diff --git a/LArCalorimeter/LArRecUtils/python/LArAutoCorrTotalCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArAutoCorrTotalCondAlgDefault.py deleted file mode 100644 index 1fa8c7d4effe674252a5240d7d119c2d542f3c05..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArAutoCorrTotalCondAlgDefault.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Include import include -from AthenaCommon.Logging import logging - -include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") - - - -from LArRecUtils.LArRecUtilsConf import LArAutoCorrTotalCondAlg -from AthenaCommon.AlgSequence import AthSequencer -from LArCabling.LArCablingAccess import LArOnOffIdMapping -condSeq = AthSequencer("AthCondSeq") - - -def LArAutoCorrTotalCondAlgDefault(): - - mlog = logging.getLogger( 'LArAutoCorrTotalCondAlg::__init__ ' ) - mlog.info("entering LArAutoCorrTotalCondAlgDefault") - LArOnOffIdMapping() - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArAutoCorrTotalCondAlg"): - return getattr(condSeq,"LArAutoCorrTotalCondAlg") - - theAutoCorrTotalCondAlg=LArAutoCorrTotalCondAlg() - - - from AthenaCommon.BeamFlags import jobproperties - from LArROD.LArRODFlags import larRODFlags - - from AthenaCommon.SystemOfUnits import ns - theAutoCorrTotalCondAlg.Nsamples = larRODFlags.nSamples() - theAutoCorrTotalCondAlg.firstSample = larRODFlags.firstSample() - theAutoCorrTotalCondAlg.deltaBunch = int(jobproperties.Beam.bunchSpacing()/( 25.*ns)+0.5) - - if larRODFlags.doOFCPileupOptimization(): - if larRODFlags.NumberOfCollisions(): - theAutoCorrTotalCondAlg.NoPileUp = larRODFlags.NumberOfCollisions() <= 0 - mlog.info(" setup for Ncollisions %f deltaBunch %f", larRODFlags.NumberOfCollisions(), jobproperties.Beam.bunchSpacing()) - else: - theAutoCorrTotalCondAlg.NoPileUp = jobproperties.Beam.numberOfCollisions() <=0 - mlog.info(" setup for Ncollisions %f deltaBunch %f", jobproperties.Beam.numberOfCollisions(), jobproperties.Beam.bunchSpacing()) - else: - theAutoCorrTotalCondAlg.NoPileUp = True - mlog.info(" setup for computing total noise autocorrelation without pileup") - - - condSeq+=theAutoCorrTotalCondAlg - return theAutoCorrTotalCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArAutoCorrTotalSCCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArAutoCorrTotalSCCondAlgDefault.py deleted file mode 100644 index d70724d928f7e61401eeb0666c3e52127539cf00..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArAutoCorrTotalSCCondAlgDefault.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Logging import logging - -from LArRecUtils.LArRecUtilsConf import LArAutoCorrTotalCondAlg -from AthenaCommon.AlgSequence import AthSequencer -from LArCabling.LArCablingAccess import LArOnOffIdMappingSC -condSeq = AthSequencer("AthCondSeq") -from IOVDbSvc.CondDB import conddb - -def addLArFlatFolder (db, obj, calg, folder_base='/LAR/ElecCalibFlat/',qual=''): - from AthenaCommon.AlgSequence import AthSequencer - condSequence = AthSequencer("AthCondSeq") - - folder = folder_base + obj - if not conddb.folderRequested(folder): - conddb.addFolder(db, folder + qual, - className = 'CondAttrListCollection') - condSequence += calg (ReadKey=folder, WriteKey='LAr'+obj+'SC') - return - -def LArAutoCorrTotalSCCondAlgDefault(): - - mlog = logging.getLogger( 'LArAutoCorrTotalSCCondAlg::__init__ ' ) - mlog.info("entering LArAutoCorrTotalSCCondAlgDefault") - - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArAutoCorrTotalSCCondAlg"): - return getattr(condSeq,"LArAutoCorrTotalSCCondAlg") - - LArOnOffIdMappingSC() - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArNoiseSC_ as LArNoiseSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArPedestalSC_ as LArPedestalSCFlatCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArShapeSC_ as LArShapeSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArfSamplSC_ as LArfSamplSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArAutoCorrSC_ as LArAutoCorrSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArMinBiasSC_ as LArMinBiasSCCondAlg - - - #include('LArConditionsCommon/LArConditionsCommon_comm_jobOptions') - addLArFlatFolder ('LAR_OFL', 'Shape', LArShapeSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'Pedestal', LArPedestalSCFlatCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'Noise', LArNoiseSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'fSampl', LArfSamplSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'AutoCorr', LArAutoCorrSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'MinBias', LArMinBiasSCCondAlg,'/LAR/ElecCalibMCSC/') - - from LArRecUtils.LArADC2MeVSCCondAlgDefault import LArADC2MeVSCCondAlgDefault - LArADC2MeVSCCondAlgDefault() - - theAutoCorrTotalCondAlg=LArAutoCorrTotalCondAlg("LArAutoCorrTotalSCCondAlg",isSuperCell=True) - theAutoCorrTotalCondAlg.LArADC2MeVObjKey='LArADC2MeVSC' - theAutoCorrTotalCondAlg.LArOnOffIdMappingObjKey='LArOnOffIdMapSC' - theAutoCorrTotalCondAlg.LArShapeObjKey='LArShapeSC' - theAutoCorrTotalCondAlg.LArAutoCorrObjKey='LArAutoCorrSC' - theAutoCorrTotalCondAlg.LArNoiseObjKey='LArNoiseSC' - theAutoCorrTotalCondAlg.LArPedestalObjKey='LArPedestalSC' - theAutoCorrTotalCondAlg.LArfSamplObjKey='LArfSamplSC' - theAutoCorrTotalCondAlg.LArMinBiasObjKey='LArMinBiasSC' - theAutoCorrTotalCondAlg.LArAutoCorrTotalObjKey='LArAutoCorrTotalSC' - - - from AthenaCommon.BeamFlags import jobproperties - from LArROD.LArRODFlags import larRODFlags - - from AthenaCommon.SystemOfUnits import ns - theAutoCorrTotalCondAlg.Nsamples = larRODFlags.nSamples() - theAutoCorrTotalCondAlg.firstSample = larRODFlags.firstSample() - theAutoCorrTotalCondAlg.deltaBunch = int(jobproperties.Beam.bunchSpacing()/( 25.*ns)+0.5) - - if larRODFlags.doOFCPileupOptimization(): - if larRODFlags.NumberOfCollisions(): - theAutoCorrTotalCondAlg.NoPileUp = larRODFlags.NumberOfCollisions() <= 0 - mlog.info(" setup for Ncollisions %f deltaBunch %f", larRODFlags.NumberOfCollisions(), jobproperties.Beam.bunchSpacing()) - else: - theAutoCorrTotalCondAlg.NoPileUp = jobproperties.Beam.numberOfCollisions() <=0 - mlog.info(" setup for Ncollisions %f deltaBunch %f", jobproperties.Beam.numberOfCollisions(), jobproperties.Beam.bunchSpacing()) - else: - theAutoCorrTotalCondAlg.NoPileUp = True - mlog.info(" setup for computing total noise autocorrelation without pileup") - - - condSeq+=theAutoCorrTotalCondAlg - return theAutoCorrTotalCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py deleted file mode 100644 index 24c5df677ef0c744fe7e5c30830230f39e12c438..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArFebConfigCondAlgDefault.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from IOVDbSvc.CondDB import conddb -from AthenaCommon.AlgSequence import AthSequencer -from LArRecUtils.LArRecUtilsConf import LArFEBConfigCondAlg - - -def LArFebConfigCondAlgDefault (): - - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArFEBConfigCondAlg"): - return getattr(condSeq,"LArFEBConfigCondAlg") - - theLArFEBConfigCondAlg = LArFEBConfigCondAlg() - - LArFebConfigFolders=[ - "/LAR/Configuration/FEBConfig/Physics/EMBA1", - "/LAR/Configuration/FEBConfig/Physics/EMBA2", - "/LAR/Configuration/FEBConfig/Physics/EMBA3", - "/LAR/Configuration/FEBConfig/Physics/EMBA4", - "/LAR/Configuration/FEBConfig/Physics/EMBC1", - "/LAR/Configuration/FEBConfig/Physics/EMBC2", - "/LAR/Configuration/FEBConfig/Physics/EMBC3", - "/LAR/Configuration/FEBConfig/Physics/EMBC4", - "/LAR/Configuration/FEBConfig/Physics/EMECA1", - "/LAR/Configuration/FEBConfig/Physics/EMECA2", - "/LAR/Configuration/FEBConfig/Physics/EMECA3", - "/LAR/Configuration/FEBConfig/Physics/EMECC1", - "/LAR/Configuration/FEBConfig/Physics/EMECC2", - "/LAR/Configuration/FEBConfig/Physics/EMECC3", - "/LAR/Configuration/FEBConfig/Physics/FCALA", - "/LAR/Configuration/FEBConfig/Physics/FCALC", - "/LAR/Configuration/FEBConfig/Physics/HECA", - "/LAR/Configuration/FEBConfig/Physics/HECC", - ] - - - for f in LArFebConfigFolders: - conddb.addFolder("LAR_ONL",f,className="CondAttrListCollection") - - theLArFEBConfigCondAlg.ListOfFolders=LArFebConfigFolders - theLArFEBConfigCondAlg.keyOutput="LArFebConfig" - - condSeq+=theLArFEBConfigCondAlg - return theLArFEBConfigCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArMCSymCondAlg.py b/LArCalorimeter/LArRecUtils/python/LArMCSymCondAlg.py deleted file mode 100644 index 32d543f193e9bd1b092305f529fd916a05680b5a..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArMCSymCondAlg.py +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -def LArMCSymCondAlgDefault(): - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - if not hasattr(condSeq, "LArMCSymCondAlg"): - from LArRecUtils.LArRecUtilsConf import LArMCSymCondAlg - condSeq+=LArMCSymCondAlg("LArMCSymCondAlg",ReadKey="LArOnOffIdMap") - return - diff --git a/LArCalorimeter/LArRecUtils/python/LArOFCCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArOFCCondAlgDefault.py deleted file mode 100644 index 444b9b9c82378ec49bd36abc67f4c66129322659..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArOFCCondAlgDefault.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Include import include - -include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") -from AthenaCommon.Logging import logging -from LArRecUtils.LArRecUtilsConf import LArOFCCondAlg -from AthenaCommon.AlgSequence import AthSequencer -from LArCabling.LArCablingAccess import LArOnOffIdMapping -condSeq = AthSequencer("AthCondSeq") - - -def LArOFCCondAlgDefault(): - - mlog = logging.getLogger('LArOFCCondAlg') - mlog.info("entering LArOFCCondAlgDefault") - - LArOnOffIdMapping() - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArOFCCondAlg"): - return getattr(condSeq,"LArOFCCondAlg") - - theOFCCondAlg=LArOFCCondAlg() - #theOFCCondAlg.MCSym = True - theOFCCondAlg.isMC = True - from LArROD.LArRODFlags import larRODFlags - from AthenaCommon.BeamFlags import jobproperties - - theOFCCondAlg.firstSample = larRODFlags.firstSample() - theOFCCondAlg.useHighestGainAutoCorr = larRODFlags.useHighestGainAutoCorr() - - if larRODFlags.doOFCPileupOptimization(): - if larRODFlags.NumberOfCollisions(): - theOFCCondAlg.Nminbias=larRODFlags.NumberOfCollisions() - mlog.info(" setup for Ncollisions %f ", larRODFlags.NumberOfCollisions()) - else: - theOFCCondAlg.Nminbias=jobproperties.Beam.numberOfCollisions() - mlog.info(" setup for Ncollisions %f ", jobproperties.Beam.numberOfCollisions()) - else: - theOFCCondAlg.Nminbias=0 - mlog.info(" setup for no pileup optimization") - - pass - - condSeq+=theOFCCondAlg - return theOFCCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArOFCSCCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArOFCSCCondAlgDefault.py deleted file mode 100644 index 6bc6a21b3c3b007df7d57578a8d8be10e337ad0f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArOFCSCCondAlgDefault.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Include import include - -include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") -from AthenaCommon.Logging import logging -from LArRecUtils.LArRecUtilsConf import LArOFCCondAlg -from AthenaCommon.AlgSequence import AthSequencer -from LArCabling.LArCablingAccess import LArOnOffIdMappingSC -from IOVDbSvc.CondDB import conddb - -def addLArFlatFolder (db, obj, calg, folder_base='/LAR/ElecCalibFlat/',qual=''): - from AthenaCommon.AlgSequence import AthSequencer - condSequence = AthSequencer("AthCondSeq") - - folder = folder_base + obj - if not conddb.folderRequested(folder): - conddb.addFolder(db, folder + qual, - className = 'CondAttrListCollection') - condSequence += calg (ReadKey=folder, WriteKey='LAr'+obj+'SC') - return - -def LArOFCSCCondAlgDefault(): - - mlog = logging.getLogger('LArOFCSCCondAlg') - mlog.info("entering LArOFCSCCondAlgDefault") - - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq,"LArOFCSCCondAlg"): - return getattr(condSeq,"LArOFCSCCondAlg") - - LArOnOffIdMappingSC() - - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArNoiseSC_ as LArNoiseSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArPedestalSC_ as LArPedestalSCFlatCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArShapeSC_ as LArShapeSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArfSamplSC_ as LArfSamplSCCondAlg - from LArRecUtils.LArRecUtilsConf import LArFlatConditionsAlg_LArAutoCorrSC_ as LArAutoCorrSCCondAlg - - - #include('LArConditionsCommon/LArConditionsCommon_comm_jobOptions') - addLArFlatFolder ('LAR_OFL', 'Shape', LArShapeSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'Pedestal', LArPedestalSCFlatCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'Noise', LArNoiseSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'fSampl', LArfSamplSCCondAlg,'/LAR/ElecCalibMCSC/') - addLArFlatFolder ('LAR_OFL', 'AutoCorr', LArAutoCorrSCCondAlg,'/LAR/ElecCalibMCSC/') - - from LArRecUtils.LArAutoCorrTotalSCCondAlgDefault import LArAutoCorrTotalSCCondAlgDefault - LArAutoCorrTotalSCCondAlgDefault() - - theOFCCondAlg=LArOFCCondAlg("LArOFCSCCondAlg") - theOFCCondAlg.isMC = True - theOFCCondAlg.isSuperCell = True - from LArROD.LArRODFlags import larRODFlags - from AthenaCommon.BeamFlags import jobproperties - - theOFCCondAlg.firstSample = larRODFlags.firstSample() - theOFCCondAlg.useHighestGainAutoCorr = larRODFlags.useHighestGainAutoCorr() - theOFCCondAlg.LArOnOffIdMappingObjKey='LArOnOffIdMapSC' - theOFCCondAlg.LArShapeObjKey='LArShapeSC' - theOFCCondAlg.LArNoiseObjKey='LArNoiseSC' - theOFCCondAlg.LArPedestalObjKey='LArPedestalSC' - theOFCCondAlg.LArAutoCorrTotalObjKey='LArAutoCorrTotalSC' - theOFCCondAlg.LArOFCObjKey='LArOFCSC' - - - if larRODFlags.doOFCPileupOptimization(): - if larRODFlags.NumberOfCollisions(): - theOFCCondAlg.Nminbias=larRODFlags.NumberOfCollisions() - mlog.info(" setup for Ncollisions %f ", larRODFlags.NumberOfCollisions()) - else: - theOFCCondAlg.Nminbias=jobproperties.Beam.numberOfCollisions() - mlog.info(" setup for Ncollisions %f ", jobproperties.Beam.numberOfCollisions()) - else: - theOFCCondAlg.Nminbias=0 - mlog.info(" setup for no pileup optimization") - - pass - - condSeq+=theOFCCondAlg - return theOFCCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArOFPeakRecoToolDefault.py b/LArCalorimeter/LArRecUtils/python/LArOFPeakRecoToolDefault.py deleted file mode 100644 index 14c453a2e3ef8822b8e98a0304fdadf415a4220f..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArOFPeakRecoToolDefault.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Logging import logging -from AthenaCommon.GlobalFlags import globalflags - - -def LArOFPeakRecoToolDefault (name="LArOFPeakRecoToolDefault", **kw): - # call base class constructor - from AthenaCommon import CfgMgr - kw['name'] = name - tool = CfgMgr.LArOFPeakRecoTool (**kw) - - mlog = logging.getLogger( 'LArOFPeakRecoToolDefault::__init__ ' ) - mlog.info("entering") - - # do the configuration - if globalflags.DataSource()=='data': - tool.MCSym = False - else: - tool.MCSym = True - return tool - diff --git a/LArCalorimeter/LArRecUtils/python/LArParabolaPeakRecoToolDefault.py b/LArCalorimeter/LArRecUtils/python/LArParabolaPeakRecoToolDefault.py deleted file mode 100644 index 09840a1f08caa98e94bc1d2dd47ec6f2ecf1f230..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArParabolaPeakRecoToolDefault.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.Logging import logging - -def LArParabolaPeakRecoToolDefault (name="LArParabolaPeakRecoToolDefault", - **kw): - # call base class constructor - from AthenaCommon import CfgMgr - kw['name'] = name - tool = CfgMgr.LArParabolaPeakRecoTool (**kw) - - mlog = logging.getLogger( 'LArParabolaPeakRecoToolDefault::__init__ ' ) - mlog.info("entering") - - # do the configuration - tool.correctBias=True - return tool - diff --git a/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py b/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py deleted file mode 100644 index 8918381ddcc8de8d454a6b3d5afd9d1cc6d4c374..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArRecUtilsConfigDb.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.CfgGetter import addTool -addTool("LArRecUtils.LArOFPeakRecoToolDefault.LArOFPeakRecoToolDefault","LArOFPeakRecoToolDefault") -addTool("LArRecUtils.LArParabolaPeakRecoToolDefault.LArParabolaPeakRecoToolDefault","LArParabolaPeakRecoToolDefault") diff --git a/LArCalorimeter/LArRecUtils/python/LArRoIMapCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArRoIMapCondAlgDefault.py deleted file mode 100644 index b830a16550675699f6874c3f80b6e351f8374f04..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArRoIMapCondAlgDefault.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - - -from LArCabling.LArCablingAccess import LArOnOffIdMapping, LArFebRodMapping -from AthenaCommon.AlgSequence import AthSequencer -from AthenaConfiguration.ComponentFactory import CompFactory - - -def LArRoIMapCondAlgDefault (name = 'LArRoIMapCondAlg'): - - condSeq = AthSequencer("AthCondSeq") - if hasattr (condSeq, name): - return getattr(condSeq, name) - - LArOnOffIdMapping() - LArFebRodMapping() - - from AthenaCommon.Include import include - include ('CaloConditions/LArTTCellMap_ATLAS_jobOptions.py') - include ('CaloConditions/CaloTTIdMap_ATLAS_jobOptions.py') - - CaloTriggerTowerService = CompFactory.CaloTriggerTowerService # CaloTriggerTool - larRoIMapCondAlg = CompFactory.LArRoIMapCondAlg (name, - TriggerTowerSvc = CaloTriggerTowerService()) - - condSeq += larRoIMapCondAlg - return larRoIMapCondAlg diff --git a/LArCalorimeter/LArRecUtils/python/LArXTalkWeightCondAlgDefault.py b/LArCalorimeter/LArRecUtils/python/LArXTalkWeightCondAlgDefault.py deleted file mode 100644 index c55ce7d9f2c2f78ba4319e2d47aafcefd188e8e3..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/python/LArXTalkWeightCondAlgDefault.py +++ /dev/null @@ -1,148 +0,0 @@ - -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration - -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_strip -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_strip_ec -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middleback -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middleback_ecow -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middleback_eciw -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_stripmiddle -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_stripmiddle_ec -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_2strip -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_2strip_ec -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middle1 -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middle2 -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middle1_ec -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightCondAlg_middle2_ec -from LArRecUtils.LArRecUtilsConf import LArXTalkWeightGlobalCondAlg -from AthenaCommon.AlgSequence import AthSequencer - -def LArXTalkWeightCondAlg_stripCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_strip"): - return getattr(condSeq,"LArXTalkWeightCondAlg_strip") # return existing one - theLArXTalkWeightCondAlg_strip=LArXTalkWeightCondAlg_strip(name="LArXTalkWeightCondAlg_strip") - condSeq+=theLArXTalkWeightCondAlg_strip - return theLArXTalkWeightCondAlg_strip - -def LArXTalkWeightCondAlg_strip_ecCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_strip_ec"): - return getattr(condSeq,"LArXTalkWeightCondAlg_strip_ec") # return existing one - theLArXTalkWeightCondAlg_strip_ec=LArXTalkWeightCondAlg_strip_ec(name="LArXTalkWeightCondAlg_strip_ec") - condSeq+=theLArXTalkWeightCondAlg_strip_ec - return theLArXTalkWeightCondAlg_strip_ec - -def LArXTalkWeightCondAlg_middlebackCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middleback"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middleback") # return existing one - theLArXTalkWeightCondAlg_middleback = LArXTalkWeightCondAlg_middleback(name="LArXTalkWeightCondAlg_middleback") - condSeq+=theLArXTalkWeightCondAlg_middleback - return - -def LArXTalkWeightCondAlg_middleback_ecowCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middleback_ecow"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middleback_ecow") # return existing one - theLArXTalkWeightCondAlg_middleback_ecow=LArXTalkWeightCondAlg_middleback_ecow(name="LArXTalkWeightCondAlg_middleback_ecow") - condSeq+=theLArXTalkWeightCondAlg_middleback_ecow - return theLArXTalkWeightCondAlg_middleback_ecow - -def LArXTalkWeightCondAlg_middleback_eciwCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middleback_eciw"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middleback_eciw") # return existing one - theLArXTalkWeightCondAlg_middleback_eciw=LArXTalkWeightCondAlg_middleback_eciw(name="LArXTalkWeightCondAlg_middleback_eciw") - condSeq+=theLArXTalkWeightCondAlg_middleback_eciw - return theLArXTalkWeightCondAlg_middleback_eciw - -def LArXTalkWeightCondAlg_stripmiddleCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_stripmiddle"): - return getattr(condSeq,"LArXTalkWeightCondAlg_stripmiddle") # return existing one - theLArXTalkWeightCondAlg_stripmiddle=LArXTalkWeightCondAlg_stripmiddle(name="LArXTalkWeightCondAlg_stripmiddle") - condSeq+=theLArXTalkWeightCondAlg_stripmiddle - return theLArXTalkWeightCondAlg_stripmiddle - -def LArXTalkWeightCondAlg_stripmiddle_ecCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_stripmiddle_ec"): - return getattr(condSeq,"LArXTalkWeightCondAlg_stripmiddle_ec") # return existing one - theLArXTalkWeightCondAlg_stripmiddle_ec=LArXTalkWeightCondAlg_stripmiddle_ec(name="LArXTalkWeightCondAlg_stripmiddle_ec") - condSeq+=theLArXTalkWeightCondAlg_stripmiddle_ec - return theLArXTalkWeightCondAlg_stripmiddle_ec - -def LArXTalkWeightCondAlg_2stripCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_2strip"): - return getattr(condSeq,"LArXTalkWeightCondAlg_2strip") # return existing one - theLArXTalkWeightCondAlg_2strip=LArXTalkWeightCondAlg_2strip(name="LArXTalkWeightCondAlg_2strip") - condSeq+=theLArXTalkWeightCondAlg_2strip - return theLArXTalkWeightCondAlg_2strip - -def LArXTalkWeightCondAlg_2strip_ecCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_2strip_ec"): - return getattr(condSeq,"LArXTalkWeightCondAlg_2strip_ec") # return existing one - theLArXTalkWeightCondAlg_2strip_ec=LArXTalkWeightCondAlg_2strip_ec(name="LArXTalkWeightCondAlg_2strip_ec") - condSeq+=theLArXTalkWeightCondAlg_2strip_ec - return theLArXTalkWeightCondAlg_2strip_ec - -def LArXTalkWeightCondAlg_middle1Cfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middle1"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middle1") # return existing one - theLArXTalkWeightCondAlg_middle1=LArXTalkWeightCondAlg_middle1(name="LArXTalkWeightCondAlg_middle1") - condSeq+=theLArXTalkWeightCondAlg_middle1 - return theLArXTalkWeightCondAlg_middle1 - -def LArXTalkWeightCondAlg_middle2Cfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middle2"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middle2") # return existing one - theLArXTalkWeightCondAlg_middle2=LArXTalkWeightCondAlg_middle2(name="LArXTalkWeightCondAlg_middle2") - condSeq+=theLArXTalkWeightCondAlg_middle2 - return theLArXTalkWeightCondAlg_middle2 - -def LArXTalkWeightCondAlg_middle1_ecCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middle1_ec"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middle1_ec") # return existing one - theLArXTalkWeightCondAlg_middle1_ec=LArXTalkWeightCondAlg_middle1_ec(name="LArXTalkWeightCondAlg_middle1_ec") - condSeq+=theLArXTalkWeightCondAlg_middle1_ec - return theLArXTalkWeightCondAlg_middle1_ec - -def LArXTalkWeightCondAlg_middle2_ecCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightCondAlg_middle2_ec"): - return getattr(condSeq,"LArXTalkWeightCondAlg_middle2_ec") # return existing one - theLArXTalkWeightCondAlg_middle2_ec=LArXTalkWeightCondAlg_middle2_ec(name="LArXTalkWeightCondAlg_middle2_ec") - condSeq+=theLArXTalkWeightCondAlg_middle2_ec - return theLArXTalkWeightCondAlg_middle2_ec - -def LArXTalkWeightGlobalCondAlgCfg(): - condSeq = AthSequencer("AthCondSeq") - if hasattr(condSeq,"LArXTalkWeightGlobalCondAlg"): - return getattr(condSeq,"LArXTalkWeightGlobalCondAlg") # return existing one - theLArXTalkWeightGlobalCondAlg=LArXTalkWeightGlobalCondAlg(name="LArXTalkWeightGlobalCondAlg") - condSeq+=theLArXTalkWeightGlobalCondAlg - return theLArXTalkWeightGlobalCondAlg - - -def LArXTalkWeightCondAlgDefault(): - # make sure we start everything - LArXTalkWeightCondAlg_stripCfg() - LArXTalkWeightCondAlg_strip_ecCfg() - LArXTalkWeightCondAlg_middlebackCfg() - LArXTalkWeightCondAlg_middleback_ecowCfg() - LArXTalkWeightCondAlg_middleback_eciwCfg() - LArXTalkWeightCondAlg_stripmiddleCfg() - LArXTalkWeightCondAlg_stripmiddle_ecCfg() - LArXTalkWeightCondAlg_2stripCfg() - LArXTalkWeightCondAlg_2strip_ecCfg() - LArXTalkWeightCondAlg_middle1Cfg() - LArXTalkWeightCondAlg_middle2Cfg() - LArXTalkWeightCondAlg_middle1_ecCfg() - LArXTalkWeightCondAlg_middle2_ecCfg() - LArXTalkWeightGlobalCondAlgCfg() diff --git a/LArCalorimeter/LArRecUtils/share/LArAffectedRegion.py b/LArCalorimeter/LArRecUtils/share/LArAffectedRegion.py deleted file mode 100644 index 358fc158ea8d44bef59bef95987970f1bc281c25..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArRecUtils/share/LArAffectedRegion.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration - -from IOVDbSvc.CondDB import conddb -from AthenaCommon.AlgSequence import AthSequencer -condseq = AthSequencer("AthCondSeq") - -if not hasattr (condSeq,"LArHVCondAlg"): - if conddb.isMC: - from LArRecUtils.LArRecUtilsConf import LArHVCondAlg - hvcond = LArHVCondAlg(doHV=False,doAffectedHV=False) - condSeq+=hvcond - else: - from LArConditionsCommon import LArHVDB diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TRIG8.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TRIG8.py index 75d3e82a2103f5137492cec245fde062a2c25873..33c3dd34ce291aba6dee498941bc9e2d7d27c6e9 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TRIG8.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TRIG8.py @@ -62,11 +62,27 @@ def TRIG8KernelCfg(flags, name='TRIG8Kernel', **kwargs): from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg acc.merge(MuonsCommonCfg(flags, suff="LRT")) + + from TriggerMenuMT.TriggerAPI.TriggerAPI import TriggerAPI + from TriggerMenuMT.TriggerAPI.TriggerEnums import TriggerPeriod + allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 + TriggerAPI.setConfigFlags(flags) + trig_all = list(TriggerAPI.getAllHLT(allperiods).keys()) + + # Add in Run 3 triggers + TriggerListsHelper = kwargs['TriggerListsHelper'] + trig_all += TriggerListsHelper.Run3TriggerNames + + #get all displaced jet triggers and all bjet triggers + displaced_jet_triggers = [t for t in trig_all if "dispjet" in t] + bjet_veto = ["HLT_e26_lhtight_ivarloose_2j20_0eta290_020jvt_boffperf_pf_ftf_L1EM22VHI"] + bjet_triggers = [t for t in trig_all if "boffperf" in t and t not in bjet_veto] # Thinning tools... from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg + from DerivationFrameworkTrigger.TriggerGenericObjectThinningConfig import TriggerGenericThinningCfg # Inner detector group recommendations for indet tracks in analysis # https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/DaodRecommendations @@ -91,26 +107,24 @@ def TRIG8KernelCfg(flags, name='TRIG8Kernel', **kwargs): StreamName = kwargs['StreamName'], SelectionString = "InDetLargeD0TrackParticles.pt > 1*GeV", InDetTrackParticlesKey = "InDetLargeD0TrackParticles")) + + TRIG8JETThinningTool = acc.getPrimaryAndMerge(TriggerGenericThinningCfg( + flags, + name = "TRIG8JetThinningTool", + StreamName = kwargs['StreamName'], + ContainerName = "HLT_AntiKt4EMTopoJets_subjesIS", + TriggerListOR = sorted(list(set(displaced_jet_triggers + bjet_triggers))) + )) # Finally the kernel itself thinningTools = [TRIG8PhotonsThinningTool, TRIG8TrackParticleThinningTool, - TRIG8LRTTrackParticleThinningTool] + TRIG8LRTTrackParticleThinningTool, + TRIG8JETThinningTool] # Skimming skimmingTools = [] - from TriggerMenuMT.TriggerAPI.TriggerAPI import TriggerAPI - from TriggerMenuMT.TriggerAPI.TriggerEnums import TriggerPeriod - - allperiods = TriggerPeriod.y2015 | TriggerPeriod.y2016 | TriggerPeriod.y2017 | TriggerPeriod.y2018 | TriggerPeriod.future2e34 - TriggerAPI.setConfigFlags(flags) - trig_all = list(TriggerAPI.getAllHLT(allperiods).keys()) - - # Add in Run 3 triggers - TriggerListsHelper = kwargs['TriggerListsHelper'] - trig_all += TriggerListsHelper.Run3TriggerNames - # Pieces of trigger names to keep idtrig_keys = ['idperf', 'boffperf', 'ivarperf', 'idtp'] # Triggers to veto @@ -118,7 +132,6 @@ def TRIG8KernelCfg(flags, name='TRIG8Kernel', **kwargs): # Add specific triggers additional_triggers = [ "HLT_mu20_msonly", - "HLT_j180_2dispjet_2p_L1J100", "HLT_j45_pf_ftf_preselj20_L1J15", "HLT_xe80_tcpufit_isotrk120_medium_iaggrmedium_L1XE55", "HLT_xe80_tcpufit_isotrk140_medium_iaggrmedium_L1XE55", @@ -126,9 +139,9 @@ def TRIG8KernelCfg(flags, name='TRIG8Kernel', **kwargs): "HLT_xe80_tcpufit_distrk20_medium_L1XE50", "HLT_xe80_tcpufit_distrk20_tight_L1XE50", "HLT_mu60_L1MU14FCH" - - ] + ] idtrig_keys += additional_triggers + idtrig_keys += displaced_jet_triggers triggers = [t for t in trig_all for k in idtrig_keys if k in t] for veto in idtrig_veto: @@ -305,7 +318,8 @@ def TRIG8Cfg(flags): "GSFTrackParticles.d0.z0.vz.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.numberOfPixelHoles.numberOfSCTHoles.numberDoF.chiSquared.trackFitter.patternRecoInfo.hitPattern.numberOfTRTHits.numberOfTRTOutliers.numberOfBLayerHits.expectBLayerHit.numberOfPixelDeadSensors.numberOfSCTDeadSensors.numberOfTRTHighThresholdHits.expectInnermostPixelLayerHit", "LRTGSFTrackParticles.d0.z0.vz.vx.vy.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.truthParticleLink.truthMatchProbability.radiusOfFirstHit.numberOfPixelHoles.numberOfSCTHoles.numberDoF.chiSquared.trackFitter.patternRecoInfo.hitPattern.numberOfTRTHits.numberOfTRTOutliers.numberOfBLayerHits.expectBLayerHit.numberOfPixelDeadSensors.numberOfSCTDeadSensors.numberOfTRTHighThresholdHits.expectInnermostPixelLayerHit", "EventInfo.hardScatterVertexLink.timeStampNSOffset", - "TauJets.dRmax.etOverPtLeadTrk"] + "TauJets.dRmax.etOverPtLeadTrk", + "HLT_AntiKt4EMTopoJets_subjesIS.m.pt.eta.phi"] # Truth containers diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerGenericObjectThinningConfig.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerGenericObjectThinningConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..f8a30e9ef97a18057e0075d0087df229c105e86d --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/TriggerGenericObjectThinningConfig.py @@ -0,0 +1,11 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def TriggerGenericThinningCfg(ConfigFlags, name, **kwargs): + acc = ComponentAccumulator() + got = CompFactory.DerivationFramework.TriggerGenericObjectThinningTool + acc.addPublicTool(got(name, **kwargs), + primary = True) + return acc \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/TriggerGenericObjectThinningTool.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/TriggerGenericObjectThinningTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..468aa998eaaa4cc2a3f92d78d987f2e5f4b2dde3 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/TriggerGenericObjectThinningTool.cxx @@ -0,0 +1,92 @@ +#include "TriggerGenericObjectThinningTool.h" +#include "StoreGate/ThinningHandle.h" +#include "GaudiKernel/ThreadLocalContext.h" + +namespace DerivationFramework{ + bool TriggerGenericObjectThinningTool::eventPassedFilter() const + { + if (msgLvl(MSG::VERBOSE)){ + const Trig::ChainGroup* Chain = m_trigDec->getChainGroup(".*"); + const std::vector<std::string> fired_triggers = Chain->getListOfTriggers(); + for (const std::string& fired : fired_triggers) { + if (m_trigDec->isPassed(fired)) ATH_MSG_VERBOSE("Fired trigger "<<fired); + } + } + + unsigned int cntrAND{0}, cntrOR{0}, cntrORHLTOnly{0}; + for (const std::string& trig_and : m_triggerListAND) { + ATH_MSG_DEBUG("AND - Trigger "<<trig_and<<" passed "<<m_trigDec->isPassed(trig_and)); + cntrAND+=(m_trigDec->isPassed(trig_and)); + } + for (const std::string& trig_or : m_triggerListOR) { + ATH_MSG_DEBUG("OR - Trigger "<<trig_or<<" passed "<<m_trigDec->isPassed(trig_or)); + cntrOR +=(m_trigDec->isPassed(trig_or)); + } + for (const std::string& trig_orhltonly : m_triggerListORHLTOnly) { + ATH_MSG_DEBUG("ORHLTOnly - Trigger "<<trig_orhltonly<<" passed "<<m_trigDec->isPassed(trig_orhltonly, TrigDefs::requireDecision)); + cntrORHLTOnly +=(m_trigDec->isPassed(trig_orhltonly, TrigDefs::requireDecision)); + } + + bool passAND = (cntrAND==m_triggerListAND.size() && !m_triggerListAND.empty()); + bool passOR = (cntrOR > 0); + bool passORHLTOnly = (cntrORHLTOnly > 0); + + bool pass = passAND || passOR || passORHLTOnly; + return pass; + } + + TriggerGenericObjectThinningTool::TriggerGenericObjectThinningTool(const std::string& t, + const std::string& n, + const IInterface* p ) : + base_class(t,n,p) + { + } + + // Destructor + TriggerGenericObjectThinningTool::~TriggerGenericObjectThinningTool() { + } + + // Athena initialize and finalize + StatusCode TriggerGenericObjectThinningTool::initialize() + { + ATH_MSG_VERBOSE("initialize() ..."); + + //check xAOD::InDetTrackParticle collection + ATH_CHECK( m_SGKey.initialize (m_streamName) ); + ATH_MSG_INFO("Using " << m_SGKey << "as the source collection"); + + return StatusCode::SUCCESS; + } + + StatusCode TriggerGenericObjectThinningTool::finalize() + { + ATH_MSG_VERBOSE("finalize() ..."); + return StatusCode::SUCCESS; + } + + // The thinning itself + StatusCode TriggerGenericObjectThinningTool::doThinning() const + { + const EventContext& ctx = Gaudi::Hive::currentContext(); + + // Retrieve main object collection + SG::ThinningHandle<xAOD::IParticleContainer> particles (m_SGKey, ctx); + + // Check the event contains objects + unsigned int nObjects = particles->size(); + if (nObjects==0) return StatusCode::SUCCESS; + + //check if the trigger passed for the event + bool keep_container = eventPassedFilter(); + + // Set up a mask with the same entries as the full collection + std::vector<bool> mask; + mask.assign(nObjects,keep_container); + + + // Execute the thinning based on the mask. Finish. + particles.keep (mask); + + return StatusCode::SUCCESS; + } +}; \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/TriggerGenericObjectThinningTool.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/TriggerGenericObjectThinningTool.h new file mode 100644 index 0000000000000000000000000000000000000000..3c53f678b047555197ad4643236576837f3270a9 --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/TriggerGenericObjectThinningTool.h @@ -0,0 +1,54 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +/////////////////////////////////////////////////////////////////// +// TriggerGenericObjectThinningTool.h, (c) ATLAS Detector software +/////////////////////////////////////////////////////////////////// + +//Thin collection based if a trigger has passed or not +//Just save an empty collection + +#ifndef DERIVATIONFRAMEWORK_TRIGGERGENERICOBJECTTHINNINGTOOL_H +#define DERIVATIONFRAMEWORK_TRIGGERGENERICOBJECTTHINNINGTOOL_H + +#include <string> + +#include "AthenaBaseComps/AthAlgTool.h" +#include "TrigDecisionTool/TrigDecisionTool.h" + + +#include "DerivationFrameworkInterfaces/IThinningTool.h" +#include "GaudiKernel/ToolHandle.h" +#include "xAODBase/IParticleContainer.h" +#include "StoreGate/ThinningHandleKey.h" + +#include "xAODBase/IParticleContainer.h" + +namespace DerivationFramework { + + class TriggerGenericObjectThinningTool : public extends<AthAlgTool, IThinningTool> { + public: + TriggerGenericObjectThinningTool(const std::string& t, const std::string& n, const IInterface* p); + ~TriggerGenericObjectThinningTool(); + virtual StatusCode initialize() override; + virtual StatusCode finalize() override; + virtual StatusCode doThinning() const override; + + private: + StringProperty m_streamName + { this, "StreamName", "", "Name of the stream being thinned" }; + SG::ThinningHandleKey<xAOD::IParticleContainer> m_SGKey + { this, "ContainerName", "", "" }; + + private: + Gaudi::Property<std::vector<std::string>> m_triggerListAND{this,"TriggerListAND", {}}; + Gaudi::Property<std::vector<std::string>> m_triggerListOR{this,"TriggerListOR", {}}; + Gaudi::Property<std::vector<std::string>> m_triggerListORHLTOnly{this,"TriggerListORHLTOnly", {}, "Decision is based on HLT only (unseeded triggers)"}; + PublicToolHandle<Trig::TrigDecisionTool> m_trigDec{this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool"}; + + bool eventPassedFilter() const; + }; +} + +#endif // DERIVATIONFRAMEWORK_TRIGGERSKIMMINGTOOL_H \ No newline at end of file diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/components/DerivationFrameworkTrigger_entries.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/components/DerivationFrameworkTrigger_entries.cxx index 17463f8f4649a261871efa50116d44706ca5ee40..36f6f8e9622291f41d24f093da3569e76b105d90 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/components/DerivationFrameworkTrigger_entries.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/src/components/DerivationFrameworkTrigger_entries.cxx @@ -1,3 +1,5 @@ #include "../TriggerMatchingTool.h" +#include "../TriggerGenericObjectThinningTool.h" DECLARE_COMPONENT( DerivationFramework::TriggerMatchingTool ) +DECLARE_COMPONENT( DerivationFramework::TriggerGenericObjectThinningTool ) diff --git a/PhysicsAnalysis/PrimaryDPDMaker/python/DESDM_ALLCELLS.py b/PhysicsAnalysis/PrimaryDPDMaker/python/DESDM_ALLCELLS.py index ce25728370de63778b74e18163830040c2cceacd..1d005dffaca85dd73f6dd1afd7e91d7f665b6ad0 100644 --- a/PhysicsAnalysis/PrimaryDPDMaker/python/DESDM_ALLCELLS.py +++ b/PhysicsAnalysis/PrimaryDPDMaker/python/DESDM_ALLCELLS.py @@ -37,6 +37,11 @@ def DESDM_ALLCELLSCfg(configFlags): from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg items = ['xAOD::EventInfo#*', 'xAOD::EventAuxInfo#*', + # trigger content + 'xAOD::TrigDecision#xTrigDecision', 'xAOD::TrigDecisionAuxInfo#xTrigDecisionAux.', + 'xAOD::TrigCompositeContainer#HLTNav_Summary_AODSlimmed', 'xAOD::TrigCompositeAuxContainer#HLTNav_Summary_AODSlimmedAux.', + 'xAOD::TrigConfKeys#TrigConfKeys', + 'xAOD::BunchConfKey#BunchConfKey', # Standard CP objects 'xAOD::ElectronContainer#Electrons','xAOD::ElectronAuxContainer#ElectronsAux.', 'xAOD::PhotonContainer#Photons','xAOD::PhotonAuxContainer#PhotonsAux.', diff --git a/Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run470000_MC23e_SingleBeamspot.py b/Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run470000_MC23e_SingleBeamspot.py new file mode 100644 index 0000000000000000000000000000000000000000..95b5db5231e70324044ecea4bf6d8978d69fe18e --- /dev/null +++ b/Simulation/RunDependentSim/RunDependentSimData/python/PileUpProfile_run470000_MC23e_SingleBeamspot.py @@ -0,0 +1,110 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +# Equivalent of PileUpProfile_run470000_MC23e_MultiBeamspot.py, but +# without the division into different beam spots. + +def setupProfile(flags, scaleTaskLength=1): + + def _evts(x): + return int(scaleTaskLength * x) + + return [ + {'run':470000, 'lb':1, 'starttstamp':1704000060, 'evts':_evts(1), 'mu':1.5}, + {'run':470000, 'lb':2, 'starttstamp':1704000120, 'evts':_evts(1), 'mu':2.5}, + {'run':470000, 'lb':3, 'starttstamp':1704000180, 'evts':_evts(1), 'mu':3.5}, + {'run':470000, 'lb':4, 'starttstamp':1704000240, 'evts':_evts(1), 'mu':4.5}, + {'run':470000, 'lb':5, 'starttstamp':1704000300, 'evts':_evts(1), 'mu':5.5}, + {'run':470000, 'lb':6, 'starttstamp':1704000360, 'evts':_evts(1), 'mu':6.5}, + {'run':470000, 'lb':7, 'starttstamp':1704000420, 'evts':_evts(1), 'mu':7.5}, + {'run':470000, 'lb':8, 'starttstamp':1704000480, 'evts':_evts(1), 'mu':8.5}, + {'run':470000, 'lb':9, 'starttstamp':1704000540, 'evts':_evts(1), 'mu':9.5}, + {'run':470000, 'lb':10, 'starttstamp':1704000600, 'evts':_evts(1), 'mu':10.5}, + {'run':470000, 'lb':11, 'starttstamp':1704000660, 'evts':_evts(1), 'mu':11.5}, + {'run':470000, 'lb':12, 'starttstamp':1704000720, 'evts':_evts(1), 'mu':12.5}, + {'run':470000, 'lb':13, 'starttstamp':1704000780, 'evts':_evts(1), 'mu':13.5}, + {'run':470000, 'lb':14, 'starttstamp':1704000840, 'evts':_evts(1), 'mu':14.5}, + {'run':470000, 'lb':15, 'starttstamp':1704000900, 'evts':_evts(1), 'mu':15.5}, + {'run':470000, 'lb':16, 'starttstamp':1704000960, 'evts':_evts(1), 'mu':16.5}, + {'run':470000, 'lb':17, 'starttstamp':1704001020, 'evts':_evts(1), 'mu':17.5}, + {'run':470000, 'lb':18, 'starttstamp':1704001080, 'evts':_evts(1), 'mu':18.5}, + {'run':470000, 'lb':19, 'starttstamp':1704001140, 'evts':_evts(1), 'mu':19.5}, + {'run':470000, 'lb':20, 'starttstamp':1704001200, 'evts':_evts(1), 'mu':20.5}, + {'run':470000, 'lb':21, 'starttstamp':1704001260, 'evts':_evts(2), 'mu':21.5}, + {'run':470000, 'lb':22, 'starttstamp':1704001320, 'evts':_evts(2), 'mu':22.5}, + {'run':470000, 'lb':23, 'starttstamp':1704001380, 'evts':_evts(3), 'mu':23.5}, + {'run':470000, 'lb':24, 'starttstamp':1704001440, 'evts':_evts(4), 'mu':24.5}, + {'run':470000, 'lb':25, 'starttstamp':1704001500, 'evts':_evts(6), 'mu':25.5}, + {'run':470000, 'lb':26, 'starttstamp':1704001560, 'evts':_evts(7), 'mu':26.5}, + {'run':470000, 'lb':27, 'starttstamp':1704001620, 'evts':_evts(9), 'mu':27.5}, + {'run':470000, 'lb':28, 'starttstamp':1704001680, 'evts':_evts(11), 'mu':28.5}, + {'run':470000, 'lb':29, 'starttstamp':1704001740, 'evts':_evts(13), 'mu':29.5}, + {'run':470000, 'lb':30, 'starttstamp':1704001800, 'evts':_evts(15), 'mu':30.5}, + {'run':470000, 'lb':31, 'starttstamp':1704001860, 'evts':_evts(17), 'mu':31.5}, + {'run':470000, 'lb':32, 'starttstamp':1704001920, 'evts':_evts(18), 'mu':32.5}, + {'run':470000, 'lb':33, 'starttstamp':1704001980, 'evts':_evts(20), 'mu':33.5}, + {'run':470000, 'lb':34, 'starttstamp':1704002040, 'evts':_evts(22), 'mu':34.5}, + {'run':470000, 'lb':35, 'starttstamp':1704002100, 'evts':_evts(23), 'mu':35.5}, + {'run':470000, 'lb':36, 'starttstamp':1704002160, 'evts':_evts(25), 'mu':36.5}, + {'run':470000, 'lb':37, 'starttstamp':1704002220, 'evts':_evts(26), 'mu':37.5}, + {'run':470000, 'lb':38, 'starttstamp':1704002280, 'evts':_evts(27), 'mu':38.5}, + {'run':470000, 'lb':39, 'starttstamp':1704002340, 'evts':_evts(27), 'mu':39.5}, + {'run':470000, 'lb':40, 'starttstamp':1704002400, 'evts':_evts(28), 'mu':40.5}, + {'run':470000, 'lb':41, 'starttstamp':1704002460, 'evts':_evts(29), 'mu':41.5}, + {'run':470000, 'lb':42, 'starttstamp':1704002520, 'evts':_evts(30), 'mu':42.5}, + {'run':470000, 'lb':43, 'starttstamp':1704002580, 'evts':_evts(31), 'mu':43.5}, + {'run':470000, 'lb':44, 'starttstamp':1704002640, 'evts':_evts(32), 'mu':44.5}, + {'run':470000, 'lb':45, 'starttstamp':1704002700, 'evts':_evts(34), 'mu':45.5}, + {'run':470000, 'lb':46, 'starttstamp':1704002760, 'evts':_evts(36), 'mu':46.5}, + {'run':470000, 'lb':47, 'starttstamp':1704002820, 'evts':_evts(38), 'mu':47.5}, + {'run':470000, 'lb':48, 'starttstamp':1704002880, 'evts':_evts(41), 'mu':48.5}, + {'run':470000, 'lb':49, 'starttstamp':1704002940, 'evts':_evts(45), 'mu':49.5}, + {'run':470000, 'lb':50, 'starttstamp':1704003000, 'evts':_evts(50), 'mu':50.5}, + {'run':470000, 'lb':51, 'starttstamp':1704003060, 'evts':_evts(55), 'mu':51.5}, + {'run':470000, 'lb':52, 'starttstamp':1704003120, 'evts':_evts(61), 'mu':52.5}, + {'run':470000, 'lb':53, 'starttstamp':1704003180, 'evts':_evts(66), 'mu':53.5}, + {'run':470000, 'lb':54, 'starttstamp':1704003240, 'evts':_evts(71), 'mu':54.5}, + {'run':470000, 'lb':55, 'starttstamp':1704003300, 'evts':_evts(74), 'mu':55.5}, + {'run':470000, 'lb':56, 'starttstamp':1704003360, 'evts':_evts(76), 'mu':56.5}, + {'run':470000, 'lb':57, 'starttstamp':1704003420, 'evts':_evts(75), 'mu':57.5}, + {'run':470000, 'lb':58, 'starttstamp':1704003480, 'evts':_evts(74), 'mu':58.5}, + {'run':470000, 'lb':59, 'starttstamp':1704003540, 'evts':_evts(72), 'mu':59.5}, + {'run':470000, 'lb':60, 'starttstamp':1704003600, 'evts':_evts(71), 'mu':60.5}, + {'run':470000, 'lb':61, 'starttstamp':1704003660, 'evts':_evts(68), 'mu':61.5}, + {'run':470000, 'lb':62, 'starttstamp':1704003720, 'evts':_evts(66), 'mu':62.5}, + {'run':470000, 'lb':63, 'starttstamp':1704003780, 'evts':_evts(63), 'mu':63.5}, + {'run':470000, 'lb':64, 'starttstamp':1704003840, 'evts':_evts(60), 'mu':64.5}, + {'run':470000, 'lb':65, 'starttstamp':1704003900, 'evts':_evts(55), 'mu':65.5}, + {'run':470000, 'lb':66, 'starttstamp':1704003960, 'evts':_evts(50), 'mu':66.5}, + {'run':470000, 'lb':67, 'starttstamp':1704004020, 'evts':_evts(44), 'mu':67.5}, + {'run':470000, 'lb':68, 'starttstamp':1704004080, 'evts':_evts(38), 'mu':68.5}, + {'run':470000, 'lb':69, 'starttstamp':1704004140, 'evts':_evts(31), 'mu':69.5}, + {'run':470000, 'lb':70, 'starttstamp':1704004200, 'evts':_evts(26), 'mu':70.5}, + {'run':470000, 'lb':71, 'starttstamp':1704004260, 'evts':_evts(22), 'mu':71.5}, + {'run':470000, 'lb':72, 'starttstamp':1704004320, 'evts':_evts(18), 'mu':72.5}, + {'run':470000, 'lb':73, 'starttstamp':1704004380, 'evts':_evts(14), 'mu':73.5}, + {'run':470000, 'lb':74, 'starttstamp':1704004440, 'evts':_evts(11), 'mu':74.5}, + {'run':470000, 'lb':75, 'starttstamp':1704004500, 'evts':_evts(8), 'mu':75.5}, + {'run':470000, 'lb':76, 'starttstamp':1704004560, 'evts':_evts(7), 'mu':76.5}, + {'run':470000, 'lb':77, 'starttstamp':1704004620, 'evts':_evts(6), 'mu':77.5}, + {'run':470000, 'lb':78, 'starttstamp':1704004680, 'evts':_evts(4), 'mu':78.5}, + {'run':470000, 'lb':79, 'starttstamp':1704004740, 'evts':_evts(3), 'mu':79.5}, + {'run':470000, 'lb':80, 'starttstamp':1704004800, 'evts':_evts(2), 'mu':80.5}, + {'run':470000, 'lb':81, 'starttstamp':1704004860, 'evts':_evts(1), 'mu':81.5}, + {'run':470000, 'lb':82, 'starttstamp':1704004920, 'evts':_evts(1), 'mu':82.5}, + {'run':470000, 'lb':83, 'starttstamp':1704004980, 'evts':_evts(1), 'mu':83.5}, + {'run':470000, 'lb':84, 'starttstamp':1704005040, 'evts':_evts(1), 'mu':84.5}, + {'run':470000, 'lb':85, 'starttstamp':1704005100, 'evts':_evts(1), 'mu':85.5}, + {'run':470000, 'lb':86, 'starttstamp':1704005160, 'evts':_evts(1), 'mu':86.5}, + {'run':470000, 'lb':87, 'starttstamp':1704005220, 'evts':_evts(1), 'mu':87.5}, + {'run':470000, 'lb':88, 'starttstamp':1704005280, 'evts':_evts(1), 'mu':88.5}, + {'run':470000, 'lb':89, 'starttstamp':1704005340, 'evts':_evts(1), 'mu':89.5}, + {'run':470000, 'lb':90, 'starttstamp':1704005400, 'evts':_evts(1), 'mu':90.5}, + {'run':470000, 'lb':91, 'starttstamp':1704005460, 'evts':_evts(1), 'mu':91.5}, + {'run':470000, 'lb':92, 'starttstamp':1704005520, 'evts':_evts(1), 'mu':92.5}, + {'run':470000, 'lb':93, 'starttstamp':1704005580, 'evts':_evts(1), 'mu':93.5}, + {'run':470000, 'lb':94, 'starttstamp':1704005640, 'evts':_evts(1), 'mu':94.5}, + {'run':470000, 'lb':95, 'starttstamp':1704005700, 'evts':_evts(1), 'mu':95.5}, + {'run':470000, 'lb':96, 'starttstamp':1704005760, 'evts':_evts(1), 'mu':96.5}, + {'run':470000, 'lb':97, 'starttstamp':1704005820, 'evts':_evts(1), 'mu':97.5}, + {'run':470000, 'lb':98, 'starttstamp':1704005880, 'evts':_evts(1), 'mu':98.5} +] diff --git a/TileCalorimeter/TileMonitoring/python/TileJiveXMLConfig.py b/TileCalorimeter/TileMonitoring/python/TileJiveXMLConfig.py index a9c085516e20c2f4380f5e4070672a20219dc86f..eb1a16177bdf1f8c02786a61ba275cab7e29fa21 100644 --- a/TileCalorimeter/TileMonitoring/python/TileJiveXMLConfig.py +++ b/TileCalorimeter/TileMonitoring/python/TileJiveXMLConfig.py @@ -55,7 +55,7 @@ def getTileRawChannelContainer(flags): def TileAlgoJiveXMLCfg(flags, TileDigitsContainer=None, TileRawChannelContainer=None, - CaloClusterContainer='TileTopoCluster', stateless=False, **kwargs): + CaloClusterContainer='TileTopoCluster', **kwargs): """ Function to configure AlgoJiveXML algorithm for Tile. @@ -173,13 +173,6 @@ def TileAlgoJiveXMLCfg(flags, TileDigitsContainer=None, TileRawChannelContainer= kwargs.setdefault("WriteGeometry", False) kwargs.setdefault("DataTypes", data_types) - if stateless: - StreamToServerTool = CompFactory.JiveXML.StreamToServerTool - tileStreamToServerTool = StreamToServerTool(StreamName='Tile') - - acc.addPublicTool(tileStreamToServerTool) - kwargs['StreamTools'] = [ tileStreamToServerTool ] - AlgoJiveXML = CompFactory.JiveXML.AlgoJiveXML acc.addEventAlgo(AlgoJiveXML(name="AlgoJiveXML", **kwargs), primary=True) diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamRead_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamRead_test.ref index 2c939305b6c7cc4a9c28b9350ad1cbd49d96865a..fabe0e9dd345f50dec8cd6716657acf166e18201 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamRead_test.ref +++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileBeamElemContByteStreamRead_test.ref @@ -1,5 +1,4 @@ Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) @@ -145,7 +144,6 @@ FPEAuditor INFO FPE DIVBYZEROs : 0 ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamRead_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamRead_test.ref index eb5aea0054c224ff9560ab2a166542b932bf44e8..a6604a4d592dce9ad7deb136ccbabb7c5200bdd7 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamRead_test.ref +++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileDigitsContByteStreamRead_test.ref @@ -1,5 +1,4 @@ Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) @@ -147,7 +146,6 @@ FPEAuditor INFO FPE DIVBYZEROs : 0 ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamRead_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamRead_test.ref index cd11225777884cbb374b53f34ee7c71cc3feed4b..e3f5feeeeebe4a60f25071aa0e5fda4450b90d65 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamRead_test.ref +++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileL2ContByteStreamRead_test.ref @@ -1,5 +1,4 @@ Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) @@ -145,7 +144,6 @@ FPEAuditor INFO FPE DIVBYZEROs : 0 ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamRead_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamRead_test.ref index 552772c44c98b2ef35b444bbbe30d317df09e751..94125654fa73d934593f9a06180a6753c3d8f640 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamRead_test.ref +++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileLaserObjByteStreamRead_test.ref @@ -1,4 +1,3 @@ -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) @@ -144,7 +143,6 @@ FPEAuditor INFO FPE INVALIDs : 0 FPEAuditor INFO FPE DIVBYZEROs : 0 ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamRead_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamRead_test.ref index db5ef546e2fa724264a3cd2aab06a8b95236d6c5..fab8d2e5e340cf1ffd54e3882a76ce2943235c78 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamRead_test.ref +++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileMuRcvContByteStreamRead_test.ref @@ -1,4 +1,3 @@ -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) @@ -144,7 +143,6 @@ FPEAuditor INFO FPE INVALIDs : 0 FPEAuditor INFO FPE DIVBYZEROs : 0 ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) diff --git a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamRead_test.ref b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamRead_test.ref index fb0817b922328f55f742aae3cc82ede41f422362..26839ede13562fe5e1ae32e15b61894358f9e337 100644 --- a/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamRead_test.ref +++ b/TileCalorimeter/TileSvc/TileByteStream/share/TileRawChannelContByteStreamRead_test.ref @@ -1,5 +1,4 @@ Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) @@ -147,7 +146,6 @@ FPEAuditor INFO FPE DIVBYZEROs : 0 ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking into '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data12_8TeV.00204073.physics_JetTauEtmiss.merge.RAW._lb0144._SFO-5._0001.1' -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthMasterSeq (seq: SEQ AND) diff --git a/Tools/Campaigns/python/MC23.py b/Tools/Campaigns/python/MC23.py index b163c1bb5ffbf4d6fee9192ee69093c52fa9165e..e945f2a2d0ea3069d1a595e771e2f7106427e444 100644 --- a/Tools/Campaigns/python/MC23.py +++ b/Tools/Campaigns/python/MC23.py @@ -142,6 +142,12 @@ def MC23dSingleBeamspot(flags): # override only pile-up profile flags.Digitization.PU.ProfileConfig = 'RunDependentSimData.PileUpProfile_run450000_MC23d_SingleBeamspot' +def MC23eSingleBeamspot(flags): + """MC23e flags for MC to match 2024 Run 3 data (initial pile-up profile estimate, single beamspot version)""" + MC23e(flags) + + # override only pile-up profile + flags.Digitization.PU.ProfileConfig = 'RunDependentSimData.PileUpProfile_run470000_MC23e_SingleBeamspot' def MC23LowMu(flags): """MC23 flags for MC to match Run 3 data with low pile-up""" diff --git a/Tools/Campaigns/python/__init__.py b/Tools/Campaigns/python/__init__.py index 8f80f2b3e9dae86fd088b080b102687b9b581292..7ecf6c8c4616aa80a686e0c78d287d8e45c18b5e 100644 --- a/Tools/Campaigns/python/__init__.py +++ b/Tools/Campaigns/python/__init__.py @@ -14,6 +14,8 @@ from .MC23 import (MC23a, MC23aSingleBeamspot, BeamspotSplitMC23a, MC23c, MC23cSingleBeamspot, BeamspotSplitMC23c, MC23cSimulationMultipleIoV, MC23cSimulationMultipleIoVCalibrationHits, MC23d, MC23dSingleBeamspot, BeamspotSplitMC23d, + MC23e, MC23eSingleBeamspot, BeamspotSplitMC23e, + MC23eSimulationMultipleIoV, MC23eSimulationMultipleIoVCalibrationHits, MC23LowMu, MC23NoPileUp, MC23NoPileUpLowMuRun ) from .PhaseII import (PhaseIIPileUp1, PhaseIIPileUp60, PhaseIIPileUp140, PhaseIIPileUp200, PhaseIIPileUpMC21a, PhaseIINoPileUp, @@ -42,6 +44,8 @@ __all__ = [ 'MC23c', 'MC23cSingleBeamspot', 'BeamspotSplitMC23c', 'MC23cSimulationMultipleIoV', 'MC23cSimulationMultipleIoVCalibrationHits', 'MC23d', 'MC23dSingleBeamspot', 'BeamspotSplitMC23d', + 'MC23e', 'MC23eSingleBeamspot', 'BeamspotSplitMC23e', + 'MC23eSimulationMultipleIoV', 'MC23eSimulationMultipleIoVCalibrationHits', 'MC23LowMu', 'MC23NoPileUp', 'MC23NoPileUpLowMuRun', 'PhaseIIPileUp1', 'PhaseIIPileUp60', 'PhaseIIPileUp140', 'PhaseIIPileUp200', 'PhaseIIPileUpMC21a', 'PhaseIINoPileUp', diff --git a/Tracking/TrkConfig/share/TrackCollectionReadConfig_test.ref b/Tracking/TrkConfig/share/TrackCollectionReadConfig_test.ref index 7116c55ceaeab6bd63b92016c0cbfc4129476cf7..4aefa5704c02f2607377eacbe7fc296dccae32d9 100644 --- a/Tracking/TrkConfig/share/TrackCollectionReadConfig_test.ref +++ b/Tracking/TrkConfig/share/TrackCollectionReadConfig_test.ref @@ -4,7 +4,6 @@ Py:AutoConfigFlags INFO Obtaining metadata of auto-configuration by peeking i Py:MetaReader INFO Current mode used: peeker Py:MetaReader INFO Current filenames: ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root'] Py:MetaReader INFO MetaReader is called with the parameter "unique_tag_info_values" set to True. This is a workaround to remove all duplicate values from "/TagInfo" key -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq (seq: SEQ AND) @@ -23,7 +22,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO TheApp properties --- Reference aliased object by alias. -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq (seq: SEQ AND) @@ -42,7 +40,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO TheApp properties --- Non-aliased object. -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq (seq: SEQ AND) @@ -60,7 +57,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO TheApp properties --- Non-existent object. -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq (seq: SEQ AND) @@ -75,7 +71,6 @@ Py:ComponentAccumulator INFO [ Py:ComponentAccumulator INFO ] Py:ComponentAccumulator INFO TheApp properties --- Non-threaded. -Py:ComponentAccumulator INFO Event Inputs Py:ComponentAccumulator INFO Event Algorithm Sequences Py:ComponentAccumulator INFO Top sequence 0 Py:ComponentAccumulator INFO \__ AthAlgSeq (seq: SEQ AND) diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py b/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py index 683a5a0bf40e608a397a12779eb6fdc0e6d61fa3..bcb5f354fc1f5e79c18242ff7fb47a6d69369513 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/python/TrigGenericAlgsConfig.py @@ -62,33 +62,47 @@ def ROBPrefetchingAlgCfg_Calo(flags, nameSuffix, **kwargs): def ROBPrefetchingAlgCfg_Muon(flags, nameSuffix, **kwargs): return ROBPrefetchingAlgCfg(flags, 'ROBPrefetchingAlg_Muon_'+nameSuffix, ['MDT', 'RPC', 'TGC', 'CSC', 'MM', 'sTGC'], **kwargs) - -def getChainsForPrefetching(chains): - from AthenaCommon.Configurable import Configurable + +def getChainsForPrefetching(CF_list): from TrigConfHLTUtils.HLTUtils import string2hash from AthenaCommon.CFElements import getSequenceChildren, isSequence from collections import defaultdict def sequenceAlgs(seq): algs = [] - for alg in getSequenceChildren(seq): - conf = Configurable.allConfigurables[alg] if type(alg)==str else alg - if isSequence(conf): - algs.extend(sequenceAlgs(conf)) - elif conf.getName().startswith('IMEmpty'): + for alg in getSequenceChildren(seq): + if isSequence(alg): + algs.extend(sequenceAlgs(alg)) + elif alg.getName().startswith('IMEmpty'): # skip empty probe step in tag&probe chains continue else: - algs.append(conf.getName()) + algs.append(alg.getName()) + return algs - def firstNonEmptyStepAlgs(chainConfig): + def firstNonEmptyStepAlgs(CF_list): algsMap = defaultdict(list) # {chainLegName, algsInFirstNonEmptyStep} - for step in chainConfig.steps: - for legName,menuSeq in zip(step.getChainLegs(), step.sequences): - algsMap[legName] = sequenceAlgs(menuSeq.sequence.Alg) - if algsMap[legName]: - # only consider the first non-empty sequence across all legs - once found, break the loop - return algsMap + firstSequence = [] + + for cfseq_per_step in CF_list: + for cfseq in cfseq_per_step: # all the steps with same step number + step = cfseq.sequenceCA.step + foundFirstSequence = False + for ileg, menuSeq in enumerate(step.sequences): + seqA = sequenceAlgs(menuSeq.sequence.Alg) + if seqA: # found not empty sequence in this step + for stepD, chain in zip(cfseq.stepDicts, cfseq.chains): # loop over chains + if chain in firstSequence: + continue + legName = stepD[ileg]['chainName'] + if legName not in algsMap: # add only the first time + algsMap[legName] = seqA + firstSequence.append(chain) + foundFirstSequence = True + + if foundFirstSequence: + break + return algsMap detGroupIdentifierAlgs = { @@ -99,7 +113,7 @@ def getChainsForPrefetching(chains): def algsToDetGroup(algs): groups = [] - for group,idAlgs in detGroupIdentifierAlgs.items(): + for group,idAlgs in detGroupIdentifierAlgs.items(): if any([ida in algName for algName in algs for ida in idAlgs]): groups.append(group) if len(groups)>1: @@ -111,18 +125,17 @@ def getChainsForPrefetching(chains): 'Calo': [], 'Muon': [] } - - for chain in chains: - algsMap = firstNonEmptyStepAlgs(chain) - for legName,algs in algsMap.items(): - det = algsToDetGroup(algs) - if not det: - continue - _log.debug("%s initialRoI will prefetch %s", legName, det) - chainFilterMap[det].append(string2hash(legName)) + + + algsMap = firstNonEmptyStepAlgs(CF_list) + for legName,algs in algsMap.items(): + det = algsToDetGroup(algs) + if not det: + continue + _log.debug("%s initialRoI will prefetch %s", legName, det) + chainFilterMap[det].append(string2hash(legName)) return chainFilterMap - # Legacy searches for the algs through the top level sequence def configurePrefetchingInitialRoI(flags, chains): from AthenaCommon.AlgSequence import AlgSequence @@ -140,12 +153,11 @@ def configurePrefetchingInitialRoI(flags, chains): prefetchAlg.ChainFilter = chainFilter - # In CA we have no access to the HLTBeginSeq in here # Instead generate the prefetching alg configs and append the ChainFilter, # to be merged into the global config. -def prefetchingInitialRoIConfig(flags, chains): - chainFilterMap = getChainsForPrefetching(chains) +def prefetchingInitialRoIConfig(flags, CFseq_list): + chainFilterMap = getChainsForPrefetching(CFseq_list) configurators = { 'Si': ROBPrefetchingAlgCfg_Si, 'Calo': ROBPrefetchingAlgCfg_Calo, @@ -164,3 +176,5 @@ def prefetchingInitialRoIConfig(flags, chains): prefetchCfg.merge(prefetchAlg) return prefetchCfg + + diff --git a/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnAOD_test.ref b/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnAOD_test.ref index bd38be5107082420c63f167e2f0068ba2e60524f..e3a7b8e2350b3785b6b3ed78b8250f5e0b6125d3 100644 --- a/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnAOD_test.ref +++ b/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnAOD_test.ref @@ -1,4 +1,3 @@ -Py:UnitTest INFO Event Inputs Py:UnitTest INFO Event Algorithm Sequences Py:UnitTest INFO Top sequence 0 Py:UnitTest INFO \__ AthAlgSeq (seq: PAR AND) diff --git a/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnRAW_test.ref b/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnRAW_test.ref index 5479f1743ad1e8377779adbb6ec026c7fe0f685b..f018e3bb50c6e12def3b7df979cb7ee16f6e07ee 100644 --- a/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnRAW_test.ref +++ b/Trigger/TrigAnalysis/TrigDecisionTool/share/Run2TrigDecisionToolOnRAW_test.ref @@ -1,4 +1,3 @@ -Py:UnitTest INFO Event Inputs Py:UnitTest INFO Event Algorithm Sequences Py:UnitTest INFO Top sequence 0 Py:UnitTest INFO \__ AthAlgSeq (seq: PAR AND) diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx index 8429eac7edf3fc53ca47e9e82638ebef91bc28e8..6570e59b516aa162ef7a28982a0edc637b26d447 100644 --- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx +++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXFPGA.cxx @@ -551,6 +551,12 @@ void eFEXFPGA::SetIsoWP(const std::vector<unsigned int>& CoreEnv, const std::vec // Working point evaluted by Core * 2^bitshift > Threshold * Environment conditions std::unordered_map<unsigned int, unsigned int> bsmap { {3, 8}, {5, 32}}; + // if core (denom) has overflowed, automatically pass all thresholds + if (CoreEnv[0] > 0xffff) { + workingPoint = 3; + return; + } + unsigned int large = CoreEnv[0]*bsmap[bitshift]; // core unsigned int small = CoreEnv[1]; // env @@ -558,13 +564,8 @@ void eFEXFPGA::SetIsoWP(const std::vector<unsigned int>& CoreEnv, const std::vec if (large > 0xffff ) large = 0xffff; if (small > 0xffff ) small = 0xffff; - // Pass all if shifted core sum overflows - if (large == 0xffff) { - workingPoint = 3; - return; - } // Fail all if env sum overflows - else if (small == 0xffff) { + if (small == 0xffff) { workingPoint = 0; return; } diff --git a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx index 4ab59389c8134710a7f0fbe838fb0856a0e5dc7c..2fd4cb8b491d1e7920721b9bbab97d926f437ccd 100644 --- a/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx +++ b/Trigger/TrigT1/L1CaloFEX/L1CaloFEXSim/src/eFEXegAlgo.cxx @@ -221,7 +221,7 @@ void LVL1::eFEXegAlgo::getWstot(std::vector<unsigned int> & output){ } // Overflow handling - if (den > 0xffff) den = 0xffff; + //if (den > 0xffff) den = 0xffff; - commented out so that denom can overflow, will then automatically pass all thresholds (see eFEXFPGA::SetIsoWP) if (numer > 0xffff) numer = 0xffff; // Return results diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/test_menu_cf_CA.py b/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/test_menu_cf_CA.py index 6803deda722fd30d4fc3d6d3cca09074eb055733..ddc919634c28be85ad06bb21d84b8aa1a12dae61 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/test_menu_cf_CA.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/CFtest/test_menu_cf_CA.py @@ -68,7 +68,7 @@ def makeMenu(flags): # from here generate the ControlFlow and the Dataflow # doing the same as menu.generateMT() from TriggerMenuMT.HLT.Config.GenerateMenuMT import makeHLTTree - menuCA = makeHLTTree(flags) + menuCA, cfseqlist = makeHLTTree(flags) return menuCA def main(): diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ChainConfigurationBase.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ChainConfigurationBase.py index b2f6df038c8b53c7d07ed0db6d94f992716779ea..60ce48f7cbac2eb04d9684720dff6a87a9b9fc09 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ChainConfigurationBase.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ChainConfigurationBase.py @@ -55,7 +55,7 @@ class ChainConfigurationBase(metaclass=abc.ABCMeta): # Bind flags to comboHypo generator if needed if 'flags' in inspect.signature(comboHypoCfg).parameters: comboHypoCfg = functools.partial(comboHypoCfg, flags) - return ChainStep(stepName, seqArray, [self.mult], [self.dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools) + return ChainStep(stepName, seqArray, [self.mult], [self.dict], comboHypoCfg = comboHypoCfg, comboToolConfs = comboTools) # if not returned any step raise RuntimeError("[getStep] No sequences generated for step %s!", stepPartName) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFComponents.py index 76f1f4632e7d82ed21f7838f84f68d78af974d42..ee82f4a3eefa9ec783d5ccce130f86365acc7135 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFComponents.py @@ -93,103 +93,44 @@ class CFSequence(object): A Filter can have more than one input/output if used in different chains, so this class stores and manages all of them (when doing the connect) """ def __init__(self, ChainStep, FilterAlg): - self.empty= ChainStep.isEmpty - self.filter = FilterAlg + self.filterNode = FilterAlg self.step = ChainStep - self.combo = ChainStep.combo #copy this instance self.connectCombo() - self.setDecisions() - log.debug("CFSequence.__init: created %s ",self) + self.setDecisions() + log.debug("CFSequence.__init: created %s ",self) def setDecisions(self): """ Set the output decision of this CFSequence as the hypo outputdecision; In case of combo, takes the Combo outputs""" self.decisions=[] # empty steps: - if self.combo is None: - self.decisions.extend(self.filter.getOutputList()) + if self.step.combo is None: + self.decisions.extend(self.filterNode.getOutputList()) else: - self.decisions.extend(self.combo.getOutputList()) + self.decisions.extend(self.step.combo.getOutputList()) log.debug("CFSequence: set out decisions: %s", self.decisions) - - - def connect(self, connections): - """Connect filter to ChainStep (and all its sequences) through these connections (which are sets of filter outputs) - if a ChainStep contains the same sequence multiple times (for multi-object chains), - the filter is connected only once (to avoid multiple DH links) - """ - if log.isEnabledFor(logging.DEBUG): - log.debug("CFSequence: connect Filter %s with %d menuSequences of step %s, using %d connections", self.filter.Alg.name, len(self.step.sequences), self.step.name, len(connections)) - log.debug(" --- sequences: ") - for seq in self.step.sequences: - log.debug(seq) - - if len(connections) == 0: - log.error("No filter outputs are set!") - - if len(self.step.sequences): - # check whether the number of filter outputs are the same as the number of sequences in the step - if len(connections) != len(self.step.sequences): - log.error("Found %d connections and %d MenuSequences in Step %s", len(connections), len(self.step.sequences), self.step.name) - raise Exception("[CFSequence] Connections and sequences do not match, this must be fixed!") - nseq=0 - for seq in self.step.sequences: - filter_out = connections[nseq] - log.debug("CFSequence: Found input %s to sequence::%s from Filter::%s", filter_out, seq.name, self.filter.Alg.name) - seq.connectToFilter( filter_out ) - nseq+=1 - else: - log.debug("This CFSequence has no sequences: outputs are the Filter outputs, which are %d", len(self.decisions)) - + def connectCombo(self): """ connect Combo to Hypos""" - if self.combo is None: + if self.step.combo is None: + log.debug("CFSequence.connectCombo: no Combo found") return for seq in self.step.sequences: combo_input=seq.getOutputList()[0] - self.combo.addInput(combo_input) - inputs = self.combo.readInputList() + self.step.combo.addInput(combo_input) + inputs = self.step.combo.readInputList() legindex = inputs.index(combo_input) - log.debug("CFSequence.connectCombo: adding input to %s: %s", self.combo.Alg.getName(), combo_input) + log.debug("CFSequence.connectCombo: adding input to %s: %s", self.step.combo.Alg.getName(), combo_input) # inputs are the output decisions of the hypos of the sequences - combo_output=CFNaming.comboHypoOutputName (self.combo.Alg.getName(), legindex) - self.combo.addOutput(combo_output) - log.debug("CFSequence.connectCombo: adding output to %s: %s", self.combo.Alg.getName(), combo_output) - + combo_output=CFNaming.comboHypoOutputName (self.step.combo.Alg.getName(), legindex) + self.step.combo.addOutput(combo_output) + log.debug("CFSequence.connectCombo: adding output to %s: %s", self.step.combo.Alg.getName(), combo_output) - def createHypoTools(self, flags, chain, newstep): - """ set and create HypoTools accumulated on the self.step from an input step configuration - """ - if self.combo is None: - return - acc = ComponentAccumulator() - - assert len(newstep.sequences) == len(self.step.sequences), f'Trying to add HypoTools from new step {newstep.name}, which differ in number of sequences' - assert len(self.step.sequences) == len(newstep.stepDicts), f'The number of sequences of step {self.step.name} ({len(self.step.sequences)}) differ from the number of dictionaries in the chain {len(newstep.stepDicts)}' - - log.debug("createHypoTools for Step %s", newstep.name) - log.debug('from chain %s with step mult= %d', chain, sum(newstep.multiplicity)) - log.debug("N(seq)=%d, N(chainDicts)=%d", len(newstep.sequences), len(newstep.stepDicts)) - - for seq, myseq, onePartChainDict in zip(newstep.sequences, self.step.sequences, newstep.stepDicts): - log.debug(' seq: %s, onePartChainDict:', seq.name) - log.debug(' %s', onePartChainDict) - hypoToolConf=seq.getHypoToolConf() - if hypoToolConf is not None: # avoid empty sequences - hypoToolConf.setConf( onePartChainDict ) - hypoAcc = myseq.hypo.addHypoTool(flags, hypoToolConf) #this creates the HypoTools - if isinstance(hypoAcc, ComponentAccumulator): - acc.merge(hypoAcc) - - chainDict = HLTMenuConfig.getChainDictFromChainName(chain) - self.combo.createComboHypoTools(flags, chainDict, newstep.comboToolConfs) - return acc - def __repr__(self): return "--- CFSequence ---\n + Filter: %s \n + decisions: %s\n + %s \n"%(\ - self.filter.Alg.name, self.decisions, self.step) + self.filterNode.Alg.name, self.decisions, self.step) class CFSequenceCA(CFSequence): @@ -197,15 +138,13 @@ class CFSequenceCA(CFSequence): A Filter can have more than one input/output if used in different chains, so this class stores and manages all of them (when doing the connect) """ def __init__(self, chainStep, filterAlg): - log.debug(" *** Create CFSequence %s with Filter %s", chainStep.name, filterAlg.Alg.getName()) - - self.empty= chainStep.isEmpty + log.debug(" *** Create CFSequenceCA %s with Filter %s", chainStep.name, filterAlg.Alg.getName()) self.ca = ComponentAccumulator() #empty step: add the PassSequence, one instance only is appended to the tree - seqAndWithFilter = filterAlg.Alg if self.empty else seqAND(chainStep.name) + seqAndWithFilter = filterAlg.Alg if chainStep.isEmpty else seqAND(chainStep.name) self.ca.addSequence(seqAndWithFilter) self.seq = seqAndWithFilter - if not self.empty: + if not chainStep.isEmpty: self.ca.addEventAlgo(filterAlg.Alg, sequenceName=seqAndWithFilter.getName()) self.stepReco = parOR(chainStep.name + CFNaming.RECO_POSTFIX) # all reco algorithms from all the sequences in a parallel sequence self.ca.addSequence(self.stepReco, parentName=seqAndWithFilter.getName()) @@ -214,13 +153,13 @@ class CFSequenceCA(CFSequence): CFSequence.__init__(self, chainStep, filterAlg) - if not self.empty: + if not chainStep.isEmpty: # merge the Hypoalg (before the Combo) for menuseq in chainStep.sequences: if not isinstance(menuseq, EmptyMenuSequence): self.ca.merge(menuseq.hypoAcc, sequenceName=seqAndWithFilter.getName()) - if self.combo is not None: + if self.step.combo is not None: self.ca.merge(self.step.combo.acc, sequenceName=seqAndWithFilter.getName()) def mergeStepSequences(self, chainStep): @@ -238,31 +177,78 @@ class CFSequenceCA(CFSequence): return findAlgorithmByPredicate(self.seq, lambda alg: alg.name == self.step.Alg.name and isComboHypoAlg(alg)) - def createHypoTools(self, flags, chain, newstep): - """ set and create HypoTools accumulated on the self.step from an input step configuration + +class CFGroup(object): + """Class to store the Step + its Filter (CFSequence) plus the chains and dictionaries of the legs using that step """ + def __init__(self, ChainStep, FilterAlg):#, fastMenu): + self.stepDicts = [] # will become a list of lists + self.multiplicity = [] + self.chains = [] + self.comboToolConfs = [] + self.createCFSequenceCA(ChainStep, FilterAlg) + log.debug("CFGroup.__init: created for %s ",ChainStep.name) + + def createCFSequenceCA(self, ChainStep, FilterAlg): + '''This creates the CAs for the menu sequences, if fastMenu style, and the CFSequenceCA''' + log.debug("CFGroup.creating CFSEquenceCA") + self.sequenceCA = CFSequenceCA(ChainStep, FilterAlg) + return self.sequenceCA + + def addStepLeg(self, newstep, chainName): + self.stepDicts.append(newstep.stepDicts) # one dict per leg + self.chains.append(chainName) + self.comboToolConfs.append(newstep.comboToolConfs) + self.multiplicity.append(newstep.multiplicity) + + + def connect(self, connections): + """Connect filter to ChainStep (and all its sequences) through these connections (which are sets of filter outputs) + if a ChainStep contains the same sequence multiple times (for multi-object chains), + the filter is connected only once (to avoid multiple DH links) """ - - if self.step.combo is None: + if log.isEnabledFor(logging.DEBUG): + log.debug("CFGroup: connect Filter %s with %d menuSequences of step %s, using %d connections", self.sequenceCA.filterNode.Alg.name, len(self.sequenceCA.step.sequences), self.sequenceCA.step.name, len(connections)) + log.debug(" --- sequences: ") + for seq in self.sequenceCA.step.sequences: + log.debug(seq) + + if len(connections) == 0: + log.error("No filter outputs are set!") + + if len(self.sequenceCA.step.sequences): + # check whether the number of filter outputs are the same as the number of sequences in the step + if len(connections) != len(self.sequenceCA.step.sequences): + log.error("CFGroup: Found %d connections and %d MenuSequences in Step %s", len(connections), len(self.sequenceCA.step.sequences), self.sequenceCA.step.name) + raise Exception("[CFGroup] Connections and sequences do not match, this must be fixed!") + + for nseq, seq in enumerate(self.sequenceCA.step.sequences): + filter_out = connections[nseq] + log.debug("CFGroup: Found input %s to sequence::%s from Filter::%s", filter_out, seq.name, self.sequenceCA.filterNode.Alg.name) + seq.connectToFilter( filter_out ) + else: + log.debug("This CFGroup has no sequences: outputs are the Filter outputs, which are %d", len(self.sequenceCA.decisions)) + + def createHypoTools(self, flags): + """ set and create HypoTools accumulated on the self.step from an input step configuration + """ + if self.sequenceCA.step.combo is None: return - assert len(newstep.sequences) == len(self.step.sequences), f'Trying to add HypoTools from new step {newstep.name}, which differ in number of sequences' - assert len(self.step.sequences) == len(newstep.stepDicts), f'The number of sequences of step {self.step.name} ({len(self.step.sequences)}) differ from the number of dictionaries in the chain {len(newstep.stepDicts)}' - - log.debug("createHypoTools for Step %s", newstep.name) - log.debug('from chain %s with step mult= %d', chain, sum(newstep.multiplicity)) - log.debug("N(seq)=%d, N(chainDicts)=%d", len(newstep.sequences), len(newstep.stepDicts)) - - for seq, myseq, onePartChainDict in zip(newstep.sequences, self.step.sequences, newstep.stepDicts): - log.debug(' seq: %s, onePartChainDict:', seq.name) - log.debug(' %s', onePartChainDict) - hypoToolConf=seq.getHypoToolConf() - if hypoToolConf is not None: # avoid empty sequences - hypoToolConf.setConf( onePartChainDict ) - hypo = HypoAlgNode(Alg = self.ca.getEventAlgo(myseq.hypo.Alg.getName())) - hypoToolAcc = hypo.addHypoTool(flags, hypoToolConf) #this creates the HypoTools - if isinstance(hypoToolAcc, ComponentAccumulator): - self.ca.merge(hypoToolAcc) + log.debug("CFGroup.createHypoTools for Step %s", self.sequenceCA.step.name) + for sdict in self.stepDicts: + for seq, onePartChainDict in zip(self.sequenceCA.step.sequences, sdict): + log.debug(' seq: %s, onePartChainDict:', seq.name) + log.debug(' %s', onePartChainDict) + if not isinstance(seq, EmptyMenuSequence): + hypoToolConf=seq.getHypoToolConf() + if hypoToolConf is None: # avoid empty sequences + log.error("HypoToolConf not found ", seq.name) + hypoToolConf.setConf( onePartChainDict ) + hypo = HypoAlgNode(Alg = self.sequenceCA.ca.getEventAlgo(seq.hypo.Alg.getName())) + hypoToolAcc = hypo.addHypoTool(flags, hypoToolConf) #this creates the HypoTools + if isinstance(hypoToolAcc, ComponentAccumulator): + self.sequenceCA.ca.merge(hypoToolAcc) - - chainDict = HLTMenuConfig.getChainDictFromChainName(chain) - self.combo.createComboHypoTools(flags, chainDict, newstep.comboToolConfs) + for chain,conf in zip(self.chains, self.comboToolConfs): + chainDict = HLTMenuConfig.getChainDictFromChainName(chain) + self.sequenceCA.step.combo.createComboHypoTools(flags, chainDict, conf) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFConfig.py index 702aa9259a0f595dcb34c9e73eb202ff4e8b0c6f..095e8381e3575e89a7e43784792d148253c6fdcc 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFConfig.py @@ -23,10 +23,9 @@ """ from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFDot import stepCF_DataFlow_to_dot, stepCF_ControlFlow_to_dot, all_DataFlow_to_dot -from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFComponents import RoRSequenceFilterNode, PassFilterNode, CFSequenceCA +from TriggerMenuMT.HLT.Config.ControlFlow.HLTCFComponents import RoRSequenceFilterNode, PassFilterNode, CFGroup from TriggerMenuMT.HLT.Config.ControlFlow.MenuComponentsNaming import CFNaming - -from AthenaCommon.CFElements import parOR, seqAND, isSequence +from AthenaCommon.CFElements import parOR, isSequence from AthenaCommon.AlgSequence import dumpSequence from AthenaCommon.Logging import logging @@ -51,19 +50,6 @@ def makeSummary(flags, name, flatDecisions): return summary -def createStepRecoNode(name, seq_list, dump=False): - """ Elementary HLT reco step, contianing all sequences of the step """ - - log.debug("Create reco step %s with %d sequences", name, len(seq_list)) - stepCF = parOR(name + CFNaming.RECO_POSTFIX) - for seq in seq_list: - stepCF += createCFTree(seq) - - if dump: - dumpSequence (stepCF, indent=0) - return stepCF - - def createStepFilterNode(name, seq_list, dump=False): """ Elementary HLT filter step: OR node containing all Filters of the sequences. The node gates execution of next reco step """ @@ -82,32 +68,6 @@ def createStepFilterNode(name, seq_list, dump=False): return stepCF -def createCFTree(CFseq): - """ Creates AthSequencer nodes with sequences attached """ - - log.debug(" *** Create CF Tree for CFSequence %s", CFseq.step.name) - filterAlg = CFseq.filter.Alg - - #empty step: add the PassSequence, one instance only is appended to the tree - if len(CFseq.step.sequences)==0: - seqAndWithFilter=filterAlg - return seqAndWithFilter - - stepReco = parOR(CFseq.step.name + CFNaming.RECO_POSTFIX) # all reco algorithms from all the sequences in a parallel sequence - seqAndWithFilter = seqAND(CFseq.step.name, [filterAlg, stepReco]) - - recoSeqSet=set() - hypoSet=set() - for menuseq in CFseq.step.sequences: - menuseq.addToSequencer(recoSeqSet,hypoSet) - - stepReco += sorted(list(recoSeqSet), key=lambda t: t.getName()) - seqAndWithFilter += sorted(list(hypoSet), key=lambda t: t.getName()) - if CFseq.step.combo is not None: - seqAndWithFilter += CFseq.step.combo.Alg - - return seqAndWithFilter - ####################################### ## CORE of Decision Handling @@ -212,15 +172,16 @@ def decisionTreeFromChains(flags, HLTNode, chains, allDicts): if len(chains) == 0: log.info("[decisionTreeFromChains] Configuring empty decisionTree") acc.addSequence(HLTNode) - return ([], acc) - - ( finalDecisions, CFseq_list) = createDataFlow(flags, chains, allDicts) + return ([], [], acc) + + ( finalDecisions, CFseq_list) = createDataFlow(flags, chains) + addChainsToDataFlow(flags, CFseq_list, allDicts) + # now connect all algorithms and creates the CAs cfAcc = createControlFlow(flags, HLTNode, CFseq_list) acc.merge(cfAcc) # create dot graphs log.debug("finalDecisions: %s", finalDecisions) - if flags.Trigger.generateMenuDiagnostics: all_DataFlow_to_dot(HLTNodeName, CFseq_list) @@ -228,10 +189,9 @@ def decisionTreeFromChains(flags, HLTNode, chains, allDicts): # uncomment for serious debugging # matrixDisplay( CFseq_list ) - return (finalDecisions,acc) + return (finalDecisions,CFseq_list, acc) - -def createDataFlow(flags, chains, allDicts): +def createDataFlow(flags, chains): """ Creates the filters and connect them to the menu sequences""" # find tot nsteps @@ -248,11 +208,12 @@ def createDataFlow(flags, chains, allDicts): for chain in chains: log.debug("\n Configuring chain %s with %d steps: \n - %s ", chain.name,len(chain.steps),'\n - '.join(map(str, [{step.name:step.multiplicity} for step in chain.steps]))) - lastCFseq = None + lastCFgroup = None lastDecisions = [] for nstep, chainStep in enumerate( chain.steps ): - #create all sequences CA in all steps to allow data flow connections - chainStep.createSequences() + if not flags.Trigger.fastMenuGeneration: + #create all sequences CA in all steps to allow data flow connections + chainStep.createSequences() log.debug("\n************* Start connecting step %d %s for chain %s", nstep+1, chainStep.name, chain.name) if nstep == 0: filterInput = chain.L1decisions @@ -273,32 +234,28 @@ def createDataFlow(flags, chains, allDicts): filterOutput = [CFNaming.filterOutName(filterName, inputName) for inputName in filterInput ] # TODO: Check sequence consistency if skipping, to avoid issues like https://its.cern.ch/jira/browse/ATR-28617 - foundCFseq = CFSeqByFilterName[nstep].get(filterName, None) - log.debug("%s CF sequences with filter name %s", "Not found" if foundCFseq is None else "Found", filterName) - if foundCFseq is None: - sequenceFilter = buildFilter(filterName, filterInput, chainStep.isEmpty) - CFseq = CFSequenceCA( chainStep = chainStep, filterAlg = sequenceFilter) - CFseq.connect(filterOutput) - CFSeqByFilterName[nstep][CFseq.filter.Alg.getName()] = CFseq - CFseqList[nstep].append(CFseq) - lastCFseq = CFseq - else: - lastCFseq = foundCFseq - - # skip re-merging + foundCFgroup = CFSeqByFilterName[nstep].get(filterName, None) + log.debug("%s CF sequences with filter name %s", "Not found" if foundCFgroup is None else "Found", filterName) + if foundCFgroup is None: + sequenceFilter = buildFilter(filterName, filterInput, chainStep.isEmpty) if flags.Trigger.fastMenuGeneration: - for menuseq in chainStep.sequences: - menuseq.ca.wasMerged() - if menuseq.globalRecoCA: - menuseq.globalRecoCA.wasMerged() - - sequenceFilter = lastCFseq.filter + #create the sequences CA of this step in fast mode + chainStep.createSequences() + # add the step to a new group + CFgroup = CFGroup( ChainStep = chainStep, FilterAlg = sequenceFilter) #, fastMenu = flags.Trigger.fastMenuGeneration) + CFgroup.connect(filterOutput) + CFSeqByFilterName[nstep][sequenceFilter.Alg.getName()] = CFgroup + CFseqList[nstep].append(CFgroup) + lastCFgroup = CFgroup + else: + lastCFgroup = foundCFgroup + sequenceFilter = lastCFgroup.sequenceCA.filterNode if len(list(set(sequenceFilter.getInputList()).intersection(filterInput))) != len(list(set(filterInput))): [ sequenceFilter.addInput(inputName) for inputName in filterInput ] [ sequenceFilter.addOutput(outputName) for outputName in filterOutput ] - lastCFseq.connect(filterOutput) + lastCFgroup.connect(filterOutput) - lastDecisions = lastCFseq.decisions + lastDecisions = lastCFgroup.sequenceCA.decisions # add chains to the filter: chainLegs = chainStep.getChainLegs() @@ -311,15 +268,8 @@ def createDataFlow(flags, chains, allDicts): log.debug("Now Filter has chains: %s", sequenceFilter.getChains()) log.debug("Now Filter has chains/input: %s", sequenceFilter.getChainsPerInput()) - - if lastCFseq.step.combo is not None: - lastCFseq.step.combo.addChain( [d for d in allDicts if d['chainName'] == chain.name ][0]) - log.debug("Added chains to ComboHypo: %s",lastCFseq.step.combo.getChains()) - else: - log.debug("Combo not implemented if it's empty step") - - # add HypoTools to this step (cumulating all same steps) - lastCFseq.createHypoTools(flags,chain.name,chainStep) + # store legs and mult in the CFGroup + lastCFgroup.addStepLeg(chainStep, chain.name) if len(chain.steps) == nstep+1: log.debug("Adding finalDecisions for chain %s at step %d:", chain.name, nstep+1) @@ -354,8 +304,8 @@ def createControlFlow(flags, HLTNode, CFseqList): filter_list = [] # add the filter to the node - for cseq in sequences: - filterAlg = cseq.filter.Alg + for cgroup in sequences: + filterAlg = cgroup.sequenceCA.filterNode.Alg if filterAlg.getName() not in filter_list: log.debug("[createControlFlow] Add %s to filter node %s", filterAlg.getName(), stepSequenceName) filter_list.append(filterAlg.getName()) @@ -368,11 +318,12 @@ def createControlFlow(flags, HLTNode, CFseqList): # add the sequences to the reco node addedEmtpy = False - for cseq in sequences: - if cseq.empty and addedEmtpy: + for cgroup in sequences: + cseq=cgroup.sequenceCA + if cseq.step.isEmpty and addedEmtpy: cseq.ca.wasMerged() continue - if cseq.empty: # adding Empty only once to avoid merging multiple times the PassSequence + if cseq.step.isEmpty: # adding Empty only once to avoid merging multiple times the PassSequence addedEmtpy= True log.debug(" *** Create CF Tree for CFSequence %s", cseq.step.name) acc.merge(cseq.ca, sequenceName=stepCFReco.getName()) @@ -380,7 +331,7 @@ def createControlFlow(flags, HLTNode, CFseqList): # add the monitor summary stepDecisions = [] for CFseq in CFseqList[nstep]: - stepDecisions.extend(CFseq.decisions) + stepDecisions.extend(CFseq.sequenceCA.decisions) summary = makeSummary( flags, stepSequenceName, stepDecisions ) acc.addEventAlgo([summary],sequenceName = HLTNode.getName()) @@ -394,7 +345,19 @@ def createControlFlow(flags, HLTNode, CFseqList): return acc - +def addChainsToDataFlow(flags, CFseq_list, allDicts): + for groupsInStep in CFseq_list: + for cfgroup in groupsInStep: + chains = cfgroup.chains + CFS = cfgroup.sequenceCA + # add chains to the ComboHypo: + if CFS.step.combo is not None: + for chain in chains: + CFS.step.combo.addChain( [d for d in allDicts if d['chainName'] == chain ][0]) + log.debug("Added chains to ComboHypo: %s",CFS.step.combo.getChains()) + + # add HypoTools to this step (cumulating all same steps) + cfgroup.createHypoTools(flags) @@ -425,3 +388,4 @@ def buildFilter(filter_name, filter_input, empty): return (sfilter) + diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFDot.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFDot.py index 7749afb3d112ee2a65da4364073c44375e9e2df1..b62afd510a9a1b6d9e75127198c34447d0c10759 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFDot.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/ControlFlow/HLTCFDot.py @@ -103,33 +103,33 @@ def all_DataFlow_to_dot(name, step_list): # reset the last step last_step_hypoNodes =[] for cfseq in cfseq_list: - file.write(" %s[fillcolor=%s style=filled]\n"%(cfseq.filter.Alg.name,algColor(cfseq.filter.Alg))) - step_connections.append(cfseq.filter) - file.write( '\n subgraph cluster_%s {\n'%(cfseq.step.name)\ + file.write(" %s[fillcolor=%s style=filled]\n"%(cfseq.sequenceCA.filterNode.Alg.name,algColor(cfseq.sequenceCA.filterNode.Alg))) + step_connections.append(cfseq.sequenceCA.filterNode) + file.write( '\n subgraph cluster_%s {\n'%(cfseq.sequenceCA.step.name)\ +' concentrate=true;\n' +' node [color=white style=filled]\n'\ +' style=filled\n'\ +' color=lightgrey\n'\ +' fontname=Helvetica\n'\ - +' label = %s\n'%(cfseq.step.name)) + +' label = %s\n'%(cfseq.sequenceCA.step.name)) cfseq_algs = [] - cfseq_algs.append(cfseq.filter) + cfseq_algs.append(cfseq.sequenceCA.filterNode) - if len(cfseq.step.sequences)==0: - last_step_hypoNodes.append(cfseq.filter) + if len(cfseq.sequenceCA.step.sequences)==0: + last_step_hypoNodes.append(cfseq.sequenceCA.filterNode) - for menuseq in cfseq.step.sequences: + for menuseq in cfseq.sequenceCA.step.sequences: cfseq_algs, all_hypos, last_step_hypoNodes = menuseq.buildDFDot(cfseq_algs, all_hypos, last_step_hypoNodes, file) - if cfseq.step.combo is not None: - file.write(" %s[color=%s]\n"%(cfseq.step.combo.Alg.name, algColor(cfseq.step.combo.Alg))) - cfseq_algs.append(cfseq.step.combo) - last_step_hypoNodes.append(cfseq.step.combo) + if cfseq.sequenceCA.step.combo is not None: + file.write(" %s[color=%s]\n"%(cfseq.sequenceCA.step.combo.Alg.name, algColor(cfseq.sequenceCA.step.combo.Alg))) + cfseq_algs.append(cfseq.sequenceCA.step.combo) + last_step_hypoNodes.append(cfseq.sequenceCA.step.combo) file.write(' }\n') file.write(findConnections(cfseq_algs)) file.write('\n') @@ -156,29 +156,29 @@ def stepCF_DataFlow_to_dot(name, cfseq_list): all_hypos = [] for cfseq in cfseq_list: - file.write(" %s[fillcolor=%s style=filled]\n"%(cfseq.filter.Alg.name,algColor(cfseq.filter.Alg))) - for inp in cfseq.filter.getInputList(): - file.write(addConnection(name, cfseq.filter.Alg.name, inp)) + file.write(" %s[fillcolor=%s style=filled]\n"%(cfseq.sequenceCA.filterNode.Alg.name,algColor(cfseq.sequenceCA.filterNode.Alg))) + for inp in cfseq.sequenceCA.filterNode.getInputList(): + file.write(addConnection(name, cfseq.sequenceCA.filterNode.Alg.name, inp)) - file.write( '\n subgraph cluster_%s {\n'%(cfseq.step.name)\ + file.write( '\n subgraph cluster_%s {\n'%(cfseq.sequenceCA.step.name)\ +' concentrate=true;\n' +' node [color=white style=filled]\n'\ +' style=filled\n'\ +' color=lightgrey\n'\ +' fontname=Helvetica\n'\ - +' label = %s\n'%(cfseq.step.name)) + +' label = %s\n'%(cfseq.sequenceCA.step.name)) cfseq_algs = [] - cfseq_algs.append(cfseq.filter) + cfseq_algs.append(cfseq.sequenceCA.filterNode) - for menuseq in cfseq.step.sequences: + for menuseq in cfseq.sequenceCA.step.sequences: cfseq_algs, all_hypos, _ = menuseq.buildDFDot(cfseq_algs, all_hypos, None, file) - if cfseq.step.combo is not None: - file.write(" %s[color=%s]\n"%(cfseq.step.combo.Alg.name, algColor(cfseq.step.combo.Alg))) - cfseq_algs.append(cfseq.step.combo) + if cfseq.sequenceCA.step.combo is not None: + file.write(" %s[color=%s]\n"%(cfseq.sequenceCA.step.combo.Alg.name, algColor(cfseq.sequenceCA.step.combo.Alg))) + cfseq_algs.append(cfseq.sequenceCA.step.combo) file.write(' }\n') file.write(findConnections(cfseq_algs)) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py index 3b76c7e12ff782852684e337f883a65956a97e26..3a2cea77f4bc4a2e3a4368119b2bcdd846f5fbcd 100755 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/GenerateMenuMT.py @@ -187,7 +187,7 @@ class GenerateMenuMT(object, metaclass=Singleton): log.debug("Next: getting chain configuration for chain %s ", chainDict['chainName']) chainConfig,lengthOfChainConfigs = self.__generateChainConfig(flags, chainDict) all_chains += [(chainDict,chainConfig,lengthOfChainConfigs)] - + #update the alignment group length dictionary if we have a longer number of steps #or the signature isn't registered in the dictionary yet for config_length, config_grp in lengthOfChainConfigs: @@ -228,7 +228,7 @@ class GenerateMenuMT(object, metaclass=Singleton): # decoding of the chain name log.info("Will now get chain dictionaries for each chain") self.getChainDicts(flags) - + if flags.Trigger.disableCPS: log.warning('Removing all CPS group because the flag Trigger.disableCPS is set') for chainDict in self.chainDicts: @@ -537,20 +537,19 @@ def generateMenuMT(flags): (menu.L1Prescales, menu.HLTPrescales, menu.chainsInMenu) = MenuPrescaleConfig(HLTMenuConfig, flags) from TriggerMenuMT.HLT.Menu.MenuPrescaleConfig import applyHLTPrescale applyHLTPrescale(HLTMenuConfig, menu.HLTPrescales, menu.signaturesOverwritten) - + # make sure that we didn't generate any steps that are fully empty in all chains # if there are empty steps, remove them finalListOfChainConfigs = menu.resolveEmptySteps(finalListOfChainConfigs) log.debug("finalListOfChainConfig %s", finalListOfChainConfigs) log.info("Making the HLT configuration tree") - menuAcc=makeHLTTree(flags) - + menuAcc, CFseq_list = makeHLTTree(flags) # Configure ChainFilters for ROBPrefetching from TriggerJobOpts.TriggerConfigFlags import ROBPrefetching if ROBPrefetching.InitialRoI in flags.Trigger.ROBPrefetchingOptions: from TrigGenericAlgs.TrigGenericAlgsConfig import prefetchingInitialRoIConfig - menuAcc.merge( prefetchingInitialRoIConfig(flags, HLTMenuConfig.configsList()), 'HLTBeginSeq') + menuAcc.merge( prefetchingInitialRoIConfig(flags, CFseq_list), 'HLTBeginSeq') log.info("Checking the L1HLTConsistency...") from TriggerMenuMT.HLT.Config.Validation.CheckL1HLTConsistency import checkL1HLTConsistency @@ -575,7 +574,7 @@ def makeHLTTree(flags): acc = ComponentAccumulator() steps = seqAND('HLTAllSteps') - finalDecisions, menuAcc = decisionTreeFromChains(flags, steps, HLTMenuConfig.configsList(), HLTMenuConfig.dictsList()) + finalDecisions, CFseq_list, menuAcc = decisionTreeFromChains(flags, steps, HLTMenuConfig.configsList(), HLTMenuConfig.dictsList()) if log.getEffectiveLevel() <= logging.DEBUG: menuAcc.printConfig() @@ -612,4 +611,4 @@ def makeHLTTree(flags): from AthenaCommon.CFElements import checkSequenceConsistency checkSequenceConsistency(steps) - return acc + return acc, CFseq_list diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py index e0a68e15e25bf68f2b3c315083c24cd13ec53f69..83478705bbaf9e922aae12a569dbead2edfb146f 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/MenuComponents.py @@ -355,9 +355,6 @@ class EmptyMenuSequence: """Connect filter to the InputMaker""" self.maker.addInput(outfilter) - def createHypoTools(self, chainDict): - log.debug("This sequence is empty. No Hypo to configure") - def getHypoToolConf(self): return None @@ -467,17 +464,7 @@ class MenuSequenceCA: """Connect filter to the InputMaker""" log.debug("connecting %s to inputs of %s", outfilter, self.maker.Alg.name) self.maker.addInput(outfilter) - - def createHypoTools(self, flags, chainDict): - if isinstance(self._hypoToolConf, list): - log.warning ("This sequence %s has %d multiple HypoTools ",self.sequence.name, len(self.hypoToolConf)) - for hypo, hypoToolConf in zip(self._hypo, self._hypoToolConf): - hypoToolConf.setConf( chainDict ) - hypo.addHypoTool(flags, self._hypoToolConf) - else: - self._hypoToolConf.setConf( chainDict ) - self._hypo.addHypoTool(flags, self._hypoToolConf) #this creates the HypoTools - + def getHypoToolConf(self) : return self._hypoToolConf @@ -620,23 +607,7 @@ class Chain(object): return 0 return not_empty_mult[0] - def createHypoTools(self, flags): - """ This is extrapolating the hypotool configuration from the chain name""" - log.debug("createHypoTools for chain %s", self.name) - - for step in self.steps: - if step.combo is None: - continue - log.debug("createHypoTools for Step %s", step.name) - log.debug('%s in new hypo tool creation method, step mult= %d', self.name, sum(step.multiplicity)) - log.debug("N(seq)=%d, N(chainDicts)=%d", len(step.sequences), len(step.stepDicts)) - for seq, onePartChainDict in zip(step.sequences, step.stepDicts): - log.debug(' seq: %s, onePartChainDict:', seq.name) - log.debug(' %s', onePartChainDict) - seq.createHypoTools( flags, onePartChainDict ) - - step.createComboHypoTools(flags, self.name) - + # Receives a pair with the topo config function and an identifier string, # optionally also a target step name # The string is needed to rename the step after addition of the ComboHypoTool @@ -647,8 +618,8 @@ class Chain(object): def __repr__(self): return "-*- Chain %s -*- \n + Seeds: %s, Steps: %s, AlignmentGroups: %s \n + Steps: \n %s \n"%(\ - self.name, ' '.join(map(str, self.L1decisions)), self.nSteps, self.alignmentGroups, '\n '.join(map(str, self.steps))) - + self.name, ' '.join(map(str, self.L1decisions)), self.nSteps, self.alignmentGroups, '\n '.join(map(str, self.steps))) + # next: can we remove multiplicity array, if it can be retrieved from the ChainDict? class ChainStep(object): @@ -712,7 +683,6 @@ class ChainStep(object): self.sequences.append(seq()) # create the sequences def relabelLegIdsForJets(self): - has_jets = False leg_counter = [] @@ -796,7 +766,7 @@ class ChainStep(object): if key not in _ComboHypoPool: _ComboHypoPool[key] = createComboAlg(None, name=comboName, comboHypoCfg=self.comboHypoCfg) self.combo = _ComboHypoPool[key] - + def createComboHypoTools(self, flags, chainName): chainDict = HLTMenuConfig.getChainDictFromChainName(chainName) @@ -816,10 +786,11 @@ class ChainStep(object): if len(self.sequenceFunctions) == 0: return "--- ChainStep %s ---\n is Empty, ChainDict = %s "%(self.name, ' '.join(map(str, [dic['chainName'] for dic in self.stepDicts])) ) - repr_string= "--- ChainStep %s ---\n , multiplicity = %s ChainDict = %s \n + MenuSequences size = %d "%\ + repr_string= "--- ChainStep %s ---\n , multiplicity = %s ChainDict = %s \n + MenuSequences = %s "%\ (self.name, ' '.join(map(str,[mult for mult in self.multiplicity])), ' '.join(map(str, [dic['chainName'] for dic in self.stepDicts])), - len(self.sequenceFunctions) ) + ' '.join(map(str, [seq.func.__name__ for seq in self.sequenceFunctions]) )) + if self.combo is not None: repr_string += "\n + ComboHypo = %s" % self.combo.Alg.name if len(self.comboToolConfs)>0: diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py index cddae9130dd130d065a5e5c8a81a7baf560b8792..fd270161f5d877a8484ff44524a76b2001662f2c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Config/Utility/ChainMerging.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration from TriggerMenuMT.HLT.Config.Utility.MenuAlignmentTools import get_alignment_group_ordering as getAlignmentGroupOrdering -from TriggerMenuMT.HLT.Config.MenuComponents import Chain, ChainStep, EmptyMenuSequence, EmptyMenuSequenceCfg, isEmptySequenceCfg +from TriggerMenuMT.HLT.Config.MenuComponents import Chain, ChainStep, EmptyMenuSequenceCfg, isEmptySequenceCfg from AthenaCommon.Logging import logging from DecisionHandling.DecisionHandlingConfig import ComboHypoCfg @@ -254,30 +254,8 @@ def isFullScanRoI(inputL1Nav): else: return False -def noPrecedingStepsPreMerge(newsteps,chain_index,ileg): - for step in newsteps: - seq = step[chain_index].sequences[ileg] - if isinstance(seq, EmptyMenuSequence): - continue - else: - #if there's a non-empty sequence in a step before, there is clearly a - #preceding step in this chain. - return False - return True - -def noPrecedingStepsPostMerge(newsteps, ileg): - for step in newsteps: - seq = step.sequences[ileg] - if isinstance(seq, EmptyMenuSequence): - continue - else: - #if there's a non-empty sequence in a step before, there is clearly a - #preceding step in this chain. - return False - return True def getCurrentAG(chainStep): - filled_seq_ag = [] for iseq,seq in enumerate(chainStep.sequenceFunctions): # In the case of dummy configs, they are all empty diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py index 0ac40c2114a2d0cc69dd52b988b97650f342010c..960ba1778d221afdf283aa2cee188d351724be28 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Jet/JetMenuSequencesConfig.py @@ -238,7 +238,7 @@ def jetCaloHypoMenuSequence(flags, isPerf, **jetRecoDict): def makejetCaloHypoMenuSequence(): return MenuSequenceCA(flags, selAcc, HypoToolGen=hypoToolGenerator(hypoType)) return functools.partial(makejetCaloHypoMenuSequence), jetDef - + # A full hypo selecting only on heavy ion calo jets (step 1) # Passing isPerf = True disables the hypo diff --git a/graphics/EventDisplaysOnline/CMakeLists.txt b/graphics/EventDisplaysOnline/CMakeLists.txt index b5650338bb96ab0ca024321a6f441d90d5ea77a3..9864ae5d5479c2805a9289579dc33df018b4cce0 100644 --- a/graphics/EventDisplaysOnline/CMakeLists.txt +++ b/graphics/EventDisplaysOnline/CMakeLists.txt @@ -1,10 +1,23 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( EventDisplaysOnline ) +find_package( Python COMPONENTS Development ) + +atlas_add_library(EventDisplaysOnlineLib + INTERFACE + EventDisplaysOnline/*.h + src/*.cxx + PUBLIC_HEADERS EventDisplaysOnline + INCLUDE_DIRS ${Python_INCLUDE_DIRS} + LINK_LIBRARIES ${Python_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel xAODEventInfo RootUtils) + +atlas_add_component( EventDisplaysOnline + EventDisplaysOnline/*.h + src/*.cxx + src/components/*.cxx + LINK_LIBRARIES EventDisplaysOnlineLib ) + # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) -atlas_install_joboptions( share/*.py ) -atlas_install_scripts( scripts/*.sh ) - diff --git a/graphics/EventDisplaysOnline/EventDisplaysOnline/IOnlineEventDisplaysSvc.h b/graphics/EventDisplaysOnline/EventDisplaysOnline/IOnlineEventDisplaysSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..1b7253f813e960f225b27dc5a63dc777e73ada1e --- /dev/null +++ b/graphics/EventDisplaysOnline/EventDisplaysOnline/IOnlineEventDisplaysSvc.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef IONLINEEVENTDISPLAYSSVC_H +#define IONLINEEVENTDISPLAYSSVC_H + +#include "GaudiKernel/IService.h" + +class IOnlineEventDisplaysSvc : virtual public IService { + +public: + + virtual ~IOnlineEventDisplaysSvc(){}; + + static const InterfaceID& interfaceID(); + virtual std::string getFileNamePrefix() = 0; + virtual std::string getStreamName() = 0; + virtual std::string getEntireOutputStr() = 0; +}; + +inline const InterfaceID& IOnlineEventDisplaysSvc::interfaceID() +{ + static const InterfaceID IID_IOnlineEventDisplaysSvc("IOnlineEventDisplaysSvc", 1, 0); + return IID_IOnlineEventDisplaysSvc; +} + +#endif diff --git a/graphics/EventDisplaysOnline/EventDisplaysOnline/OnlineEventDisplaysSvc.h b/graphics/EventDisplaysOnline/EventDisplaysOnline/OnlineEventDisplaysSvc.h new file mode 100644 index 0000000000000000000000000000000000000000..85c7382941dcd3d69893bb13851b7fa739cb6ea7 --- /dev/null +++ b/graphics/EventDisplaysOnline/EventDisplaysOnline/OnlineEventDisplaysSvc.h @@ -0,0 +1,68 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ONLINEEVENTDISPLAYSSVC_H +#define ONLINEEVENTDISPLAYSSVC_H + +#include "AthenaBaseComps/AthService.h" +#include "EventDisplaysOnline/IOnlineEventDisplaysSvc.h" +#include "GaudiKernel/IIncidentListener.h" +#include "StoreGate/ReadHandle.h" +#include "xAODEventInfo/EventInfo.h" +#include <iostream> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> +#include <grp.h> + +template <class TYPE> class SvcFactory; + +class OnlineEventDisplaysSvc : public AthService, virtual public IOnlineEventDisplaysSvc, virtual public IIncidentListener { + +protected: + friend class SvcFactory<OnlineEventDisplaysSvc>; + +public: + + OnlineEventDisplaysSvc( const std::string& name, ISvcLocator* pSvcLocator ); + + static const InterfaceID& interfaceID(); + + //To allow access to the IOnlineEventDisplaysSvc interface + StatusCode queryInterface( const InterfaceID& riid, void** ppvIf ); + + StatusCode initialize(); + StatusCode finalize(); + void beginEvent(); + void endEvent(); + void handle(const Incident& incident ); + void createWriteableDir(std::string directory, gid_t zpgid); + gid_t setOwnershipToZpGrpOrDefault(); + std::string getFileNamePrefix() override; + std::string getEntireOutputStr() override; + std::string getStreamName() override; + +private: + OnlineEventDisplaysSvc(); + SG::ReadHandleKey<xAOD::EventInfo> m_evt{this, "EventInfo", "EventInfo", "Input event information"}; + Gaudi::Property<std::string> m_outputDirectory {this, "OutputDirectory", "/atlas/EventDisplayEvents", "Output Directory"}; + Gaudi::Property<std::vector<std::string>> m_streamsWanted {this, "StreamsWanted", {}, "Desired trigger streams"}; + Gaudi::Property<std::string> m_projectTag {this, "ProjectTag", "", "Is needed to add streams to the Public trigger streams"}; + Gaudi::Property<bool> m_BeamSplash {this, "BeamSplash", false, "Is a beam splash event"}; + Gaudi::Property<bool> m_CheckPair {this, "CheckPair", false, "Check for matching ESD and JiveXML files"}; + Gaudi::Property<int> m_maxEvents {this, "MaxEvents", 200, "Number of events to keep per stream"}; + std::string m_FileNamePrefix = "JiveXML"; + std::string m_outputStreamDir = ".Unknown"; + std::string m_entireOutputStr = "."; + int m_runNumber; + long m_eventNumber; + +}; + +inline const InterfaceID& OnlineEventDisplaysSvc::interfaceID() +{ + return IOnlineEventDisplaysSvc::interfaceID(); +} + +#endif diff --git a/graphics/EventDisplaysOnline/python/ByteStreamConfig.py b/graphics/EventDisplaysOnline/python/ByteStreamConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..344b91996a1ff60bdd92b67f3e26b7c482689639 --- /dev/null +++ b/graphics/EventDisplaysOnline/python/ByteStreamConfig.py @@ -0,0 +1,36 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def ByteStreamCfg(flags, **kwargs): + + acc = ComponentAccumulator() + + from ByteStreamEmonSvc.EmonByteStreamConfig import EmonByteStreamCfg + acc.merge(EmonByteStreamCfg(flags)) + + bytestreamInput = acc.getService("ByteStreamInputSvc") + bytestreamInput.Partition = flags.OnlineEventDisplays.PartitionName + bytestreamInput.GroupName = "EventDisplaysOnline" + bytestreamInput.PublishName = "EventDisplays" + bytestreamInput.Key = "dcm" + bytestreamInput.KeyCount = 3 + bytestreamInput.Timeout = 600000 + bytestreamInput.UpdatePeriod = 200 + bytestreamInput.BufferSize = 10 # three times of keycount for beam splashes + bytestreamInput.ISServer = '' # Disable histogramming + bytestreamInput.StreamNames = flags.OnlineEventDisplays.TriggerStreams + #bytestreamInput.StreamType = "physics" #comment out for all streams, e.g. if you also want claibration streams + bytestreamInput.StreamLogic = "Or" + + if flags.OnlineEventDisplays.BeamSplashMode: + bytestreamInput.KeyCount = 62 # equal or greater than the number of DCMs for beam splashes + bytestreamInput.BufferSize = 186 # three times of keycount for beam splashes + bytestreamInput.Timeout = 144000000 #(40 hrs) for beam splashes + bytestreamInput.StreamType = "physics" #if trigger fails it will go to debug_HltError + + if flags.OnlineEventDisplays.PartitionName != 'ATLAS': + bytestreamInput.KeyValue = [ 'Test_emon_push' ] + bytestreamInput.KeyCount = 1 + + return acc diff --git a/graphics/EventDisplaysOnline/python/EventDisplaysConfig.py b/graphics/EventDisplaysOnline/python/EventDisplaysConfig.py deleted file mode 100644 index 2d9f46b56b3297a25e228f13dd45de1a198ea687..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/python/EventDisplaysConfig.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -def GetRunType(): - """Get the run type by reading the run-type setting in the partition from IS """ - - #Get a logger so we can show formated messages - from AthenaCommon.Logging import logging - mlog = logging.getLogger( 'EventDisplays' ) - - #Try to get the partition name - try : - import os - partition = os.environ['TDAQ_PARTITION'] - except KeyError : - partition = "ATLAS" - mlog.warning("TDAQ_PARTITION not defined in environment, using %s as default", partition) - - mlog.debug('Probing partition %s for RunType', partition) - - #now try and read the information from IS - try : - from ipc import IPCPartition - from ispy import ISObject - runparams = ISObject(IPCPartition(partition), 'RunParams.RunParams','RunParams') - runparams.checkout() - runType = runparams.run_type - except UserWarning as err: - mlog.error(err) - #Set the default runtype - runType="collisions" - mlog.warning("Failed to read run type from IS, using %s as default", runType) - finally : - if runType not in ['collisions','singlebeam','cosmics']: - mlog.fatal("Invalid run type: %s", runType) - import sys - sys.exit(1) - - mlog.info("Setting run type to: %s", runType) - return runType - -def GetBFields(): - - #Get a logger so we can show formated messages - from AthenaCommon.Logging import logging - mlog = logging.getLogger( 'EventDisplays' ) - - #BFields are read from initial partition - partition='initial' - mlog.debug("Trying to read magnetic field configuration from partition %s", partition) - - #now try and read the information from IS - try : - from ipc import IPCPartition - from ispy import ISObject - #Get hold of the initial partition - ipcPart = IPCPartition(partition) - if not ipcPart.isValid(): - raise UserWarning("Partition %s invalid - cannot access magnetic field setting"%partition) - #Get the current and valid status - toroidCurrent = ISObject(ipcPart,'DCS_GENERAL.MagnetToroidsCurrent.value','DdcFloatInfo') - solenoidCurrent = ISObject(ipcPart,'DCS_GENERAL.MagnetSolenoidCurrent.value','DdcFloatInfo') - toroidInvalid = ISObject(ipcPart,'DCS_GENERAL.MagnetToroidsCurrent.invalid','DdcIntInfo') - solenoidInvalid = ISObject(ipcPart,'DCS_GENERAL.MagnetSolenoidCurrent.invalid','DdcIntInfo') - toroidCurrent.checkout() - solenoidCurrent.checkout() - toroidInvalid.checkout() - solenoidInvalid.checkout() - #And calculate the flags - solenoidOn=((solenoidCurrent.value > 1000.) and (solenoidInvalid.value == 0)) - toroidOn=((toroidCurrent.value > 1000.) and (toroidInvalid.value == 0)) - except UserWarning as err: - mlog.error(err) - #Should always be able to access initial parititon - mlog.fatal("Failed to read magnetic field configuration from IS, aborting") - import sys - sys.exit(1) - - #print the result - mlog.info("Magnetic field in solenoid is %s", (solenoidOn and "ON") or "OFF") - mlog.info("Magnetic field in toroid is %s", (toroidOn and "ON") or "OFF") - - #finally return our values - return (solenoidOn,toroidOn) - -if __name__ == "__main__": - runType=GetRunType() - print ("RunType: %s"%runType) - bFields = GetBFields() - print ("BFields (Sol,Tor):",bFields) diff --git a/graphics/EventDisplaysOnline/python/EventDisplaysOnlineConfig.py b/graphics/EventDisplaysOnline/python/EventDisplaysOnlineConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..6a02d35007fb9073928d378c156934ac436a4076 --- /dev/null +++ b/graphics/EventDisplaysOnline/python/EventDisplaysOnlineConfig.py @@ -0,0 +1,215 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +def EventDisplaysOnlineCfg(flags, **kwargs): + from EventDisplaysOnline.EventDisplaysOnlineHelpers import GetBFields, WaitForPartition, GetUniqueJobID, GetRunNumber + + if not flags.OnlineEventDisplays.OfflineTest: + from AthenaConfiguration.AutoConfigOnlineRecoFlags import autoConfigOnlineRecoFlags + autoConfigOnlineRecoFlags(flags, flags.OnlineEventDisplays.PartitionName) + + flags.OnlineEventDisplays.CosmicMode = False + flags.OnlineEventDisplays.HIMode = False + flags.OnlineEventDisplays.BeamSplashMode = False + flags.OnlineEventDisplays.OfflineTest = False + + # An explicit list for nominal data taking to exclude some high rate streams + # Empty list to read all + flags.OnlineEventDisplays.TriggerStreams = ['MinBias','express','ZeroBias','CosmicCalo','IDCosmic','CosmicMuons','Background','Standby','L1Calo','Main'] + if flags.OnlineEventDisplays.BeamSplashMode: + flags.OnlineEventDisplays.TriggerStreams = ['MinBias'] #if trigger fails it will go to debug_HltError + + # If testing at p1, create dir /tmp/your_user_name and write out to /tmp/your_user_name to see output + flags.OnlineEventDisplays.OutputDirectory = "/atlas/EventDisplayEvents/" + + if flags.OnlineEventDisplays.OfflineTest: + flags.OnlineEventDisplays.OutputDirectory = "." + + ##----------------------------------------------------------------------## + ## When the ATLAS partition is not running you can use two test ## + ## partitions that serve events from a raw data file. ## + ## To see which files will be ran over on the test partitions, at ## + ## point 1, see the uncommented lines in: ## + ## /det/dqm/GlobalMonitoring/GMTestPartition_oks/tdaq-11-02-01/ ## + ## without_gatherer/GMTestPartitionT9.data.xml ## + ## and in: ## + ## /det/dqm/GlobalMonitoring/GMTestPartition_oks/tdaq-11-02-01/ ## + ## without_gatherer/GMTestPartition.data.xml ## + ##----------------------------------------------------------------------## + flags.OnlineEventDisplays.PartitionName='ATLAS' # 'ATLAS', 'GMTestPartition' or 'GMTestPartitionT9' + + if flags.OnlineEventDisplays.HIMode: + flags.OnlineEventDisplays.MaxEvents=200 + flags.OnlineEventDisplays.ProjectTag='data24_hi' + flags.OnlineEventDisplays.PublicStreams=['HardProbes'] + if flags.OnlineEventDisplays.CosmicMode: + flags.OnlineEventDisplays.MaxEvents=200 + flags.OnlineEventDisplays.ProjectTag='data24_cos' + flags.OnlineEventDisplays.PublicStreams=[''] + if flags.OnlineEventDisplays.BeamSplashMode: + flags.OnlineEventDisplays.MaxEvents=-1 # keep all the events + flags.OnlineEventDisplays.ProjectTag='data24_13p6TeV' + flags.OnlineEventDisplays.PublicStreams=[''] + else: + flags.OnlineEventDisplays.MaxEvents=100 + flags.OnlineEventDisplays.ProjectTag='data24_13p6TeV' + flags.OnlineEventDisplays.PublicStreams=['Main'] + + # Pause this thread until the partition is up + if not flags.OnlineEventDisplays.OfflineTest: + WaitForPartition(flags.OnlineEventDisplays.PartitionName) + + if not flags.OnlineEventDisplays.OfflineTest: + import os + IPC_timeout = int(os.environ['TDAQ_IPC_TIMEOUT']) + print(" IPC_timeout Envrionment Variable = %d" %IPC_timeout) + + # Conditions tag + flags.IOVDb.DatabaseInstance = "CONDBR2" + if flags.OnlineEventDisplays.OfflineTest: + flags.IOVDb.GlobalTag = 'CONDBR2-BLKPA-2023-02' + else: + flags.IOVDb.GlobalTag = 'CONDBR2-HLTP-2023-01' # Online conditions tag + + # Geometry tag + flags.GeoModel.AtlasVersion = 'ATLAS-R3S-2021-03-02-00' + + if flags.OnlineEventDisplays.HIMode: + flags.Beam.BunchSpacing = 100 # ns + + flags.Trigger.triggerConfig='DB' + + jobId = GetUniqueJobID() + # Test wth a small amount of events and write out to e.g. a tmp dir + if flags.OnlineEventDisplays.PartitionName != 'ATLAS' or flags.OnlineEventDisplays.OfflineTest: + flags.Exec.MaxEvents = 3 + flags.Output.ESDFileName = flags.OnlineEventDisplays.OutputDirectory + "ESD-%s-%s.pool.root" % (jobId[3], jobId[4]) + else: + flags.Exec.MaxEvents = 20000 # hack until we find a way to fix the memory fragmentation ATEAM-896, this resets the memory after 20k events + flags.Output.ESDFileName = "ESD-%s-%s.pool.root" % (jobId[3], jobId[4]) + + flags.Output.doWriteESD = True + flags.Output.doJiveXML = False #we call the AlgoJive later on + + if flags.OnlineEventDisplays.OfflineTest: + flags.Input.Files = ['/eos/home-m/myexley/sharedWithATLASauthors/data23_13p6TeV.00454188.physics_Main.daq.RAW._lb0633._SFO-12._0002.data'] + else: + flags.Input.Files = [] # Files are read from the ATLAS (or GM test) partition + + flags.Reco.EnableTrigger = False # TODO test True + flags.Detector.GeometryForward = False + flags.Detector.EnableFwdRegion = False + flags.LAr.doHVCorr = False # ATLASRECTS-6823 + + if flags.OnlineEventDisplays.BeamSplashMode: + flags.Reco.EnableJet=False + flags.Reco.EnableMet=False + flags.Reco.EnableTau=False + flags.Reco.EnablePFlow=False + flags.Reco.EnableBTagging=False + flags.Reco.EnableEgamma=False + flags.Reco.EnableCombinedMuon=False + + from AthenaCommon.Constants import INFO + flags.Exec.OutputLevel = INFO + flags.Concurrency.NumThreads = 0 + + flags.Common.isOnline = not flags.OnlineEventDisplays.OfflineTest + + if flags.OnlineEventDisplays.PartitionName == 'ATLAS' and not flags.OnlineEventDisplays.OfflineTest: + # For beam plashes when LAr running in a different samples mode, the current run number to LAr config is needed + run_number = GetRunNumber(flags.OnlineEventDisplays.PartitionName) + flags.Input.OverrideRunNumber = True + flags.Input.RunNumbers = [run_number] + + # Get the B field + (solenoidOn,toroidOn)=GetBFields() + flags.BField.override = True + flags.BField.solenoidOn = solenoidOn + flags.BField.barrelToroidOn = toroidOn + flags.BField.endcapToroidOn = toroidOn + + # GM test partition needs to be given the below info + if (flags.OnlineEventDisplays.PartitionName == 'GMTestPartition' or flags.OnlineEventDisplays.PartitionName == 'GMTestPartitionT9'): + flags.Input.OverrideRunNumber = True + flags.Input.RunNumbers = [454188] # keep this number the same as (or close to) the run number of the file you are testing on + flags.Input.LumiBlockNumbers = [1] + flags.Input.ProjectName = flags.OnlineEventDisplays.ProjectTag + + from AthenaConfiguration.Enums import BeamType + if not flags.OnlineEventDisplays.OfflineTest: + if flags.OnlineEventDisplays.CosmicMode: + flags.Beam.Type = BeamType.Cosmics + else: + flags.Beam.Type = BeamType.Collisions + flags.lock() + flags.dump() + ##----------------------------------------------------------------------## + # Call the reconstruction + from RecJobTransforms.RecoSteering import RecoSteering + cfg = RecoSteering(flags) + + from IOVDbSvc.IOVDbSvcConfig import addOverride + if not flags.OnlineEventDisplays.OfflineTest: + cfg.merge(addOverride(flags, "/TRT/Onl/Calib/PID_NN", "TRTCalibPID_NN_v2", db="")) + + # Get the input files from the partition + if not flags.OnlineEventDisplays.OfflineTest: + from EventDisplaysOnline.ByteStreamConfig import ByteStreamCfg + cfg.merge(ByteStreamCfg(flags, **kwargs)) + + from EventDisplaysOnline.OnlineEventDisplaysSvcConfig import OnlineEventDisplaysSvcCfg + cfg.merge(OnlineEventDisplaysSvcCfg(flags, **kwargs)) + + from JiveXML.OnlineStreamToFileConfig import OnlineStreamToFileCfg + streamToFileTool = cfg.popToolsAndMerge(OnlineStreamToFileCfg(flags, **kwargs)) + + streamToServerTool = None + if not flags.OnlineEventDisplays.OfflineTest: + from JiveXML.OnlineStreamToServerConfig import OnlineStreamToServerCfg + streamToServerTool = cfg.popToolsAndMerge(OnlineStreamToServerCfg(flags, **kwargs)) + + from JiveXML.JiveXMLConfig import AlgoJiveXMLCfg + cfg.merge(AlgoJiveXMLCfg(flags, + StreamToFileTool = streamToFileTool, + StreamToServerTool = streamToServerTool, + OnlineMode = not flags.OnlineEventDisplays.OfflineTest)) + + # This creates an ESD file per event which is renamed and moved to the desired output + # dir in the VP1 Event Prod alg + from AthenaServices.OutputStreamSequencerSvcConfig import OutputStreamSequencerSvcCfg + cfg.merge(OutputStreamSequencerSvcCfg(flags,incidentName="EndEvent")) + streamESD = cfg.getEventAlgo("OutputStreamESD") + + from VP1AlgsEventProd.VP1AlgsEventProdConfig import VP1AlgsEventProdCfg + cfg.merge(VP1AlgsEventProdCfg(flags, streamESD, **kwargs)) + + # switch of the NSW segment making as it takes too much CPU in beamsplashes + if flags.OnlineEventDisplays.BeamSplashMode: + cfg.getEventAlgo("MuonSegmentMaker").doStgcSegments=False + cfg.getEventAlgo("MuonSegmentMaker").doMMSegments=False + cfg.getEventAlgo("MuonSegmentMaker_NCB").doStgcSegments=False + cfg.getEventAlgo("MuonSegmentMaker_NCB").doMMSegments=False + cfg.dropEventAlgo("QuadNSW_MuonSegmentCnvAlg") + + cfg.getService("PoolSvc").WriteCatalog = "xmlcatalog_file:PoolFileCatalog_%s_%s.xml" % (jobId[3], jobId[4]) + + ##----------------------------------------------------------------------## + ## Need line below to fix error that occurs when trying to ## + ## get CaloRec::ToolConstants/H1WeightsCone4Topo DataObject ## + ##----------------------------------------------------------------------## + cfg.getService("PoolSvc").ReadCatalog += ["xmlcatalog_file:/det/dqm/GlobalMonitoring/PoolFileCatalog_M7/PoolFileCatalog.xml"] + + # Dump the pickle file + with open("OnlineEventDisplays.pkl", "wb") as f: + cfg.store(f) + + return cfg + +if __name__ == "__main__": + from AthenaConfiguration.AllConfigFlags import initConfigFlags + flags = initConfigFlags() + cfg = EventDisplaysOnlineCfg(flags) + # Execute + sc = cfg.run() + import sys + sys.exit(0 if sc.isSuccess() else 1) diff --git a/graphics/EventDisplaysOnline/python/EventDisplaysOnlineFlags.py b/graphics/EventDisplaysOnline/python/EventDisplaysOnlineFlags.py new file mode 100644 index 0000000000000000000000000000000000000000..1f5d6d5f322b11f14d8d9bf15ca593b55e041f41 --- /dev/null +++ b/graphics/EventDisplaysOnline/python/EventDisplaysOnlineFlags.py @@ -0,0 +1,17 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.AthConfigFlags import AthConfigFlags + +def createOnlineEventDisplayFlags(): + flags=AthConfigFlags() + flags.addFlag('OnlineEventDisplays.BeamSplashMode', False) + flags.addFlag('OnlineEventDisplays.HIMode', False) + flags.addFlag('OnlineEventDisplays.CosmicMode',False) + flags.addFlag('OnlineEventDisplays.PartitionName', 'ATLAS') + flags.addFlag('OnlineEventDisplays.OfflineTest', False, help='Run the online event displays reco outside of point 1.') + flags.addFlag('OnlineEventDisplays.TriggerStreams', ['MinBias','express','ZeroBias','CosmicCalo','IDCosmic','CosmicMuons','Background','Standby','L1Calo','Main']) + flags.addFlag('OnlineEventDisplays.OutputDirectory', '/atlas/EventDisplayEvents/') + flags.addFlag('OnlineEventDisplays.MaxEvents', 100, help= 'Number of events to keep per stream in /atlas/EventDisplays/streamName') + flags.addFlag('OnlineEventDisplays.PublicStreams',[''], help = 'Trigger streams that can be seen by the general public') + flags.addFlag('OnlineEventDisplays.ProjectTag', "") + return flags diff --git a/graphics/EventDisplaysOnline/python/EventDisplaysOnlineHelpers.py b/graphics/EventDisplaysOnline/python/EventDisplaysOnlineHelpers.py new file mode 100644 index 0000000000000000000000000000000000000000..5db42d201039d3bd78302b816c426ecc377eaab0 --- /dev/null +++ b/graphics/EventDisplaysOnline/python/EventDisplaysOnlineHelpers.py @@ -0,0 +1,110 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +from ispy import ISObject, IPCPartition, ISInfoAny, ISInfoDictionary +import time +from AthenaCommon.Logging import logging +import sys + +def GetBFields(): + mlog = logging.getLogger( 'EventDisplays' ) + + #BFields are read from initial partition + partition='initial' + mlog.debug("Trying to read magnetic field configuration from partition %s", partition) + + #now try and read the information from IS + try : + #Get hold of the initial partition + ipcPart = IPCPartition(partition) + if not ipcPart.isValid(): + raise UserWarning("Partition %s invalid - cannot access magnetic field setting"%partition) + #Get the current and valid status + toroidCurrent = ISObject(ipcPart,'DCS_GENERAL.MagnetToroidsCurrent.value','DdcFloatInfo') + solenoidCurrent = ISObject(ipcPart,'DCS_GENERAL.MagnetSolenoidCurrent.value','DdcFloatInfo') + toroidInvalid = ISObject(ipcPart,'DCS_GENERAL.MagnetToroidsCurrent.invalid','DdcIntInfo') + solenoidInvalid = ISObject(ipcPart,'DCS_GENERAL.MagnetSolenoidCurrent.invalid','DdcIntInfo') + toroidCurrent.checkout() + solenoidCurrent.checkout() + toroidInvalid.checkout() + solenoidInvalid.checkout() + #And calculate the flags + solenoidOn=((solenoidCurrent.value > 1000.) and (solenoidInvalid.value == 0)) + toroidOn=((toroidCurrent.value > 1000.) and (toroidInvalid.value == 0)) + except UserWarning as err: + mlog.error(err) + #Should always be able to access initial parititon + mlog.fatal("Failed to read magnetic field configuration from IS, aborting") + sys.exit(1) + + #print the result + mlog.info("Magnetic field in solenoid is %s", (solenoidOn and "ON") or "OFF") + mlog.info("Magnetic field in toroid is %s", (toroidOn and "ON") or "OFF") + + #finally return our values + return (solenoidOn,toroidOn) + + +def WaitForPartition(partitionName=None): + mlog = logging.getLogger( 'EventDisplays' ) + partitionUp = False + while not partitionUp: + try: + partition = IPCPartition(partitionName) + runParams = ISObject(partition, "RunParams.RunParams", "RunParams") + runParams.checkout() + partitionUp = True + + except Exception: + mlog.info("%s partition is not up, sleeping for 30 seconds", partitionName) + time.sleep(30) + +def EventCanBeSeenByPublic(projectTags): +# Is the data allowed to be seen by the general public on atlas live and in the CCC + + try: + partition = IPCPartition('ATLAS') + RunParams = ISObject(partition, 'RunParams.RunParams', 'RunParams') + RunParams.checkout() + + ready4physics = ISInfoAny() + ISInfoDictionary(partition).getValue('RunParams.Ready4Physics', ready4physics) + print("physicsReady: %s " % ready4physics.get()) + + physicsReady = ISObject(partition, 'RunParams.Ready4Physics','Ready4PhysicsInfo') + physicsReady.checkout() + print("Ready for physics: %r" % (physicsReady.ready4physics)) + print("RunParams.T0_project_tag", RunParams.T0_project_tag) + + sendToPublicStream = False + if physicsReady.ready4physics and RunParams.T0_project_tag in projectTags: + sendToPublicStream = True + + return sendToPublicStream + + except Exception: + print('Failed to get bool for EventCanBeSeenByPublic, this is expected for offline test and GM test paritions') + return False + +def GetUniqueJobID(): + # Setup unique output files (so that multiple Athena jobs on the same machine don't interfere) + import os + jobId = os.environ.get('TDAQ_APPLICATION_NAME', '').split(':') + if not len(jobId) == 5: + from random import randint + jobId = ['Athena-EventProcessor', 'Athena-EventDisplays-Segment', 'EventDisplays-Rack', 'tmp', '%d' % randint(0, 999)] + + return jobId + +def GetRunNumber(partitionName): + part = IPCPartition(partitionName) + RunParams = ISObject(part, 'RunParams.RunParams', 'RunParams') + RunParams.checkout() + run_number = RunParams.getAttributeValue('run_number') + return run_number + +if __name__ == "__main__": + runNumber=GetRunNumber() + print ("RunNumber: %s"%runNumber) + bFields = GetBFields() + print ("BFields (Sol,Tor):", bFields) + isPublicEvent = EventCanBeSeenByPublic(['data24_13p6TeV']) + print("isPublicEvent:", isPublicEvent) diff --git a/graphics/EventDisplaysOnline/python/EventUtils.py b/graphics/EventDisplaysOnline/python/EventUtils.py index f9f4b55dcef4a17c04a00c1ff020aceb1b194798..cdbe596afac5486794902a655ca8f67ff3a715e8 100644 --- a/graphics/EventDisplaysOnline/python/EventUtils.py +++ b/graphics/EventDisplaysOnline/python/EventUtils.py @@ -1,8 +1,9 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration import os, re, time, glob, shutil from pathlib import Path from zipfile import ZipFile, ZIP_DEFLATED +from AthenaCommon.Logging import logging # This method reads the files in the given directory, sorts them by run/event number, # finds atlantis and vp1 files belonging to the same event and returns a list of events @@ -10,7 +11,8 @@ from zipfile import ZipFile, ZIP_DEFLATED # checkpair=True and remove=True, remove the files that do not form an atlanits-vp1 pair # checkpair=True and remove=False, generate event list for atlantis-vp1 pairs # checkpair=False, generate event list without checking for valid pairs -def getEventlist(msg, directory, checkpair, remove=True, patternAtlantis='.xml', patternVP1='.pool.root'): +def getEventlist(directory, checkpair, remove=True, patternAtlantis='.xml', patternVP1='.pool.root'): + msg = logging.getLogger( 'EventUtils' ) msg.verbose('%s begin get event list', time.ctime(time.time())) filelist = [] files = os.listdir(directory) @@ -61,7 +63,8 @@ def getEventlist(msg, directory, checkpair, remove=True, patternAtlantis='.xml', return eventlist # Prune events in the given directory if the number exceeds the specified number -def pruneEvents(msg, directory, maxevents, eventlist): +def pruneEvents(directory, maxevents, eventlist): + msg = logging.getLogger( 'EventUtils' ) msg.verbose('%s begin prune events', time.ctime(time.time())) i = 0 numevents = len(eventlist) @@ -86,7 +89,8 @@ def pruneEvents(msg, directory, maxevents, eventlist): msg.verbose('%s end prune events', time.ctime(time.time())) # Build the event.list file that is used by atlas-live.cern.ch for synchronizing events -def writeEventlist(msg, directory, eventlist, listname='event'): +def writeEventlist(directory, eventlist, listname='event'): + msg = logging.getLogger( 'EventUtils' ) msg.verbose('%s begin write event list', time.ctime(time.time())) pid = os.getpid() try: @@ -105,20 +109,32 @@ def writeEventlist(msg, directory, eventlist, listname='event'): msg.verbose('%s end write event list', time.ctime(time.time())) # Perform all of these in one command -def cleanDirectory(msg, directory, maxevents, checkpair): +def cleanDirectory(directory, maxevents, checkpair,isBeamSplashMode): + msg = logging.getLogger( 'EventUtils' ) + msg.verbose('%s begin clean directory', time.ctime(time.time())) - eventlist = getEventlist(msg, directory, checkpair) + eventlist = getEventlist(directory, checkpair) if maxevents>0: - pruneEvents(msg, directory, maxevents, eventlist) - writeEventlist(msg, directory, eventlist) + pruneEvents(directory, maxevents, eventlist) + writeEventlist(directory, eventlist) # disable this for beam splashes. Call zipXMLFile directly in OnlineEventDisplaysSvc.py to transfer every event. - if len(eventlist)>0: - prepareFilesForTransfer(msg, directory, eventlist, pair=checkpair, timeinterval=60) - + if len(eventlist)>0 and not isBeamSplashMode: + prepareFilesForTransfer(directory, eventlist, pair=checkpair, timeinterval=60) + + if isBeamSplashMode: + for filename in os.listdir(directory): + if filename.startswith("vp1") and "CEST.pool.root" in filename: + orgname = f'{directory}/{filename}' + newname = orgname.replace('.pool.root', '.online.pool.root') + try: + shutil.copyfile(Path(orgname), Path(newname)) + except OSError as err: + msg.warning("Could not copy %s to %s: %s", orgname, newname, err) msg.verbose('%s end clean directory', time.ctime(time.time())) -def prepareFilesForTransfer(msg, directory, eventlist, pair, timeinterval): +def prepareFilesForTransfer(directory, eventlist, pair, timeinterval): + msg = logging.getLogger( 'EventUtils' ) """Preparing the list of files for CastorScript to transfer to EOS CastorScript is configured to look for *.zip and *.online.pool.root files to transfer. @@ -132,7 +148,7 @@ def prepareFilesForTransfer(msg, directory, eventlist, pair, timeinterval): timeinterval: time interval between two events in the transfer list (in seconds). """ msg.verbose('%s begin prepare files for transfer', time.ctime(time.time())) - transferlist = getEventlist(msg, directory, checkpair=pair, remove=False, patternAtlantis='.zip', patternVP1='.online.pool.root') + transferlist = getEventlist(directory, checkpair=pair, remove=False, patternAtlantis='.zip', patternVP1='.online.pool.root') if len(transferlist)>0 and eventlist[-1][0] == transferlist[-1][0] and eventlist[-1][1] == transferlist[-1][1]: msg.debug("Last event already in transfer list. No new event to transfer.") return @@ -162,17 +178,18 @@ def prepareFilesForTransfer(msg, directory, eventlist, pair, timeinterval): # Handle atlantis files msg.debug('%s going to zip file %s', time.ctime(time.time()), atlantis) - zipXMLFile(msg, directory, atlantis) + zipXMLFile(directory, atlantis) # Handle VP1 files if pair: msg.debug('%s going to rename ESD file %s', time.ctime(time.time()), vp1) - renameESDFile(msg, directory, vp1) + renameESDFile(directory, vp1) - writeEventlist(msg, directory, transferlist, listname='transfer') + writeEventlist(directory, transferlist, listname='transfer') msg.verbose('%s end prepare files for transfer', time.ctime(time.time())) -def zipXMLFile(msg, directory, filename): +def zipXMLFile(directory, filename): + msg = logging.getLogger( 'EventUtils' ) """Zip the JiveXML file for the specified event. Looks for a JiveXML file with the required filename in the given directory, @@ -201,7 +218,8 @@ def zipXMLFile(msg, directory, filename): msg.warning("Could not zip %s: %s", filename, err) msg.verbose('%s end of zipXMLFile', time.ctime(time.time())) -def renameESDFile(msg, directory, filename): +def renameESDFile(directory, filename): + msg = logging.getLogger( 'EventUtils' ) """Rename the ESD for the specified event. Looks for an ESD file with the required filename in the given directory, diff --git a/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py b/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py deleted file mode 100644 index 51abcb99ecfa2b4f513141105559157d0fa3acf9..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvc.py +++ /dev/null @@ -1,213 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -__doc__ = """This service runs in the online Athena event display threads. It -manages the distribution of incoming events to the right event display streams. -In order to do that it connects to the different Atlantis and VP1 event output -algorithms/tools and manipulates their job options during the run. -""" -__version__ = "0.1" -__author__ = "Eric Jansen <eric.jansen@cern.ch>" - -import os, grp, stat, random -from ipc import IPCPartition -from ispy import ISInfoDictionary, ISInfoAny, ISObject -from AthenaPython import PyAthena -from AthenaPython.PyAthena import StatusCode -from PyAnalysisCore import PyEventTools -from EventDisplaysOnline import EventUtils - -class OnlineEventDisplaysSvc( PyAthena.Svc ): - - def __init__(self, name = 'OnlineEventDisplaysSvc', **kw): - kw['name'] = name - self.output = kw.get('OutputDirectory') - self.maxevents = kw.get('MaxEvents') - self.public = kw.get('Public') - self.projecttags = kw.get('ProjectTags') - - self.zpgid = None - self.partition = None - - self.StreamToFileTool = None - self.StreamToServerTool = None - self.VP1EventProducer = None - - self.run = 0 - self.event = 0 - self.stream = '' - self.directory = '' - - super(OnlineEventDisplaysSvc,self).__init__(**kw) - - def initialize(self): - incidentSvc = PyAthena.py_svc('IncidentSvc', iface='IIncidentSvc') - incidentSvc.addListener(self, 'BeginEvent') - incidentSvc.addListener(self, 'StoreCleared') - - self.partition = IPCPartition('ATLAS') - self.dict = ISInfoDictionary(self.partition) - self.zpgid = grp.getgrnam("zp").gr_gid - return StatusCode.Success - - def finalize(self): - return StatusCode.Success - - def getJobOptions(self): - self.StreamToFileTool = PyAthena.py_tool('JiveXML::StreamToFileTool', iface='IProperty') - self.StreamToServerTool = PyAthena.py_tool('JiveXML::StreamToServerTool', iface='IProperty') - - # Some casting magic is needed to access algorithm properties - from GaudiPython.Bindings import gbl, InterfaceCast - vp1alg = PyAthena.py_alg('VP1EventProd') - self.VP1EventProducer = InterfaceCast(gbl.IProperty).cast(vp1alg) - - self.msg.info("StreamToFileTool: %s", self.StreamToFileTool) - self.msg.info("StreamToServerTool: %s", self.StreamToServerTool) - self.msg.info("VP1EventProducer: %s", self.VP1EventProducer) - - def beginEvent(self): - if not (self.StreamToFileTool and self.StreamToServerTool and self.VP1EventProducer): - self.getJobOptions() - - try: - eventInfo = PyEventTools.getEventInfo('EventInfo') - except LookupError as err: - self.msg.error("Could not retrieve EventInfo: %s", err) - return StatusCode.Recoverable - - try: - # Read event info - self.run = eventInfo.runNumber() - self.event = eventInfo.eventNumber() - - # Retrieve trigger info - streamTags = eventInfo.streamTags() - except Exception as err: - self.msg.error("Exception occured while reading event/trigger info: %s", err) - return StatusCode.Recoverable - - # Retrieve the physics stream names from the trigger info - streams = [] - for tag in streamTags: - - ## Added 08/03/15 - sjiggins - Wanted to see if events had physics stream tag or was from random trigger - if tag.name(): - self.msg.debug("Event %d/%d has the corresponding streamTags: %s", self.run, self.event, tag.type()) - ################################################################################## - if tag.type() == 'express' and tag.name(): - streams += [tag.type()+'_'+tag.name()] - - if tag.type() == 'physics' and tag.name(): - streams += [tag.type()+'_'+tag.name()] - - # Add special streams to the list Public - try: - for stream in streams: - if stream in self.public: - ready4physics = ISInfoAny() - self.dict.getValue('RunParams.Ready4Physics', ready4physics) - print("Ready for physics: %s " % ready4physics.get()) - runparams = ISObject(self.partition, 'RunParams.RunParams','RunParams') - runparams.checkout() - physicsReady = ISObject(self.partition, 'RunParams.Ready4Physics','Ready4PhysicsInfo') - physicsReady.checkout() - print("Ready for physics: %r" % (physicsReady.ready4physics)) - #if ready4physics.get() and physicsReady.ready4physics and runparams.T0_project_tag in self.projecttags: - if physicsReady.ready4physics and runparams.T0_project_tag in self.projecttags: - streams += ['Public'] - else: - self.msg.debug("RunParams.Ready4Physics is not set, run number is not set, or T0_project_tag is not set to any of %s", ", ".join(self.projecttags)) - break - except Exception as err: - self.msg.error("Exception occured while reading RunParams.Ready4Physics: %s", err) - - # Randomize list of streams - random.shuffle(streams) - self.msg.debug("Event %d/%d has event display stream tags: %s", self.run, self.event, ", ".join(streams)) - - ## for beam splash, give priority to MinBias - #if 'physics_MinBias' in streams: - # streams = ['physics_MinBias'] - # self.msg.debug("Modified stream tag: %s", ", ".join(streams)) - - # Start from the beginning and send the event to the first stream that passes our directory checks - self.directory = '' - for self.stream in streams: - self.directory = "%s/%s" % (self.output, self.stream) - if os.access(self.directory, os.F_OK): - if os.path.isdir(self.directory) and os.access(self.directory, os.W_OK): - self.msg.debug("Going to write file to existing directory: %s", self.directory) - if os.stat(self.directory).st_gid != self.zpgid: - self.msg.debug("Setting group to 'zp' for directory: %s", self.directory) - os.chown(self.directory, -1, self.zpgid) - break - else: - self.msg.warning("Directory \'%s\' is not usable, trying next alternative", self.directory) - self.directory = '' - else: - try: - os.mkdir(self.directory) - os.chmod(self.directory, stat.S_IRWXU | stat.S_IRWXG | stat.S_IROTH | stat.S_IXOTH) - os.chown(self.directory, -1, self.zpgid) - self.msg.info("Created output directory \'%s\' for stream \'%s\'", self.directory, self.stream) - break - except OSError as err: - self.msg.warning("Failed to create output directory \'%s\' for stream \'%s\': %s", (self.directory, self.stream, err.strerror)) - self.directory = '' - - # Check if a suitable directory was found - if self.directory: - self.msg.debug("Event %d/%d will be streamed to: %s", self.run, self.event, self.stream) - else: - # This event is hopelessly lost, send StatusCode.Recoverable in an attempt to abort. - # But if Athena chooses to ignore that, set the output to the "Unknown" trashcan stream. - self.stream = 'Unknown' - self.directory = "%s/.Unknown" % self.output - try: - # Set output stream for JiveXML event streaming (file and server) - self.StreamToServerTool.getProperty('StreamName').setValue("%s" % self.stream) - self.StreamToFileTool.getProperty('FileNamePrefix').setValue("%s/JiveXML" % self.directory) - - except Exception as err: - self.msg.error("Exception occured while setting job options: %s", err) - return StatusCode.Failure - - if not self.directory: - return StatusCode.Recoverable - - def endEvent(self): - # VP1 copied its ESD file of the previous event to the destination directory. - # So we set the directory of the current event in endEvent to pass it to the next event. - if self.VP1EventProducer: - self.VP1EventProducer.getProperty('DestinationDirectory').setValue(self.directory) - - # Prune events and make index file for atlas-live.cern.ch - if self.directory: - # If VP1 event producer is missing, skip the pair check to make cleanup/sync work - if self.VP1EventProducer: - EventUtils.cleanDirectory(self.msg, self.directory, self.maxevents, checkpair=True) - else: - EventUtils.cleanDirectory(self.msg, self.directory, self.maxevents, checkpair=False) - - ## for beam splashes, disable prepareFilesForTransfer() in EventUtils.py - ## Activate these lines to zip and transfer every JiveXML file. - #event = "%05d" % int(self.event) - #EventUtils.zipXMLFile(self.msg, self.directory, f'JiveXML_{self.run}_{event}.xml') - - # And cleanup the variables - self.run = 0 - self.event = 0 - self.stream = '' - self.directory = '' - - def handle(self, incident): - self.msg.verbose("Received incident %s from %s" % (incident.type(), incident.source())) - - # Event and trigger info present, decide stream - if incident.type() == 'BeginEvent' and incident.source() == 'BeginIncFiringAlg': - self.beginEvent() - - # VP1 writes its file at EndEvent, so we can do cleanup at StoreCleared - if incident.type() == 'StoreCleared' and incident.source() == 'StoreGateSvc': - self.endEvent() - diff --git a/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvcConfig.py b/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvcConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..cedd2a9e30525ea9afbf347cd6977ca843df3cc7 --- /dev/null +++ b/graphics/EventDisplaysOnline/python/OnlineEventDisplaysSvcConfig.py @@ -0,0 +1,20 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def OnlineEventDisplaysSvcCfg(flags, name = "OnlineEventDisplaysSvc", **kwargs): + + acc = ComponentAccumulator() + + kwargs.setdefault("MaxEvents", flags.OnlineEventDisplays.MaxEvents) + kwargs.setdefault("OutputDirectory", flags.OnlineEventDisplays.OutputDirectory) + kwargs.setdefault("ProjectTag", flags.OnlineEventDisplays.ProjectTag) + kwargs.setdefault("StreamsWanted", flags.OnlineEventDisplays.TriggerStreams) + kwargs.setdefault("BeamSplash", flags.OnlineEventDisplays.BeamSplashMode) + kwargs.setdefault("CheckPair", False) + onlineEventDisplaysSvc = CompFactory.OnlineEventDisplaysSvc(name, **kwargs) + + acc.addService(onlineEventDisplaysSvc, create=True) + + return acc diff --git a/graphics/EventDisplaysOnline/python/PruneAlg.py b/graphics/EventDisplaysOnline/python/PruneAlg.py deleted file mode 100755 index 41dfdbf56dea2449b15b1da01ad70c2afdc528c0..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/python/PruneAlg.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration - -__doc__ = """Algorithm for pruning eventdisplay files -""" -__version__ = "0.2" -__author__ = "Eric Jansen <eric.jansen@cern.ch>" - -from AthenaPython import PyAthena -from AthenaPython.PyAthena import StatusCode -from EventDisplaysOnline import EventUtils - -class PruneAlg( PyAthena.Alg ): - - def __init__(self, name = "PruneAlg", **kw): - kw['name'] = name - super(PruneAlg,self).__init__(**kw) - - self.directory = kw.get("OutputDirectory", "/EventDisplayEvents/Default") - self.numevents = kw.get("NumberOfEvents", 250) - - def initialize(self): - self.msg.debug("Going to prune %s, keeping %d events", self.directory, self.numevents) - return StatusCode.Success - - def execute(self): - EventUtils.cleanDirectory(self.msg, self.directory, self.numevents) - return StatusCode.Success - - def finalize(self): - return StatusCode.Success - diff --git a/graphics/EventDisplaysOnline/python/__init__.py b/graphics/EventDisplaysOnline/python/__init__.py deleted file mode 100644 index 74583d364ec2ca794156596c7254d9b234a940c6..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/python/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - diff --git a/graphics/EventDisplaysOnline/scripts/athena_script.sh b/graphics/EventDisplaysOnline/scripts/athena_script.sh deleted file mode 100755 index 7cd662e90f78d7a5d69449d66d67c597aa1229e2..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/scripts/athena_script.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec athena.py $* \ No newline at end of file diff --git a/graphics/EventDisplaysOnline/scripts/athena_script_configonly.sh b/graphics/EventDisplaysOnline/scripts/athena_script_configonly.sh deleted file mode 100755 index e41f562f4796112df5d368dd5d5e91c7706fa78a..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/scripts/athena_script_configonly.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec athena.py --config-only=/atlas/EventDisplayEvents/EventProcessorConfig/EventDisplaysOnline_EventProcessorConfig_$( date '+%F_%H_%M_%S' ).pkl $* diff --git a/graphics/EventDisplaysOnline/scripts/prune_evdisp_data.sh b/graphics/EventDisplaysOnline/scripts/prune_evdisp_data.sh deleted file mode 100755 index 67da84bf8233d82752654d3a406c90eb778cefdf..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/scripts/prune_evdisp_data.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash - -########################################################################## -# -# Loops over all directories given as first parameter, looking for files -# atlantis and VP1 output files and keeping their number limited to the -# paramter given as second argument. This is repeated in the interval given -# as third argument -# -# author: Sebastian Boeser <sboeser@hep.ucl.ac.uk> -# -########################################################################### - -## Printout environment -print_setup(){ - echo "DATAPATH=${DATAPATH}" - echo "KEEPFILES=${KEEPFILES}" - echo "UPDATEINT=${UPDATEINT}" - echo "================================================================================" -} - -## Print a short usage statement -print_usage(){ - echo "Usage: $0 <data-path> <keep-files> <update-intervall>" - echo " <data-path>: directories to search for Atlantis and VP1 files" - echo " <keep-files>: number of files to keep in each directory" - echo " <update-intervall>: repeat removal at this interval in seconds" -} - -## get the commandline args -get_args(){ - #Check we have the proper number - if test $# != 3; then - print_usage - exit 1 - fi - DATAPATH="" - #First is pathes to look at - for dir in `echo $1 | sed 's/:/ /g'`; do - if [ ! -d $dir ]; then - echo "Directory '$dir' does not exist - removed from list!" - else - DATAPATH="${DATAPATH} $dir" - fi - done - #Check there is at least one dir left - if [[ $DATAPATH == "" ]]; then - echo "No directories to prune - exiting" - exit 1 - fi - KEEPFILES=0 - #now check keepfiles - if (( $2 > 0 )); then - if (($2 < 100000 )) ; then - KEEPFILES=$2 - fi - fi - if (( $KEEPFILES == 0 )); then - echo "Invalid number of files to keep: $2 (allowed range 1-99999) - exiting!" - exit 1; - fi - UPDATEINT=0 - #now check update interval - if (( $3 > 0 )); then - if (($3 < 10000 )) ; then - UPDATEINT=$3 - fi - fi - if (( $UPDATEINT == 0 )); then - echo "Invalid update intervall: $3 (allowed range 1-9999) - exiting!" - exit 1; - fi -} - -prune_dir(){ - if [ ! -z "${EVENTDISPLAY_VERBOSE}" ]; then - echo "Entering $1 looking for $3 ..." - fi - #Get list of Atlantis files - #Find file matching pattern, print last change time (unix secs) and name, - #sort by time, then only keep filename - FILES=$( find $1 -name "$3" -printf "%C@ %f \n" | sort -n | awk '{print $2}' ) - #Calculate total number of files to remove - NTOTAL=`echo $FILES | wc -w` - #Calculate number of files to delete - NDELETE=$(( $NTOTAL-$2 )) - if (( $NDELETE <= 0 )); then - echo "Only $NTOTAL files total - not deleting any!" - return - fi - #Be verbose - echo "Removing $NDELETE files of $NTOTAL total" - if [ ! -z "${EVENTDISPLAY_VERBOSE}" ]; then - VERBOSE=" -v" - fi - #Now loop and delete - for file in $FILES; do - #Delete files - if rm $VERBOSE -f $1/$file; then - #Count successfully deleted - NDELETE=$(( $NDELETE-1 )) - fi - #Break if we have deleted enough - if (( $NDELETE == 0)); then - break - fi - done -} - -## Wait for a given time -wait_for(){ - if [ ! -z "${EVENTDISPLAY_VERBOSE}" ]; then - date "+%Y-%m-%d %H:%M:%S" - echo -n "Now sleeping for $1 seconds ..." - fi - sleep $1 - if [ ! -z "${EVENTDISPLAY_VERBOSE}" ]; then - echo " - done" - fi -} - -## Write a file list consisting of run number, event number and associated data files -file_list(){ - if [ ! -z "${EVENTDISPLAY_VERBOSE}" ]; then - echo "Creating file list for directory $1 ..." - fi - - #Now generat the listing by - #finding all files - find $1 -name "*[0-9]*_[0-9]*" -printf "%f\n" | - #printing run_event;filename and sorting it - sed 's/vp1_\([0-9]*\)_\([0-9]*\).*/\1_\2;\0/' | - sed 's/JiveXML_\([0-9]*\)_0*\([0-9]*\)\.xml/\1_\2;\0/' | - sort -n | - #Using awk to build an event table and print it - awk -F ";" '/JiveXML/{ events[$1]=(events[$1] ",atlantis:" $2) } - /vp1/{ events[$1]=(events[$1] ",vp1:" $2) } - END{ for (evt in events) { - if ( (index(events[evt],"vp1") > 0) && (index(events[evt],"atlantis") > 0)){ - split(evt,nums,"_"); - printf "run:%012i,event:%012i%s\n",nums[1],nums[2],events[evt] - } - }}' | - #And sorting again as awk does not provide sorted output - sort -n >| $1/events.list.new - #Now move the new list on the old one - mv -f $1/events.list.new $1/event.list -} - -##### This is the start of the actual script #### - -#First of all setup the path -PATH=$PATH:$EVENTDISPLAY_SW_EXTRA_PATH - -echo "EVENTDISPLAY_SW_EXTRA_PATH=$EVENTDISPLAY_SW_EXTRA_PATH" -echo "EVENTDISPLAY_VERBOSE=$EVENTDISPLAY_VERBOSE" -echo "PATH=$PATH" - -echo "================== Start trimming of EventDisplay data =========================" -get_args $@ -print_setup - -#enter endless loop -while true; do - #Now enter loop - echo "==================== Entering loop over directories ============================" - for dir in $DATAPATH; do - prune_dir $dir $KEEPFILES "JiveXML_*.xml" - prune_dir $dir $KEEPFILES "vp1_*.pool.root" - file_list $dir - done - - #then sleep - wait_for $UPDATEINT -done - -echo "===================== Finished pruning event display data ======================" diff --git a/graphics/EventDisplaysOnline/share/Atlantis_jobOptions.py b/graphics/EventDisplaysOnline/share/Atlantis_jobOptions.py deleted file mode 100644 index 50e8c6009d497253346e463fe73f24861974c93c..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/Atlantis_jobOptions.py +++ /dev/null @@ -1,145 +0,0 @@ -### -# Atlantis specific jOs for P1 -# --> Do not rely on RecExCommission setup (doJiveXML), -# but setup things ourselves -### - -### Enable Atlantis-flag (fake as this happens after we include RecExCommon) -from RecExConfig.RecFlags import rec -rec.doJiveXML.set_Value_and_Lock(True) ## Steered by graphics/JiveXML/share/JiveXML_RecEx_Config.py - -### Setup output level -if not 'AtlantisMsgLvl' in dir(): - AtlantisMsgLvl=WARNING - -### import and create top sequence -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -### Create a new algorithm -from JiveXML.JiveXMLConf import JiveXML__AlgoJiveXML -AlgoJiveXML = JiveXML__AlgoJiveXML(name="AlgoJiveXML",OutputLevel=AtlantisMsgLvl) - -### Set the atlas release version -import os -AlgoJiveXML.AtlasRelease = os.environ["AtlasVersion"] - -### Write the event data to disk and to a server -### - this is the same as AlgoJiveXML.WriteToFile = True -### but allows to set the StreamName as prefix -from JiveXML.JiveXMLConf import JiveXML__StreamToFileTool -StreamToFileTool = JiveXML__StreamToFileTool( - FileNamePrefix="%s/.Unknown/JiveXML" % OutputDirectory, - OutputLevel=AtlantisMsgLvl) -ToolSvc += StreamToFileTool -AlgoJiveXML.StreamTools += [ StreamToFileTool ] -#Disable default tool -AlgoJiveXML.WriteToFile = False - -### Online mode allows you to send events to -### AtlantisJava clients over a network connection -### - this is the same as AlgoJiveXML.OnlineMode = True -### but allows to the set server port number -#if 'Port' in dir(): -# from JiveXML.JiveXMLConf import JiveXML__XMLRPCStreamTool -# AlgoJiveXML.StreamTools += [ -# JiveXML__XMLRPCStreamTool(ServerPort=Port,OutputLevel=AtlantisMsgLvl) -# ] -#Disable default tool -AlgoJiveXML.OnlineMode = False - -### Also stream events to the new external ONCRPC server -### If you test this from the command line, after setting up -### AltasHLT, the server can be started with 'jivexmlserver.exe' - -#configure external ONCRCP server service to stream to the machine running our -#server instance and adopt the message level -if not 'ServerHost' in dir(): - ServerHost="pc-tdq-mon-29" -from JiveXML.JiveXMLConf import JiveXML__ExternalONCRPCServerSvc -ServiceMgr += JiveXML__ExternalONCRPCServerSvc("ExternalONCRPCServerSvc", - Hostname=ServerHost, - OutputLevel=AtlantisMsgLvl) -#And add a stream tool that stream using the current stream tag -from JiveXML.JiveXMLConf import JiveXML__StreamToServerTool -StreamToServerTool = JiveXML__StreamToServerTool( - OutputLevel=AtlantisMsgLvl, - ServerService=ServiceMgr.ExternalONCRPCServerSvc, - StreamName="Unknown") -ToolSvc += StreamToServerTool -AlgoJiveXML.StreamTools += [ StreamToServerTool ] - -### Enable this to recreate the geometry XML files for Atlantis -AlgoJiveXML.WriteGeometry = False - -### add the AlgoJiveXML -topSequence += AlgoJiveXML - -### add a dummy flag so that AlgoJiveXML won't be reinstantiated -theEventData2XML=AlgoJiveXML - -### Now add the data retrievers for sub-detectors -if DetFlags.detdescr.ID_on() : - include ( "JiveXML/DataTypes_InDet.py" ) - -if DetFlags.detdescr.Calo_on(): - include ( "JiveXML/DataTypes_Calos.py" ) - if not rec.doHeavyIon: - #Switch on pulse shapes for Tiles - ToolSvc.CaloTileRetriever.DoTileDigit = True - ToolSvc.CaloTileRetriever.DoTileCellDetails = True - #Switch on pulse shapes for MBTS - ToolSvc.CaloMBTSRetriever.DoMBTSDigits = True - ToolSvc.CaloMBTSRetriever.DoMBTSCellDetails = True - #Also switch on LAR digits, but only for Calo streams - -if DetFlags.detdescr.Muon_on() : - include ( "JiveXML/DataTypes_Muons.py" ) - -#Switch on trigger if trig data is there -if rec.doTrigger(): - include ( "JiveXML/DataTypes_Trig.py" ) - #Special options for ACR - from TrigJiveXML.TrigJiveXMLConf import JiveXML__EmTauROIRetriever - ToolSvc += JiveXML__EmTauROIRetriever (name = "EmTauROIRetriever",readCPM=True) - from TrigJiveXML.TrigJiveXMLConf import JiveXML__JetROIRetriever - ToolSvc += JiveXML__JetROIRetriever (name = "JetROIRetriever", readJEM = True) - - -## ================== Edit: 25-02-2015 by sjiggins - Do not limit additional Track Collection ======================== -#include ("xAODJiveXML/xAODJiveXML_DataTypes.py") # 04-04/15 by sjiggins -#### jpthomas 4Jun15: Added correct muon track collection, but still also retrieve MS-only too: -ToolSvc.TrackRetriever.OtherTrackCollections = ["CombinedMuonTracks","MuonSpectrometerTracks"] -## =================================================================================================================== - -## ================= Edit: Beam Splash reduction flags (updated by lshi in 2022 beam splashes) ======================= -#theEventData2XML.DataTypes.remove("JiveXML::SiClusterRetriever/SiClusterRetriever"); -#theEventData2XML.DataTypes.remove("JiveXML::PixelClusterRetriever/PixelClusterRetriever"); -#theEventData2XML.DataTypes.remove("JiveXML::SCTRDORetriever/SCTRDORetriever"); -# -#ToolSvc.CaloLArRetriever.LArlCellThreshold = 500.; -#ToolSvc.CaloHECRetriever.HEClCellThreshold = 500.; -# -### more flags that were not used in 2022 beam splases -##topSequence.theEventData2XML.DataTypes.remove("JiveXML::TRTRetriever/TRTRetriever"); -##topSequence.theEventData2XML.DataTypes.remove("JiveXML::TrigSiSpacePointRetrieverTrigSiSpacePointRetriever"); -##topSequence.theEventData2XML.DataTypes.remove("JiveXML::MdtPrepDataRetriever/MdtPrepDataRetriever"); -##ToolSvc.TrackRetriever.OtherTrackCollections = []; -##ToolSvc.xAODTrackParticleRetriever.OtherTrackCollections = [] -## ======================================================================================= - -## ================= Edit: Heavy Ion reduction flags (updated by lshi in 2022 HI tests) ======================= -if rec.doHeavyIon: - topSequence.AlgoJiveXML.DataTypes.remove("JiveXML::SiClusterRetriever/SiClusterRetriever") - topSequence.AlgoJiveXML.DataTypes.remove("JiveXML::PixelClusterRetriever/PixelClusterRetriever") - topSequence.AlgoJiveXML.DataTypes.remove("JiveXML::CaloClusterRetriever/CaloClusterRetriever") - topSequence.AlgoJiveXML.DataTypes.remove("JiveXML::PixelRDORetriever/PixelRDORetriever") - topSequence.AlgoJiveXML.DataTypes.remove("JiveXML::SCTRDORetriever/SCTRDORetriever") - - ToolSvc.TrackRetriever.PriorityTrackCollection = "Tracks" - - ToolSvc.TrackRetriever.DoHitsDetails = False - -### Finally, print setup if in debug mode -if AtlantisMsgLvl <= DEBUG: - printfunc ("\n\n\t Atlantis setup\n",AlgoJiveXML,"\n\n") diff --git a/graphics/EventDisplaysOnline/share/ByteStreamController_jobOptions.py b/graphics/EventDisplaysOnline/share/ByteStreamController_jobOptions.py deleted file mode 100644 index a534d243aab5a925e8801da911cc2ab92663b2b1..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/ByteStreamController_jobOptions.py +++ /dev/null @@ -1,43 +0,0 @@ -### -# Finally, set up the ByteStreamEmonController -### - -#First get the partition to which the controller shall publish -try : - import os - publishToPartition = os.environ['TDAQ_PARTITION'] -except KeyError : - publishToPartition = "EventDisplays" - mlog.warning("TDAQ_PARTITION not defined in environment, using %s as default"%publishToPartition) - -#Setup and configure ISProperty -from ISProperty.ISPropertyConf import ISPropertySvc -ISPropertySvc = ISPropertySvc(PartitionName=publishToPartition,ForcePublish=True) -ServiceMgr += ISPropertySvc -### NOTE: make sure ISProperty is created before BSEmonCtrlSvc, -### otherwise the shutdown sequence will fail -theApp.CreateSvc += ['ISPropertySvc'] - -#Now create and configure the ByteStreamEmonController -from ByteStreamEmonController.ByteStreamEmonControllerConf import BSEmonCtrlSvc - -#Create an instance with a stream-specific name -ByteStreamEmonCtrlSvc = BSEmonCtrlSvc(AppName+"-BSEmonCtrlSvc") -ServiceMgr += ByteStreamEmonCtrlSvc - -#Add to list of services created right-away (otherwise not referenced) -theApp.CreateSvc += ["BSEmonCtrlSvc/"+AppName+"-BSEmonCtrlSvc"] - -### -# Switch output level if requested -### -if not 'BSEmonMsgLvl' in dir(): - BSEmonMsgLvl=WARNING - -ByteStreamEmonCtrlSvc.OutputLevel=BSEmonMsgLvl -ISPropertySvc.OutputLevel=BSEmonMsgLvl - -if BSEmonMsgLvl <= DEBUG: - printfunc ("\n\n\t ISPropertySvc setup:\n",ISPropertySvc,"\n\n") - printfunc ("\n\n\t ByteStreamEmonControl setup:\n",ByteStreamEmonCtrlSvc,"\n\n") - diff --git a/graphics/EventDisplaysOnline/share/ByteStreamInput_jobOptions.py b/graphics/EventDisplaysOnline/share/ByteStreamInput_jobOptions.py deleted file mode 100644 index 75828087fcf9e71d0a089c3dd40772721b63bbe6..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/ByteStreamInput_jobOptions.py +++ /dev/null @@ -1,163 +0,0 @@ -######################################### -# -# Example setup for ByteStreamEmonSvc -# -######################################### - -# Common part, copy from here - -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -from AthenaCommon.Constants import * - -include("ByteStreamEmonSvc/ByteStreamEmonInputSvc_jobOptions.py") - -# ##################################################### -# If using the ERSBootstrap.py file, enable the output -# via ERS -# #################################################### -#MessageSvc.useErs = True - -# Define the input -ByteStreamEmonInputSvc = svcMgr.ByteStreamInputSvc - -# ############################################################ -# The name of the partition you want to connect to is taken -# from 'TDAQ_PARTITION' if it exists, otherwise from here. -# ############################################################ -if not 'Partition' in dir(): - Partition = 'ATLAS' -printfunc ("ByteStreamEmonInputSvc: Setting partition to : %s" % (Partition)) -ByteStreamEmonInputSvc.Partition = Partition - -# ######################################### -# The source of events, SFI for full events -# ######################################### -if not 'SamplingLevel' in dir(): - SamplingLevel="efd" -ByteStreamEmonInputSvc.Key = SamplingLevel - -# ############################################################ -# A list of of key values, e.g. a list of SFIs to contact. -# If not defined, one event provider of this type (i.e. any SFI) -# ############################################################ -#ByteStreamEmonInputSvc.KeyValue = ["SFI-1", "SFI-2", "SFI-3" ] - -# ####################################### -# Alternative: N providers of type 'SFI' -# KeyValue is ignored if this is set. -# ###################################### -if not 'Nodes' in dir(): - Nodes=10 -ByteStreamEmonInputSvc.KeyCount = Nodes - -# ####################################### -# Set this to the IS server where you want -# to publish histograms, too. If unset, no -# histograms are published. -# ####################################### -#ByteStreamEmonInputSvc.ISServer = 'Histogramming' - -# ######################################## -# The provider name under which your histograms -# appear in OH. -# ######################################## -#ByteStreamEmonInputSvc.PublishName = 'TRT_PT' - -# ################################################### -# Should histograms be cleared at new run ? default: yes -# ################################################### -#ByteStreamEmonInputSvc.ClearHistograms = True - -# #################################################### -# A regular expression to restrict which histograms are published. -# #################################################### -# ByteStreamEmonInputSvc.Include = '.*' -# ByteStreamEmonInputSvc.Exclude = '' - -# ############################################### -# Frequency of updates (in number of events, not secs...) -# ############################################### -# ByteStreamEmonInputSvc.Frequency = 5 - -# ################################# -# Set GroupName to empty (so others can sample the same event) -# ################################# -if not 'GroupName' in dir(): - GroupName="" -ByteStreamEmonInputSvc.GroupName=GroupName - -# ################################# -# Set timeout (in ms?) -# ################################# -ByteStreamEmonInputSvc.Timeout=600000 - -# ############################## -# one of 'Ignore', 'Or', 'And' -# ############################## -ByteStreamEmonInputSvc.LVL1Logic = "Ignore" - -# ######################################### -# One of 'TAP', 'TBP' or 'TAV' (default) -# ######################################### -#ByteStreamEmonInputSvc.LVL1Origin = "TAV" - -# ########################################################### -# A list of L1 bit names to select on. This requires the -# L1CT.TrigConfL1Items to be published in IS. -# -# This can be used instead of or in addition to LVL1Bits. -# ########################################################### -if 'LVL1Names' in dir(): - ByteStreamEmonInputSvc.LVL1Logic = "Or" - ByteStreamEmonInputSvc.LVL1Names = LVL1Names.split(' ') - -# A list of numerical trigger bits instead of names. This is -# Or'ed with LVL1Names -#ByteStreamEmonInputSvc.LVL1Items = [ 10, 20, 72, 245 ] - -# ########################################### -# Selection by stream tag: -# One of 'Or', 'And', 'Ignore' (default) -# ########################################### -## Set stream logic ignore for 'Random' stream -if ( not 'Stream' in dir()) or (Stream == 'Default') or (Stream.startswith("Test")): - ByteStreamEmonInputSvc.StreamLogic = "Ignore" -else: - ByteStreamEmonInputSvc.StreamLogic = "Or" - -# ########################################### -# One of 'physics' or 'calibration' -# ############################################ -#Make sure it is defined -if not 'StreamType' in dir(): - StreamType="physics" -ByteStreamEmonInputSvc.StreamType = StreamType - -# ############################################ -# A list of stream tag names -# ############################################ -ByteStreamEmonInputSvc.StreamNames = Stream.split(' ') - -# ################################################# -# The event buffer size -# ################################################# -ByteStreamEmonInputSvc.BufferSize = 30 - -# ################################################# -# Shall athena exit if the partition is shutdown ? -# For offline athena tasks mainly. -# ################################################# -#ByteStreamEmonInputSvc.ExitOnPartitionShutdown = False - -ByteStreamCnvSvc = Service( "ByteStreamCnvSvc" ) -theApp.ExtSvc += [ "ByteStreamCnvSvc"] - -### -# Switch output level if requested -### -if not 'BSEmonMsgLvl' in dir(): - BSEmonMsgLvl=WARNING -ByteStreamEmonInputSvc.OutputLevel=BSEmonMsgLvl - -if BSEmonMsgLvl <= DEBUG: - printfunc ("\n\n\t ByteStreamEmonInput setup:\n",ByteStreamEmonInputSvc,"\n\n") diff --git a/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py b/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py deleted file mode 100644 index 18468812195a171f9f5a3c3d4aec67879526196a..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/EventDisplay_jobOptions.py +++ /dev/null @@ -1,213 +0,0 @@ -## -- Overview of all default local settings that one can change -## -- The default values are also shown. - -isHI_mode = False - -## ------------------------------------------- name of the partition from which to read data and configuration parameters -partitionName = 'ATLAS' -#partitionName = 'GMTestPartition' #Test partition serving events from a raw data file if you want to test when no run is ongoing. To see which files will be ran over on this test partition, at point 1, see the uncommented lines in: /det/dqm/GlobalMonitoring/GMTestPartition_oks/tdaq-10-00-00/without_gatherer/GMTestPartition.data.xml -#partitionName = 'GMTestPartitionT9' To see which files will be ran over on this test partition, at point 1, see the uncommented lines in: /det/dqm/GlobalMonitoring/GMTestPartition_oks/tdaq-10-00-00/without_gatherer/GMTestPartitionT9.data.xml - -## ------------------------------------------- set both the old flags in RecExOnline and the new flags consistently -beamType = 'collisions' -#beamType = 'cosmics' - -#COND tag -ConditionsTag = 'CONDBR2-HLTP-2023-01' -#Current DetDesc -DetDescrVersion = 'ATLAS-R3S-2021-03-00-00' - -## Pause this thread until the ATLAS partition is up -include ("EventDisplaysOnline/WaitForAtlas_jobOptions.py") - -## ------------------------------------------- set online defaults for AthenaConfiguration.AllConfigFlags -from AthenaConfiguration.AllConfigFlags import ConfigFlags -from AthenaConfiguration.AutoConfigOnlineRecoFlags import autoConfigOnlineRecoFlags -from AthenaConfiguration.Enums import BeamType -ConfigFlags.Trigger.triggerConfig = 'DB' # temporary 02/2021 -autoConfigOnlineRecoFlags(ConfigFlags, partitionName) - -## ------------------------------------------- update selected ConfigFlags if needed -ConfigFlags.Beam.Type = BeamType(beamType) -ConfigFlags.IOVDb.GlobalTag = ConditionsTag -ConfigFlags.GeoModel.AtlasVersion = DetDescrVersion - -## ------------------------------------------- flags set in: RecExOnline_jobOptions.py -isOnline = True -isOnlineStateless = True - -#Crashes online if you do not set this.... -isOfflineTest = False - -#for the time being, running over file is not possible ONLINE (please see RecExOnline_File_Offline.py) -useEmon = True -#The number of machines per single monitoring task we run with helpfully labelled "keycount" -keycount = 3 # equal or greater than the number of DCMs for beam splashes -buffersize = 10 # three times of keycount for beam splashes -updateperiod = 200 -timeout = 600000 # 144000000 (40 hrs) for beam splashes - -keyname = 'dcm' - -# Empty list to read all -# 'MinBias' for beam splashes -# An explicit list for nominal data taking to exclude some high rate streams -streamName = 'ZeroBias:CosmicCalo:IDCosmic:CosmicMuons:Background:Standby:L1Calo:Main' - -#Read Physics -streamType = 'physics' #Progonal Does not specify these - - -streamLogic = 'Or'#HAS TO BE OR AT ALL TIMES WHEN SPECIFYING A CERTAIN STREAM - -useAtlantisEmon = False - -# Set a unique group name for ED jobs so that: Events are distributed between ED jobs with the same groupName -# and shared between different (non ED) groups. -groupName = "EventDisplaysOnline" - - -## ------------------------------------------- flags set in: RecExOnline_emonsvc.py (from RecExOnline_jobOptions.py) -publishName = 'EventDisplays' - -if (partitionName == 'ATLAS'): - evtMax = -1 - # from Pavol in 2021 beam splashes - # for beam plashes when LAr running in 32 samples mode, provide the current run number to LAr config - import ispy - from ispy import ISObject - obj = ispy.ISObject(ispy.IPCPartition(partitionName), 'RunParams.RunParams', 'RunParams') - obj.checkout() - # setting run number from IS, some configs need it - from RecExConfig.RecFlags import rec - rec.RunNumber.set_Value_and_Lock(obj.run_number) - - - -#Don't flood if you are running on a test loop -if (partitionName != 'ATLAS'): - evtMax = 200 - keycount = 1 - -## ------------------------------------------- flags set in: RecExOnline_globalconfig.py (from RecExOnline_jobOptions.py) -#read the pickle file if you want to use the AMI tag info -#stored in ami_recotrf.pickle (produced by 'tct_getAmiTag.py f140 ami_recotrf.cmdargs ami_recotrf.pickle') -usePickleConfig = False -pickleconfigfile = './ami_recotrf.pickle' -DataSource = 'data' -InputFormat = 'bytestream' -fileName = './0.data' - -doESD = True -writeESD = True # False - Jiggins_12Feb_v2 working version switch -doAOD = False #True # False - Jiggins_12Feb_v2 wokring version switch -writeAOD = False # True # False - Jiggins_12Feb_v2 working version switch -IOVDbSvcMessage = False - -## ------------------------------------------ flags set in: RecExOnline_recoflags.py (from RecExOnline_jobOptions.py) -doAllReco = True -doInDet = doAllReco -doMuon = doAllReco -doLArg = doAllReco -doTile = doAllReco -doTrigger = False # lshi 29 Apr 2022 need AthenaMT to turn on trigger reco again -doHist = False -doJiveXML = False -doEgammaTau = doAllReco # lshi Feb 18 2022 enable this to get rid of Electron error - -## ------------------------------------------ flags set in : RecExOnline_monitoring.py (from from RecExOnline_jobOptions.py) -doAllMon = False -doCaloMon = doAllMon -doPhysMon = doAllMon -doTrigMon = doAllMon -doIDMon = doAllMon -doTRTMon = doAllMon -doMuonMon = doAllMon - -## ------------------------------------------ flags set in : RecExOnline_postconfig.py (called from RecExOnline_jobOptions.py) - -## Define the general output directory for VP1 and Atlantis -if not 'OutputDirectory' in dir(): - OutputDirectory="/atlas/EventDisplayEvents" - -from AthenaCommon.GlobalFlags import globalflags -globalflags.ConditionsTag.set_Value_and_Lock(ConditionsTag) -# set geometry tag before including RecExOnline. Otherwise something will initialize based on the default geometry tag which is Run2. lshi Apr 2022 -globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion) - -## Setup unique output files (so that multiple Athenas on the same machine don't interfere) -jobId = os.environ.get('TDAQ_APPLICATION_NAME', '').split(':') -if not len(jobId) == 5: - from random import randint - jobId = ['Athena-EventProcessor', 'Athena-EventDisplays-Segment', 'EventDisplays-Rack', 'tmp', '%d' % randint(0, 999)] - -IPC_timeout = int(os.environ['TDAQ_IPC_TIMEOUT']) -printfunc (" IPC_timeout Envrionment Variable = %d" %IPC_timeout) -################################################################################# - -#from random import randrange -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - -# #################### From JiveXML server python script #################### -athenaCommonFlags.PoolESDOutput = "ESD-%s-%s.pool.root" % (jobId[3], jobId[4]) -## Additional flags from: GetTfCommand.py --AMI=x392 -from CaloRec.CaloCellFlags import jobproperties -jobproperties.CaloCellFlags.doLArHVCorr=False -jobproperties.CaloCellFlags.doPileupOffsetBCIDCorr.set_Value_and_Lock(False) -jobproperties.CaloCellFlags.doLArCreateMissingCells=False -ConfigFlags.LAr.doHVCorr = False # ATLASRECTS-6823 - -#Work around to stop crash in pixel cluster splitting (Updated by lshi 23 July 2020, ATLASRECTS-5496) -from InDetRecExample.InDetJobProperties import InDetFlags#All OK -InDetFlags.doPixelClusterSplitting.set_Value_and_Lock(False) - -from RecExConfig.RecAlgsFlags import recAlgs -recAlgs.doMissingET.set_Value_and_Lock(False) - -## from Global Monitoring 12 Oct 2021 -from AthenaCommon.GlobalFlags import jobproperties -jobproperties.Global.DetGeo.set_Value_and_Lock('atlas') - -if isHI_mode: - InDetFlags.cutLevel.set_Value_and_Lock(4) - jobproperties.Beam.bunchSpacing.set_Value_and_Lock(100) # Needed for collisions - rec.doHeavyIon.set_Value_and_Lock(True) - streamName = '' -elif beamType == 'collisions': - jobproperties.Beam.bunchSpacing.set_Value_and_Lock(25) # Needed for collisions - -if (partitionName != 'ATLAS'): # Can't get some information from the test partition - ConfigFlags.Input.RunNumbers = [412343] - ConfigFlags.Input.ProjectName = 'data23_13p6TeV' - ## ERROR Missing ROBFragment with ID 0x760001 requested ATR-24151 13 Oct 2021 lshi - ConfigFlags.Trigger.L1.doMuon=False; - ConfigFlags.Trigger.L1.doCalo=False; - ConfigFlags.Trigger.L1.doTopo=False; - ConfigFlags.Trigger.doNavigationSlimming = False # ATR-24551 - -## Main online reco scripts -include ("RecExOnline/RecExOnline_jobOptions.py") - -ToolSvc.InDetPixelRodDecoder.OutputLevel = ERROR - -topSequence.LArRawDataReadingAlg.FailOnCorruption=False - -# lshi from 2021 Pilot Beam: disable SCT in tracking for beam splashes -#topSequence.InDetSiTrackerSpacePointFinder.ProcessSCTs = False - -include ("EventDisplaysOnline/JiveXMLServer_jobOptions.py") -include ("EventDisplaysOnline/Atlantis_jobOptions.py") -include ("EventDisplaysOnline/VP1_jobOptions.py") - -## Disable histogramming -svcMgr.ByteStreamInputSvc.ISServer='' - -if (partitionName != 'ATLAS'): - svcMgr.ByteStreamInputSvc.KeyValue = [ 'Test_emon_push' ] - -################### Added by sjiggins 10/03/15 as given by Peter Van Gemmeren for name PoolFileatalogs -svcMgr.PoolSvc.WriteCatalog = "xmlcatalog_file:PoolFileCatalog_%s_%s.xml" % (jobId[3], jobId[4]) -#################################################################################################### - -svcMgr.MessageSvc.OutputLevel = WARNING #INFO -svcMgr.MessageSvc.Format = "% F%t %18W%S%7W%R%T %0W%M" diff --git a/graphics/EventDisplaysOnline/share/JiveXMLServer_jobOptions.py b/graphics/EventDisplaysOnline/share/JiveXMLServer_jobOptions.py deleted file mode 100644 index cf9c67484ce4013618b3093c6f60f604ef1982a1..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/JiveXMLServer_jobOptions.py +++ /dev/null @@ -1,44 +0,0 @@ - ######################################### -# -# Setup for running event displays at point1 -# -######################################### - -import os -from random import randrange -from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - -######## Commented out by sjiggins - 19-02-2015 because of a ############### -######## writeESD crash with PoolFileCatalog read only error ############### - -#randomString=str(randrange(0,100000)) -#athenaCommonFlags.PoolESDOutput = 'ESD_' + randomString +'.pool.root' -#os.environ['POOL_CATALOG'] = 'xmlcatalog_file:PoolFileCatalog_'+randomString+'.xml' - -############################################################################ - -#Add the online event display service -from AthenaCommon.AppMgr import theApp -if not hasattr(svcMgr, 'OnlineEventDisplaysSvc'): - if rec.doHeavyIon: - maxEvents=200 - projectTags=['data23_hi'] - publicStreams=['physics_MinBias'] - else: - maxEvents=100 - projectTags=['data23_13p6TeV'] - publicStreams=['physics_Main'] - - - - from EventDisplaysOnline.OnlineEventDisplaysSvc import OnlineEventDisplaysSvc - svcMgr += OnlineEventDisplaysSvc( - "OnlineEventDisplaysSvc", - OutputLevel = DEBUG, # Verbosity - MaxEvents = maxEvents, # Number of events to keep per stream - OutputDirectory = OutputDirectory, # Base directory for streams - ProjectTags = projectTags, # Project tags that are allowed to be made public - Public = publicStreams, # These streams go into public stream when Ready4Physics - ) - theApp.CreateSvc += [svcMgr.OnlineEventDisplaysSvc.getFullJobOptName()] - diff --git a/graphics/EventDisplaysOnline/share/LArDigits_jobOptions.py b/graphics/EventDisplaysOnline/share/LArDigits_jobOptions.py deleted file mode 100644 index 09fdacf4929a27837674ffe0c3edda8d61c81ffe..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/LArDigits_jobOptions.py +++ /dev/null @@ -1,14 +0,0 @@ -### -# Configure LAr retriever to write out digits -### - -#Add the single LAr digit retriever -AlgoJiveXML.DataTypes += ["JiveXML::LArDigitRetriever/LArDigitRetriever"] -#Remove the individual LAr non-digit retrievers -AlgoJiveXML.DataTypes.remove("JiveXML::CaloLArRetriever/CaloLArRetriever") -AlgoJiveXML.DataTypes.remove("JiveXML::CaloHECRetriever/CaloHECRetriever") -AlgoJiveXML.DataTypes.remove("JiveXML::CaloFCalRetriever/CaloFCalRetriever") -#Enable all digits -ToolSvc.LArDigitRetriever.DoLArDigit=True -ToolSvc.LArDigitRetriever.DoHECDigit=True -ToolSvc.LArDigitRetriever.DoFCalDigit=True diff --git a/graphics/EventDisplaysOnline/share/RecoCommon_jobOptions.py b/graphics/EventDisplaysOnline/share/RecoCommon_jobOptions.py deleted file mode 100644 index 861a15344192cdfaf765e2011fea16dcf84a27d4..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/RecoCommon_jobOptions.py +++ /dev/null @@ -1,115 +0,0 @@ -#----------------------------------------------- Get the run type from IS -from AthenaCommon.BeamFlags import jobproperties -from EventDisplaysOnline.EventDisplaysConfig import GetRunType -jobproperties.Beam.beamType.set_Value_and_Lock(GetRunType()) - -#----------------------------------------------- Set the magnetic field -from AthenaCommon.BFieldFlags import jobproperties -from EventDisplaysOnline.EventDisplaysConfig import GetBFields -(solenoidOn,toroidOn)=GetBFields(); -jobproperties.BField.barrelToroidOn.set_Value_and_Lock(toroidOn); -jobproperties.BField.endcapToroidOn.set_Value_and_Lock(toroidOn); -jobproperties.BField.solenoidOn.set_Value_and_Lock(solenoidOn); - -# ----------------------------------------------- Run configuration -from AthenaCommon.GlobalFlags import globalflags -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock("bytestream") -globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-GEO-08-00-02') - -# ----------------------------------------------- Use conditions according to beamType -conditionTags = { 'collisions' : "COMCOND-MONP-001-00", - 'singlebeam' : "COMCOND-MONS-001-00", - 'cosmics' : "COMCOND-MONC-003-00" } -globalflags.ConditionsTag.set_Value_and_Lock(conditionTags[jobproperties.Beam.beamType()]) - - -# ----------------------------------------------- Online flag -from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags -athenaCommonFlags.isOnline = True # configures the job for online running -athenaCommonFlags.BSRDOInput.set_Value_and_Lock([]) # set proper bytestream input (for trigger) - -#make sure ESD's and PoolFileCatalog from multiple jobs don't overwrite each other -import os -from random import randrange -randomString=str(randrange(0,100000)) -athenaCommonFlags.PoolESDOutput = 'ESD_' + randomString +'.pool.root' -os.environ['POOL_CATALOG'] = 'xmlcatalog_file:PoolFileCatalog_'+randomString+'.xml' -athenaCommonFlags.BSRDOInput = [] - - -# ----------------------------------------------- Output flags -from RecExConfig.RecFlags import rec - -rec.doESD.set_Value_and_Lock(True) -rec.doAOD.set_Value_and_Lock(False) -rec.doDPD.set_Value_and_Lock(False) -rec.doWriteESD.set_Value_and_Lock(True) -rec.doWriteAOD.set_Value_and_Lock(False) -rec.doCBNT.set_Value_and_Lock(False) -rec.doWriteTAG.set_Value_and_Lock(False) - -# ----------------------------------------------- Robust tracking for 30 Mar 2010 -#from InDetRecExample.InDetJobProperties import InDetFlags -#InDetFlags.doRobustReco.set_Value_and_Lock(True) - -# ----------------------------------------------- Reco flags -rec.doInDet.set_Value_and_Lock(True) -rec.doMuon.set_Value_and_Lock(True) # if True and doTrigger=True, set doID, doLAr, doTile to True -rec.doLArg.set_Value_and_Lock(True) # if True, set doID, doTile to True -rec.doTile.set_Value_and_Lock(True) # if True, set doID, doLAr to True - -# --- Temporarily disable ZDC as it crashes ( savannah bug #59762 ) -rec.UserFlags=["DetFlags.ZDC_setOff()"] - -rec.doMonitoring.set_Value_and_Lock(False) - -rec.doTrigger.set_Value_and_Lock(True) -rec.doHist.set_Value_and_Lock(False) -rec.doEgamma.set_Value_and_Lock(False) -rec.doTau.set_Value_and_Lock(False) - -# ---------------------------------------------- Debug flags -rec.doPerfMon.set_Value_and_Lock(False) # optional for performance check -rec.doDetailedPerfMon.set_Value_and_Lock(False) # optional for performance check -rec.doNameAuditor.set_Value_and_Lock(False) # optional for debugging -rec.doDetStatus.set_Value_and_Lock(False) # - -#------------------------------ Cosmics running -> do not use beam-spot -rec.Commissioning.set_Value_and_Lock(True) - -# ----------------------------- LAr Online fix -include("RecExOnline/SimpleLarCondFlags.py") - -#### -# If LAr is running in transaprent mode, these lines need to be commented -# Otherwise, they should be uncommented. -#### -#from LArROD.LArRODFlags import larRODFlags -#larRODFlags.readDigits.set_Value_and_Lock(False) - -# ----------------------------- Main jobOpt -include("RecExCommon/RecExCommon_topOptions.py") - -# ----------------------------- Catalog file -Service("PoolSvc").SortReplicas = False -PoolSvc = Service( "PoolSvc" ) -PoolSvc.ReadCatalog += ["xmlcatalog_file:/sw/DbData/poolcond/PoolCat_comcond.xml"] -PoolSvc.ReadCatalog += ["xmlcatalog_file:/det/dqm/AthenaMonitoring/AtlasTier0-15.4.0.2/DbData/poolcond/PoolCat_comcond.xml"] - -# ------------------------------ Force run number for test partition -# Otherwise can't use TrigDecisionTool - -if 'ForceRunNumber' in dir() : - Service("IOVDbSvc").forceRunNumber = ForceRunNumber - Service("IOVDbSvc").forceLumiblockNumber = 1 - -# --------------------------------- Printout -globalflags.print_JobProperties() - -# ----------------------- Over-writes come at the end -MessageSvc = Service("MessageSvc") -if 'MsgLvl' in dir(): - MessageSvc.OutputLevel = MsgLvl -else: - MessageSvc.OutputLevel = WARNING diff --git a/graphics/EventDisplaysOnline/share/SplashEvent_jobOptions.py b/graphics/EventDisplaysOnline/share/SplashEvent_jobOptions.py deleted file mode 100644 index c4981a7930ec92c8ec84b6e1a9ef7e2ac1286943..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/SplashEvent_jobOptions.py +++ /dev/null @@ -1,122 +0,0 @@ - -# Load all the usefull flags we might want to switch -include ("RecExCommon/RecoUsefulFlags.py") - -# ----------------------------------------------- Run configuration -globalflags.DataSource.set_Value_and_Lock('data') -globalflags.InputFormat.set_Value_and_Lock("bytestream") -globalflags.ConditionsTag.set_Value_and_Lock('COMCOND-ES1CT-002-00') -globalflags.DetDescrVersion.set_Value_and_Lock('ATLAS-GEO-08-00-02') - -# ----------------------------------------------- Beam type fixed to singlebeam for splash -jobproperties.Beam.beamType.set_Value_and_Lock("singlebeam") - -# ----------------------------------------------- Online flag -from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags -athenaCommonFlags.isOnline = True # configures the job for online running - -# ----------------------------------------------- Input flags -#make sure ESD's and PoolFileCatalog from multiple jobs don't overwrite each other -import os -from random import randrange -randomString=str(randrange(0,100000)) -athenaCommonFlags.PoolESDOutput = 'ESD_' + randomString +'.pool.root' -os.environ['POOL_CATALOG'] = 'xmlcatalog_file:PoolFileCatalog_'+randomString+'.xml' -athenaCommonFlags.BSRDOInput.set_Value_and_Lock([]) # set proper bytestream input (for trigger) - -# ----------------------------------------------- Output flags -rec.doESD.set_Value_and_Lock(True) -rec.doAOD.set_Value_and_Lock(True) -rec.doWriteESD.set_Value_and_Lock(True) -rec.doWriteAOD.set_Value_and_Lock(False) -rec.doCBNT.set_Value_and_Lock(False) -rec.doWriteTAG.set_Value_and_Lock(False) - -# ----------------------------------------------- Reco flags -# ------------ Inner Detector -rec.doInDet.set_Value_and_Lock(True) -# --- Minimal reco -from InDetRecExample.InDetJobProperties import InDetFlags -InDetFlags.doMinimalReco = True -InDetFlags.useDCS.set_Value_and_Lock(False) - -# ------------ LAr -rec.doLArg.set_Value_and_Lock(True) # if True, set doID, doTile to True -# --- LAr Online fix -include("RecExOnline/SimpleLarCondFlags.py") - -#### -# If LAr is running in transaprent mode, these lines need to be commented -# Otherwise, they should be uncommented. -#### -#from LArROD.LArRODFlags import larRODFlags -#larRODFlags.readDigits.set_Value_and_Lock(False) - -# ------------ Tile -rec.doTile.set_Value_and_Lock(True) # if True, set doID, doLAr to True - -# ------------ Calo reco -from CaloRec.CaloRecFlags import jobproperties -jobproperties.CaloRecFlags.doEmCluster.set_Value_and_Lock(False) -jobproperties.CaloRecFlags.doCaloTopoCluster.set_Value_and_Lock(False) -jobproperties.CaloRecFlags.doCaloEMTopoCluster.set_Value_and_Lock(False) - -# ------------ Muon Detector -rec.doMuon.set_Value_and_Lock(True) # if True and doTrigger=True, set doID, doLAr, doTile to True -# ---- muon settings from Rosy -muonRecFlags.doMoore=False -muonCombinedRecFlags.doMuidMuonCollection=False -#muonRecFlags.doMuonboy=False -#muonCombinedRecFlags.doStacoMuonCollection=False -mooreFlags.doSegmentsOnly=True -muonboyFlags.doSegmentsOnly=True -muonRecFlags.doSegmentT0Fit = False -muonCombinedRecFlags.Enabled = False - -# ------------ Trigger -rec.doTrigger.set_Value_and_Lock(True) - -# ------------ AOD objects -rec.doEgamma.set_Value_and_Lock(False) -rec.doTau.set_Value_and_Lock(False) -rec.doJetMissingETTag.set_Value_and_Lock(False) -BTaggingFlags.Active=False - -# ------------ Monitoring -rec.doMonitoring.set_Value_and_Lock(False) -rec.doHist.set_Value_and_Lock(False) - -# ---------------------------------------------- Debug flags -rec.doPerfMon.set_Value_and_Lock(False) # optional for performance check -rec.doDetailedPerfMon.set_Value_and_Lock(False) # optional for performance check -rec.doNameAuditor.set_Value_and_Lock(False) # optional for debugging -rec.doDetStatus.set_Value_and_Lock(False) # - -#---------------------------------------------- Comissioning settings -rec.Commissioning.set_Value_and_Lock(True) - -# ----------------------------- Main jobOpt -include("RecExCommon/RecExCommon_topOptions.py") - -# ----------------------------- Catalog file -Service("PoolSvc").SortReplicas = False -PoolSvc = Service( "PoolSvc" ) -PoolSvc.ReadCatalog += ["xmlcatalog_file:/sw/DbData/poolcond/PoolCat_comcond.xml"] -PoolSvc.ReadCatalog += ["xmlcatalog_file:/det/dqm/AthenaMonitoring/AtlasTier0-15.4.0.2/DbData/poolcond/PoolCat_comcond.xml"] - -# ------------------------------ Force run number for test partition -# Otherwise can't use TrigDecisionTool - -if 'ForceRunNumber' in dir() : - Service("IOVDbSvc").forceRunNumber = ForceRunNumber - Service("IOVDbSvc").forceLumiblockNumber = 1 - -# --------------------------------- Printout -globalflags.print_JobProperties() - -# ----------------------- Over-writes come at the end -MessageSvc = Service("MessageSvc") -if 'MsgLvl' in dir(): - MessageSvc.OutputLevel = MsgLvl -else: - MessageSvc.OutputLevel = WARNING diff --git a/graphics/EventDisplaysOnline/share/VP1_jobOptions.py b/graphics/EventDisplaysOnline/share/VP1_jobOptions.py deleted file mode 100644 index 6773ffe1e166099e96bbadca0eceb8817525a9ec..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/VP1_jobOptions.py +++ /dev/null @@ -1,42 +0,0 @@ -#### -# Setup VP1 jobOptions for running at P1 -# --> do not rely on RecExCommon options (doVP1), -# but setup things ourselves -##### - -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -from AthenaServices.AthenaServicesConf import OutputStreamSequencerSvc - -outputStreamSequencerSvc = OutputStreamSequencerSvc() -outputStreamSequencerSvc.SequenceIncidentName = "EndEvent" -svcMgr += outputStreamSequencerSvc - -### Add the algorithm producing VP1 events -from VP1AlgsEventProd.VP1AlgsEventProdConf import VP1EventProd -VP1EventProducer = VP1EventProd(InputPoolFile = StreamESD.OutputFile) -## =================== Added 09/03/15 by sjiggins ================= -printfunc ("<<<<<<< VP1 Output File >>>>>>>") -printfunc ("OutputFile: %s" % StreamESD.OutputFile) -## ================================================================ - -#Write out files in the directory given by the stream name -VP1EventProducer.DestinationDirectory = "%s/.Unknown/" % OutputDirectory - -#Set number of files large so deleting is doen by prune script -#Disable VP1 pruning by lshi on 19/May/2022 -#The pruning is performed centrally by python/EventUtils.py -VP1EventProducer.MaxNumberOfFiles = -1 - -#Set the output level -if not 'VP1MsgLvl' in dir(): - VP1MsgLvl=WARNING -VP1EventProducer.OutputLevel=VP1MsgLvl - -### Finally add this event producer to the main sequencer -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() -topSequence += VP1EventProducer - -### Finally print setup in debug mode -if VP1MsgLvl <= DEBUG: - printfunc ("\n\n\t VP1 setup\n",VP1EventProducer,"\n\n") diff --git a/graphics/EventDisplaysOnline/share/WaitForAtlas_jobOptions.py b/graphics/EventDisplaysOnline/share/WaitForAtlas_jobOptions.py deleted file mode 100644 index c1e96dfaf6e82f23a0817f00487fcf0c07e940ba..0000000000000000000000000000000000000000 --- a/graphics/EventDisplaysOnline/share/WaitForAtlas_jobOptions.py +++ /dev/null @@ -1,15 +0,0 @@ -from ispy import * -import time - -partitionUp=False -while not partitionUp: - try: - p = IPCPartition(partitionName) - runparams = ISObject(p, "RunParams.RunParams", "RunParams") - runparams.checkout() - partitionUp=True - - except Exception as e: - printfunc ("%s partition is not up, sleeping for 30 seconds" % partitionName) - time.sleep(30) - diff --git a/graphics/EventDisplaysOnline/src/OnlineEventDisplaysSvc.cxx b/graphics/EventDisplaysOnline/src/OnlineEventDisplaysSvc.cxx new file mode 100644 index 0000000000000000000000000000000000000000..264c0ebe2b8d7dd1da8fcbefc56fea5b031cb674 --- /dev/null +++ b/graphics/EventDisplaysOnline/src/OnlineEventDisplaysSvc.cxx @@ -0,0 +1,269 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ +#include "EventDisplaysOnline/OnlineEventDisplaysSvc.h" +#include "RootUtils/PyAthenaGILStateEnsure.h" +#include "Gaudi/Property.h" +#include "GaudiKernel/IIncidentSvc.h" +#include "GaudiKernel/Incident.h" +#include "GaudiKernel/MsgStream.h" +#include "xAODEventInfo/EventInfo.h" +#include <cstdlib> // For std::rand() and std::srand() +#include "Python.h" + +OnlineEventDisplaysSvc::OnlineEventDisplaysSvc( const std::string& name, + ISvcLocator* pSvcLocator ) : + AthService(name, pSvcLocator){} + +void OnlineEventDisplaysSvc::beginEvent(){ + + SG::ReadHandle<xAOD::EventInfo> evt (m_evt); + if (!evt.isValid()) { + ATH_MSG_FATAL("Could not find event info"); + } + std::vector<std::string> streams; + + m_eventNumber = evt->eventNumber(); + m_runNumber = evt->runNumber(); + + //Check what trigger streams were fired, if in list of desired + //streams to be reconstructed pick one randomly + for (const xAOD::EventInfo::StreamTag& tag : evt->streamTags()){ + ATH_MSG_DEBUG("A trigger in stream " << tag.type() << "_" << tag.name() << " was fired in this event."); + std::string stream_fullname = tag.type() + "_" + tag.name(); + + if (m_streamsWanted.empty()) { + ATH_MSG_WARNING("You have not requested any specific streams, going to allow all streams"); + streams.emplace_back(stream_fullname); + } + + else{ + //If the stream is in the list of streams requested, add it + if(std::find(m_streamsWanted.begin(), m_streamsWanted.end(), tag.name()) != m_streamsWanted.end()){ + streams.emplace_back(stream_fullname); + } + + bool isPublic = false; + // Acquire the Global Interpreter Lock (GIL) to ensure thread safety when interacting with Python objects + RootUtils::PyGILStateEnsure ensure; + // Convert the project tag string to a Python Unicode object + std::string tag = m_projectTag; + PyObject* pProjectTag = PyUnicode_FromString(tag.c_str()); + if (!pProjectTag) { + // Error handling: Print Python exception if conversion fails + PyErr_Print(); + ATH_MSG_WARNING("Failed to create Python Unicode object from project tag"); + } else { + // Import the Python module + PyObject* pHelper = PyImport_ImportModule("EventDisplaysOnline.EventDisplaysOnlineHelpers"); + if (!pHelper) { + // Error handling: Print Python exception if import fails + PyErr_Print(); + ATH_MSG_WARNING("Failed to import EventDisplaysOnline.EventDisplaysOnlineHelpers module"); + } else { + // Get the "EventCanBeSeenByPublic" function from the module + PyObject* EventCanBeSeenByPublic = PyObject_GetAttrString(pHelper, "EventCanBeSeenByPublic"); + if (!EventCanBeSeenByPublic || !PyCallable_Check(EventCanBeSeenByPublic)) { + // Error handling: Print warning if function not found or not callable + ATH_MSG_WARNING("Could not find or call EventCanBeSeenByPublic function in EventDisplaysOnline.EventDisplaysOnlineHelpers module"); + } else { + // Call the "EventCanBeSeenByPublic" function with the project tag as argument + PyObject* result = PyObject_CallFunctionObjArgs(EventCanBeSeenByPublic, pProjectTag, NULL); + if (!result) { + PyErr_Print(); + ATH_MSG_WARNING("Failed to call EventCanBeSeenByPublic function"); + } else { + // Convert the result to a boolean value + isPublic = PyObject_IsTrue(result); + Py_DECREF(result); // Decrement reference count of the result object + } + } + Py_XDECREF(EventCanBeSeenByPublic); + Py_DECREF(pHelper); + } + Py_DECREF(pProjectTag); + } + if(isPublic){ + streams.emplace_back("Public"); + ATH_MSG_DEBUG("Can send event to public stream"); + } + } + } + for (std::string stream : streams){ + ATH_MSG_DEBUG("streams where a trigger fired and in your desired streams list: " << stream); + } + std::random_shuffle(streams.begin(), streams.end()); + //Pick the first stream as the output directory + if(!streams.empty()){ + m_outputStreamDir = streams[0]; + } + else{ + ATH_MSG_WARNING("Cannot find a stream adding to .Unknown directory"); + m_outputStreamDir = ".Unkown"; + } + + m_entireOutputStr = m_outputDirectory + "/" + m_outputStreamDir; + + std::string FileNamePrefix = m_entireOutputStr + "/JiveXML"; + m_FileNamePrefix = FileNamePrefix; + + gid_t zpgid = setOwnershipToZpGrpOrDefault(); + createWriteableDir(m_outputDirectory, zpgid); +} + +void OnlineEventDisplaysSvc::endEvent(){ + RootUtils::PyGILStateEnsure ensure; + PyObject* pCheckPair = PyBool_FromLong(m_CheckPair); + PyObject* pBeamSplash = PyBool_FromLong(m_BeamSplash); + PyObject* pMaxEvents = PyLong_FromLong(m_maxEvents); + const char* cString = m_entireOutputStr.c_str(); + PyObject* pDirectory = PyUnicode_FromString(cString); + PyObject* pArgs = PyTuple_Pack(4, pDirectory, pMaxEvents, pCheckPair,pBeamSplash); + PyObject* pModule = PyImport_ImportModule(const_cast< char* >("EventDisplaysOnline.EventUtils")); + if(!pCheckPair || !pBeamSplash || !pMaxEvents || !pDirectory || !pArgs){ + PyErr_Print(); + ATH_MSG_WARNING("Failed to create Python Unicode object");} + if (!pModule) { + PyErr_Print(); + ATH_MSG_WARNING("Failed to import EventDisplaysOnline.EventUtils module"); + } else { + ATH_MSG_DEBUG("Successfully imported EventDisplaysOnline.EventUtils module"); + + // Get the "cleanDirectory" function from the module + PyObject* cleanDirectory = PyObject_GetAttrString(pModule, "cleanDirectory"); + if (!cleanDirectory || !PyCallable_Check(cleanDirectory)) { + ATH_MSG_WARNING("Could not find or call cleanDirectory function in EventDisplaysOnline.EventUtils module"); + } else { + ATH_MSG_DEBUG("Found cleanDirectory function in EventDisplaysOnline.EventUtils module"); + + // Call the "cleanDirectory" function with the provided arguments + PyObject_CallObject(cleanDirectory, pArgs); + if (PyErr_Occurred()) { + PyErr_Print(); + } + } + Py_DECREF(cleanDirectory); + } + + if(m_BeamSplash){ + std::string JiveXMLFileName ="JiveXML_"+ std::to_string(m_runNumber)+"_"+std::to_string(m_eventNumber)+".xml"; + const char* JiveXMLFileName_cString = JiveXMLFileName.c_str(); + PyObject* pJiveXMLFileName = PyUnicode_FromString(JiveXMLFileName_cString); + PyObject* pArgs_zip = PyTuple_Pack(2, pDirectory, pJiveXMLFileName); + PyObject* zipXMLFile = PyObject_GetAttrString(pModule, "zipXMLFile"); + if (!zipXMLFile) { + PyErr_Print(); + ATH_MSG_WARNING("Failed to import EventDisplaysOnline.EventUtils.zipXMLFile"); + } + else { + PyObject_CallObject(zipXMLFile, pArgs_zip); + } + Py_DECREF(pJiveXMLFileName); + Py_DECREF(zipXMLFile); + Py_DECREF(pArgs_zip); + } + Py_DECREF(pModule); + Py_DECREF(pArgs); + Py_DECREF(pCheckPair); + Py_DECREF(pMaxEvents); + Py_DECREF(pDirectory); +} + +std::string OnlineEventDisplaysSvc::getFileNamePrefix(){ + return m_FileNamePrefix; +} + +std::string OnlineEventDisplaysSvc::getEntireOutputStr(){ + return m_entireOutputStr; +} + +std::string OnlineEventDisplaysSvc::getStreamName(){ + return m_outputStreamDir; +} +void OnlineEventDisplaysSvc::createWriteableDir(std::string directory, gid_t zpgid){ + + const char* char_dir = directory.c_str(); + + if (access(char_dir, F_OK) == 0) { + struct stat directoryStat; + if (stat(char_dir, &directoryStat) == 0 && S_ISDIR(directoryStat.st_mode) && + access(char_dir, W_OK) == 0) { + ATH_MSG_DEBUG("Going to write file to existing directory: " << directory); + if (directoryStat.st_gid != zpgid) { + ATH_MSG_DEBUG("Setting group to 'zp' for directory: " << directory); + chown(char_dir, -1, zpgid); + } + } else { + ATH_MSG_WARNING("Directory '" << directory << "' is not usable, trying next alternative"); + } + } else { + try { + mkdir(char_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + chown(char_dir, -1, zpgid); + ATH_MSG_DEBUG("Created output directory " << directory); + } catch (const std::system_error& err) { + std::cerr << "Failed to create output directory " << directory + << err.what() << std::endl; + } + } +} + +gid_t OnlineEventDisplaysSvc::setOwnershipToZpGrpOrDefault(){ + gid_t zpgid; + struct group* zp_group = getgrnam("zp"); + if (zp_group != nullptr) { + zpgid = zp_group->gr_gid; + } else { + ATH_MSG_DEBUG("If running on private machine, zp group might not exist. Just set to the likely value 1307."); + zpgid = 1307; + } + return zpgid; +} + +StatusCode OnlineEventDisplaysSvc::initialize(){ + + ATH_MSG_DEBUG("Initializing " << name()); + IIncidentSvc* incSvc = nullptr; + ATH_CHECK( service("IncidentSvc",incSvc) ); + ATH_MSG_DEBUG("You have requested to only output JiveXML and ESD files when a trigger in the following streams was fired: "); + for (std::string stream : m_streamsWanted){ + ATH_MSG_DEBUG(stream); + } + if(m_BeamSplash){ + m_CheckPair = false; + } + incSvc->addListener( this, "BeginEvent"); + incSvc->addListener( this, "StoreCleared"); + + ATH_CHECK( m_evt.initialize() ); + + return StatusCode::SUCCESS; +} + +StatusCode OnlineEventDisplaysSvc::finalize(){ + + ATH_MSG_DEBUG("Finalizing " << name()); + return StatusCode::SUCCESS; +} + +void OnlineEventDisplaysSvc::handle( const Incident& incident ){ + ATH_MSG_DEBUG("Received incident " << incident.type() << " from " << incident.source() ); + if ( incident.type() == IncidentType::BeginEvent && incident.source() == "BeginIncFiringAlg" ){ + beginEvent(); + } + if ( incident.type() == "StoreCleared" && incident.source() == "StoreGateSvc" ){ + endEvent(); + } +} + +StatusCode OnlineEventDisplaysSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) +{ + if ( IOnlineEventDisplaysSvc::interfaceID().versionMatch(riid) ) { + *ppvInterface = dynamic_cast<IOnlineEventDisplaysSvc*>(this); + } else { + // Interface is not directly available : try out a base class + return AthService::queryInterface(riid, ppvInterface); + } + addRef(); + return StatusCode::SUCCESS; +} diff --git a/graphics/EventDisplaysOnline/src/components/EventDisplaysOnline_entries.cxx b/graphics/EventDisplaysOnline/src/components/EventDisplaysOnline_entries.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0434c1268ddcfe25731c6f11800b830a1fde3322 --- /dev/null +++ b/graphics/EventDisplaysOnline/src/components/EventDisplaysOnline_entries.cxx @@ -0,0 +1,4 @@ +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +#include "EventDisplaysOnline/OnlineEventDisplaysSvc.h" + +DECLARE_COMPONENT( OnlineEventDisplaysSvc ) diff --git a/graphics/JiveXML/CMakeLists.txt b/graphics/JiveXML/CMakeLists.txt index 21ccefb909f9107b8d779be49b0b24d5691266c4..3f8771412dd5c828a05a9003bf5ecad33b6f541f 100644 --- a/graphics/JiveXML/CMakeLists.txt +++ b/graphics/JiveXML/CMakeLists.txt @@ -3,7 +3,6 @@ # Declare the package name: atlas_subdir( JiveXML ) - # External package(s). list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) if( ( "${ATLAS_OS_ID}" STREQUAL "centos9" ) OR ( "${ATLAS_OS_ID}" STREQUAL "el9" ) ) @@ -16,20 +15,20 @@ if ( RPC_FOUND ) JiveXML/*.h src/*.cxx PUBLIC_HEADERS JiveXML INCLUDE_DIRS ${RPC_INCLUDE_DIRS} - LINK_LIBRARIES ${RPC_LIBRARIES} AthenaBaseComps CxxUtils GaudiKernel + LINK_LIBRARIES ${RPC_LIBRARIES} AthenaBaseComps CxxUtils GaudiKernel EventDisplaysOnlineLib PRIVATE_LINK_LIBRARIES xAODEventInfo ) else() atlas_add_library( JiveXMLLib JiveXML/*.h src/*.cxx PUBLIC_HEADERS JiveXML INCLUDE_DIRS ${RPC_INCLUDE_DIRS} - LINK_LIBRARIES AthenaBaseComps CxxUtils GaudiKernel - PRIVATE_LINK_LIBRARIES xAODEventInfo ) -endif() + LINK_LIBRARIES AthenaBaseComps CxxUtils GaudiKernel EventDisplaysOnlineLib + PRIVATE_LINK_LIBRARIES xAODEventInfo ) +endif() atlas_add_component( JiveXML src/components/*.cxx - LINK_LIBRARIES JiveXMLLib ) + LINK_LIBRARIES JiveXMLLib) # Install files from the package: atlas_install_runtime( test/*.xml test/*.xsl ) diff --git a/graphics/JiveXML/JiveXML/AlgoJiveXML.h b/graphics/JiveXML/JiveXML/AlgoJiveXML.h index 3fcacaa7137ad70974d91f6cf3462bdc849d9539..0308798052ad6d28dea6e7b837466d346224a936 100755 --- a/graphics/JiveXML/JiveXML/AlgoJiveXML.h +++ b/graphics/JiveXML/JiveXML/AlgoJiveXML.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef JIVEXML_ALGOJIVEXML_H @@ -10,15 +10,15 @@ #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/MsgStream.h" #include "JiveXML/IDataRetriever.h" - +#include "xAODEventInfo/EventInfo.h" #include <vector> //Forward declarations namespace JiveXML{ - // class IDataRetriever; + // class IDataRetriever; class IFormatTool; class IStreamTool; -} +} namespace JiveXML { @@ -31,61 +31,45 @@ namespace JiveXML { */ class AlgoJiveXML : public AthAlgorithm { - public: - - //Constructor - AlgoJiveXML (const std::string& name, ISvcLocator* pSvcLocator); - - //Default Athena algorithm methods - StatusCode initialize(); - StatusCode execute(); - StatusCode finalize(); - - private: - - /** @name Configurable options */ - //@{ - //Whether default server stream shall be created - bool m_onlineMode; - //Whether events shall be written to a file - bool m_writeToFile; - //Whether XML geometry information shall be generated - bool m_writeGeometry; - // Geometry version from Athena - std::string m_geometryVersionIn; - // Athena release version - std::string m_AtlasRelease; - //@} - - - /** List of dataTypes to be retrieved and written to xml */ - std::vector<std::string> m_dataTypes; - - /** List of geometry writer tools to be called */ - std::vector<std::string> m_GeoWriterNames; - - protected: - - /** - * The list of DataRetrievers. This is initialised using the list of names - * supplied by the jobOptions. DataRetrievers are AlgTools residing in the - * corresponding sub-detector packages (e.g. TrackRetriever in InDetJiveXML). - **/ - ToolHandleArray<JiveXML::IDataRetriever> m_DataRetrievers; - - /** - * Handle to the formatting tool, which is passed on to - * the data retrievers and converts the data into XML - **/ - ToolHandle<JiveXML::IFormatTool> m_FormatTool; - - /** - * List of streaming tools that pass the formatted XML text - * into a file, to a server, etc. - **/ - ToolHandleArray<JiveXML::IStreamTool> m_StreamTools; + public: + + //Constructor + AlgoJiveXML (const std::string& name, ISvcLocator* pSvcLocator); + + //Default Athena algorithm methods + StatusCode initialize(); + StatusCode execute(); + StatusCode finalize(); + private: + + Gaudi::Property<std::string> m_AtlasRelease {this, "AtlasRelease", "unknown", "The Athena release number"}; + Gaudi::Property<std::vector<std::string>> m_dataTypes {this, "DataTypes", {}, "List of data retriever names to be run"}; + Gaudi::Property<bool> m_writeToFile {this, "WriteToFile", true, "Whether XML files shall be produced"}; + Gaudi::Property<bool> m_onlineMode {this, "OnlineMode", false, "Whether an XMLRPC server shall be started"}; + Gaudi::Property<bool> m_writeGeometry {this, "WriteGeometry", false, "Whether Geometry-XML files shall be produced"}; + Gaudi::Property<std::string> m_geometryVersionIn {this, "GeometryVersion", "default", "Geometry version as read from Athena"}; + Gaudi::Property<std::vector<std::string>> m_GeoWriterNames {this, "GeoWriterNames", {"JiveXML::GeometryWriter/GeometryWriter","JiveXML::MuonGeometryWriter/MuonGeometryWriter"}, "The names of the geometry-writer tools"}; + /** + * The list of DataRetrievers. This is initialised using the list of names + * supplied by the jobOptions. DataRetrievers are AlgTools residing in the + * corresponding sub-detector packages (e.g. TrackRetriever in InDetJiveXML). + **/ + ToolHandleArray<JiveXML::IDataRetriever> m_DataRetrievers; + + /** + * Handle to the formatting tool, which is passed on to + * the data retrievers and converts the data into XML + **/ + ToolHandle<JiveXML::IFormatTool> m_FormatTool {this, "FormatTool", "JiveXML::XMLFormatTool/XMLFormatTool", "Format tool"}; + + /** + * Streaming tools that pass the formatted XML text + * into a file, to a server, etc. + **/ + ToolHandle<JiveXML::IStreamTool> m_StreamToFileTool {this, "StreamToFileTool", "JiveXML::StreamToFileTool/StreamToFileTool", "Stream to file tool"}; + ToolHandle<JiveXML::IStreamTool> m_StreamToServerTool; //only initialised if m_onlineMode is True }; }//namespace -#endif +#endif diff --git a/graphics/JiveXML/JiveXML/IStreamTool.h b/graphics/JiveXML/JiveXML/IStreamTool.h index d8b92d42b2fd5de0dc1d1722ff9422f79ff21dc5..0fd4f7fb859bdb285d93c9ca5d8491bad0968877 100644 --- a/graphics/JiveXML/JiveXML/IStreamTool.h +++ b/graphics/JiveXML/JiveXML/IStreamTool.h @@ -6,6 +6,7 @@ #define JIVEXML__ISTREAMTOOL_H #include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/IProperty.h" namespace JiveXML { @@ -18,7 +19,9 @@ namespace JiveXML { * * @author Sebastian Boeser */ - class IStreamTool : virtual public IAlgTool { + class IStreamTool : virtual public IAlgTool, + virtual public IProperty + { public: /** The interface identifier */ diff --git a/graphics/JiveXML/JiveXML/StreamToFileTool.h b/graphics/JiveXML/JiveXML/StreamToFileTool.h index 297ddad020a63462f4ca416633b8ad858ef9a263..8579c9bc3f12f4efee6d7db93ee0847eb54312a5 100644 --- a/graphics/JiveXML/JiveXML/StreamToFileTool.h +++ b/graphics/JiveXML/JiveXML/StreamToFileTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef JIVEXML__STREAMTOFILETOOL_H @@ -8,48 +8,54 @@ //IAlgTool interface #include "JiveXML/IStreamTool.h" #include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ServiceHandle.h" +#include "EventDisplaysOnline/IOnlineEventDisplaysSvc.h" namespace JiveXML { - + /** * Stream JiveXML event information into a file. Currently only * one file per event is supported, this will hopefully be changed soon. * * @author Sebastian Boeser */ - class StreamToFileTool : virtual public IStreamTool, public AthAlgTool{ - - public: - - /// Constructor - StreamToFileTool( const std::string&, const std::string&, const IInterface*); - - /// Initialize - virtual StatusCode initialize(); - - /// Finalize - virtual StatusCode finalize(); - - /// Stream one event - virtual StatusCode StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* EventBuffer ) ; - - private: - - /** Prefix put in front of file name */ - std::string m_FileNamePrefix; - - /** Suffix put at the end of the file name (including type)*/ - std::string m_FileNameSuffix; - - /** Generate a file name */ - std::string MakeFileName( const unsigned long EventNumber, const unsigned int RunNumber ) const; - - /** Creates a new output stream to write XML to */ - StatusCode NewFile( const unsigned long EventNumber, const unsigned int RunNumber, std::ofstream *& outFile ) const ; - - /** Closes output stream */ - StatusCode CloseFile( std::ofstream *& outFile ) const ; - + class StreamToFileTool : virtual public IStreamTool, public AthAlgTool { + + public: + + /// Constructor + StreamToFileTool( const std::string&, const std::string&, const IInterface*); + + /// Initialize + virtual StatusCode initialize(); + + /// Finalize + virtual StatusCode finalize(); + + /// Stream one event + virtual StatusCode StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* EventBuffer ) ; + + private: + + ServiceHandle<IOnlineEventDisplaysSvc> m_onlineEDsvc{this, "OnlineEventDisplaysSvc", "Online Event Displays Service"}; + + Gaudi::Property<bool> m_isOnline {this, "IsOnline", false, "If running at point 1"}; + + /** Prefix put in front of JiveXML file name */ + std::string m_FileNamePrefix; + + /** Suffix put at the end of the file name (including type)*/ + std::string m_FileNameSuffix; + + /** Generate a file name */ + std::string MakeFileName( const unsigned long EventNumber, const unsigned int RunNumber ) const; + + /** Creates a new output stream to write XML to */ + StatusCode NewFile( const unsigned long EventNumber, const unsigned int RunNumber, std::ofstream *& outFile ) const ; + + /** Closes output stream */ + StatusCode CloseFile( std::ofstream *& outFile ) const ; + }; } //Namespace diff --git a/graphics/JiveXML/JiveXML/StreamToServerTool.h b/graphics/JiveXML/JiveXML/StreamToServerTool.h index 88525d7d8fcf7bfba6ca51e31648d05483ff3b2b..b9f69cfa885c84239e7a81dd46c137749bca6685 100644 --- a/graphics/JiveXML/JiveXML/StreamToServerTool.h +++ b/graphics/JiveXML/JiveXML/StreamToServerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #ifndef JIVEXML__STREAMTOSERVERTOOL_H @@ -11,9 +11,10 @@ #include "JiveXML/EventStream.h" #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ServiceHandle.h" +#include "EventDisplaysOnline/IOnlineEventDisplaysSvc.h" namespace JiveXML { - + /** * Stream event to an IServerSvc, which typically is a network server run from * and controlled by the Athena application. A stream name is attached to the @@ -23,29 +24,29 @@ namespace JiveXML { */ class StreamToServerTool : virtual public IStreamTool, public AthAlgTool{ - public: - - /// Constructor - StreamToServerTool( const std::string&, const std::string&, const IInterface*); + public: + + /// Constructor + StreamToServerTool( const std::string&, const std::string&, const IInterface*); - /// Initialize - virtual StatusCode initialize(); - - /// Finalize - virtual StatusCode finalize(); + /// Initialize + virtual StatusCode initialize(); - /// Stream one event - virtual StatusCode StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* const EventBuffer ) ; + /// Finalize + virtual StatusCode finalize(); - protected: + /// Stream one event + virtual StatusCode StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* const EventBuffer ) ; - /// Handle to the server that this tools shall stream events to - ServiceHandle<IServerSvc> m_ServerSvc; + protected: - private: + /// Handle to the server that this tools shall stream events to + ServiceHandle<IServerSvc> m_ServerSvc; + ServiceHandle<IOnlineEventDisplaysSvc> m_onlineEDsvc{this, "OnlineEventDisplaysSvc", "Online Event Displays Service"}; + private: - /** Stream name under which these events shall appear */ - std::string m_StreamName; + /** Stream name under which these events shall appear */ + std::string m_StreamName; }; diff --git a/graphics/JiveXML/python/ExternalONCRPCServerSvcConfig.py b/graphics/JiveXML/python/ExternalONCRPCServerSvcConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..d6b4d51c5c2113866bac26ac916d5e306e9e5a83 --- /dev/null +++ b/graphics/JiveXML/python/ExternalONCRPCServerSvcConfig.py @@ -0,0 +1,14 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def ExternalONCRPCServerSvcCfg(flags): + + acc = ComponentAccumulator() + + serverService = CompFactory.JiveXML.ExternalONCRPCServerSvc(name="ExternalONCRPCServerSvc", Hostname = "pc-tdq-mon-29") + + acc.addService(serverService) + + return acc diff --git a/graphics/JiveXML/python/JiveXMLConfig.py b/graphics/JiveXML/python/JiveXMLConfig.py index a0008cf878882f901a6a09366ae2b1316a40c834..b09334df7e639a9834d26b562bae81141352b546 100644 --- a/graphics/JiveXML/python/JiveXMLConfig.py +++ b/graphics/JiveXML/python/JiveXMLConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -19,58 +19,62 @@ def getDataTypes(flags, haveRDO=False, readAOD=False): data_types = [] # These need to match the tools added later if flags.Detector.EnableID: # General ID types - data_types += ["JiveXML::SiSpacePointRetriever/SiSpacePointRetriever"] - data_types += ["JiveXML::SiClusterRetriever/SiClusterRetriever"] + if flags.Detector.GeometryPixel and flags.Detector.GeometrySCT: + data_types += ["JiveXML::SiSpacePointRetriever/SiSpacePointRetriever"] + data_types += ["JiveXML::SiClusterRetriever/SiClusterRetriever"] data_types += ["JiveXML::VertexRetriever/VertexRetriever"] # These options will retrieve any available collection of segments/tracks from storegate data_types += ["JiveXML::SegmentRetriever/SegmentRetriever"] data_types += ["JiveXML::TrackRetriever/TrackRetriever"] - if flags.Detector.EnablePixel: + if flags.Detector.EnablePixel and flags.Detector.GeometryPixel: data_types += ["JiveXML::PixelClusterRetriever/PixelClusterRetriever"] if haveRDO: data_types += ["JiveXML::PixelRDORetriever/PixelRDORetriever"] - if flags.Detector.EnableTRT: + if flags.Detector.EnableTRT and flags.Detector.GeometryTRT: data_types += ["JiveXML::TRTRetriever/TRTRetriever"] - if haveRDO and flags.Detector.EnableSCT: + if haveRDO and flags.Detector.EnableSCT and flags.Detector.GeometrySCT: data_types += ["JiveXML::SCTRDORetriever/SCTRDORetriever"] - # TODO this datatype is not yet understood by Atlantis - data_types += ["JiveXML::BeamSpotRetriever/BeamSpotRetriever"] + if not flags.OnlineEventDisplays.OfflineTest: + # TODO this datatype is not yet understood by Atlantis + data_types += ["JiveXML::BeamSpotRetriever/BeamSpotRetriever"] # Truth (from TruthJiveXML_DataTypes.py) if not readAOD: data_types += ["JiveXML::TruthTrackRetriever/TruthTrackRetriever"] data_types += ["JiveXML::TruthMuonTrackRetriever/TruthMuonTrackRetriever"] - if flags.Detector.EnableCalo: + if flags.Detector.EnableCalo and flags.Detector.GeometryCalo: # Taken from CaloJiveXML_DataTypes.py # TODO find correct flag and check the LArDigitRetriever is doing what we want it to do #if doLArDigits: #data_types += ["JiveXML::LArDigitRetriever/LArDigitRetriever"] #else: - data_types += ["JiveXML::CaloFCalRetriever/CaloFCalRetriever"] - data_types += ["JiveXML::CaloLArRetriever/CaloLArRetriever"] - data_types += ["JiveXML::CaloHECRetriever/CaloHECRetriever"] + if flags.Detector.EnableLAr and flags.Detector.GeometryLAr: + data_types += ["JiveXML::CaloFCalRetriever/CaloFCalRetriever"] + data_types += ["JiveXML::CaloHECRetriever/CaloHECRetriever"] + data_types += ["JiveXML::CaloLArRetriever/CaloLArRetriever"] #end of else - data_types += ["JiveXML::CaloMBTSRetriever/CaloMBTSRetriever"] - data_types += ["JiveXML::CaloTileRetriever/CaloTileRetriever"] + if flags.Detector.EnableMBTS and flags.Detector.GeometryMBTS: + data_types += ["JiveXML::CaloMBTSRetriever/CaloMBTSRetriever"] + if flags.Detector.EnableTile and flags.Detector.GeometryTile: + data_types += ["JiveXML::CaloTileRetriever/CaloTileRetriever"] data_types += ["JiveXML::CaloClusterRetriever/CaloClusterRetriever"] - if flags.Detector.EnableMuon: + if flags.Detector.EnableMuon and flags.Detector.GeometryMuon: # Taken from MuonJiveXML_DataTypes.py - if flags.Detector.EnableMDT: + if flags.Detector.EnableMDT and flags.Detector.GeometryMDT: data_types += ["JiveXML::MdtPrepDataRetriever/MdtPrepDataRetriever"] - if flags.Detector.EnableTGC: + if flags.Detector.EnableTGC and flags.Detector.GeometryTGC: data_types += ["JiveXML::TgcPrepDataRetriever/TgcPrepDataRetriever"] - if flags.Detector.EnableRPC: + data_types += ["JiveXML::sTgcPrepDataRetriever/sTgcPrepDataRetriever"] + if flags.Detector.EnableRPC and flags.Detector.GeometryRPC: data_types += ["JiveXML::RpcPrepDataRetriever/RpcPrepDataRetriever"] - if flags.Detector.EnableCSC: + if flags.Detector.EnableCSC and flags.Detector.GeometryCSC: data_types += ["JiveXML::CSCClusterRetriever/CSCClusterRetriever"] data_types += ["JiveXML::CscPrepDataRetriever/CscPrepDataRetriever"] - if flags.Detector.EnablesTGC: - data_types += ["JiveXML::sTgcPrepDataRetriever/sTgcPrepDataRetriever"] - if flags.Detector.EnableMM: + if flags.Detector.EnableMM and flags.Detector.GeometryMM: data_types += ["JiveXML::MMPrepDataRetriever/MMPrepDataRetriever"] # TODO Not sure if below are still needed? # data_types += ["JiveXML::TrigMuonROIRetriever/TrigMuonROIRetriever"] @@ -104,18 +108,19 @@ def InDetRetrieversCfg(flags): result = ComponentAccumulator() # Do we need to add equivalent of InDetFlags.doSlimming=False (in JiveXML_RecEx_config.py)? If so, why? # Following is based on InDetJiveXML_DataTypes.py and TrkJiveXML_DataTypes.py - if flags.Detector.EnablePixel: + if flags.Detector.EnablePixel and flags.Detector.GeometryPixel: result.merge(PixelClusterRetrieverCfg(flags)) - if flags.Detector.EnableID: - result.merge(SiClusterRetrieverCfg(flags)) - result.merge(SiSpacePointRetrieverCfg(flags)) - result.merge(TrackRetrieverCfg(flags)) + if flags.Detector.EnableID and flags.Detector.GeometryID and flags.Detector.EnablePixel and flags.Detector.GeometryPixel and flags.Detector.EnableSCT and flags.Detector.GeometrySCT: + result.merge(SiClusterRetrieverCfg(flags)) + result.merge(SiSpacePointRetrieverCfg(flags)) + result.merge(TrackRetrieverCfg(flags)) - if flags.Detector.EnableTRT: + if flags.Detector.EnableTRT and flags.Detector.GeometryTRT: result.merge(TRTRetrieverCfg(flags)) - result.merge(BeamSpotRetrieverCfg(flags)) + if not flags.OnlineEventDisplays.OfflineTest: + result.merge(BeamSpotRetrieverCfg(flags)) return result @@ -254,7 +259,7 @@ def CaloRetrieversCfg(flags, **kwargs): DoFCalDigit=False, ) ) - + else: result.addPublicTool( CompFactory.JiveXML.CaloFCalRetriever( @@ -269,6 +274,7 @@ def CaloRetrieversCfg(flags, **kwargs): name="CaloLArRetriever", DoLArCellDetails=False, DoBadLAr=False, + LArlCellThreshold = 500 if flags.OnlineEventDisplays.BeamSplashMode else 50, ) ) @@ -277,6 +283,7 @@ def CaloRetrieversCfg(flags, **kwargs): name="CaloHECRetriever", DoHECCellDetails=False, DoBadHEC=False, + HEClCellThreshold = 500 if flags.OnlineEventDisplays.BeamSplashMode else 50, ) ) @@ -284,7 +291,7 @@ def CaloRetrieversCfg(flags, **kwargs): CompFactory.JiveXML.CaloClusterRetriever(name = "CaloClusterRetriever",**kwargs ) ) - + result.addPublicTool( CompFactory.JiveXML.CaloTileRetriever( name = "CaloTileRetriever", @@ -312,20 +319,19 @@ def MuonRetrieversCfg(flags, **kwargs): result = ComponentAccumulator() #kwargs.setdefault("StoreGateKey", "MDT_DriftCircles") - if flags.Detector.EnableMuon: + if flags.Detector.EnableMuon and flags.Detector.GeometryMuon: # Taken from MuonJiveXML_DataTypes.py - if flags.Detector.EnableMDT: + if flags.Detector.EnableMDT and flags.Detector.GeometryMDT: result.addPublicTool(CompFactory.JiveXML.MdtPrepDataRetriever(name="MdtPrepDataRetriever"), **kwargs) - if flags.Detector.EnableTGC: + if flags.Detector.EnableTGC and flags.Detector.GeometryTGC: result.addPublicTool(CompFactory.JiveXML.TgcPrepDataRetriever(name="TgcPrepDataRetriever"), **kwargs) - if flags.Detector.EnableRPC: + result.addPublicTool(CompFactory.JiveXML.sTgcPrepDataRetriever(name="sTgcPrepDataRetriever"), **kwargs) + if flags.Detector.EnableRPC and flags.Detector.GeometryRPC: result.addPublicTool(CompFactory.JiveXML.RpcPrepDataRetriever(name="RpcPrepDataRetriever"), **kwargs) - if flags.Detector.EnableCSC: + if flags.Detector.EnableCSC and flags.Detector.GeometryCSC: result.addPublicTool(CompFactory.JiveXML.CSCClusterRetriever(name="CSCClusterRetriever"), **kwargs) result.addPublicTool(CompFactory.JiveXML.CscPrepDataRetriever(name="CscPrepDataRetriever"), **kwargs) - if flags.Detector.EnablesTGC: - result.addPublicTool(CompFactory.JiveXML.sTgcPrepDataRetriever(name="sTgcPrepDataRetriever"), **kwargs) - if flags.Detector.EnableMM: + if flags.Detector.EnableMM and flags.Detector.GeometryMM: result.addPublicTool(CompFactory.JiveXML.MMPrepDataRetriever(name="MMPrepDataRetriever"), **kwargs) # TODO Not sure if below are still needed? # data_types += ["JiveXML::TrigMuonROIRetriever/TrigMuonROIRetriever"] @@ -427,7 +433,7 @@ def TriggerRetrieversCfg(flags): #--- TriggerInfo (Etmiss, etc) result.addPublicTool( CompFactory.JiveXML.TriggerInfoRetriever( - name="TriggerInfoRetriever" + name="TriggerInfoRetriever" ) ) @@ -457,7 +463,7 @@ def TriggerRetrieversCfg(flags): ) return result -def AlgoJiveXMLCfg(flags, name="MuonCombinePatternTool", **kwargs): +def AlgoJiveXMLCfg(flags, name="AlgoJiveXML", **kwargs): # This is based on a few old-style configuation files: # JiveXML_RecEx_config.py # JiveXML_jobOptionBase.py @@ -465,7 +471,6 @@ def AlgoJiveXMLCfg(flags, name="MuonCombinePatternTool", **kwargs): kwargs.setdefault("AtlasRelease", getATLASVersion()) kwargs.setdefault("WriteToFile", True) - kwargs.setdefault("OnlineMode", False) ### Enable this to recreate the geometry XML files for Atlantis kwargs.setdefault("WriteGeometry", False) @@ -481,13 +486,13 @@ def AlgoJiveXMLCfg(flags, name="MuonCombinePatternTool", **kwargs): result.merge(TruthTrackRetrieverCfg(flags)) if haveRDO or readESD: - if flags.Detector.EnableID: + if flags.Detector.EnableID and flags.Detector.GeometryID: result.merge(InDetRetrieversCfg(flags)) - if flags.Detector.EnableCalo: + if flags.Detector.EnableCalo and flags.Detector.GeometryCalo: result.merge(CaloRetrieversCfg(flags)) - if flags.Detector.EnableMuon: + if flags.Detector.EnableMuon and flags.Detector.GeometryMuon: result.merge(MuonRetrieversCfg(flags)) result.merge(xAODRetrieversCfg(flags)) diff --git a/graphics/JiveXML/python/OnlineStreamToFileConfig.py b/graphics/JiveXML/python/OnlineStreamToFileConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..e5ebe1d8693311274f9df33d4b901c24c6e54df4 --- /dev/null +++ b/graphics/JiveXML/python/OnlineStreamToFileConfig.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def OnlineStreamToFileCfg(flags,name='OnlineStreamToFileTool', **kwargs): + acc = ComponentAccumulator() + + if "OnlineEventDisplaysSvc" not in kwargs: + from EventDisplaysOnline.OnlineEventDisplaysSvcConfig import OnlineEventDisplaysSvcCfg + acc.merge(OnlineEventDisplaysSvcCfg(flags)) + kwargs.setdefault("OnlineEventDisplaysSvc", acc.getService("OnlineEventDisplaysSvc")) + + kwargs.setdefault("IsOnline", True) + + streamToFileTool = CompFactory.JiveXML.StreamToFileTool(name, **kwargs) + acc.setPrivateTools(streamToFileTool) + return acc diff --git a/graphics/JiveXML/python/OnlineStreamToServerConfig.py b/graphics/JiveXML/python/OnlineStreamToServerConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..3b41e8f19801206e2321641dec9f9296a655ec7b --- /dev/null +++ b/graphics/JiveXML/python/OnlineStreamToServerConfig.py @@ -0,0 +1,25 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def OnlineStreamToServerCfg(flags, name='OnlineStreamToFileTool', **kwargs): + acc = ComponentAccumulator() + + if "ExternalONCRPCServerSvc" not in kwargs: + from JiveXML.ExternalONCRPCServerSvcConfig import ExternalONCRPCServerSvcCfg + acc.merge(ExternalONCRPCServerSvcCfg(flags)) + kwargs.setdefault("ExternalONCRPCServerSvc", acc.getService("ExternalONCRPCServerSvc")) + + if "OnlineEventDisplaysSvc" not in kwargs: + from EventDisplaysOnline.OnlineEventDisplaysSvcConfig import OnlineEventDisplaysSvcCfg + acc.merge(OnlineEventDisplaysSvcCfg(flags)) + kwargs.setdefault("OnlineEventDisplaysSvc", acc.getService("OnlineEventDisplaysSvc")) + + kwargs.setdefault("StreamName", ".Unknown") + + streamToServerTool = CompFactory.JiveXML.StreamToServerTool(name, **kwargs) + + acc.setPrivateTools(streamToServerTool) + + return acc diff --git a/graphics/JiveXML/src/AlgoJiveXML.cxx b/graphics/JiveXML/src/AlgoJiveXML.cxx index dceae1add241f4e7272f8a10b10af016216f8317..c60893901d1682ccfe85557f98e20636bc0fe8b3 100755 --- a/graphics/JiveXML/src/AlgoJiveXML.cxx +++ b/graphics/JiveXML/src/AlgoJiveXML.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "JiveXML/AlgoJiveXML.h" @@ -7,6 +7,7 @@ #include "JiveXML/IGeometryWriter.h" #include "JiveXML/XMLFormatTool.h" #include "JiveXML/StreamToFileTool.h" +#include "JiveXML/StreamToServerTool.h" #include "xAODEventInfo/EventInfo.h" @@ -18,30 +19,7 @@ namespace JiveXML{ AlgoJiveXML::AlgoJiveXML(const std::string& name, ISvcLocator* pSvcLocator) : - AthAlgorithm(name, pSvcLocator) { - - //Configurable properties - declareProperty("AtlasRelease" ,m_AtlasRelease = "unknown", "The Athena release number"); - declareProperty("DataTypes" ,m_dataTypes, "List of data retriever names to be run"); - declareProperty("WriteToFile" ,m_writeToFile = true, "Whether XML files shall be produced"); - declareProperty("OnlineMode" ,m_onlineMode = false, "Whether an XMLRPC server shall be started"); - declareProperty("WriteGeometry" ,m_writeGeometry = false, "Whether Geometry-XML files shall be produced"); - declareProperty("GeometryVersion" ,m_geometryVersionIn = "default", "Geometry version as read from Athena"); - declareProperty("GeometryWriterTools",m_GeoWriterNames, "The names of the geometry-writer tools"); - - /// Default list of geometries to write - m_GeoWriterNames.push_back("JiveXML::GeometryWriter/GeometryWriter"); - m_GeoWriterNames.push_back("JiveXML::MuonGeometryWriter/MuonGeometryWriter"); - - //Array of tools that retrieve the data, set public and createIf as default - declareProperty("DataRetrievers", m_DataRetrievers = ToolHandleArray<IDataRetriever>( NULL ,true)); - - //Generate XMLFormatTool as default privat format tool - declareProperty("FormatTool", m_FormatTool = ToolHandle<IFormatTool>("JiveXML::XMLFormatTool/XMLFormatTool",this)); - - //Array of tools for streaming events, set public and createIf as default - declareProperty("StreamTools", m_StreamTools = ToolHandleArray<IStreamTool>(NULL,true)); - } + AthAlgorithm(name, pSvcLocator) {} /** * Initialize - called once in the beginning @@ -49,8 +27,7 @@ namespace JiveXML{ * - Get GeometryWriters and write geometry if asked for * - Get the formatting tool * - Get the data retrievers - * - Get the streaming tools, including defaults if asked for - */ + * - Get the streaming tools, including defaults if asked for */ StatusCode AlgoJiveXML::initialize(){ //be verbose @@ -103,28 +80,20 @@ namespace JiveXML{ */ ATH_MSG_DEBUG("Retrieving streaming tools"); if (m_writeToFile){ - ATH_MSG_INFO("Adding default file streaming tool"); - m_StreamTools.push_back("JiveXML::StreamToFileTool/StreamToFileTool"); - } - if (m_onlineMode){ - ATH_MSG_INFO("Adding default XMLRPC streaming tool"); - m_StreamTools.push_back("JiveXML::XMLRPCStreamTool/XMLRPCStreamTool"); + ATH_MSG_INFO("Retrieving default file streaming tool"); + ATH_CHECK(m_StreamToFileTool.retrieve()); } - + ATH_MSG_INFO("online " << m_onlineMode); /// Get the streaming tools - if (m_StreamTools.size() == 0) { - ATH_MSG_WARNING("No streaming tools defined, events will be created but not stored!"); - } else { - if (m_StreamTools.retrieve().isFailure()){ - ATH_MSG_ERROR("Unable to retrieve streaming tools !"); - return StatusCode::FAILURE; - } - } + if (m_onlineMode){ + ATH_MSG_INFO("Retrieving default server streaming tool"); + ATH_CHECK(m_StreamToServerTool.retrieve()); + } /** - * Get the IDataRetrievers requested in the m_dataTypes list from the toolSvc + * Get the IDataRetrievers requested in the m_dataTypes list from the toolSvc * and store them in the ToolHandleArray - */ + */ ATH_MSG_DEBUG("Obtaining list of data retrievers"); /// Iteratate over the given data types @@ -149,6 +118,15 @@ namespace JiveXML{ ATH_MSG_INFO("Retrieving data from " << m_DataRetrievers.size() << " tools" ); + ATH_MSG_INFO("List property settings: "); + ATH_MSG_INFO("AtlasRelease: " << m_AtlasRelease); + ATH_MSG_INFO("DataTypes: " << m_dataTypes ); + ATH_MSG_INFO("WriteToFile: " << m_writeToFile); + ATH_MSG_INFO("OnlineMode: " << m_onlineMode); + ATH_MSG_INFO("WriteGeometry: " << m_writeGeometry); + ATH_MSG_INFO("GeometryVersion: " << m_geometryVersionIn); + ATH_MSG_INFO("GeoWriterNames: " << m_GeoWriterNames ); + return StatusCode::SUCCESS; } @@ -160,8 +138,8 @@ namespace JiveXML{ */ StatusCode AlgoJiveXML::execute() { - /** - * Firstly retrieve all the event header information + /** + * Firstly retrieve all the event header information */ //The run and event number of the current event unsigned int runNo = 0, lumiBlock = 0; @@ -182,7 +160,7 @@ namespace JiveXML{ return StatusCode::FAILURE; }else{ // Event/xAOD/xAODEventInfo/trunk/xAODEventInfo/versions/EventInfo_v1.h - ATH_MSG_VERBOSE(" xAODEventInfo: runNumber: " << eventInfo->runNumber() // is '222222' for mc events ? + ATH_MSG_DEBUG(" xAODEventInfo: runNumber: " << eventInfo->runNumber() // is '222222' for mc events ? << ", eventNumber: " << eventInfo->eventNumber() << ", mcChannelNumber: " << eventInfo->mcChannelNumber() << ", mcEventNumber: " << eventInfo->mcEventNumber() // MC: use this instead of runNumber @@ -192,33 +170,33 @@ namespace JiveXML{ << ", eventTypeBitmask: " << eventInfo->eventTypeBitmask() << ", actualInteractionsPerCrossing: " << eventInfo->actualInteractionsPerCrossing() << ", averageInteractionsPerCrossing: " << eventInfo->averageInteractionsPerCrossing() - ); + ); } // new treatment of mc_channel_number for mc12 // from: https://twiki.cern.ch/twiki/bin/viewauth/Atlas/PileupDigitization#Contents_of_Pileup_RDO unsigned int mcChannelNo = 0; bool firstEv = true; - + //+++ Get sub-event info object ATH_MSG_DEBUG( "Sub Event Infos: " ); for (const xAOD::EventInfo::SubEvent& subevt : eventInfo->subEvents()) { const xAOD::EventInfo* sevt = subevt.ptr(); if (sevt) { - if (firstEv){ - mcChannelNo = sevt->mcChannelNumber(); // the 'real' mc-channel - ATH_MSG_INFO( " mc_channel from SubEvent : " << sevt->mcChannelNumber() ); + if (firstEv){ + mcChannelNo = sevt->mcChannelNumber(); // the 'real' mc-channel + ATH_MSG_DEBUG( " mc_channel from SubEvent : " << sevt->mcChannelNumber() ); firstEv = false; } ATH_MSG_VERBOSE("Sub Event Info:\n Time : " << subevt.time() << " Index : " << subevt.index() << " Provenance : " << subevt.type() // This is the provenance stuff: signal, minbias, cavern, etc - << " Run Number : " << sevt->runNumber() - << " Event Number : " << sevt->eventNumber() - << " ns Offset : " << sevt->timeStampNSOffset() - << " Lumi Block : " << sevt->lumiBlock() - << " mc_channel : " << sevt->mcChannelNumber() - << " BCID : " << sevt->bcid() + << " Run Number : " << sevt->runNumber() + << " Event Number : " << sevt->eventNumber() + << " ns Offset : " << sevt->timeStampNSOffset() + << " Lumi Block : " << sevt->lumiBlock() + << " mc_channel : " << sevt->mcChannelNumber() + << " BCID : " << sevt->bcid() << " Geo version : " << m_geometryVersionIn ); } @@ -232,14 +210,14 @@ namespace JiveXML{ // Note: 4294967293 is the maximum value for a unsigned long if ( mcChannelNo != 0 ){ runNo = mcChannelNo + 140000000; } // indicating 'mc14' - ATH_MSG_INFO( " runNumber for filename: " << runNo << ", eventNumber: " << eventNo); + ATH_MSG_DEBUG( " runNumber for filename: " << runNo << ", eventNumber: " << eventNo); if ( eventInfo->lumiBlock() ){ lumiBlock = eventInfo->lumiBlock(); - }else{ - lumiBlock = -1; // placeholder - } - if ( mcChannelNo != 0 ) lumiBlock = -1; // mask for mc11a + }else{ + lumiBlock = -1; // placeholder + } + if ( mcChannelNo != 0 ) lumiBlock = -1; // mask for mc11a // lumiBlock from mc can be just huge number, ignore then if ( lumiBlock > 1000000 ) { lumiBlock = 0; } @@ -257,7 +235,7 @@ namespace JiveXML{ struct tm utctime; gmtime_r(&unixtime, &utctime); found1 = (DataType(dateTime).toString().find("CEST")); - found2 = (DataType(dateTime).toString().find("CET")); + found2 = (DataType(dateTime).toString().find("CET")); if ( int(found1)<0 && int(found2)<0 ){ // not found is -1 strftime(dateTime, 32, "%Y-%m-%d %H:%M:%S UTC", &utctime); ATH_MSG_DEBUG( " TIME NOT CET/CEST. Adjusted to:" << dateTime ); @@ -276,8 +254,8 @@ namespace JiveXML{ } /** - * Now iterate over all the IDataRetrievers and - * write their data to the xml file by giving it the XMLWriter + * Now iterate over all the IDataRetrievers and + * write their data to the xml file by giving it the XMLWriter */ ATH_MSG_DEBUG("Starting loop over data retrievers" ); //Loop over data retrievers @@ -294,8 +272,8 @@ namespace JiveXML{ //Only catch std::exception } catch ( std::exception& ex ){ //Now show some message - ATH_MSG_FATAL("Caught exception in " << (*DataRetrieverItr)->name() - << " while retrieving data for " << (*DataRetrieverItr)->dataTypeName() + ATH_MSG_FATAL("Caught exception in " << (*DataRetrieverItr)->name() + << " while retrieving data for " << (*DataRetrieverItr)->dataTypeName() << " : " << ex.what() ); //and return with an error return StatusCode::FAILURE; @@ -314,16 +292,18 @@ namespace JiveXML{ /** * Now stream the events to all registered streaming tools */ - ATH_MSG_DEBUG( "Starting loop over event streamers" ); - //Loop over streaming tools - ToolHandleArray<IStreamTool>::iterator StreamToolsItr = m_StreamTools.begin(); - for ( ; StreamToolsItr != m_StreamTools.end(); ++StreamToolsItr ){ - ATH_MSG_INFO("Streaming event to " << (*StreamToolsItr)->name() ); - if ( (*StreamToolsItr)->StreamEvent(eventNo, runNo, m_FormatTool->getFormattedEvent()).isFailure() ){ - ATH_MSG_WARNING( "Could not stream event to " << (*StreamToolsItr)->name() ); - } + if(m_writeToFile){ + ATH_MSG_DEBUG("Streaming event to file"); + if ( (m_StreamToFileTool->StreamEvent(eventNo, runNo, m_FormatTool->getFormattedEvent()).isFailure() )){ + ATH_MSG_WARNING( "Could not stream event to file" ); + } + } + if(m_onlineMode){ + ATH_MSG_DEBUG("Streaming event to server"); + if ( (m_StreamToServerTool->StreamEvent(eventNo, runNo, m_FormatTool->getFormattedEvent()).isFailure() )){ + ATH_MSG_WARNING( "Could not stream event to server" ); + } } - ATH_MSG_DEBUG( "Finished loop over event streamers" ); return StatusCode::SUCCESS; } @@ -334,12 +314,13 @@ namespace JiveXML{ */ StatusCode AlgoJiveXML::finalize() { - ATH_MSG_VERBOSE( "finalize()" ); + ATH_MSG_VERBOSE( "finalize()" ); /// Release all the tools m_DataRetrievers.release().ignore(); m_FormatTool.release().ignore(); - m_StreamTools.release().ignore(); + m_StreamToFileTool.release().ignore(); + m_StreamToServerTool.release().ignore(); return StatusCode::SUCCESS; } diff --git a/graphics/JiveXML/src/StreamToFileTool.cxx b/graphics/JiveXML/src/StreamToFileTool.cxx index 0d74148f8b099d1e35e6ace548e862f06be583a6..456db49c153b42ffe3f0db0c33c6ab9b8222038e 100644 --- a/graphics/JiveXML/src/StreamToFileTool.cxx +++ b/graphics/JiveXML/src/StreamToFileTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include <JiveXML/StreamToFileTool.h> @@ -10,13 +10,13 @@ namespace JiveXML { /** - * Constructor + * Constructor * - setup message service * - initialize properties */ StreamToFileTool::StreamToFileTool( const std::string& type , const std::string& name, const IInterface* p): AthAlgTool(type,name,p){ - + //Provide interface declareInterface<IStreamTool>(this); @@ -24,13 +24,19 @@ namespace JiveXML { declareProperty("FileNamePrefix", m_FileNamePrefix = "JiveXML"); /// The file name suffix declareProperty("FileNameSuffix", m_FileNameSuffix = ".xml"); + } /** * Intialize - called once at the beginning */ StatusCode StreamToFileTool::initialize(){ - + if(m_isOnline){ + if(m_onlineEDsvc.retrieve().isFailure()){ + ATH_MSG_ERROR("Could not locate the online event displays service"); + return StatusCode::FAILURE; + } + } return StatusCode::SUCCESS; } @@ -47,27 +53,27 @@ namespace JiveXML { * @param RunNumber the run number * @param EventBuffer the string holding the complete event */ - StatusCode StreamToFileTool::StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* EventBuffer ) { - + StatusCode StreamToFileTool::StreamEvent( const unsigned long EventNumber, const unsigned int RunNumber, const std::ostringstream* EventBuffer ) { + if(m_isOnline){ + m_FileNamePrefix = m_onlineEDsvc->getFileNamePrefix(); + ATH_MSG_DEBUG("m_FileNamePrefix: " << m_FileNamePrefix << " EventNumber: " << EventNumber); + } /// Get a pointer to a new file std::ofstream* outFile; StatusCode sc = NewFile(EventNumber,RunNumber,outFile); if (sc.isFailure()){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not open file for event " - << EventNumber << " from run " << RunNumber << endmsg; + ATH_MSG_WARNING("Could not open file for event " << EventNumber << " from run " << RunNumber); return sc; } - - /// Stream this event into the file + /// Stream this event into the file (*outFile) << EventBuffer->str(); outFile->flush(); /// Check wether we could write the event if (!outFile->good()){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Could not write event " - << EventNumber << " from run " << RunNumber << endmsg; + ATH_MSG_WARNING("Could not open file for event " << EventNumber << " from run " << RunNumber); return StatusCode::FAILURE; } - + /// Finally close the file sc = CloseFile(outFile); return sc; @@ -79,33 +85,33 @@ namespace JiveXML { * @param EventNumber the event number * @param RunNumber the run number */ - std::string StreamToFileTool::MakeFileName( const unsigned long EventNumber, const unsigned int RunNumber) const { + std::string StreamToFileTool::MakeFileName(const unsigned long EventNumber, const unsigned int RunNumber) const { //Generate a the return string with file prefix std::ostringstream name; - + //Assemble file name name << m_FileNamePrefix << std::setfill('0'); name << "_" << std::setw(5) << RunNumber; name << "_" << std::setw(5) << EventNumber; - name << m_FileNameSuffix; + name << m_FileNameSuffix; return name.str(); } - /** + /** * Open a new file */ StatusCode StreamToFileTool::NewFile( const unsigned long EventNumber, const unsigned int RunNumber, std::ofstream *& outputFile) const { - + // Generate the file name std::string filename = MakeFileName(EventNumber,RunNumber); // create a new output stream outputFile = new std::ofstream(filename.c_str()); - + ATH_MSG_DEBUG("outputFile "<< filename); // check if it worked if ( !(outputFile->good()) ){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to create output file with name " << filename << endmsg; + ATH_MSG_WARNING("Unable to create output file with name " << filename); return StatusCode::FAILURE; } @@ -113,16 +119,16 @@ namespace JiveXML { } /** - * Close the file - */ + * Close the file + */ StatusCode StreamToFileTool::CloseFile( std::ofstream *& outputFile ) const { //Try to close the file outputFile->close(); - + //See if it worked if (!outputFile->good()){ - if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Unable to close file" << endmsg; + ATH_MSG_WARNING("Unable to close file"); } //In any case delete object diff --git a/graphics/JiveXML/src/StreamToServerTool.cxx b/graphics/JiveXML/src/StreamToServerTool.cxx index 8917a9358b4060ce20873595ec55ded919c1ffd7..0d61e61db4cbea3e86c89e69a0ddcf704144203e 100644 --- a/graphics/JiveXML/src/StreamToServerTool.cxx +++ b/graphics/JiveXML/src/StreamToServerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include <JiveXML/StreamToServerTool.h> @@ -7,14 +7,14 @@ namespace JiveXML { /** - * Constructor + * Constructor * - setup message service * - initialize properties */ StreamToServerTool::StreamToServerTool( const std::string& type , const std::string& name, const IInterface* p): AthAlgTool(type,name,p), m_ServerSvc("JiveXML::ONCRPCServerSvc",name){ - + //Provide interface declareInterface<IStreamTool>(this); @@ -29,9 +29,14 @@ namespace JiveXML { */ StatusCode StreamToServerTool::initialize(){ - //Make sure we can get hold of the server + //Make sure we can get hold of the server and the online event displays service if (m_ServerSvc.retrieve().isFailure()){ - if (msgLvl(MSG::ERROR)) msg(MSG::ERROR) << "Unable to initialize server service with name " << m_ServerSvc.name() << endmsg; + ATH_MSG_ERROR("Unable to initialize server service with name " << m_ServerSvc.name()); + return StatusCode::FAILURE; + } + + if( m_onlineEDsvc.retrieve().isFailure()){ + ATH_MSG_ERROR("Could not locate the online event displays service"); return StatusCode::FAILURE; } @@ -51,13 +56,14 @@ namespace JiveXML { * @param RunNumber the run number * @param EventBuffer the string holding the complete event */ - StatusCode StreamToServerTool::StreamEvent( const unsigned long EventNumber, - const unsigned int RunNumber, - const std::ostringstream* const EventBuffer ) { - if (msgLvl(MSG::VERBOSE)) msg(MSG::VERBOSE) << "Streaming event Nr. " << EventNumber - << " from run Nr. " << RunNumber - << " to stream " << m_StreamName - << " on " << m_ServerSvc.name() << " service" << endmsg; + StatusCode StreamToServerTool::StreamEvent( const unsigned long EventNumber, + const unsigned int RunNumber, + const std::ostringstream* const EventBuffer ) { + m_StreamName = m_onlineEDsvc->getStreamName(); + ATH_MSG_VERBOSE("Streaming event Number " << EventNumber + << " from run Number " << RunNumber + << " to stream " << m_StreamName + << " on " << m_ServerSvc.name() << " service"); /// Create an EventStreamID for this event EventStreamID evtStreamID(EventNumber,RunNumber,m_StreamName); diff --git a/graphics/JiveXML/src/components/JiveXML_entries.cxx b/graphics/JiveXML/src/components/JiveXML_entries.cxx index 783e60e0b466de3a705c76b6631c16054811292a..254a60e96629cda79425406fb2053f164c92ab83 100644 --- a/graphics/JiveXML/src/components/JiveXML_entries.cxx +++ b/graphics/JiveXML/src/components/JiveXML_entries.cxx @@ -1,3 +1,4 @@ +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration #include "JiveXML/AlgoJiveXML.h" #include "JiveXML/StreamToFileTool.h" #include "JiveXML/StreamToServerTool.h" diff --git a/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt b/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt index a85ce8aeb7037bac0880a62f4c004bc2c1b08925..877316718a6cfaf5eabfe8bae30948c92f9beddd 100644 --- a/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt +++ b/graphics/VP1/VP1AlgsEventProd/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( VP1AlgsEventProd ) @@ -7,4 +7,6 @@ atlas_subdir( VP1AlgsEventProd ) atlas_add_component( VP1AlgsEventProd VP1AlgsEventProd/*.h src/*.cxx src/components/*.cxx LINK_LIBRARIES AthenaBaseComps GaudiKernel PathResolver - VP1UtilsBase ) + VP1UtilsBase EventDisplaysOnlineLib) + +atlas_install_python_modules( python/*.py) diff --git a/graphics/VP1/VP1AlgsEventProd/VP1AlgsEventProd/VP1EventProd.h b/graphics/VP1/VP1AlgsEventProd/VP1AlgsEventProd/VP1EventProd.h index 49ac9fba42c1b1dbc2646e4f26e3a5ad267659a6..57c63ac17223d93afad474055b96747f1eab33cc 100755 --- a/graphics/VP1/VP1AlgsEventProd/VP1AlgsEventProd/VP1EventProd.h +++ b/graphics/VP1/VP1AlgsEventProd/VP1AlgsEventProd/VP1EventProd.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////// @@ -11,12 +11,12 @@ // // // This is the Athena algorithm starting the production // // of event files for VP1 Live, the online 3D event // -// display at P1. +// display at P1. // // Major updates: // - 2022 Apr, Riccardo Maria BIANCHI <riccardo.maria.bianchi@cern.ch> // Fixed the bug with large event numbers, moving to 'unsigned long long' -// +// ///////////////////////////////////////////////////////////// #ifndef VP1ALGS_VP1EVENTPROD @@ -24,10 +24,13 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/IIncidentListener.h" +#include "GaudiKernel/ServiceHandle.h" +#include "EventDisplaysOnline/IOnlineEventDisplaysSvc.h" + #include <string> class VP1EventProd: public AthAlgorithm, - public IIncidentListener + public IIncidentListener { public: VP1EventProd(const std::string& name, ISvcLocator* pSvcLocator); @@ -40,10 +43,14 @@ class VP1EventProd: public AthAlgorithm, void handle(const Incident& inc); private: + + Gaudi::Property<bool> m_isOnline {this, "IsOnline", false, "If running at point 1"}; + ServiceHandle<IOnlineEventDisplaysSvc> m_onlineEDsvc{this, "OnlineEventDisplaysSvc", "Online Event Displays Service"}; + // run/event number to be used in the vp1 event file name unsigned long m_runNumber; unsigned long long m_eventNumber; - + unsigned long m_timeStamp; std::string m_humanTimestamp; std::string m_outputFileType; diff --git a/graphics/VP1/VP1AlgsEventProd/python/VP1AlgsEventProdConfig.py b/graphics/VP1/VP1AlgsEventProd/python/VP1AlgsEventProdConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..bd29f9e293be600f7148aaf1f6b3f30cf1871571 --- /dev/null +++ b/graphics/VP1/VP1AlgsEventProd/python/VP1AlgsEventProdConfig.py @@ -0,0 +1,21 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory + +def VP1AlgsEventProdCfg(flags, StreamESD, **kwargs): + + acc = ComponentAccumulator() + + if "OnlineEventDisplaysSvc" not in kwargs: + from EventDisplaysOnline.OnlineEventDisplaysSvcConfig import OnlineEventDisplaysSvcCfg + acc.merge(OnlineEventDisplaysSvcCfg(flags)) + kwargs.setdefault("OnlineEventDisplaysSvc", acc.getService("OnlineEventDisplaysSvc")) + + kwargs.setdefault("InputPoolFile", StreamESD.OutputFile) + kwargs.setdefault("IsOnline", True) + kwargs.setdefault("MaxNumberOfFiles", -1) + vp1Alg = CompFactory.VP1EventProd(name="VP1AlgsEventProd", **kwargs) + acc.addEventAlgo(vp1Alg, primary=True) + + return acc diff --git a/graphics/VP1/VP1AlgsEventProd/src/VP1EventProd.cxx b/graphics/VP1/VP1AlgsEventProd/src/VP1EventProd.cxx index 37fa9467b57c7aca932394123fec20b992bd8ba3..6b49e45d4cb4538f9920e72a50effc9af330467f 100755 --- a/graphics/VP1/VP1AlgsEventProd/src/VP1EventProd.cxx +++ b/graphics/VP1/VP1AlgsEventProd/src/VP1EventProd.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ #include "VP1AlgsEventProd/VP1EventProd.h" @@ -48,7 +48,7 @@ VP1EventProd::~VP1EventProd() StatusCode VP1EventProd::initialize() { - ATH_MSG_INFO(" in initialize() "); + ATH_MSG_DEBUG(" in initialize() "); StatusCode result = StatusCode::SUCCESS; @@ -61,6 +61,13 @@ StatusCode VP1EventProd::initialize() else incsvc->addListener(this, "BeginEvent", 0); + if(m_isOnline){ + if( m_onlineEDsvc.retrieve().isFailure()){ + ATH_MSG_ERROR("Could not locate the online event displays service"); + return StatusCode::FAILURE; + } + } + return result; } @@ -68,26 +75,35 @@ StatusCode VP1EventProd::execute() { ATH_MSG_DEBUG(" in execute(). Nothing to do here..."); + if(m_isOnline){ + m_destinationDir = m_onlineEDsvc->getEntireOutputStr(); + } + return StatusCode::SUCCESS; } StatusCode VP1EventProd::finalize() { - ATH_MSG_INFO("in finalize() "); + ATH_MSG_DEBUG("in finalize() "); + if(m_isOnline){ + m_destinationDir = m_onlineEDsvc->getEntireOutputStr(); + } + + ATH_MSG_DEBUG("VP1ALG m_destinationDir " << m_destinationDir); // handle the output of the last event if(m_nEvent) { --m_nEvent; // since we don't use another call to handle() to process the last event, we need to revert the counter by one, otherwise the wrong file is looked for - ATH_MSG_INFO("--> Input POOL file: " << m_inputPoolFile); + ATH_MSG_DEBUG("--> Input POOL file: " << m_inputPoolFile); std::ostringstream ostri; ostri << m_inputPoolFile << "._" << std::setw(4) << std::setfill('0') << m_nEvent; std::string inputFileName = ostri.str(); ATH_MSG_DEBUG("copying the input file: '"<< inputFileName << "'..."); - + ATH_MSG_DEBUG("VP1 alg event number: " << m_eventNumber); try { /* clean the output directory if m_maxProducedFiles == 0 @@ -105,16 +121,22 @@ StatusCode VP1EventProd::finalize() ATH_MSG_WARNING("In finalize() -- Unable to produce new VP1 event file"); } } - + return StatusCode::SUCCESS; } -void VP1EventProd::handle(const Incident& inc) +void VP1EventProd::handle(const Incident& inc) { - ATH_MSG_INFO("in handle()... "); - ATH_MSG_INFO("Handling incident '" << inc.type() << "'"); + ATH_MSG_DEBUG("in handle()... "); + ATH_MSG_DEBUG("Handling incident '" << inc.type() << "'"); + + if(m_isOnline){ + m_destinationDir = m_onlineEDsvc->getEntireOutputStr(); + } + + ATH_MSG_DEBUG("VP1ALG m_destinationDir " << m_destinationDir); // Let VP1FileUtilities handle the output of the previous event. // Skip this if m_nEvent == 0, @@ -125,8 +147,7 @@ void VP1EventProd::handle(const Incident& inc) unsigned int nLastFile = m_nEvent - 1; // we copy the file produced while processing the previous event, so we need a file number of (current - 1) - ATH_MSG_INFO("--> Input POOL file: " << m_inputPoolFile); - + ATH_MSG_DEBUG("--> Input POOL file: " << m_inputPoolFile); std::ostringstream ostri; ostri << m_inputPoolFile << "._" << std::setw(4) << std::setfill('0') << nLastFile; @@ -196,4 +217,3 @@ void VP1EventProd::handle(const Incident& inc) ATH_MSG_DEBUG("'human readable' timestamp: " << m_humanTimestamp); } - diff --git a/graphics/VP1/VP1AlgsEventProd/src/components/VP1AlgsEventProd_entries.cxx b/graphics/VP1/VP1AlgsEventProd/src/components/VP1AlgsEventProd_entries.cxx index e9e5aff52c41c60ca3a5e96f9776f4fd40e8e7e8..c2718a69959bda3a80a54f4cd1ea8e47cc59c8e9 100644 --- a/graphics/VP1/VP1AlgsEventProd/src/components/VP1AlgsEventProd_entries.cxx +++ b/graphics/VP1/VP1AlgsEventProd/src/components/VP1AlgsEventProd_entries.cxx @@ -1,3 +1,4 @@ +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration #include "VP1AlgsEventProd/VP1EventProd.h" DECLARE_COMPONENT( VP1EventProd ) diff --git a/graphics/VP1/VP1UtilsBase/CMakeLists.txt b/graphics/VP1/VP1UtilsBase/CMakeLists.txt index 9ad2a7110b1b20ebf28dca7e25bc501d673d5f33..04583a77de2c928f87ba4e91726a0770d87d0d98 100644 --- a/graphics/VP1/VP1UtilsBase/CMakeLists.txt +++ b/graphics/VP1/VP1UtilsBase/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration # Declare the package name: atlas_subdir( VP1UtilsBase ) diff --git a/graphics/VP1/VP1UtilsBase/VP1UtilsBase/VP1FileUtilities.h b/graphics/VP1/VP1UtilsBase/VP1UtilsBase/VP1FileUtilities.h index 8398094a41b0d06ddff3e9985e71d06a2610b9b4..b382b9733f42b5e6cfcdad273fd2139961269bd7 100644 --- a/graphics/VP1/VP1UtilsBase/VP1UtilsBase/VP1FileUtilities.h +++ b/graphics/VP1/VP1UtilsBase/VP1UtilsBase/VP1FileUtilities.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////// @@ -34,7 +34,7 @@ public: // * Writing: maximum number of files to keep in 'inputDirectory' // * Reading: maximum number of files to keep in 'copyDirectory' (see below) VP1FileUtilities(const std::string& inputDirectory, - unsigned int fileLimit, const std::string& outputDir = "", bool forceMakeOutputDir = false, bool removeInputFile = true); + unsigned int fileLimit, const std::string& outputDir = "", bool forceMakeOutputDir = false, bool removeInputFile = true); virtual ~VP1FileUtilities(); // @@ -48,9 +48,9 @@ public: // After that, if the total number of files in the 'inputDirectory' is > fileLimit then the oldest // vp1 event file is deleted. void produceNewFile(const std::string& sourceFile, - unsigned int runNumber, - unsigned long long eventNumber, - unsigned int timeStamp, + unsigned int runNumber, + unsigned long long eventNumber, + unsigned int timeStamp, const std::string& textLabel = ""); // **** Check if file exists **** diff --git a/graphics/VP1/VP1UtilsBase/src/VP1FileUtilities.cxx b/graphics/VP1/VP1UtilsBase/src/VP1FileUtilities.cxx index 9f93f5c655e7ce12a4ae0538c4af694c47b5a7d0..4b31a10ed95a33e2471aa20ac8aec14793011962 100644 --- a/graphics/VP1/VP1UtilsBase/src/VP1FileUtilities.cxx +++ b/graphics/VP1/VP1UtilsBase/src/VP1FileUtilities.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////// @@ -65,14 +65,15 @@ VP1FileUtilities::~VP1FileUtilities() } void VP1FileUtilities::produceNewFile(const std::string& sourceFile, - unsigned int runNumber, - unsigned long long eventNumber, - unsigned int timeStamp, + unsigned int runNumber, + unsigned long long eventNumber, + unsigned int timeStamp, const std::string& textLabel) { // Check if the sourceFile exists QString srcName(sourceFile.c_str()); QFile srcFile(srcName); + if(!srcFile.exists()) throw std::runtime_error("Source file does not exist!"); @@ -116,46 +117,40 @@ void VP1FileUtilities::produceNewFile(const std::string& sourceFile, throw std::runtime_error("VP1FileUtilities -- Unable to copy the temp file to the new file, so unable to produce the new vp1 event file"); } - - // the operation to time (for elapsed time) - char ch; std::cout << '?' && std::cin >> ch ; - - - - // remove the input file (if not disabled by user) - std::cout << "VP1FileUtilities -- delete temp file? --> " << m_removeInputFile << std::endl; - if (m_removeInputFile) { - bool copyDone = false; - std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now() ; - typedef std::chrono::duration<int,std::milli> millisecs_t ; - while (!copyDone) { - - // get handle on new file - QFileInfo checkFile(newFileName); - - - // check if file exists (and it is a file, and not a directory) - if (checkFile.exists() && checkFile.isFile() && (checkFile.size() == inputSize) ) - { - std::cout << "VP1FileUtilities -- Size of the file to be deleted: " << checkFile.size() << std::endl; - copyDone = true; - if(!srcFile.remove()) - std::cerr << "VP1FileUtilities -- WARNING! Unable to delete " << sourceFile << std::endl; - } - else - { - std::cout << "VP1FileUtilities -- I could not find the output file, so probably the copy action is not finished yet. I'll wait for a short while and I will retry..." << std::endl; - std::this_thread::sleep_for(std::chrono::milliseconds(500)); //make the program waiting for 0.5 seconds - std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now() ; - millisecs_t duration( std::chrono::duration_cast<millisecs_t>(end-start) ) ; - if (duration.count() > 2000.0 ) - { - std::cout << "VP1FileUtilities -- WARNING!!! " << duration.count() << " milliseconds passed and still I cannot find the output file. Probably there was a problem. Giving up with the removal of the source file...\n" ; - copyDone = true; - } - } - } - } + // remove the input file (if not disabled by user) + std::cout << "VP1FileUtilities -- delete temp file? --> " << m_removeInputFile << std::endl; + if (m_removeInputFile) { + bool copyDone = false; + std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now() ; + typedef std::chrono::duration<int,std::milli> millisecs_t ; + while (!copyDone) { + + // get handle on new file + QFileInfo checkFile(newFileName); + + + // check if file exists (and it is a file, and not a directory) + if (checkFile.exists() && checkFile.isFile() && (checkFile.size() == inputSize) ) + { + std::cout << "VP1FileUtilities -- Size of the file to be deleted: " << checkFile.size() << std::endl; + copyDone = true; + if(!srcFile.remove()) + std::cerr << "VP1FileUtilities -- WARNING! Unable to delete " << sourceFile << std::endl; + } + else + { + std::cout << "VP1FileUtilities -- I could not find the output file, so probably the copy action is not finished yet. I'll wait for a short while and I will retry..." << std::endl; + std::this_thread::sleep_for(std::chrono::milliseconds(500)); //make the program waiting for 0.5 seconds + std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now() ; + millisecs_t duration( std::chrono::duration_cast<millisecs_t>(end-start) ) ; + if (duration.count() > 2000.0 ) + { + std::cout << "VP1FileUtilities -- WARNING!!! " << duration.count() << " milliseconds passed and still I cannot find the output file. Probably there was a problem. Giving up with the removal of the source file...\n" ; + copyDone = true; + } + } + } + } // create/update the latest event file QFile latestEvent(latestEventFileName); @@ -192,8 +187,6 @@ void VP1FileUtilities::cleanUp() dir.setSorting(QDir::Time|QDir::Reversed); QFileInfoList list = dir.entryInfoList(); - //std::cout << "m_fileLimit: " << m_fileLimit << " - list.size(): " << list.size() << " - list: " << list << std::endl; - if(int(list.size()) > m_fileLimit) { const QFileInfo& fileInfo = list.at(0); @@ -212,7 +205,6 @@ void VP1FileUtilities::cleanUp() std::cerr << "VP1FileUtilities WARNING! Unable to delete " << poolCatalogStr << std::endl; } - return; }