From 1598fbb834346bcf38a2321aafa462936d3435c4 Mon Sep 17 00:00:00 2001 From: Dave Casper <dcasper@uci.edu> Date: Sat, 17 Apr 2021 10:38:50 +0000 Subject: [PATCH] Athena 22.0.30 compatibility --- .gitlab-ci.yml | 4 +- .../EcalGeoModel/python/EcalGeoModelConfig.py | 20 -- .../EcalGeoModel/test/EcalGMConfig_test.py | 2 +- .../python/AllConfigFlags.py | 14 +- .../python/AutoConfigFlags.py | 133 +++++++++ .../python/DetectorConfigFlags.py | 271 ++++++++++++++---- .../python/GeoModelConfigFlags.py | 13 +- .../python/MainServicesConfig.py | 4 +- .../python/testDetectorFlags.py | 128 +++++++++ .../python/GenEventReadExampleConfig.py | 2 +- .../GeoModelTest/python/GeoModelTestConfig.py | 16 +- .../python/RDOReadExampleConfig.py | 2 +- .../python/WriteAlignmentConfig.py | 7 - .../GeoModel/FaserGeoModel/data/geomDB.sql | 8 +- .../FaserGeoModel/python/CaloGMConfig.py | 49 ---- .../FaserGeoModel/python/CommonGeoDB.py | 27 ++ .../FaserGeoModel/python/DipoleGMConfig.py | 60 ---- .../python/FaserGeoDBInterface.py | 230 +++++++++++++++ .../python/FaserGeoModelConfig.py | 30 +- .../FaserGeoModel/python/GeoModelConfig.py | 12 +- .../FaserGeoModel/python/SCTGMConfig.py | 51 ---- .../FaserGeoModel/python/ScintGMConfig.py | 11 +- .../test/FaserGeometryConfig_EVNT_test.py | 7 +- Generators/FaserCosmicGenerator/README.md | 2 +- README.md | 2 +- .../python/PreshowerGeoModelConfig.py | 20 -- .../test/PreshowerGMConfig_test.py | 1 - .../python/TriggerGeoModelConfig.py | 20 -- .../test/TriggerGMConfig_test.py | 1 - .../VetoGeoModel/python/VetoGeoModelConfig.py | 20 -- .../VetoGeoModel/test/VetoGMConfig_test.py | 1 - Simulation/G4Faser/G4FaserAlg/test/runEcal.py | 19 +- Simulation/G4Faser/G4FaserAlg/test/runG4.py | 21 +- .../G4Faser/G4FaserAlg/test/runG4Cosmics.py | 19 +- .../G4FaserAlg/test/runG4DecayInFlight.py | 19 +- .../G4FaserAlg/test/runGeantinoScan.py | 17 +- Simulation/G4Faser/G4FaserAlg/test/runGen.py | 17 +- .../python/G4FaserServicesConfigNew.py | 30 +- .../python/G4FaserToolsConfigNew.py | 10 +- .../python/G4GeometryToolConfig.py | 12 +- .../test/FaserISF_ServicesConfigNew_test.py | 1 - .../DipoleGeoModel/CMakeLists.txt | 3 +- .../python/DipoleGeoModelConfig.py | 7 - .../test/DipoleGMConfig_test.py | 1 - .../python/FaserSCT_GeoModelConfig.py | 18 +- .../test/FaserSCT_GMConfig_test.py | 1 - .../python/FaserSCT_DigitizationConfigNew.py | 4 +- .../test/FaserSCT_DigitizationDbg.py | 1 - .../python/FaserSpacePointsCosmics.py | 3 +- .../python/TrackerClusterFitConfig.py | 5 +- .../test/TrackerClusterFitDbg.py | 2 + .../TrackerPrepRawDataFormationConfig.py | 4 +- .../TrackerSpacePointFormationConfig.py | 4 +- .../python/TruthSeededTrackFinderConfig.py | 5 +- .../python/FaserActsExtrapolationConfig.py | 4 +- .../FaserActsMaterialMapping_jobOptions.py | 9 - .../FaserActsWriteTrackingGeometryConfig.py | 4 +- .../test/FaserActsExtrapolationAlg.py | 2 +- .../test/FaserActsWriteTrackingGeometry.py | 2 +- version.txt | 2 +- 60 files changed, 864 insertions(+), 550 deletions(-) create mode 100644 Control/CalypsoConfiguration/python/AutoConfigFlags.py create mode 100644 Control/CalypsoConfiguration/python/testDetectorFlags.py delete mode 100644 DetectorDescription/GeoModel/FaserGeoModel/python/CaloGMConfig.py create mode 100644 DetectorDescription/GeoModel/FaserGeoModel/python/CommonGeoDB.py delete mode 100644 DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py create mode 100644 DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoDBInterface.py delete mode 100644 DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d53606322..cc9355a1d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,7 +25,7 @@ build_image: - mkdir build - cd build - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e - - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.29; set -e + - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.30; set -e - cmake ../../calypso - make -j 3 artifacts: @@ -41,7 +41,7 @@ test_unittest: - yum -y install man - cd build - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e - - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.29; set -e + - set +e && asetup --input=../../calypso/asetup.faser Athena,22.0.30; set -e - set +e && source `find . -name 'setup.sh'`; set -e - ctest -j12 dependencies: diff --git a/Calorimeter/CaloDetDescr/EcalGeoModel/python/EcalGeoModelConfig.py b/Calorimeter/CaloDetDescr/EcalGeoModel/python/EcalGeoModelConfig.py index 0959d09df..5d2025c41 100644 --- a/Calorimeter/CaloDetDescr/EcalGeoModel/python/EcalGeoModelConfig.py +++ b/Calorimeter/CaloDetDescr/EcalGeoModel/python/EcalGeoModelConfig.py @@ -17,24 +17,4 @@ def EcalGeometryCfg( flags ): ecalDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic geoModelSvc.DetectorTools += [ ecalDetectorTool ] - # if flags.GeoModel.Align.Dynamic: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/SCT","/Indet/AlignL2/SCT",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer")) - # else: - # if (not flags.Detector.SimulatePreshower) or flags.Detector.OverlayPreshower: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")) - # else: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) - - # if flags.Common.Project is not "AthSimulation": # Protection for AthSimulation builds - # if (not flags.Detector.SimulatePreshower) or flags.Detector.OverlayPreshower: - # from PreshowerConditionsAlgorithms.PreshowerConditionsAlgorithmsConf import PreshowerAlignCondAlg - # preshowerAlignCondAlg = PreshowerAlignCondAlg(name = "PreshowerAlignCondAlg", - # UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic) - # acc.addCondAlgo(preshowerAlignCondAlg) - # from PreshowerConditionsAlgorithms.PreshowerConditionsAlgorithmsConf import PreshowerDetectorElementCondAlg - # preshowerDetectorElementCondAlg = PreshowerDetectorElementCondAlg(name = "PreshowerDetectorElementCondAlg") - # acc.addCondAlgo(preshowerDetectorElementCondAlg) - return acc diff --git a/Calorimeter/CaloDetDescr/EcalGeoModel/test/EcalGMConfig_test.py b/Calorimeter/CaloDetDescr/EcalGeoModel/test/EcalGMConfig_test.py index 98aed0888..9df7d3907 100644 --- a/Calorimeter/CaloDetDescr/EcalGeoModel/test/EcalGMConfig_test.py +++ b/Calorimeter/CaloDetDescr/EcalGeoModel/test/EcalGMConfig_test.py @@ -11,7 +11,7 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateEcal = False + ConfigFlags.Detector.EnableEcal = True ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Control/CalypsoConfiguration/python/AllConfigFlags.py b/Control/CalypsoConfiguration/python/AllConfigFlags.py index 779516111..8cc83b1ec 100644 --- a/Control/CalypsoConfiguration/python/AllConfigFlags.py +++ b/Control/CalypsoConfiguration/python/AllConfigFlags.py @@ -34,7 +34,7 @@ def _createCfgFlags(): # acf=AthConfigFlags() fcf = athenaConfigFlags - # acf.addFlag('Input.Files', ["_ATHENA_GENERIC_INPUTFILE_NAME_",] ) # former global.InputFiles + fcf.Input.Files = ["_FASER_GENERIC_INPUTFILE_NAME_",] # former global.InputFiles # acf.addFlag('Input.SecondaryFiles', []) # secondary input files for DoubleEventSelector # acf.addFlag('Input.isMC', lambda prevFlags : "IS_SIMULATION" in GetFileMD(prevFlags.Input.Files).get("eventTypes",[]) ) # former global.isMC # acf.addFlag('Input.RunNumber', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("runNumbers",[]))) # former global.RunNumber @@ -98,12 +98,14 @@ def _createCfgFlags(): return createDetectorConfigFlags() # acf.addFlagsCategory( "Detector", __detector ) fcf.join( __detector() ) + from CalypsoConfiguration.DetectorConfigFlags import modifyDetectorConfigFlags + fcf = modifyDetectorConfigFlags(fcf) #Simulation Flags: - def __simulation(): - from G4AtlasApps.SimConfigFlags import createSimConfigFlags - return createSimConfigFlags() - _addFlagsCategory (fcf, "Sim", __simulation, 'G4AtlasApps' ) + # def __simulation(): + # from G4AtlasApps.SimConfigFlags import createSimConfigFlags + # return createSimConfigFlags() + # _addFlagsCategory (fcf, "Sim", __simulation, 'G4AtlasApps' ) #Digitization Flags: # def __digitization(): @@ -123,6 +125,8 @@ def _createCfgFlags(): return createGeoModelConfigFlags() # _addFlagsCategory( fcf, "GeoModel", __geomodel ) fcf.join( __geomodel() ) + from CalypsoConfiguration.GeoModelConfigFlags import modifyGeoModelConfigFlags + fcf = modifyGeoModelConfigFlags(fcf) # acf.addFlag('GeoModel.Layout', 'atlas') # replaces global.GeoLayout # acf.addFlag("GeoModel.AtlasVersion", lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("GeoAtlas",None) or "ATLAS-R2-2016-01-00-01") # diff --git a/Control/CalypsoConfiguration/python/AutoConfigFlags.py b/Control/CalypsoConfiguration/python/AutoConfigFlags.py new file mode 100644 index 000000000..b81df65fc --- /dev/null +++ b/Control/CalypsoConfiguration/python/AutoConfigFlags.py @@ -0,0 +1,133 @@ +from PyUtils.MetaReader import read_metadata +from AthenaCommon.Logging import logging +from functools import lru_cache + +msg = logging.getLogger('AutoConfigFlags') + +# Module level cache of file-metadata: +_fileMetaData = dict() + +class DynamicallyLoadMetadata: + def __init__(self, filename): + self.metadata = {} + self.filename = filename + self.metAccessLevel = 'lite' + thisFileMD = read_metadata(filename, None, 'lite') + self.metadata.update(thisFileMD[self.filename]) + msg.debug("Loaded using 'lite' %s", str(self.metadata)) + + def _loadMore(self): + thisFileMD = read_metadata(self.filename, None, 'peeker') + self.metadata.update(thisFileMD[self.filename]) + + def get(self, key, default): + if key in self.metadata: + return self.metadata[key] + if self.metAccessLevel != 'peeker': + msg.info("Looking into the file in 'peeker' mode as the configuration requires more details: %s ", key) + self.metAccessLevel = 'peeker' + self._loadMore() + if key in self.metadata: + return self.metadata[key] + return default + + def __contains__(self, key): + return self.get(key, None) is not None + + def __getitem__(self, key): + result = self.get(key, None) + if result is None: + raise RuntimeError("Key {} not found".format(key)) + return result + +def GetFileMD(filenames): + + filename=filenames[0] + if filename == '_FASER_GENERIC_INPUTFILE_NAME_': + raise RuntimeError('Input file name not set, instead _FASER_GENERIC_INPUTFILE_NAME_ found. Cannot read metadata.') + if filename not in _fileMetaData: + if len(filenames)>1: + msg.info("Multiple input files. Use the first one for auto-configuration") + msg.info("Obtaining metadata of auto-configuration by peeking into %s", filename) + _fileMetaData[filename] = DynamicallyLoadMetadata(filename) + + return _fileMetaData[filename] + + +def _initializeGeometryParameters(geoTag): + """Read geometry database for all detectors""" + + from FaserGeoModel import CommonGeoDB + from FaserGeoModel.FaserGeoDBInterface import FaserGeoDBInterface + + dbGeomCursor = FaserGeoDBInterface(geoTag) + dbGeomCursor.ConnectAndBrowseGeoDB() + + params = { 'Common' : CommonGeoDB.InitializeGeometryParameters(dbGeomCursor) } + + return params + + +@lru_cache(maxsize=4) # maxsize=1 should be enough for most jobs +def DetDescrInfo(geoTag): + """Query geometry DB for detector description. Returns dictionary with + detector description. Queries DB for each tag only once. + + geoTag: geometry tag (e.g. FASER-01) + """ + detDescrInfo = _initializeGeometryParameters(geoTag) + detDescrInfo["geomTag"] = geoTag + return detDescrInfo + + +@lru_cache(maxsize=4) # maxsize=1 should be enough for most jobs +def getDefaultDetectors(geoTag): + """Query geometry DB for detector description. + Returns a set of detectors used in a geometry tag. + + geoTag: geometry tag (e.g. FASER-01) + """ + detectors = set() + detectors.add('Veto') + detectors.add('Trigger') + detectors.add('Preshower') + detectors.add('FaserSCT') + detectors.add('Ecal') + detectors.add('UpstreamDipole') + detectors.add('CentralDipole') + detectors.add('DownstreamDipole') + + print("DetDescrInfo Run = ", DetDescrInfo(geoTag)['Common']['Run']) + print("DetDescrInfo TrackerType = ", DetDescrInfo(geoTag)['Common']['TrackerType']) + print("DetDescrInfo FaserNuType = ", DetDescrInfo(geoTag)['Common']['FaserNuType']) + + # if DetDescrInfo(geoTag)['Common']['Run'] == 'RUN4': + # detectors.add('ITkPixel') + # detectors.add('ITkStrip') + # else: + # detectors.add('Pixel') + # detectors.add('SCT') + # detectors.add('TRT') + # detectors.add('BCM') + # TODO: wait for special table in the geo DB + # if DetDescrInfo(geoTag)['Common']['Run'] == 'RUN4': + # detectors.add('BCMPrime') + + return detectors + + +# Based on RunDMCFlags.py +def getRunToTimestampDict(): + # this wrapper is intended to avoid an initial import + from .RunToTimestampData import RunToTimestampDict + return RunToTimestampDict + + +def getInitialTimeStampsFromRunNumbers(runNumbers): + """This is used to hold a dictionary of the form + {152166:1269948352889940910, ...} to allow the + timestamp to be determined from the run. + """ + run2timestampDict = getRunToTimestampDict() + timeStamps = [run2timestampDict.get(runNumber,1) for runNumber in runNumbers] # Add protection here? + return timeStamps diff --git a/Control/CalypsoConfiguration/python/DetectorConfigFlags.py b/Control/CalypsoConfiguration/python/DetectorConfigFlags.py index 29c4e71b3..fb0c315a7 100644 --- a/Control/CalypsoConfiguration/python/DetectorConfigFlags.py +++ b/Control/CalypsoConfiguration/python/DetectorConfigFlags.py @@ -1,22 +1,29 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -from __future__ import print_function - from AthenaConfiguration.AthConfigFlags import AthConfigFlags - +from CalypsoConfiguration.AutoConfigFlags import DetDescrInfo, getDefaultDetectors # This module is based upon Control/AthenaCommon/python/DetFlags.py # Only some flags have been migrated. + +allDetectors = [ + 'Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Ecal', 'Dipole', +] + +allGroups = { + 'Tracker' : ['SCT'], + 'Scintillator' : ['Veto', 'Trigger', 'Preshower'], + 'FaserCalo' : ['Ecal'], + 'Magnet' : ['Dipole'] +} + def createDetectorConfigFlags(): dcf=AthConfigFlags() #Detector.Geometry - merger of the old geometry and detdescr tasks - dcf.addFlag('Detector.GeometryUpstreamDipole', False) - dcf.addFlag('Detector.GeometryCentralDipole', False) - dcf.addFlag('Detector.GeometryDownstreamDipole',False) - dcf.addFlag('Detector.GeometryDipole', lambda prevFlags : (prevFlags.Detector.GeometryUpstreamDipole or - prevFlags.Detector.GeometryCentralDipole or - prevFlags.Detector.GeometryDownstreamDipole)) + dcf.addFlag('Detector.GeometryDipole', False) + dcf.addFlag('Detector.GeometryMagnet', lambda prevFlags : (prevFlags.Detector.GeometryDipole )) + dcf.addFlag('Detector.GeometryVeto', False) dcf.addFlag('Detector.GeometryTrigger', False) dcf.addFlag('Detector.GeometryPreshower', False) @@ -25,49 +32,211 @@ def createDetectorConfigFlags(): prevFlags.Detector.GeometryPreshower)) dcf.addFlag('Detector.GeometryFaserSCT', False) dcf.addFlag('Detector.GeometryTracker', lambda prevFlags : prevFlags.Detector.GeometryFaserSCT ) + dcf.addFlag('Detector.GeometryEcal', False) dcf.addFlag('Detector.GeometryFaserCalo', lambda prevFlags : prevFlags.Detector.GeometryEcal) - dcf.addFlag('Detector.GeometryFaser', lambda prevFlags : (prevFlags.Detector.GeometryDecayVolume or - prevFlags.Detector.GeometryScintillator or - prevFlags.Detector.GeometryTracker or - prevFlags.Detector.GeometryFaserCalo)) - - #Detector.Simulate - dcf.addFlag('Detector.SimulateUpstreamDipole', False) - dcf.addFlag('Detector.SimulateCentralDipole', False) - dcf.addFlag('Detector.SimulateDownstreamDipole',False) - dcf.addFlag('Detector.SimulateDipole', lambda prevFlags : (prevFlags.Detector.SimulateUpstreamDipole or - prevFlags.Detector.SimulateCentralDipole or - prevFlags.Detector.SimulateDownstreamDipole)) - dcf.addFlag('Detector.SimulateDecayVolume', False) - dcf.addFlag('Detector.SimulateVeto', False) - dcf.addFlag('Detector.SimulateTrigger', False) - dcf.addFlag('Detector.SimulatePreshower', False) - dcf.addFlag('Detector.SimulateScintillator',lambda prevFlags : (prevFlags.Detector.SimulateVeto or - prevFlags.Detector.SimulateTrigger or - prevFlags.Detector.SimulatePreshower)) - dcf.addFlag('Detector.SimulateFaserSCT', False) - dcf.addFlag('Detector.SimulateTracker', lambda prevFlags : prevFlags.Detector.SimulateFaserSCT ) - dcf.addFlag('Detector.SimulateEcal', False) - dcf.addFlag('Detector.SimulateFaserCalo', lambda prevFlags : prevFlags.Detector.SimulateEcal) - dcf.addFlag('Detector.SimulateFaser', lambda prevFlags : (prevFlags.Detector.SimulateDecayVolume or - prevFlags.Detector.SimulateScintillator or - prevFlags.Detector.SimulateTracker or - prevFlags.Detector.SimulateFaserCalo)) - - #Detector.Overlay - # dcf.addFlag('Detector.OverlayVeto', False) - # dcf.addFlag('Detector.OverlayTrigger', False) - # dcf.addFlag('Detector.OverlayPreshower', False) - # dcf.addFlag('Detector.OverlayScintillator', lambda prevFlags : (prevFlags.Detector.OverlayVeto or - # prevFlags.Detector.OverlayTrigger or - # prevFlags.Detector.OverlayPreshower)) - # dcf.addFlag('Detector.OverlayFaserSCT', False) - # dcf.addFlag('Detector.OverlayTracker', lambda prevFlags : prevFlags.Detector.OverlayFaserSCT ) - # dcf.addFlag('Detector.OverlayEcal', False) - # dcf.addFlag('Detector.OverlayFaserCalo', lambda prevFlags : prevFlags.Detector.OverlayEcal) - # dcf.addFlag('Detector.OverlayFaser', lambda prevFlags : (prevFlags.Detector.OverlayScintillator or - # prevFlags.Detector.OverlayTracker or - # prevFlags.Detector.OverlayFaserCalo)) + + # Cavern (disabled by default) + # dcf.addFlag('Detector.GeometryCavern',False) + + # dcf.addFlag('Detector.GeometryFaser', lambda prevFlags : (prevFlags.Detector.GeometryDecayVolume or + # prevFlags.Detector.GeometryScintillator or + # prevFlags.Detector.GeometryTracker or + # prevFlags.Detector.GeometryFaserCalo)) + + + + #Detector.Enable + # dcf.addFlag('Detector.EnableUpstreamDipole', False) + # dcf.addFlag('Detector.EnableCentralDipole', False) + # dcf.addFlag('Detector.EnableDownstreamDipole',False) + # dcf.addFlag('Detector.EnableDipole', lambda prevFlags : (prevFlags.Detector.EnableUpstreamDipole or + # prevFlags.Detector.EnableCentralDipole or + # prevFlags.Detector.EnableDownstreamDipole)) + # dcf.addFlag('Detector.EnableDecayVolume', False) + dcf.addFlag('Detector.EnableVeto', lambda prevFlags : 'Veto' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) + dcf.addFlag('Detector.EnableTrigger', lambda prevFlags : 'Trigger' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) + dcf.addFlag('Detector.EnablePreshower', lambda prevFlags : 'Preshower' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) + dcf.addFlag('Detector.EnableScintillator',lambda prevFlags : (prevFlags.Detector.EnableVeto or + prevFlags.Detector.EnableTrigger or + prevFlags.Detector.EnablePreshower)) + dcf.addFlag('Detector.EnableFaserSCT', lambda prevFlags : 'FaserSCT' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) + dcf.addFlag('Detector.EnableTracker', lambda prevFlags : prevFlags.Detector.EnableFaserSCT ) + dcf.addFlag('Detector.EnableEcal', lambda prevFlags : 'Ecal' in getDefaultDetectors(prevFlags.GeoModel.FaserVersion)) + dcf.addFlag('Detector.EnableFaserCalo', lambda prevFlags : prevFlags.Detector.EnableEcal) + # dcf.addFlag('Detector.EnableFaser', lambda prevFlags : (prevFlags.Detector.EnableDecayVolume or + # prevFlags.Detector.EnableScintillator or + # prevFlags.Detector.EnableTracker or + # prevFlags.Detector.EnableFaserCalo)) + + # Reco flags + dcf.addFlag('Detector.RecoVeto', False) + dcf.addFlag('Detector.RecoTrigger', False) + dcf.addFlag('Detector.RecoPreshower', False) + dcf.addFlag('Detector.RecoEcal', False) + dcf.addFlag('Detector.RecoWaveform', lambda prevFlags : (prevFlags.Detector.RecoVeto or prevFlags.Detector.RecoTrigger or + prevFlags.Detector.RecoPreshower or prevFlags.Detector.RecoEcal)) + dcf.addFlag('Detector.RecoFaserSCT', False) + dcf.addFlag('Detector.RecoTracker', lambda prevFlags : (prevFlags.Detector.RecoSCT)) return dcf + +def _parseDetectorsList(flags, detectors): + # setup logging + from AthenaCommon.Logging import logging + log = logging.getLogger('DetectorConfigFlags') + # load flags + flags._loadDynaFlags('Detector') + # first check if we have groups + groups = [d for d in detectors if d in allGroups.keys()] + detectors = [d for d in detectors if d not in allGroups.keys()] + for g in groups: + log.debug("Evaluating detector group '%s'", g) + # in case of groups only enable defaults + for d in allGroups[g]: + if d in getDefaultDetectors(flags.GeoModel.FaserVersion): + log.debug("Appending detector '%s'", d) + detectors.append(d) + + # check if valid detectors are required + for d in detectors: + if d not in allDetectors: + log.warning("Unknown detector '%s'", d) + + return detectors + +def setupDetectorsFromList(flags, detectors, toggle_geometry=False, validate_only=False): + """Setup (toggle) detectors from a pre-defined list""" + changed = False + # setup logging + from AthenaCommon.Logging import logging + log = logging.getLogger('DetectorConfigFlags') + # parse the list + detectors = _parseDetectorsList(flags, detectors) + + # print summary + if validate_only: + log.info('Required detectors: %s', detectors) + else: + log.info('Setting detectors to: %s', detectors) + + # go through all of the detectors and check what should happen + for d in allDetectors: + status = d in detectors + name = f'Detector.Enable{d}' + if flags.hasFlag(name): + if flags(name) != status: + changed = True + if validate_only: + log.warning("Flag '%s' should be %s but is set to %s", name, status, not status) + else: + log.info("Toggling '%s' from %s to %s", name, not status, status) + flags._set(name, status) + if toggle_geometry: + name = f'Detector.Geometry{d}' + if flags.hasFlag(name): + if flags(name) != status: + changed = True + if validate_only: + log.warning("Flag '%s' should be %s but is set to %s", name, status, not status) + else: + log.info("Toggling '%s' from %s to %s", name, not status, status) + flags._set(name, status) + + return changed + +def enableDetectors(flags, detectors, toggle_geometry=False): + """Enable detectors from a list""" + changed = False + # setup logging + from AthenaCommon.Logging import logging + log = logging.getLogger('DetectorConfigFlags') + # parse the list + detectors = _parseDetectorsList(flags, detectors) + + # debugging + log.info('Enabling detectors: %s', detectors) + + # go through all of the detectors and enable them if needed + for d in detectors: + name = f'Detector.Enable{d}' + if flags.hasFlag(name): + if flags(name) is not True: + changed = True + log.info("Enabling '%s'", name) + flags._set(name, True) + if toggle_geometry: + name = f'Detector.Geometry{d}' + if flags.hasFlag(name): + if flags(name) is not True: + changed = True + log.info("Enabling '%s'", name) + flags._set(name, True) + + return changed + + +def disableDetectors(flags, detectors, toggle_geometry=False): + """Disable detectors from a list""" + changed = False + # setup logging + from AthenaCommon.Logging import logging + log = logging.getLogger('DetectorConfigFlags') + # parse the list + detectors = _parseDetectorsList(flags, detectors) + + # debugging + log.info('Disabling detectors: %s', detectors) + + # go through all of the detectors and disable them if needed + for d in detectors: + name = f'Detector.Enable{d}' + if flags.hasFlag(name): + if flags(name) is not False: + changed = True + log.info("Disabling '%s'", name) + flags._set(name, False) + if toggle_geometry: + name = f'Detector.Geometry{d}' + if flags.hasFlag(name): + if flags(name) is not False: + changed = True + log.info("Disabling '%s'", name) + flags._set(name, False) + + return changed + +def modifyDetectorConfigFlags(flags): + # disable problematic ATLAS flags by hand + flags.Detector.GeometryCSC = False + flags.Detector.GeometrysTGC = False + flags.Detector.GeometryMM = False + + flags.Detector.EnableBCM = False + flags.Detector.EnableDBM = False + flags.Detector.EnablePixel = False + flags.Detector.EnableSCT = False + flags.Detector.EnableTRT = False + + # Upgrade ITk Inner Tracker is a separate and parallel detector + flags.Detector.EnableBCMPrime = False + flags.Detector.EnableITkPixel = False + flags.Detector.EnableITkStrip = False + + flags.Detector.EnableHGTD = False + + # Calorimeters + flags.Detector.EnableLAr = False + flags.Detector.EnableTile = False + + # Muon Spectrometer + flags.Detector.EnableCSC = False + flags.Detector.EnableMDT = False + flags.Detector.EnableRPC = False + flags.Detector.EnableTGC = False + flags.Detector.EnablesTGC = False + flags.Detector.EnableMM = False + + flags.Detector.RecoIBL = False + + return flags \ No newline at end of file diff --git a/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py b/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py index 9729f35ab..3b1994015 100644 --- a/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py +++ b/Control/CalypsoConfiguration/python/GeoModelConfigFlags.py @@ -1,10 +1,21 @@ # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.AthConfigFlags import AthConfigFlags +from CalypsoConfiguration.AutoConfigFlags import GetFileMD, DetDescrInfo def createGeoModelConfigFlags(): gcf=AthConfigFlags() - gcf.addFlag("GeoModel.FaserVersion", "FASER-01") # + gcf.addFlag("GeoModel.FaserVersion", lambda prevFlags : ((prevFlags.Input.Files and + prevFlags.Input.Files != ["_FASER_GENERIC_INPUTFILE_NAME_"] and + GetFileMD(prevFlags.Input.Files).get("GeoFaser",None)) + or "FASER-01")) gcf.addFlag("GeoModel.GeoExportFile","") return gcf + +def modifyGeoModelConfigFlags(flags): + print("modifyGeoModelConfigFlags called for FaserVersion: ", flags.GeoModel.FaserVersion) + flags.GeoModel.Run = lambda prevFlags : DetDescrInfo(prevFlags.GeoModel.FaserVersion)['Common']['Run'] + print(DetDescrInfo(flags.GeoModel.FaserVersion)['Common']['Run']) + return flags + \ No newline at end of file diff --git a/Control/CalypsoConfiguration/python/MainServicesConfig.py b/Control/CalypsoConfiguration/python/MainServicesConfig.py index 447b89a40..1a4e4c1af 100644 --- a/Control/CalypsoConfiguration/python/MainServicesConfig.py +++ b/Control/CalypsoConfiguration/python/MainServicesConfig.py @@ -46,14 +46,14 @@ def MainServicesCfg(cfgFlags): if cfgFlags.Concurrency.NumThreads==0: # For serial execution, we need the CondAlgs to execute first. cfg.addSequence(AthSequencer('AthCondSeq',StopOverride=True),parentName='AthAllAlgSeq') - cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq') + cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True, ProcessDynamicDataDependencies=True, ExtraDataForDynamicConsumers=[] ),parentName='AthAllAlgSeq') else: # In MT, the order of execution is irrelevant (determined by data deps). # We add the conditions sequence later such that the CondInputLoader gets # initialized after all other user Algorithms for MT, so the base classes # of data deps can be correctly determined. cfg.addSequence(AthSequencer('AthAlgSeq',IgnoreFilterPassed=True,StopOverride=True),parentName='AthAllAlgSeq') - cfg.addSequence(AthSequencer('AthCondSeq',StopOverride=True),parentName='AthAllAlgSeq') + cfg.addSequence(AthSequencer('AthCondSeq',StopOverride=True, ProcessDynamicDataDependencies=True, ExtraDataForDynamicConsumers=[]),parentName='AthAllAlgSeq') cfg.addSequence(AthSequencer('AthEndSeq',Sequential=True),parentName='AthAlgEvtSeq') cfg.setAppProperty('PrintAlgsSequence', True) diff --git a/Control/CalypsoConfiguration/python/testDetectorFlags.py b/Control/CalypsoConfiguration/python/testDetectorFlags.py new file mode 100644 index 000000000..9a555b4c6 --- /dev/null +++ b/Control/CalypsoConfiguration/python/testDetectorFlags.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + +from CalypsoConfiguration.AllConfigFlags import ConfigFlags +from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList, enableDetectors, disableDetectors + +ConfigFlags._loadDynaFlags('GeoModel') +ConfigFlags._loadDynaFlags('Detector') + +test_tags = [ + 'FASER-00', + 'FASER-01' # example +] + +flags_runs = {t: ConfigFlags.clone() for t in test_tags} + +for tag in test_tags: + flags = flags_runs[tag] + flags.GeoModel.FaserVersion = tag + + print(f'{flags.GeoModel.FaserVersion} - {flags.GeoModel.Run}') + flags.dump('Detector.(Geometry|Enable)', True) + print() + + # test flags that change with time + assert flags.Detector.EnableEcal == (tag != 'FASER-00') + # assert flags.Detector.EnableBCM == (tag != 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableDBM == (tag in ['ATLAS-R2-2016-01-00-01', 'ATLAS-R3S-2021-01-00-01']) + # assert flags.Detector.EnablePixel == (tag != 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableSCT == (tag != 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableTRT == (tag != 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableITkPixel == (tag == 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableITkStrip == (tag == 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableHGTD == (tag == 'ATLAS-P2-ITK-24-00-00') + # assert flags.Detector.EnableCSC == (tag in ['ATLAS-R1-2012-03-01-00', 'ATLAS-R2-2016-01-00-01']) + # assert flags.Detector.EnablesTGC == (tag in ['ATLAS-R3S-2021-01-00-01', 'ATLAS-P2-ITK-24-00-00']) + # assert flags.Detector.EnableMM == (tag in ['ATLAS-R3S-2021-01-00-01', 'ATLAS-P2-ITK-24-00-00']) + + +# test setup for Run 3 +flags = flags_runs['FASER-01'] + +print("Test: validate ['Tracker', 'Scintillator', 'FaserCalo', 'Dipole']") +assert not setupDetectorsFromList(flags, ['Tracker', 'Scintillator', 'FaserCalo', 'Dipole'], validate_only=True) +print() + +print("Test: validate ['Magnet']") +assert setupDetectorsFromList(flags, ['Magnet'], validate_only=True) +print() + +print("Test: setup ['Magnet']") +assert setupDetectorsFromList(flags, ['Magnet'], toggle_geometry=True) +assert flags.Detector.GeometryDipole +assert not flags.Detector.EnableFaserSCT +assert not flags.Detector.EnableEcal +assert not flags.Detector.EnableVeto +assert not flags.Detector.EnableTrigger +assert not flags.Detector.EnablePreshower +assert not flags.Detector.GeometryFaserSCT +assert not flags.Detector.GeometryEcal +assert not flags.Detector.GeometryVeto +assert not flags.Detector.GeometryTrigger +assert not flags.Detector.GeometryPreshower +print() + +# print("Test: setup ['ID'] (geometry included)") +# assert setupDetectorsFromList(flags, ['ID'], toggle_geometry=True) +# assert flags.Detector.EnablePixel +# assert flags.Detector.GeometryPixel +# assert flags.Detector.EnableSCT +# assert flags.Detector.GeometrySCT +# assert flags.Detector.EnableTRT +# assert flags.Detector.GeometryTRT +# assert not flags.Detector.EnableCSC +# assert not flags.Detector.GeometryCSC +# assert not flags.Detector.EnableMM +# print() + +# print("Test: enable ['ID'] (geometry included)") +# assert not enableDetectors(flags, ['ID'], toggle_geometry=True) +# print() + +# print("Test: disable ['ID'] (geometry included)") +# assert disableDetectors(flags, ['ID'], toggle_geometry=True) +# assert not flags.Detector.EnablePixel +# assert not flags.Detector.GeometryPixel +# assert not flags.Detector.EnableSCT +# assert not flags.Detector.GeometrySCT +# assert not flags.Detector.EnableTRT +# assert not flags.Detector.GeometryTRT +# print() + +# print("Test: enable ['MDT', 'RPC']") +# assert enableDetectors(flags, ['MDT', 'RPC']) +# assert flags.Detector.EnableMDT +# assert not flags.Detector.GeometryMDT +# assert flags.Detector.EnableRPC +# assert not flags.Detector.GeometryRPC +# assert not flags.Detector.EnableCSC +# assert not flags.Detector.GeometryCSC +# print() + +# print("Test: enable ['LAr']") +# assert enableDetectors(flags, ['LAr']) +# assert flags.Detector.EnableLAr +# assert flags.Detector.EnableL1Calo +# print() + +# print("Test: enable ['Forward']") +# assert enableDetectors(flags, ['Forward']) +# assert flags.Detector.EnableLucid +# assert flags.Detector.EnableZDC +# assert flags.Detector.EnableALFA +# assert flags.Detector.EnableAFP +# assert flags.Detector.EnableFwdRegion +# print() + + +# # test setup for Run 4 +# flags = flags_runs['ATLAS-P2-ITK-24-00-00'] + +# print("Test: validate ['ITk', 'HGTD', 'Calo', 'Muon']") +# assert not setupDetectorsFromList(flags, ['ITk', 'HGTD', 'Calo', 'Muon'], validate_only=True) +# print() + +# print("Test: enable ['ITkStrip']") +# assert setupDetectorsFromList(flags, ['ITkStrip'], toggle_geometry=True) +# print() diff --git a/Control/CalypsoExample/GenEventExample/python/GenEventReadExampleConfig.py b/Control/CalypsoExample/GenEventExample/python/GenEventReadExampleConfig.py index 3d59aef95..28073eb69 100644 --- a/Control/CalypsoExample/GenEventExample/python/GenEventReadExampleConfig.py +++ b/Control/CalypsoExample/GenEventExample/python/GenEventReadExampleConfig.py @@ -28,7 +28,7 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = True # Needed to bypass autoconfig ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry - ConfigFlags.Detector.SimulateFaserSCT = True + ConfigFlags.Detector.EnableFaserSCT = True ConfigFlags.Input.Files = ["my.cosmics.pool.root"] ConfigFlags.lock() diff --git a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py index e8474a6d6..e7f6feb7f 100644 --- a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py +++ b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py @@ -33,14 +33,14 @@ if __name__ == "__main__": ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry ConfigFlags.GeoModel.GeoExportFile = "faserGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.SimulateTrigger = True - ConfigFlags.Detector.SimulatePreshower= True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.Detector.SimulateEcal = True + # ConfigFlags.Detector.EnableVeto = True + # ConfigFlags.Detector.EnableTrigger = True + # ConfigFlags.Detector.EnablePreshower= True + # ConfigFlags.Detector.EnableFaserSCT = True + # ConfigFlags.Detector.EnableUpstreamDipole = True + # ConfigFlags.Detector.EnableCentralDipole = True + # ConfigFlags.Detector.EnableDownstreamDipole = True + # ConfigFlags.Detector.EnableEcal = True ConfigFlags.lock() # Configure components diff --git a/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py b/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py index e94f6364b..fcaea7998 100644 --- a/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py +++ b/Control/CalypsoExample/RDOReadExample/python/RDOReadExampleConfig.py @@ -28,7 +28,7 @@ if __name__ == "__main__": ConfigFlags.Input.isMC = True # Needed to bypass autoconfig ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry - ConfigFlags.Detector.SimulateFaserSCT = True + ConfigFlags.Detector.GeometryFaserSCT = True ConfigFlags.Input.Files = ["my.RDO.pool.root"] ConfigFlags.lock() diff --git a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py index a1944cee1..41fb9c936 100644 --- a/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py +++ b/Control/CalypsoExample/WriteAlignment/python/WriteAlignmentConfig.py @@ -48,13 +48,6 @@ if __name__ == "__main__": ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry ConfigFlags.GeoModel.GeoExportFile = "faserGeo.db" # Writes out a GeoModel file with the full geometry tree (optional, comment out to skip) - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.SimulateTrigger = True - ConfigFlags.Detector.SimulatePreshower= True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True ConfigFlags.lock() # Configure components diff --git a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql index 169464145..a18d47bce 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql +++ b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql @@ -439,8 +439,8 @@ DROP TABLE IF EXISTS "FASERCOMMON_DATA"; CREATE TABLE IF NOT EXISTS "FASERCOMMON_DATA" ( "FASERCOMMON_DATA_ID" SLONGLONG UNIQUE, "CONFIG" TEXT , - "GEOTYPE" TEXT , - "STRIPGEOTYPE" TEXT + "TRACKERTYPE" TEXT , + "FASERNUTYPE" TEXT ); DROP TABLE IF EXISTS "FASERCOMMON_DATA2TAG"; CREATE TABLE IF NOT EXISTS "FASERCOMMON_DATA2TAG" ( @@ -960,7 +960,7 @@ INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-01", "NeutrinoIdentifier", "NeutrinoId INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-01", "ScintIdentifier", "ScintIdentifier-00", 100016); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-01", "TrackerIdentifier", "TrackerIdentifier-00", 100017); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-01", "CaloIdentifier", "CaloIdentifier-00", 100018); -INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-CR", "FASER", "FASER-01", 100039); +INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-CR", "FASER", "FASER-CR", 107784); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-CR", "FaserCommon", "FaserCommon-00", 100013); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-CR", "Materials", "Materials-00", 100005); INSERT INTO "HVS_TAGCACHE" VALUES ("FASER-CR", "StdMaterials", "StdMaterials-00", 100006); @@ -1645,7 +1645,7 @@ INSERT INTO "SCINTMATCOMPONENTS_DATA2TAG" VALUES (100012, 0); INSERT INTO "SCINTMATCOMPONENTS_DATA2TAG" VALUES (100012, 1); -- -- -INSERT INTO "FASERCOMMON_DATA" VALUES (0, "RUN3", "UNDEFINED", "UNDEFINED"); +INSERT INTO "FASERCOMMON_DATA" VALUES (0, "RUN3", "TRACKER", "NONE"); INSERT INTO "FASERCOMMON_DATA2TAG" VALUES (100013, 0); -- -- diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/CaloGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/CaloGMConfig.py deleted file mode 100644 index 32889ca65..000000000 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/CaloGMConfig.py +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -# - -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - -def CaloGeometryCfg (flags): - acc = ComponentAccumulator() - from EcalGeoModel.EcalGeoModelConfig import EcalGeometryCfg - acc.merge(EcalGeometryCfg( flags )) - - return acc - - -if __name__ == "__main__": - # import os - from AthenaCommon.Logging import log - from AthenaCommon.Constants import DEBUG - from AthenaCommon.Configurable import Configurable - from AthenaConfiguration.AllConfigFlags import ConfigFlags - from AthenaConfiguration.MainServicesConfig import MainServicesCfg - from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg - # Set up logging and new style config - log.setLevel(DEBUG) - Configurable.configurableRun3Behavior = True - ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-01") - - # from AthenaConfiguration.TestDefaults import defaultTestFiles - # Provide MC input - # ConfigFlags.Input.Files = defaultTestFiles.HITS - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateEcal = True - ConfigFlags.GeoModel.Align.Dynamic = False - # Provide data input - ##from AthenaConfiguration.TestDefaults import defaultTestFiles - # - ConfigFlags.lock() - # Construct ComponentAccumulator - acc = MainServicesCfg(ConfigFlags) - acc.merge(PoolReadCfg(ConfigFlags)) - acc.merge(CaloGeometryCfg(ConfigFlags)) - acc.getService("ConditionStore").Dump=True - acc.printConfig(withDetails=True) - f=open('CaloGMCfg2.pkl','wb') - acc.store(f) - f.close() - ConfigFlags.dump() - # Execute and finish - acc.run(maxEvents=3) diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/CommonGeoDB.py b/DetectorDescription/GeoModel/FaserGeoModel/python/CommonGeoDB.py new file mode 100644 index 000000000..4fa37231a --- /dev/null +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/CommonGeoDB.py @@ -0,0 +1,27 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +def InitializeGeometryParameters(dbGeomCursor): + """Read version name, layout and fasernu from FaserCommon table. + + dbGeomCursor: FaserGeoDBInterface instance + """ + + dbId, dbCommon, dbParam = dbGeomCursor.GetCurrentLeafContent("FaserCommon") + print("dbId = ", dbId) + print("dbCommon = ", dbCommon) + print("dbParam = ", dbParam) + + params = {"Run" : "UNDEFINED", + "TrackerType" : "UNDEFINED", + "FaserNuType" : "UNDEFINED"} + + if len(dbId)>0: + key = dbId[0] + if "CONFIG" in dbParam : + params["Run"] = dbCommon[key][dbParam.index("CONFIG")] + if "TRACKERTYPE" in dbParam : + params["TrackerType"] = dbCommon[key][dbParam.index("TRACKERTYPE")] + if "FASERNUTYPE" in dbParam : + params["FaserNuType"] = dbCommon[key][dbParam.index("FASERNUTYPE")] + + return params diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py deleted file mode 100644 index 32c67118b..000000000 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/DipoleGMConfig.py +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -# - -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - -def DipoleGeometryCfg (flags): - acc = ComponentAccumulator() - from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg - acc.merge(DipoleGeometryCfg( flags )) - return acc - - -if __name__ == "__main__": - # import os - from AthenaCommon.Logging import log - from AthenaCommon.Constants import DEBUG - from AthenaCommon.Configurable import Configurable - from CalypsoConfiguration.AllConfigFlags import ConfigFlags - from CalypsoConfiguration.MainServicesConfig import MainServicesCfg - from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg - # Set up logging and new style config - log.setLevel(DEBUG) - Configurable.configurableRun3Behavior = True - ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-01") - # ConfigFlags.addFlag("Detector.SimulateVeto", True) - # ConfigFlags.addFlag("Detector.SimulateFaserSCT", True) - # ConfigFlags.addFlag("Detector.SimulateUpstreamDipole", True) - # ConfigFlags.addFlag("Detector.SimulateCentralDipole", True) - # ConfigFlags.addFlag("Detector.SimulateDownstreamDipole", True) - - # from AthenaConfiguration.TestDefaults import defaultTestFiles - # Provide MC input - # ConfigFlags.Input.Files = defaultTestFiles.HITS - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateVeto = False - ConfigFlags.Detector.SimulateFaserSCT = False - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.GeoModel.Align.Dynamic = False - # Provide data input - ##from AthenaConfiguration.TestDefaults import defaultTestFiles - # - ConfigFlags.lock() - # Construct ComponentAccumulator - acc = MainServicesCfg(ConfigFlags) - acc.merge(PoolReadCfg(ConfigFlags)) - # acc.merge(ScintGeometryCfg(ConfigFlags)) - # acc.merge(FaserSCT_GeometryCfg(ConfigFlags)) - acc.merge(DipoleGeometryCfg(ConfigFlags)) - #acc.getService("StoreGateSvc").Dump=True - acc.getService("ConditionStore").Dump=True - acc.printConfig(withDetails=True) - f=open('DipoleGMCfg2.pkl','wb') - acc.store(f) - f.close() - ConfigFlags.dump() - # Execute and finish - acc.run(maxEvents=3) diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoDBInterface.py b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoDBInterface.py new file mode 100644 index 000000000..fe851e833 --- /dev/null +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoDBInterface.py @@ -0,0 +1,230 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the FASER collaboration + +from AthenaCommon import Logging + +import coral +import os + +# ------------------------------------------------------------------------------------- +# FaserGeoDBInterface : Interface with the geometry DB +# ------------------------------------------------------------------------------------- + +class FaserGeoDBInterface: + + def __init__(self,dbTag,verbose=False): + + self.dbGeoTag=dbTag + self.dbGeoTagId="" + self.dbSession=0 + self.dbSchema=0 + self.bVerbose=verbose + + self.TagAndNodeVersionDict={} + + def __del__(self): + + Logging.log.verbose("-> close DB connection") + del self.dbSession + + + def ConnectToDB(self): + + svc = coral.ConnectionService() + svcconfig = svc.configuration() + svcconfig.disablePoolAutomaticCleanUp() + svcconfig.setConnectionTimeOut(0) + + # Check that the FRONTIER_SERVER is set properly, if not reduce the retrial period and time out values + if not ('FRONTIER_SERVER' in os.environ and os.environ['FRONTIER_SERVER']): + svcconfig.setConnectionRetrialPeriod(1) + svcconfig.setConnectionRetrialTimeOut(1) + else: + svcconfig.setConnectionRetrialPeriod(300) + svcconfig.setConnectionRetrialTimeOut(3600) + + self.dbSession = svc.connect( 'FASERDD', accessMode = coral.access_ReadOnly ) + transaction = self.dbSession.transaction() + + self.dbSchema = self.dbSession.nominalSchema() + transaction.start(True) + + def ConnectAndBrowseGeoDB(self): + + self.ConnectToDB() + self.ReadGeometryTagId() + self.ReadTagAndNodeVersionsFromDB() + + + def ReadGeometryTagId(self): + """ Read the geometry Id corresponding to the geometry tag name in order to collect the child node Id's """ + + query = self.dbSchema.tableHandle("HVS_TAG2NODE").newQuery() + + query.addToOutputList('TAG_NAME') + query.addToOutputList('TAG_ID') + + bindstag2node = coral.AttributeList() + bindstag2node.extend('tagN','string') + bindstag2node[0].setData(self.dbGeoTag) + condString='TAG_NAME=:tagN' + + query.setCondition(condString,bindstag2node) + + for currentRow in iter(query.execute()): + for i in range(0,currentRow.size()): + if currentRow[i].specification().name()=="TAG_ID": + Logging.log.verbose("*** GeoTagId ******** "+str(currentRow)) + self.dbGeoTagId=currentRow[i].data() + continue + + del query + return + + + def AnalyseDBRequestOutput_Query(self,request,keyName=""): + """ Analyze request output -> return a list of dictionaries and a list of parameter types """ + + dataList=[] + typeList=[] + + # Loop over row + iCmpt=0 + for row in iter(request.execute()): + dictLoc={} + # loop over parameters read fron the DB + for j in range(0,row.size()): + name=row[j].specification().name() + paramType=row[j].specification().typeName() + value=row[j].data() + dictLoc[name]=value + # collect parameter name/types + if iCmpt==0: typeList.append((name,paramType)) + iCmpt+=1 + dataList.append(dictLoc) + + # return datalist as a list of dictionaries ( 1 dictionary per line) + if keyName=="": + return dataList,typeList + + # reorganize dataList as a dictionary with keys based on the keyName input parameter + dataDict={} + for d in dataList: + k=d[keyName] + v=[d[paramName] for paramName,tmp in typeList if paramName!=keyName] + dataDict[k]=v + + return dataDict,typeList + + + def ReadTagAndNodeVersionsFromDB(self): + """ Read tag and node versions defined for the geometry tag """ + + # Proceed by looping over the chilg Id's as long as childs are defined + + bStopLoop=False + tagDictGbl={} + + # Check if the geometry tag was found in the DB + if self.dbGeoTagId=="": + Logging.log.error("The geometry tag %s could not be found in the database.", self.dbGeoTag) + Logging.log.error("Its name might be misspelled and/or the script might access a local DB that is not up to date.") + import sys + sys.exit() + + # Get node ids for the geometry tag + tagIdList=[int(self.dbGeoTagId)] # start with the geometry tag Id + + # Loop while child tags are found + while not bStopLoop : + + query0 = self.dbSchema.newQuery() + + query0.addToOutputList('C.NODE_NAME',"nodename") + query0.addToOutputList('A.TAG_NAME',"tagname") + query0.addToOutputList('A.TAG_ID',"tagid") + + query0.addToTableList( "HVS_TAG2NODE","A" ) + query0.addToTableList( "HVS_LTAG2LTAG","B") + query0.addToTableList( "HVS_NODE","C" ) + + bindstag2node = coral.AttributeList() + condString="C.NODE_ID=A.NODE_ID AND A.TAG_ID=B.CHILD_TAG and B.PARENT_TAG IN (%s)" % str(tagIdList)[1:-1] + Logging.log.verbose("----------------------------\n"+condString) + query0.setCondition(condString,bindstag2node) + + # Analyze the output and collect the new tag and node versions + dictRes,paramType=self.AnalyseDBRequestOutput_Query(query0,"nodename") + tagDictGbl.update(dictRes) + del query0 + + if len(dictRes.keys())==0: + # No child found + bStopLoop=True + else: + # create child Id's list for the next loop + tagIdList=[int(dictRes[k][1]) for k in dictRes.keys()] + + + self.TagAndNodeVersionDict.update(tagDictGbl) + + + def GetCurrentLeafContent(self, leafName): + """ Read a DB table content and return 3 lists : + - dbId : the data_id list corresponding to each entry in the table + - dbContent : the table values as a dictionary with keys corresponding to the dbId list + - paramName : the name of the table parameters """ + + upLeafName=leafName.upper() + + # check if table is defined in the current geometry + if leafName not in self.TagAndNodeVersionDict: + print("leafName not found") + dbId=[] + dbContent={} + paramName=[] + return dbId,dbContent,paramName + + + # ------ leafName_DATA_ID entries + leafTagId=self.TagAndNodeVersionDict[leafName][1] + + query = self.dbSchema.tableHandle(upLeafName+"_DATA2TAG").newQuery() + query.addToOutputList(upLeafName+'_DATA_ID') + + bindstag2node = coral.AttributeList() + condString=upLeafName+'_TAG_ID='+str(leafTagId) + query.setCondition(condString,bindstag2node) + + dictRes,typeList=self.AnalyseDBRequestOutput_Query(query) + dataIdList=[int(s[upLeafName+'_DATA_ID']) for s in dictRes] + del query + + # ------- values corresponding to leafName_DATA_ entries + + query = self.dbSchema.tableHandle(upLeafName+"_DATA").newQuery() + + condString=upLeafName+'_DATA_ID IN ('+str(dataIdList)[1:-1]+") ORDER BY "+upLeafName+"_DATA_ID" + query.setCondition(condString,bindstag2node) + + dictRes,typeList=self.AnalyseDBRequestOutput_Query(query) + del query + + # ------- build output + # paramNames : name of the DB parameters (following the table columns order) + # dbId : data_id vector + # dbContent : table content (key = dbId, value=list of value fooliwin the paramName ranking scheme) + + paramName=[s[0] for s in typeList] + + paramKey=typeList[0][0] + dbId=[] + dbContent={} + for s in dictRes: + key=int(s[paramKey]) + dbId.append(key) + v=[s[k[0]] for k in typeList] + dbContent[key]=v + + return dbId,dbContent,paramName + + diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py index 8f3b5d836..c75cbdbc6 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/FaserGeoModelConfig.py @@ -11,31 +11,13 @@ def FaserGeometryCfg (flags): from FaserGeoModel.ScintGMConfig import ScintGeometryCfg acc.merge(ScintGeometryCfg(flags)) - from FaserGeoModel.SCTGMConfig import SctGeometryCfg - acc.merge(SctGeometryCfg(flags)) + from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg + acc.merge(FaserSCT_GeometryCfg(flags)) - from FaserGeoModel.DipoleGMConfig import DipoleGeometryCfg - acc.merge(DipoleGeometryCfg(flags)) + from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg + acc.merge(DipoleGeometryCfg( flags )) - # Hack to avoid randomly failing to find sqlite file - # poolSvc = CompFactory.PoolSvc() - # poolSvc.SortReplicas = False - # acc.addService(poolSvc) - - # if flags.Detector.SimulateScintillator or flags.Detector.GeometryScintillator: - # from FaserGeoModel.ScintGMConfig import ScintGeometryCfg - # acc.merge(ScintGeometryCfg(flags)) - - # if flags.Detector.SimulateTracker or flags.Detector.GeometryTracker: - # from FaserGeoModel.SCTGMConfig import SctGeometryCfg - # acc.merge(SctGeometryCfg(flags)) - - # if flags.Detector.SimulateDipole or flags.Detector.GeometryDipole: - # from FaserGeoModel.DipoleGMConfig import DipoleGeometryCfg - # acc.merge(DipoleGeometryCfg(flags)) - - if flags.Detector.SimulateFaserCalo or flags.Detector.GeometryFaserCalo: - from FaserGeoModel.CaloGMConfig import CaloGeometryCfg - acc.merge(CaloGeometryCfg(flags)) + from EcalGeoModel.EcalGeoModelConfig import EcalGeometryCfg + acc.merge(EcalGeometryCfg( flags )) return acc diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py index d4bcd520d..04584191a 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py @@ -1,10 +1,10 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -from __future__ import print_function from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import ProductionStep from AthenaCommon.Configurable import Configurable -# from AthenaCommon.Constants import VERBOSE +from AthenaCommon import Logging def GeoModelCfg(configFlags): version = configFlags.GeoModel.FaserVersion @@ -23,8 +23,7 @@ def GeoModelCfg(configFlags): GeoExportFile = geoExportFile, SupportedGeometry = int(relversion[0]) ) - if configFlags.Detector.Simulate: - ## Protects GeoModelSvc in the simulation from the AlignCallbacks + if configFlags.Common.ProductionStep == ProductionStep.Simulation: ## Protects GeoModelSvc in the simulation from the AlignCallbacks gms.AlignCallbacks = False result.addService(gms,primary=True,create=True) @@ -35,7 +34,7 @@ def GeoModelCfg(configFlags): from EventInfoMgt.TagInfoMgrConfig import TagInfoMgrCfg tim_ca,tagInfoMgr = TagInfoMgrCfg(configFlags) - # result.addService(tagInfoMgr) + result.addService(tagInfoMgr) result.merge(tim_ca) #TagInfoMgr used by GeoModelSvc but no ServiceHandle. Relies on string-name @@ -52,6 +51,5 @@ if __name__ == "__main__": ConfigFlags.lock() acc = GeoModelCfg( ConfigFlags ) - acc.store( open("test.pkl", "wb"), useBootStrapFile = False ) - + acc.store( open("test.pkl", "wb") ) print("All OK") diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py deleted file mode 100644 index fcc96ff86..000000000 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/SCTGMConfig.py +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -# - -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg - -def SctGeometryCfg (flags): - acc = ComponentAccumulator() - acc.merge(FaserSCT_GeometryCfg( flags )) - return acc - - -if __name__ == "__main__": - from AthenaCommon.Logging import log - from AthenaCommon.Constants import DEBUG - from AthenaCommon.Configurable import Configurable - from CalypsoConfiguration.AllConfigFlags import ConfigFlags - from CalypsoConfiguration.MainServicesConfig import MainServicesCfg - from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg - # Set up logging and new style config - log.setLevel(DEBUG) - Configurable.configurableRun3Behavior = True - ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-01") - # ConfigFlags.addFlag("Detector.SimulateVeto", True) - # ConfigFlags.addFlag("Detector.SimulateFaserSCT", True) - - # from AthenaConfiguration.TestDefaults import defaultTestFiles - # Provide MC input - # ConfigFlags.Input.Files = defaultTestFiles.HITS - ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.GeoModel.Align.Dynamic = False - # Provide data input - ##from AthenaConfiguration.TestDefaults import defaultTestFiles - # - ConfigFlags.lock() - # Construct ComponentAccumulator - acc = MainServicesCfg(ConfigFlags) - acc.merge(PoolReadCfg(ConfigFlags)) - # acc.merge(ScintGeometryCfg(ConfigFlags)) - acc.merge(FaserSCT_GeometryCfg(ConfigFlags)) - #acc.getService("StoreGateSvc").Dump=True - acc.getService("ConditionStore").Dump=True - acc.printConfig(withDetails=True) - f=open('TrackerGMCfg2.pkl','wb') - acc.store(f) - f.close() - ConfigFlags.dump() - # Execute and finish - acc.run(maxEvents=3) diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py index e78a59b99..1c94db586 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/ScintGMConfig.py @@ -24,22 +24,21 @@ if __name__ == "__main__": from AthenaCommon.Logging import log from AthenaCommon.Constants import DEBUG from AthenaCommon.Configurable import Configurable - from AthenaConfiguration.AllConfigFlags import ConfigFlags + from CalypsoConfiguration.AllConfigFlags import ConfigFlags from CalypsoConfiguration.MainServicesConfig import MainServicesCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg # Set up logging and new style config log.setLevel(DEBUG) Configurable.configurableRun3Behavior = True - ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-01") - # ConfigFlags.addFlag("Detector.SimulateVeto", True) + ConfigFlags.GeoModel.FaserVersion = "Faser-01" # from AthenaConfiguration.TestDefaults import defaultTestFiles # Provide MC input # ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.SimulateTrigger= True - ConfigFlags.Detector.SimulatePreshower= True + ConfigFlags.Detector.GeometryVeto = True + ConfigFlags.Detector.GeometryTrigger= True + ConfigFlags.Detector.GeometryPreshower= True ConfigFlags.GeoModel.Align.Dynamic = False # Provide data input ##from AthenaConfiguration.TestDefaults import defaultTestFiles diff --git a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py index 4fd94d723..eb0ced94e 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py @@ -10,6 +10,7 @@ if __name__ == "__main__": from AthenaCommon.Constants import VERBOSE, INFO from AthenaCommon.Configurable import Configurable from CalypsoConfiguration.AllConfigFlags import ConfigFlags + from AthenaConfiguration.Enums import ProductionStep from CalypsoConfiguration.MainServicesConfig import MainServicesCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg # Set up logging and new style config @@ -19,13 +20,9 @@ if __name__ == "__main__": from AthenaConfiguration.TestDefaults import defaultTestFiles # Provide MC input + ConfigFlags.Common.ProductionStep = ProductionStep.Simulation ConfigFlags.Input.Files = defaultTestFiles.EVNT ConfigFlags.GeoModel.FaserVersion = "FASER-01" - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Generators/FaserCosmicGenerator/README.md b/Generators/FaserCosmicGenerator/README.md index 36032771d..c4e4a29d4 100644 --- a/Generators/FaserCosmicGenerator/README.md +++ b/Generators/FaserCosmicGenerator/README.md @@ -2,7 +2,7 @@ ## Setup -In Athena 22.0.29, the scipy module is missing from the LCG environment for some reason. +In Athena 22.0.30, the scipy module is missing from the LCG environment for some reason. To use the generator, the following command is required after the usual steps to setup the release: diff --git a/README.md b/README.md index 9eb23b38e..92183a28f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ git clone --recursive https://:@gitlab.cern.ch:8443/$USERNAME/calypso.git #The next three lines are used to setup the ATLAS release environment export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh -asetup --input=calypso/asetup.faser Athena,22.0.29 +asetup --input=calypso/asetup.faser Athena,22.0.30 #create build directory mkdir build diff --git a/Scintillator/ScintDetDescr/PreshowerGeoModel/python/PreshowerGeoModelConfig.py b/Scintillator/ScintDetDescr/PreshowerGeoModel/python/PreshowerGeoModelConfig.py index d0e538cf2..e731e9df9 100644 --- a/Scintillator/ScintDetDescr/PreshowerGeoModel/python/PreshowerGeoModelConfig.py +++ b/Scintillator/ScintDetDescr/PreshowerGeoModel/python/PreshowerGeoModelConfig.py @@ -17,24 +17,4 @@ def PreshowerGeometryCfg( flags ): preshowerDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic geoModelSvc.DetectorTools += [ preshowerDetectorTool ] - # if flags.GeoModel.Align.Dynamic: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/SCT","/Indet/AlignL2/SCT",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer")) - # else: - # if (not flags.Detector.SimulatePreshower) or flags.Detector.OverlayPreshower: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")) - # else: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) - - # if flags.Common.Project is not "AthSimulation": # Protection for AthSimulation builds - # if (not flags.Detector.SimulatePreshower) or flags.Detector.OverlayPreshower: - # from PreshowerConditionsAlgorithms.PreshowerConditionsAlgorithmsConf import PreshowerAlignCondAlg - # preshowerAlignCondAlg = PreshowerAlignCondAlg(name = "PreshowerAlignCondAlg", - # UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic) - # acc.addCondAlgo(preshowerAlignCondAlg) - # from PreshowerConditionsAlgorithms.PreshowerConditionsAlgorithmsConf import PreshowerDetectorElementCondAlg - # preshowerDetectorElementCondAlg = PreshowerDetectorElementCondAlg(name = "PreshowerDetectorElementCondAlg") - # acc.addCondAlgo(preshowerDetectorElementCondAlg) - return acc diff --git a/Scintillator/ScintDetDescr/PreshowerGeoModel/test/PreshowerGMConfig_test.py b/Scintillator/ScintDetDescr/PreshowerGeoModel/test/PreshowerGMConfig_test.py index e86bf87d5..2c2501267 100644 --- a/Scintillator/ScintDetDescr/PreshowerGeoModel/test/PreshowerGMConfig_test.py +++ b/Scintillator/ScintDetDescr/PreshowerGeoModel/test/PreshowerGMConfig_test.py @@ -11,7 +11,6 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulatePreshower = False ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Scintillator/ScintDetDescr/TriggerGeoModel/python/TriggerGeoModelConfig.py b/Scintillator/ScintDetDescr/TriggerGeoModel/python/TriggerGeoModelConfig.py index b92891b22..907ed096e 100644 --- a/Scintillator/ScintDetDescr/TriggerGeoModel/python/TriggerGeoModelConfig.py +++ b/Scintillator/ScintDetDescr/TriggerGeoModel/python/TriggerGeoModelConfig.py @@ -17,24 +17,4 @@ def TriggerGeometryCfg( flags ): triggerDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic geoModelSvc.DetectorTools += [ triggerDetectorTool ] - # if flags.GeoModel.Align.Dynamic: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/SCT","/Indet/AlignL2/SCT",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer")) - # else: - # if (not flags.Detector.SimulateTrigger) or flags.Detector.OverlayTrigger: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")) - # else: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) - - # if flags.Common.Project is not "AthSimulation": # Protection for AthSimulation builds - # if (not flags.Detector.SimulateTrigger) or flags.Detector.OverlayTrigger: - # from TriggerConditionsAlgorithms.TriggerConditionsAlgorithmsConf import TriggerAlignCondAlg - # triggerAlignCondAlg = TriggerAlignCondAlg(name = "TriggerAlignCondAlg", - # UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic) - # acc.addCondAlgo(triggerAlignCondAlg) - # from TriggerConditionsAlgorithms.TriggerConditionsAlgorithmsConf import TriggerDetectorElementCondAlg - # triggerDetectorElementCondAlg = TriggerDetectorElementCondAlg(name = "TriggerDetectorElementCondAlg") - # acc.addCondAlgo(triggerDetectorElementCondAlg) - return acc diff --git a/Scintillator/ScintDetDescr/TriggerGeoModel/test/TriggerGMConfig_test.py b/Scintillator/ScintDetDescr/TriggerGeoModel/test/TriggerGMConfig_test.py index 0c68cdf32..4c88d31ef 100644 --- a/Scintillator/ScintDetDescr/TriggerGeoModel/test/TriggerGMConfig_test.py +++ b/Scintillator/ScintDetDescr/TriggerGeoModel/test/TriggerGMConfig_test.py @@ -11,7 +11,6 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateTrigger = False ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py b/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py index 4e3497dc2..5d2e4b939 100644 --- a/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py +++ b/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py @@ -17,24 +17,4 @@ def VetoGeometryCfg( flags ): vetoDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic geoModelSvc.DetectorTools += [ vetoDetectorTool ] - # if flags.GeoModel.Align.Dynamic: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL1/ID","/Indet/AlignL1/ID",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL2/SCT","/Indet/AlignL2/SCT",className="CondAttrListCollection")) - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer")) - # else: - # if (not flags.Detector.SimulateVeto) or flags.Detector.OverlayVeto: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")) - # else: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) - - # if flags.Common.Project is not "AthSimulation": # Protection for AthSimulation builds - # if (not flags.Detector.SimulateVeto) or flags.Detector.OverlayVeto: - # from VetoConditionsAlgorithms.VetoConditionsAlgorithmsConf import VetoAlignCondAlg - # vetoAlignCondAlg = VetoAlignCondAlg(name = "VetoAlignCondAlg", - # UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic) - # acc.addCondAlgo(vetoAlignCondAlg) - # from VetoConditionsAlgorithms.VetoConditionsAlgorithmsConf import VetoDetectorElementCondAlg - # vetoDetectorElementCondAlg = VetoDetectorElementCondAlg(name = "VetoDetectorElementCondAlg") - # acc.addCondAlgo(vetoDetectorElementCondAlg) - return acc diff --git a/Scintillator/ScintDetDescr/VetoGeoModel/test/VetoGMConfig_test.py b/Scintillator/ScintDetDescr/VetoGeoModel/test/VetoGMConfig_test.py index 3b649270f..b38d833dd 100644 --- a/Scintillator/ScintDetDescr/VetoGeoModel/test/VetoGMConfig_test.py +++ b/Scintillator/ScintDetDescr/VetoGeoModel/test/VetoGMConfig_test.py @@ -11,7 +11,6 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateVeto = False ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Simulation/G4Faser/G4FaserAlg/test/runEcal.py b/Simulation/G4Faser/G4FaserAlg/test/runEcal.py index 268d8da2b..cbae412c9 100755 --- a/Simulation/G4Faser/G4FaserAlg/test/runEcal.py +++ b/Simulation/G4Faser/G4FaserAlg/test/runEcal.py @@ -57,22 +57,9 @@ if __name__ == "__main__": # Geometry-related settings # Do not change! # - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.GeometryVeto = True - ConfigFlags.Detector.SimulateTrigger= True - ConfigFlags.Detector.GeometryTrigger= True - ConfigFlags.Detector.SimulatePreshower = True - ConfigFlags.Detector.GeometryPreshower = True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.GeometryFaserSCT = True - ConfigFlags.Detector.SimulateEcal = True - ConfigFlags.Detector.GeometryEcal = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.Detector.GeometryUpstreamDipole = True - ConfigFlags.Detector.GeometryCentralDipole = True - ConfigFlags.Detector.GeometryDownstreamDipole = True + detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal'] + from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList + setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True) ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False # diff --git a/Simulation/G4Faser/G4FaserAlg/test/runG4.py b/Simulation/G4Faser/G4FaserAlg/test/runG4.py index a3e69e7a8..505468472 100644 --- a/Simulation/G4Faser/G4FaserAlg/test/runG4.py +++ b/Simulation/G4Faser/G4FaserAlg/test/runG4.py @@ -57,29 +57,14 @@ if __name__ == "__main__": # Geometry-related settings # Do not change! # - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.GeometryVeto = True - ConfigFlags.Detector.SimulateTrigger= True - ConfigFlags.Detector.GeometryTrigger= True - ConfigFlags.Detector.SimulatePreshower = True - ConfigFlags.Detector.GeometryPreshower = True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.GeometryFaserSCT = True - ConfigFlags.Detector.SimulateEcal = True - ConfigFlags.Detector.GeometryEcal = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.Detector.GeometryUpstreamDipole = True - ConfigFlags.Detector.GeometryCentralDipole = True - ConfigFlags.Detector.GeometryDownstreamDipole = True + detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal'] + from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList + setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True) ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False - # # Physics list # - ConfigFlags.Sim.PhysicsList = "FTFP_BERT" # # All flags should be set before calling lock diff --git a/Simulation/G4Faser/G4FaserAlg/test/runG4Cosmics.py b/Simulation/G4Faser/G4FaserAlg/test/runG4Cosmics.py index 56c675f5f..2479a9d11 100644 --- a/Simulation/G4Faser/G4FaserAlg/test/runG4Cosmics.py +++ b/Simulation/G4Faser/G4FaserAlg/test/runG4Cosmics.py @@ -58,22 +58,9 @@ if __name__ == "__main__": # Geometry-related settings # Do not change! # - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.GeometryVeto = True - ConfigFlags.Detector.SimulateTrigger= True - ConfigFlags.Detector.GeometryTrigger= True - ConfigFlags.Detector.SimulatePreshower = True - ConfigFlags.Detector.GeometryPreshower = True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.GeometryFaserSCT = True - ConfigFlags.Detector.SimulateEcal = True - ConfigFlags.Detector.GeometryEcal = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.Detector.GeometryUpstreamDipole = True - ConfigFlags.Detector.GeometryCentralDipole = True - ConfigFlags.Detector.GeometryDownstreamDipole = True + detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal'] + from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList + setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True) ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False diff --git a/Simulation/G4Faser/G4FaserAlg/test/runG4DecayInFlight.py b/Simulation/G4Faser/G4FaserAlg/test/runG4DecayInFlight.py index e11ee6d16..d33533819 100644 --- a/Simulation/G4Faser/G4FaserAlg/test/runG4DecayInFlight.py +++ b/Simulation/G4Faser/G4FaserAlg/test/runG4DecayInFlight.py @@ -58,22 +58,9 @@ if __name__ == "__main__": # Geometry-related settings # Do not change! # - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.GeometryVeto = True - ConfigFlags.Detector.SimulateTrigger= True - ConfigFlags.Detector.GeometryTrigger= True - ConfigFlags.Detector.SimulatePreshower = True - ConfigFlags.Detector.GeometryPreshower = True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.GeometryFaserSCT = True - ConfigFlags.Detector.SimulateEcal = True - ConfigFlags.Detector.GeometryEcal = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.Detector.GeometryUpstreamDipole = True - ConfigFlags.Detector.GeometryCentralDipole = True - ConfigFlags.Detector.GeometryDownstreamDipole = True + detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal'] + from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList + setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True) ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False diff --git a/Simulation/G4Faser/G4FaserAlg/test/runGeantinoScan.py b/Simulation/G4Faser/G4FaserAlg/test/runGeantinoScan.py index 5a35c670e..249968dfb 100644 --- a/Simulation/G4Faser/G4FaserAlg/test/runGeantinoScan.py +++ b/Simulation/G4Faser/G4FaserAlg/test/runGeantinoScan.py @@ -58,20 +58,9 @@ if __name__ == "__main__": # Geometry-related settings # Do not change! # - ConfigFlags.Detector.SimulateVeto = True - ConfigFlags.Detector.GeometryVeto = True - ConfigFlags.Detector.SimulateTrigger= True - ConfigFlags.Detector.GeometryTrigger= True - ConfigFlags.Detector.SimulatePreshower = True - ConfigFlags.Detector.GeometryPreshower = True - ConfigFlags.Detector.SimulateFaserSCT = True - ConfigFlags.Detector.GeometryFaserSCT = True - ConfigFlags.Detector.SimulateUpstreamDipole = True - ConfigFlags.Detector.SimulateCentralDipole = True - ConfigFlags.Detector.SimulateDownstreamDipole = True - ConfigFlags.Detector.GeometryUpstreamDipole = True - ConfigFlags.Detector.GeometryCentralDipole = True - ConfigFlags.Detector.GeometryDownstreamDipole = True + detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal'] + from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList + setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True) ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False # diff --git a/Simulation/G4Faser/G4FaserAlg/test/runGen.py b/Simulation/G4Faser/G4FaserAlg/test/runGen.py index 7ce711844..a53f8aabe 100755 --- a/Simulation/G4Faser/G4FaserAlg/test/runGen.py +++ b/Simulation/G4Faser/G4FaserAlg/test/runGen.py @@ -57,20 +57,9 @@ if __name__ == "__main__": # Geometry-related settings # Do not change! # -# ConfigFlags.Detector.SimulateVeto = True -# ConfigFlags.Detector.GeometryVeto = True -# ConfigFlags.Detector.SimulateTrigger= True -# ConfigFlags.Detector.GeometryTrigger= True -# ConfigFlags.Detector.SimulatePreshower = True -# ConfigFlags.Detector.GeometryPreshower = True -# ConfigFlags.Detector.SimulateFaserSCT = True -# ConfigFlags.Detector.GeometryFaserSCT = True -# ConfigFlags.Detector.SimulateUpstreamDipole = True -# ConfigFlags.Detector.SimulateCentralDipole = True -# ConfigFlags.Detector.SimulateDownstreamDipole = True -# ConfigFlags.Detector.GeometryUpstreamDipole = True -# ConfigFlags.Detector.GeometryCentralDipole = True -# ConfigFlags.Detector.GeometryDownstreamDipole = True +# detectors = ['Veto', 'Trigger', 'Preshower', 'FaserSCT', 'Dipole', 'Ecal'] +# from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList +# setupDetectorsFromList(ConfigFlags, detectors, toggle_geometry=True) ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Sim.ReleaseGeoModel = False # diff --git a/Simulation/G4Faser/G4FaserServices/python/G4FaserServicesConfigNew.py b/Simulation/G4Faser/G4FaserServices/python/G4FaserServicesConfigNew.py index a46deaa99..c9d461ceb 100644 --- a/Simulation/G4Faser/G4FaserServices/python/G4FaserServicesConfigNew.py +++ b/Simulation/G4Faser/G4FaserServices/python/G4FaserServicesConfigNew.py @@ -32,13 +32,13 @@ def getFASER_RegionCreatorList(ConfigFlags): # if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Sim.CavernBG != 'Signal': # regionCreatorList += [SX1PhysicsRegionToolCfg(ConfigFlags), BedrockPhysicsRegionToolCfg(ConfigFlags), CavernShaftsConcretePhysicsRegionToolCfg(ConfigFlags)] - if ConfigFlags.Detector.SimulateScintillator: + if ConfigFlags.Detector.EnableScintillator: regionCreatorList += [ScintillatorPhysicsRegionToolCfg(ConfigFlags)] - if ConfigFlags.Detector.SimulateTracker: + if ConfigFlags.Detector.EnableTracker: regionCreatorList += [TrackerPhysicsRegionToolCfg(ConfigFlags)] - if ConfigFlags.Detector.SimulateEcal: + if ConfigFlags.Detector.EnableEcal: regionCreatorList += [EcalPhysicsRegionToolCfg(ConfigFlags)] return regionCreatorList @@ -52,39 +52,27 @@ def FASER_FieldMgrListCfg(ConfigFlags): tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] - # if ConfigFlags.Detector.SimulateUpstreamDipole: - # acc = UpstreamDipoleFieldManagerToolCfg(ConfigFlags) - # tool = result.popToolsAndMerge(acc) - # fieldMgrList += [tool] - # if ConfigFlags.Detector.SimulateCentralDipole: - # acc = CentralDipoleFieldManagerToolCfg(ConfigFlags) - # tool = result.popToolsAndMerge(acc) - # fieldMgrList += [tool] - # if ConfigFlags.Detector.SimulateDownstreamDipole: - # acc = DownstreamDipoleFieldManagerToolCfg(ConfigFlags) - # tool = result.popToolsAndMerge(acc) - # fieldMgrList += [tool] - if ConfigFlags.Detector.SimulateDipole: + if ConfigFlags.Detector.GeometryDipole: acc = DipoleFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] - if ConfigFlags.Detector.SimulateVeto: + if ConfigFlags.Detector.GeometryVeto: acc = VetoFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] - if ConfigFlags.Detector.SimulateTrigger: + if ConfigFlags.Detector.GeometryTrigger: acc = TriggerFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] - if ConfigFlags.Detector.SimulatePreshower: + if ConfigFlags.Detector.GeometryPreshower: acc = PreshowerFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] - if ConfigFlags.Detector.SimulateTracker: + if ConfigFlags.Detector.GeometryTracker: acc = TrackerFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] - if ConfigFlags.Detector.SimulateEcal: + if ConfigFlags.Detector.GeometryEcal: acc = EcalFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] diff --git a/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py b/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py index 0fda13cce..6f091f844 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4FaserToolsConfigNew.py @@ -18,17 +18,17 @@ def generateScintSensitiveDetectorList(ConfigFlags): result = ComponentAccumulator() SensitiveDetectorList=[] - if ConfigFlags.Detector.SimulateVeto: + if ConfigFlags.Detector.EnableVeto: accVeto,toolVeto = VetoSensorSDCfg(ConfigFlags) SensitiveDetectorList += [ toolVeto ] result.merge(accVeto) - if ConfigFlags.Detector.SimulateTrigger: + if ConfigFlags.Detector.EnableTrigger: accTrigger,toolTrigger = TriggerSensorSDCfg(ConfigFlags) SensitiveDetectorList += [ toolTrigger ] result.merge(accTrigger) - if ConfigFlags.Detector.SimulatePreshower: + if ConfigFlags.Detector.EnablePreshower: accPreshower,toolPreshower = PreshowerSensorSDCfg(ConfigFlags) SensitiveDetectorList += [ toolPreshower ] result.merge(accPreshower) @@ -40,7 +40,7 @@ def generateTrackerSensitiveDetectorList(ConfigFlags): result = ComponentAccumulator() SensitiveDetectorList=[] - if ConfigFlags.Detector.SimulateFaserSCT: + if ConfigFlags.Detector.EnableFaserSCT: accSCT,toolSCT = SctSensorSDCfg(ConfigFlags) SensitiveDetectorList += [ toolSCT ] result.merge(accSCT) @@ -52,7 +52,7 @@ def generateCaloSensitiveDetectorList(ConfigFlags): result = ComponentAccumulator() SensitiveDetectorList=[] - if ConfigFlags.Detector.SimulateEcal: + if ConfigFlags.Detector.EnableEcal: accEcal,toolEcal = EcalSensorSDCfg(ConfigFlags) SensitiveDetectorList += [ toolEcal ] result.merge(accEcal) diff --git a/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py b/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py index dd8cbc0cf..d08fd6f40 100644 --- a/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py +++ b/Simulation/G4Faser/G4FaserTools/python/G4GeometryToolConfig.py @@ -61,32 +61,32 @@ def generateSubDetectorList(ConfigFlags): result = ComponentAccumulator() SubDetectorList=[] - if ConfigFlags.Detector.SimulateVeto: + if ConfigFlags.Detector.GeometryVeto: accVeto, toolVeto = VetoGeoDetectorToolCfg(ConfigFlags) SubDetectorList += [ toolVeto ] result.merge(accVeto) - if ConfigFlags.Detector.SimulateTrigger: + if ConfigFlags.Detector.GeometryTrigger: accTrigger, toolTrigger = TriggerGeoDetectorToolCfg(ConfigFlags) SubDetectorList += [ toolTrigger ] result.merge(accTrigger) - if ConfigFlags.Detector.SimulatePreshower: + if ConfigFlags.Detector.GeometryPreshower: accPreshower, toolPreshower = PreshowerGeoDetectorToolCfg(ConfigFlags) SubDetectorList += [ toolPreshower ] result.merge(accPreshower) - if ConfigFlags.Detector.SimulateFaserSCT: + if ConfigFlags.Detector.GeometryFaserSCT: accSCT, toolSCT = SCTGeoDetectorToolCfg(ConfigFlags) SubDetectorList += [ toolSCT ] result.merge(accSCT) - if ConfigFlags.Detector.SimulateDipole: + if ConfigFlags.Detector.GeometryDipole: accDipole, toolDipole = DipoleGeoDetectorToolCfg(ConfigFlags) SubDetectorList += [ toolDipole ] result.merge(accDipole) - if ConfigFlags.Detector.SimulateEcal: + if ConfigFlags.Detector.GeometryEcal: accEcal, toolEcal = EcalGeoDetectorToolCfg(ConfigFlags) SubDetectorList += [ toolEcal ] result.merge(accEcal) diff --git a/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py b/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py index 828aef6da..88c14ccb7 100644 --- a/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py +++ b/Simulation/ISF/ISF_Core/FaserISF_Services/test/FaserISF_ServicesConfigNew_test.py @@ -24,7 +24,6 @@ if __name__ == '__main__': ConfigFlags.Sim.WorldRRange = 15000 ConfigFlags.Sim.WorldZRange = 27000 #change defaults? - ConfigFlags.Detector.SimulateForward = False # Finalize ConfigFlags.lock() diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt b/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt index 534b66083..66d08f6cf 100644 --- a/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/CMakeLists.txt @@ -19,7 +19,8 @@ atlas_add_component( DipoleGeoModel LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} ${GEOMODEL_LIBRARIES} AthenaKernel GeoModelFaserUtilities GaudiKernel TrackerGeoModelUtils SGTools StoreGateLib SGtests AthenaPoolUtilities DetDescrConditions GeometryDBSvcLib ) atlas_add_test( DipoleGMConfig_test - SCRIPT test/DipoleGMConfig_test.py + SCRIPT python ${CMAKE_CURRENT_SOURCE_DIR}/test/DipoleGMConfig_test.py + PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR} PROPERTIES TIMEOUT 300 ) # Install files from the package: diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py b/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py index c45d13a1e..72c878099 100644 --- a/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/python/DipoleGeoModelConfig.py @@ -2,13 +2,6 @@ from AthenaConfiguration.ComponentFactory import CompFactory -# def getDipoleTool(name="DipoleTool", **kwargs): -# kwargs.setdefault("RDBAccessSvc", "RDBAccessSvc") -# kwargs.setdefault("GeometryDBSvc", "TrackerGeometryDBSvc") -# kwargs.setdefault("GeoDbTagSvc", "GeoDbTagSvc") -# return CfgMgr.DipoleTool(name, **kwargs) - - def DipoleGeometryCfg( flags ): from FaserGeoModel.GeoModelConfig import GeoModelCfg acc = GeoModelCfg( flags ) diff --git a/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py b/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py index a20abc7e9..e9b1cf758 100755 --- a/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py +++ b/Tracker/TrackerDetDescr/DipoleGeoModel/test/DipoleGMConfig_test.py @@ -11,7 +11,6 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateDipole = True ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py index 50af73d47..88a5b7b1e 100644 --- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py +++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py @@ -1,17 +1,9 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentFactory import CompFactory +from AthenaConfiguration.Enums import ProductionStep from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline -# def getFaserSCT_DetectorTool(name="FaserSCT_DetectorTool", **kwargs): -# kwargs.setdefault("DetectorName", "SCT") -# kwargs.setdefault("Alignable", True) -# kwargs.setdefault("RDBAccessSvc", "RDBAccessSvc") -# kwargs.setdefault("GeometryDBSvc", "TrackerGeometryDBSvc") -# kwargs.setdefault("GeoDbTagSvc", "GeoDbTagSvc") -# FaserSCT_DetectorTool = CompFactory.FaserSCT_DetectorTool -# return FaserSCT_DetectorTool(name, **kwargs) - def FaserSCT_GeometryCfg( flags ): from FaserGeoModel.GeoModelConfig import GeoModelCfg acc = GeoModelCfg( flags ) @@ -38,12 +30,12 @@ def FaserSCT_GeometryCfg( flags ): # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/AlignL3","/Indet/AlignL3",className="AlignableTransformContainer")) print("FaserSCT dynamic align flag is not supported!") else: - if (not flags.Detector.SimulateFaserSCT) : + if flags.Common.Project != "AthSimulation" and (flags.Common.ProductionStep != ProductionStep.Simulation or flags.Overlay.DataOverlay): acc.merge(addFoldersSplitOnline(flags,"SCT","/Tracker/Onl/Align","/Tracker/Align",className="AlignableTransformContainer")) - # else: - # acc.merge(addFoldersSplitOnline(flags,"INDET","/Indet/Onl/Align","/Indet/Align")) + else: + acc.merge(addFoldersSplitOnline(flags,"SCT","/Tracker/Onl/Align","/Tracker/Align")) if flags.Common.Project != "AthSimulation": # Protection for AthSimulation builds - if (not flags.Detector.SimulateFaserSCT) : + if flags.Common.ProductionStep != ProductionStep.Simulation or flags.Overlay.DataOverlay: FaserSCT_AlignCondAlg = CompFactory.FaserSCT_AlignCondAlg sctAlignCondAlg = FaserSCT_AlignCondAlg(name = "FaserSCT_AlignCondAlg", UseDynamicAlignFolders = flags.GeoModel.Align.Dynamic) diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/test/FaserSCT_GMConfig_test.py b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/test/FaserSCT_GMConfig_test.py index cd8a4d620..9349cdf70 100755 --- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/test/FaserSCT_GMConfig_test.py +++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/test/FaserSCT_GMConfig_test.py @@ -11,7 +11,6 @@ if __name__ == "__main__": ConfigFlags.Input.Files = defaultTestFiles.HITS ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" - ConfigFlags.Detector.SimulateFaserSCT = False ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.lock() diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/python/FaserSCT_DigitizationConfigNew.py b/Tracker/TrackerDigitization/FaserSCT_Digitization/python/FaserSCT_DigitizationConfigNew.py index 5b7438529..95d6b690c 100644 --- a/Tracker/TrackerDigitization/FaserSCT_Digitization/python/FaserSCT_DigitizationConfigNew.py +++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/python/FaserSCT_DigitizationConfigNew.py @@ -9,7 +9,7 @@ from AthenaCommon.Logging import logging PileUpXingFolder=CompFactory.PileUpXingFolder from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg #SCT_RadDamageSummaryTool=CompFactory.SCT_RadDamageSummaryTool -from FaserGeoModel.SCTGMConfig import SctGeometryCfg +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg from FaserSCT_ConditionsTools.FaserSCT_DCSConditionsConfig import FaserSCT_DCSConditionsCfg from FaserSCT_ConditionsTools.FaserSCT_SiliconConditionsConfig import FaserSCT_SiliconConditionsToolCfg, FaserSCT_SiliconConditionsCfg @@ -32,7 +32,7 @@ def FaserSCT_LastXing(): def FaserSCT_DigitizationCommonCfg(flags, name="FaserSCT_DigitizationToolCommon", **kwargs): """Return ComponentAccumulator with common FaserSCT digitization tool config""" - acc = SctGeometryCfg(flags) + acc = FaserSCT_GeometryCfg(flags) if not flags.Digitization.DoInnerDetectorNoise: kwargs.setdefault("OnlyHitElements", True) diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py index b4715bf9b..33389e158 100644 --- a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py +++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py @@ -27,7 +27,6 @@ ConfigFlags.Output.RDOFileName = "my.RDO.pool.root" ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Beam.NumberOfCollisions = 0. -#ConfigFlags.Detector.SimulateFaserSCT = True ConfigFlags.Digitization.TruthOutput = True diff --git a/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py b/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py index 3285654cc..1859efa6c 100644 --- a/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py +++ b/Tracker/TrackerRecAlgs/FaserSpacePoints/python/FaserSpacePointsCosmics.py @@ -14,13 +14,14 @@ from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserS from TrackerSpacePointFormation.TrackerSpacePointFormationConfig import TrackerSpacePointFinderCfg from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg Tracker__TruthSeededTrackFinder, THistSvc=CompFactory.getComps("Tracker::FaserSpacePoints", "THistSvc") def TruthSeededTrackFinderBasicCfg(flags, **kwargs): """Return ComponentAccumulator for TruthSeededTrackFinder""" - acc = ComponentAccumulator() + acc = FaserSCT_GeometryCfg(flags) kwargs.setdefault("SpacePointsSCTName", "SCT_SpacePointContainer") acc.addEventAlgo(Tracker__TruthSeededTrackFinder(**kwargs)) # attach ToolHandles diff --git a/Tracker/TrackerRecAlgs/TrackerClusterFit/python/TrackerClusterFitConfig.py b/Tracker/TrackerRecAlgs/TrackerClusterFit/python/TrackerClusterFitConfig.py index dfeb25177..19fb699da 100644 --- a/Tracker/TrackerRecAlgs/TrackerClusterFit/python/TrackerClusterFitConfig.py +++ b/Tracker/TrackerRecAlgs/TrackerClusterFit/python/TrackerClusterFitConfig.py @@ -2,13 +2,12 @@ Copyright (C) 2021 CERN for the benefit of the FASER collaboration """ -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory -# from FaserGeoModel.SCTGMConfig import SctGeometryCfg +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg def ClusterFitAlgBasicCfg(flags, **kwargs): """Return ComponentAccumulator for Tracker ClusterFitAlg""" - acc = ComponentAccumulator() + acc = FaserSCT_GeometryCfg( flags ) # clusterTool = acc.popToolsAndMerge(FaserSCT_ClusterizationToolCfg(flags)) # kwargs.setdefault("SCT_ClusteringTool", clusterTool) # kwargs.setdefault("DataObjectName", "SCT_RDOs") diff --git a/Tracker/TrackerRecAlgs/TrackerClusterFit/test/TrackerClusterFitDbg.py b/Tracker/TrackerRecAlgs/TrackerClusterFit/test/TrackerClusterFitDbg.py index da1f3c16f..0f9c27faf 100644 --- a/Tracker/TrackerRecAlgs/TrackerClusterFit/test/TrackerClusterFitDbg.py +++ b/Tracker/TrackerRecAlgs/TrackerClusterFit/test/TrackerClusterFitDbg.py @@ -102,6 +102,8 @@ ConfigFlags.Common.isOnline = False ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Beam.NumberOfCollisions = 0. +ConfigFlags.Detector.GeometryFaserSCT = True + ConfigFlags.lock() # Core components diff --git a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/python/TrackerPrepRawDataFormationConfig.py b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/python/TrackerPrepRawDataFormationConfig.py index 4d0786c4c..57c9d3cea 100644 --- a/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/python/TrackerPrepRawDataFormationConfig.py +++ b/Tracker/TrackerRecAlgs/TrackerPrepRawDataFormation/python/TrackerPrepRawDataFormationConfig.py @@ -7,14 +7,14 @@ from AthenaConfiguration.ComponentFactory import CompFactory PileUpXingFolder=CompFactory.PileUpXingFolder from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg -from FaserGeoModel.SCTGMConfig import SctGeometryCfg +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg from FaserSiLorentzAngleTool.FaserSCT_LorentzAngleConfig import FaserSCT_LorentzAngleCfg def FaserSCT_ClusterizationCommonCfg(flags, name="FaserSCT_ClusterizationToolCommon", **kwargs): """Return ComponentAccumulator with common FaserSCT Clusterization tool config""" - acc = SctGeometryCfg(flags) + acc = FaserSCT_GeometryCfg(flags) Tracker__TrackerClusterMakerTool,Tracker__FaserSCT_ClusteringTool=CompFactory.getComps("Tracker::TrackerClusterMakerTool", "Tracker::FaserSCT_ClusteringTool") trackerClusterMakerTool = Tracker__TrackerClusterMakerTool(name = "TrackerClusterMakerTool") diff --git a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py index a1076d989..de8355ded 100644 --- a/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py +++ b/Tracker/TrackerRecAlgs/TrackerSpacePointFormation/python/TrackerSpacePointFormationConfig.py @@ -7,7 +7,7 @@ from AthenaConfiguration.ComponentFactory import CompFactory PileUpXingFolder, Tracker__TrackerSpacePointFinder, Tracker__StatisticsAlg, TrackerDD__SiElementPropertiesTableCondAlg, Tracker__TrackerSpacePointMakerTool = CompFactory.getComps("PileUpXingFolder", "Tracker::TrackerSpacePointFinder", "Tracker::StatisticsAlg", "TrackerDD::SiElementPropertiesTableCondAlg", "Tracker::TrackerSpacePointMakerTool") from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg -from FaserGeoModel.SCTGMConfig import SctGeometryCfg +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg def TrackerDDSiElementPropertiesTableCondAlgCfg(flags, **kwargs): acc = ComponentAccumulator() @@ -17,7 +17,7 @@ def TrackerDDSiElementPropertiesTableCondAlgCfg(flags, **kwargs): def TrackerSpacePointMakerCommonCfg(flags, name="TrackerSpacePointMakerTool", **kwargs): """Return ComponentAccumulator with common FaserSCT Clusterization tool config""" - acc = SctGeometryCfg(flags) + acc = FaserSCT_GeometryCfg(flags) kwargs.setdefault("InputObjectName", "SCT_ClusterContainer") trackerSpacePointMakerTool = Tracker__TrackerSpacePointMakerTool(name) diff --git a/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/python/TruthSeededTrackFinderConfig.py b/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/python/TruthSeededTrackFinderConfig.py index 25ea50202..a94a28004 100644 --- a/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/python/TruthSeededTrackFinderConfig.py +++ b/Tracker/TrackerRecAlgs/TruthSeededTrackFinder/python/TruthSeededTrackFinderConfig.py @@ -4,16 +4,15 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory - Tracker__TruthSeededTrackFinder, THistSvc=CompFactory.getComps("Tracker::TruthSeededTrackFinder", "THistSvc") - +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg def TruthSeededTrackFinderBasicCfg(flags, **kwargs): """Return ComponentAccumulator for TruthSeededTrackFinder""" - acc = ComponentAccumulator() + acc = FaserSCT_GeometryCfg(flags) kwargs.setdefault("SpacePointsSCTName", "SCT_SpacePointContainer") kwargs.setdefault("FaserSpacePointsSeedsName", "Seeds_SpacePointContainer") acc.addEventAlgo(Tracker__TruthSeededTrackFinder(**kwargs)) diff --git a/Tracking/Acts/FaserActsGeometry/python/FaserActsExtrapolationConfig.py b/Tracking/Acts/FaserActsGeometry/python/FaserActsExtrapolationConfig.py index ee53a9aac..574f7f822 100644 --- a/Tracking/Acts/FaserActsGeometry/python/FaserActsExtrapolationConfig.py +++ b/Tracking/Acts/FaserActsGeometry/python/FaserActsExtrapolationConfig.py @@ -4,7 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg -from FaserGeoModel.SCTGMConfig import SctGeometryCfg +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg @@ -46,7 +46,7 @@ def FaserActsExtrapolationAlg_OutputCfg(flags): def FaserActsExtrapolationAlgCfg(flags, **kwargs): # Initialize GeoModel #acc = FaserGeometryCfg(flags) - acc = SctGeometryCfg(flags) + acc = FaserSCT_GeometryCfg(flags) # Initialize field service acc.merge(MagneticFieldSvcCfg(flags)) diff --git a/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py b/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py index 63f3a6028..40e7eb692 100644 --- a/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py +++ b/Tracking/Acts/FaserActsGeometry/python/FaserActsMaterialMapping_jobOptions.py @@ -62,15 +62,6 @@ if "__main__" == __name__: ConfigFlags.Beam.Type = "collisions" ConfigFlags.GeoModel.FaserVersion = "FASER-01" ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" -# ConfigFlags.Detector.SimulateBpipe = False -# ConfigFlags.Detector.SimulateID = False -# ConfigFlags.Detector.GeometryBpipe = True -# ConfigFlags.Detector.GeometryID = True -# ConfigFlags.Detector.GeometryPixel = True -# ConfigFlags.Detector.GeometrySCT = True -# ConfigFlags.Detector.GeometryCalo = True -# ConfigFlags.Detector.GeometryMuon = False -# ConfigFlags.Detector.GeometryTRT = True ConfigFlags.TrackingGeometry.MaterialSource = "geometry-maps.json" ConfigFlags.Concurrency.NumThreads = 1 ConfigFlags.Concurrency.NumConcurrentEvents = 1 diff --git a/Tracking/Acts/FaserActsGeometry/python/FaserActsWriteTrackingGeometryConfig.py b/Tracking/Acts/FaserActsGeometry/python/FaserActsWriteTrackingGeometryConfig.py index d4453a69f..2aef1dac0 100644 --- a/Tracking/Acts/FaserActsGeometry/python/FaserActsWriteTrackingGeometryConfig.py +++ b/Tracking/Acts/FaserActsGeometry/python/FaserActsWriteTrackingGeometryConfig.py @@ -4,7 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory #from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg -from FaserGeoModel.SCTGMConfig import SctGeometryCfg +from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg FaserActsWriteTrackingGeometry,FaserActsTrackingGeometrySvc,FaserActsTrackingGeometryTool,FaserActsObjWriterTool,FaserActsAlignmentCondAlg = CompFactory.getComps("FaserActsWriteTrackingGeometry","FaserActsTrackingGeometrySvc","FaserActsTrackingGeometryTool","FaserActsObjWriterTool","FaserActsAlignmentCondAlg") @@ -37,7 +37,7 @@ def FaserActsWriteTrackingGeometry_OutputCfg(flags): def FaserActsWriteTrackingGeometryCfg(flags, **kwargs): #acc = FaserGeometryCfg(flags) - acc = SctGeometryCfg(flags) + acc = FaserSCT_GeometryCfg(flags) acc.merge(FaserActsTrackingGeometrySvcCfg(flags, **kwargs)) #acc.merge(FaserActsAlignmentCondAlgCfg(flags)) acc.merge(FaserActsWriteTrackingGeometryBasicCfg(flags, **kwargs)) diff --git a/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py b/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py index 41a481b69..71be0017e 100644 --- a/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py +++ b/Tracking/Acts/FaserActsGeometry/test/FaserActsExtrapolationAlg.py @@ -26,7 +26,7 @@ ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Always needed ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # Workaround to avoid problematic ISF code ConfigFlags.GeoModel.Layout = "Development" -ConfigFlags.Detector.SimulateFaserSCT = True +ConfigFlags.Detector.GeometryFaserSCT = True #ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" # Always needed to fool autoconfig; value ignored ConfigFlags.GeoModel.Align.Dynamic = False #ConfigFlags.Concurrency.NumThreads = 1 diff --git a/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py b/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py index f2bc11f57..1124fd8f2 100644 --- a/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py +++ b/Tracking/Acts/FaserActsGeometry/test/FaserActsWriteTrackingGeometry.py @@ -25,7 +25,7 @@ ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Always needed ConfigFlags.addFlag("Input.InitialTimeStamp", 0) # Workaround to avoid problematic ISF code ConfigFlags.GeoModel.Layout = "Development" -ConfigFlags.Detector.SimulateFaserSCT = True +ConfigFlags.Detector.GeometryFaserSCT = True ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" # Always needed to fool autoconfig; value ignored ConfigFlags.GeoModel.Align.Dynamic = False #ConfigFlags.Concurrency.NumThreads = 1 diff --git a/version.txt b/version.txt index 6c5fa89ea..4d15ca040 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -22.0.29 +22.0.30 -- GitLab