diff --git a/Control/CalypsoConfiguration/python/AutoConfigFlags.py b/Control/CalypsoConfiguration/python/AutoConfigFlags.py index 347438815c27f2e8b2d02e3552c10de66a5915e9..61c219087376f768ccb90510bfb0f7d16725e590 100644 --- a/Control/CalypsoConfiguration/python/AutoConfigFlags.py +++ b/Control/CalypsoConfiguration/python/AutoConfigFlags.py @@ -1,3 +1,5 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + from PyUtils.MetaReader import read_metadata from AthenaCommon.Logging import logging from functools import lru_cache diff --git a/Control/CalypsoConfiguration/python/DetectorConfigFlags.py b/Control/CalypsoConfiguration/python/DetectorConfigFlags.py index c6daf00311a2c63427816b97bfd04cccb214153a..d61872c0789836972b2a6891fe532122f6709121 100644 --- a/Control/CalypsoConfiguration/python/DetectorConfigFlags.py +++ b/Control/CalypsoConfiguration/python/DetectorConfigFlags.py @@ -1,7 +1,7 @@ # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.AthConfigFlags import AthConfigFlags -from CalypsoConfiguration.AutoConfigFlags import DetDescrInfo, getDefaultDetectors +from CalypsoConfiguration.AutoConfigFlags import getDefaultDetectors # This module is based upon Control/AthenaCommon/python/DetFlags.py # Only some flags have been migrated. @@ -124,7 +124,7 @@ def _parseDetectorsList(flags, detectors): return detectors -def setupDetectorsFromList(flags, detectors, toggle_geometry=False, validate_only=False): +def setupDetectorsFromList(flags, detectors = allDetectors, toggle_geometry=False, validate_only=False): """Setup (toggle) detectors from a pre-defined list""" changed = False # setup logging diff --git a/Control/CalypsoConfiguration/python/MainServicesConfig.py b/Control/CalypsoConfiguration/python/MainServicesConfig.py index 2f04aa8e5d538606d39435283b0ce6d342e0e5bb..5e8514b3025efe814be9c9648e4e68ef14972293 100644 --- a/Control/CalypsoConfiguration/python/MainServicesConfig.py +++ b/Control/CalypsoConfiguration/python/MainServicesConfig.py @@ -68,7 +68,7 @@ def MessageSvcCfg(flags): from AthenaCommon.Constants import WARNING msgsvc.statLevel = WARNING - from AthenaConfiguration.Enums import ProductionStep + # from AthenaConfiguration.Enums import ProductionStep # if flags.Common.ProductionStep not in [ProductionStep.Default, ProductionStep.Reconstruction, ProductionStep.Derivation]: # msgsvc.Format = "% F%18W%S%7W%R%T %0W%M" # Temporary to match legacy configuration for serial simulation/digitization/overlay jobs if flags.Concurrency.NumThreads>0: @@ -206,16 +206,16 @@ def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr'): cfg.interactive=flags.Exec.Interactive - if flags.Concurrency.NumProcs > 0: - cfg.merge(AthenaMpEventLoopMgrCfg(flags)) + # if flags.Concurrency.NumProcs > 0: + # cfg.merge(AthenaMpEventLoopMgrCfg(flags)) # Additional components needed for threaded jobs only: if flags.Concurrency.NumThreads > 0: - if flags.Exec.MTEventService: - cfg.merge(AthenaMtesEventLoopMgrCfg(flags,True,flags.Exec.MTEventServiceChannel)) - else: - cfg.merge(AthenaHiveEventLoopMgrCfg(flags)) - # Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute + # if flags.Exec.MTEventService: + # cfg.merge(AthenaMtesEventLoopMgrCfg(flags,True,flags.Exec.MTEventServiceChannel)) + # else: + # cfg.merge(AthenaHiveEventLoopMgrCfg(flags)) + # # Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute cfg.addAuditor( CompFactory.SGCommitAuditor() ) elif LoopMgr == 'AthenaEventLoopMgr': cfg.merge(AthenaEventLoopMgrCfg(flags)) diff --git a/Control/CalypsoConfiguration/python/testDetectorFlags.py b/Control/CalypsoConfiguration/python/testDetectorFlags.py index 00ced8138df8e00fbd85b5231215b4ea6b060e1d..6c4c465c431d6705b68ab286e0458c868017a153 100644 --- a/Control/CalypsoConfiguration/python/testDetectorFlags.py +++ b/Control/CalypsoConfiguration/python/testDetectorFlags.py @@ -2,7 +2,7 @@ # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from CalypsoConfiguration.AllConfigFlags import initConfigFlags -from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList, enableDetectors, disableDetectors +from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList #, enableDetectors, disableDetectors configFlags = initConfigFlags() configFlags._loadDynaFlags('GeoModel') diff --git a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py index 4066807b4e7fa7e06acd6e79092371acfc4f43e4..090be3d2cf66b8377b731f6c73fecde87114c33b 100644 --- a/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py +++ b/DetectorDescription/GeoModel/FaserGeoModel/python/GeoModelConfig.py @@ -44,7 +44,7 @@ def GeoModelCfg(configFlags): if __name__ == "__main__": - from AthenaConfiguration.AllConfigFlags import initConfigFlags + from CalypsoConfiguration.AllConfigFlags import initConfigFlags # from AthenaConfiguration.TestDefaults import defaultTestFiles configFlags = initConfigFlags() # configFlags.Input.Files = defaultTestFiles.RAW diff --git a/Generators/FaserParticleGun/python/FaserParticleGunConfig.py b/Generators/FaserParticleGun/python/FaserParticleGunConfig.py index e610013175377a8b3ccf7ac430a4ecb55ed0827b..69dcec19a06261bb872c3f425af3360787759c38 100644 --- a/Generators/FaserParticleGun/python/FaserParticleGunConfig.py +++ b/Generators/FaserParticleGun/python/FaserParticleGunConfig.py @@ -3,13 +3,13 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # import sys -from AthenaCommon.AlgSequence import AthSequencer +# from AthenaCommon.AlgSequence import AthSequencer import ParticleGun as PG from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaConfiguration.ComponentFactory import CompFactory +# from AthenaConfiguration.ComponentFactory import CompFactory # from AthenaCommon.Constants import VERBOSE, INFO -from AthenaCommon.SystemOfUnits import TeV, GeV, MeV +from AthenaCommon.SystemOfUnits import TeV, MeV from AthenaCommon.PhysicalConstants import pi ### add radial pos sampler ### with gaussian beam implemented @@ -160,7 +160,7 @@ def FaserParticleGunDecayInFlightCfg(ConfigFlags, **kwargs) : from DIFGenerator.DIFSampler import CylinderSampler kwargs["mother_pos"] = CylinderSampler([0, 100**2], [0, 2*pi], [-1500, 0], 0, True) - if not "mother_mom" in kwargs: + if "mother_mom" not in kwargs: kwargs["mother_mom"] = PG.EThetaMPhiSampler(kwargs.setdefault("energy", ((1*TeV)**2 + (500*MeV)**2)**0.5), kwargs.setdefault("theta", [0, 0.0002]), kwargs.setdefault("mass", 500*MeV), diff --git a/Generators/FaserParticleGun/python/RadialPosSampler.py b/Generators/FaserParticleGun/python/RadialPosSampler.py index 8f2fe2f0f7f45c138b775ca7c0e713f36b938564..7c91e783f7f2c5da935aec1bb5a308212d415f04 100644 --- a/Generators/FaserParticleGun/python/RadialPosSampler.py +++ b/Generators/FaserParticleGun/python/RadialPosSampler.py @@ -1,5 +1,5 @@ import random -from math import pi, sin, cos, sqrt, log +from math import pi, sin, cos, sqrt from ParticleGun.samplers import Sampler, mksampler import ROOT diff --git a/Generators/GeneratorUtils/python/ShiftLOS.py b/Generators/GeneratorUtils/python/ShiftLOS.py index 8a2ff2a7b828567d2d04dff9d0204406000ffb04..3c882e269ff9d6369953fa3ebb8a6f06ef0b5f86 100644 --- a/Generators/GeneratorUtils/python/ShiftLOS.py +++ b/Generators/GeneratorUtils/python/ShiftLOS.py @@ -1,5 +1,5 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaPython import PyAthena from AthenaPython.PyAthena import StatusCode, McEventCollection, CLHEP from AthenaCommon.SystemOfUnits import m @@ -131,8 +131,8 @@ if __name__ == "__main__": parser.add_argument("--nevents", "-n", default = -1, type = int, help = "Number of events to process") args = parser.parse_args() - from AthenaCommon.Logging import log - from AthenaCommon.Constants import DEBUG, INFO + # from AthenaCommon.Logging import log + from AthenaCommon.Constants import INFO from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior = 1 @@ -152,15 +152,15 @@ if __name__ == "__main__": cfg = MainServicesCfg(configFlags) from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg - from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg + # from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg cfg = MainServicesCfg(configFlags) cfg.merge(PoolReadCfg(configFlags)) - import McParticleEvent.Pythonizations + # import McParticleEvent.Pythonizations from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - from AthenaConfiguration.ComponentFactory import CompFactory + # from AthenaConfiguration.ComponentFactory import CompFactory acc = ComponentAccumulator() alg = ShiftLOS("ShiftLOS", InputMCEventKey=args.InputMCEventKey, OutputMCEventKey=args.OutputMCEventKey, diff --git a/Generators/GeneratorUtils/python/ShiftLOSConfig.py b/Generators/GeneratorUtils/python/ShiftLOSConfig.py index 708a29578ce448876aee2ec514608c3f1879ae98..e0d9c23a302cf5945f589a7547819971f3255b21 100644 --- a/Generators/GeneratorUtils/python/ShiftLOSConfig.py +++ b/Generators/GeneratorUtils/python/ShiftLOSConfig.py @@ -3,15 +3,15 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # import sys -from AthenaCommon.AlgSequence import AthSequencer -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator, ConfigurationError -from AthenaConfiguration.ComponentFactory import CompFactory +# from AthenaCommon.AlgSequence import AthSequencer +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator #, ConfigurationError +# from AthenaConfiguration.ComponentFactory import CompFactory from GeneratorUtils.ShiftLOS import ShiftLOS def ShiftLOSCfg(ConfigFlags, **kwargs) : - import McParticleEvent.Pythonizations + # import McParticleEvent.Pythonizations cfg = ComponentAccumulator() diff --git a/graphics/VTI12/VTI12Algs/CMakeLists.txt b/graphics/VTI12/VTI12Algs/CMakeLists.txt index 97eddfd5eef6b3aa344df3346f2e45146eeef297..d1566e0296438e741bf272e4b0e8a9db8b51ae77 100644 --- a/graphics/VTI12/VTI12Algs/CMakeLists.txt +++ b/graphics/VTI12/VTI12Algs/CMakeLists.txt @@ -14,12 +14,12 @@ find_package( libffi ) atlas_add_component( VTI12Algs src/*.cxx src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps GaudiKernel EventInfo PathResolver + LINK_LIBRARIES AthenaBaseComps GaudiKernel xAODEventInfo PathResolver EventInfo PRIVATE_LINK_LIBRARIES VTI12Gui VP1UtilsBase ) # Install files from the package: -#atlas_install_python_modules( python/*.py ) -atlas_install_joboptions( share/*.py ) +atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) +atlas_install_joboptions( share/* ) atlas_install_scripts( share/vti12 ) #atlas_install_scripts( share/clear-bash-hash-table-vp1 ) diff --git a/graphics/VTI12/VTI12Algs/python/VTI12AlgConfig.py b/graphics/VTI12/VTI12Algs/python/VTI12AlgConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..ec59998c1f04805d2b17ee326a11d04e9db8415d --- /dev/null +++ b/graphics/VTI12/VTI12Algs/python/VTI12AlgConfig.py @@ -0,0 +1,384 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.ComponentFactory import CompFactory +from Campaigns.Utils import Campaign +from AthenaConfiguration.Enums import BeamType + +# from AthenaConfiguration.Enums import Format + + +def configureGeometry(flags, cfg): + if flags.Detector.GeometryEmulsion: + from EmulsionGeoModel.EmulsionGeoModelConfig import EmulsionGeometryCfg + cfg.merge(EmulsionGeometryCfg(flags)) + + if flags.Detector.GeometryDipole: + from DipoleGeoModel.DipoleGeoModelConfig import DipoleGeometryCfg + cfg.merge(DipoleGeometryCfg(flags)) + + if flags.Detector.GeometryVetoNu: + from VetoNuGeoModel.VetoNuGeoModelConfig import VetoNuGeometryCfg + cfg.merge(VetoNuGeometryCfg(flags)) + + if flags.Detector.GeometryVeto: + from VetoGeoModel.VetoGeoModelConfig import VetoGeometryCfg + cfg.merge(VetoGeometryCfg(flags)) + + if flags.Detector.GeometryTrigger: + from TriggerGeoModel.TriggerGeoModelConfig import TriggerGeometryCfg + cfg.merge(TriggerGeometryCfg(flags)) + + if flags.Detector.GeometryPreshower: + from PreshowerGeoModel.PreshowerGeoModelConfig import PreshowerGeometryCfg + cfg.merge(PreshowerGeometryCfg(flags)) + + if flags.Detector.GeometryFaserSCT: + from FaserSCT_GeoModel.FaserSCT_GeoModelConfig import FaserSCT_GeometryCfg + cfg.merge(FaserSCT_GeometryCfg(flags)) + + if flags.Detector.GeometryEcal: + from EcalGeoModel.EcalGeoModelConfig import EcalGeometryCfg + cfg.merge(EcalGeometryCfg(flags)) + + if flags.Detector.GeometryTrench: + from FaserGeoModel.TrenchGMConfig import TrenchGeometryCfg + cfg.merge(TrenchGeometryCfg(flags)) + +def getFASERVersion(): + import os + + if "FaserVersion" in os.environ: + return os.environ["FaserVersion"] + if "FaserBaseVersion" in os.environ: + return os.environ["FaserBaseVersion"] + return "Unknown" + + +def VTI12AlgCfg(flags, name="VTI12AlgCA", **kwargs): + # This is based on a few old-style configuation files: + # JiveXML_RecEx_config.py + # JiveXML_jobOptionBase.py + result = ComponentAccumulator() + + # kwargs.setdefault("FaserRelease", getFASERVersion()) + the_alg = CompFactory.VTI12Alg(name="VTI12EventDisplayAlg", **kwargs) + result.addEventAlgo(the_alg, primary=True) + return result + + +def SetupVTI12(): + from AthenaConfiguration.Enums import Format + from AthenaCommon.Logging import logging + from AthenaCommon.Constants import VERBOSE + + # ++++ Firstly we setup flags ++++ + _logger = logging.getLogger("VTI12") + _logger.setLevel(VERBOSE) + + from CalypsoConfiguration.AllConfigFlags import initConfigFlags + + flags = initConfigFlags() + flags.Concurrency.NumThreads = 0 + flags.Input.MCCampaign = Campaign.Unknown + flags.Input.TypedCollections = [] + flags.Input.MetadataItems = [] + flags.Beam.Type = BeamType.Collisions + flags.GeoModel.FaserVersion = "FASERNU-04" + + # ^ VP1 will not work with the scheduler, since its condition/data dependencies are not known in advance + # More in details: the scheduler needs to know BEFORE the event, what the dependencies of each Alg are. + # So for VP1, no dependencies are declared, which means the conditions data is not there. + # So when I load tracks, the geometry is missing and it crashes. + # Turning off the scheduler (with NumThreads=0) fixes this. + + parser = flags.getArgumentParser() + parser.prog = "vti12" + parser.description = """ + VTI12, or Virtual TI 12, is the interactive 3D event display for the FASER experiment at CERN. + It is based on the ATLAS event display VP1 + Detailed documentation can be found at the webpage: https://atlas-vp1.web.cern.ch/atlas-vp1 + but below are the flags that can be used to configure VP1 (most are standard Athena flags, but some are VP1-specific). + """ + parser.description = """ + So for example, to run VTI12 on a file: vti12 [options] myESD.pool.root""" + # Add VTI12-specific arguments here, but remember you can also directly pass flags in form <flagName>=<value>. + group = parser.add_argument_group("VTI12 specific") + group.add_argument( + "Filename", + nargs='?', + help="Input file to pass to VTI12 (i.e. vti12 myESD.pool.root as an alternative to vti12 --filesInput=[])", + metavar="File name", + ) + group.add_argument( + "--config", + nargs="*", + help="Config file to use for VTI12. If not specified, the default configuration will be used.", + ) + group.add_argument( + "--verboseAthena", + action="store_true", + help="If false, tell Athena to suppress INFO messages and below.", + ) + # group.add_argument( + # "--online", action="store_true", help="Use this flag for running VP1 at P1." + # ) + group.add_argument( + "--cruise", + type=int, + help="Start in cruise mode, changing events after N seconds.", + ) + # Batch + # group.add_argument( + # "--batch", + # action="store_true", + # help="Run VTI12 in 'batch' mode with a given configuration file.", + # ) + # group.add_argument( + # "--batch-all-events", + # action="store_true", + # help="Process all events in the input data file in '-batch' mode. Use this together with '-batch'.", + # ) + # group.add_argument( + # "--batch-n-events", + # type=int, + # help="Process 'N' events in the input data file in '-batch' mode. Use this together with '-batch'.", + # ) + # group.add_argument( + # "--batch-output-folder", + # help="Specify an output folder to store the event displays produced with the '-batch' option.", + # ) + # group.add_argument( + # "--batch-random-config", + # action="store_true", + # help="Run VTI12 in 'batch' mode; for each single event a configuration file will be randomly picked out of the configuration files provided by the user. Use this together with '-batch'.", + # ) + # Live / Livelocal + # group.add_argument( + # "--live", action="store_true", help="Run on live events from point 1." + # ) + # group.add_argument( + # "--livelocal", + # action="store_true", + # help="Run on live events from point 1 in local directory.", + # ) + # group.add_argument( + # "--eventsrc", + # help="Directory to take single event files from (do not specify input files in this case). To get files from a web server (i.e. live events), put instead the url to the file residing in the same directory (most users should just use the --live option instead).", + # ) + # group.add_argument( + # "--extraevtsrcdir", + # help="Directory to take single event files from (do not specify input files in this case). To get files from a web server (i.e. live events), put instead the url to the file residing in the same directory (most users should just use the -live option instead).", + # ) + # group.add_argument( + # "--eventcpy", + # help="Directory to keep local copies of processed event files. If --eventsrc is set, then -eventcpy will default to /tmp/emoyse/vp1events/6897 .", + # ) + # group.add_argument('--nocleanupeventcpy', action='store_true', help="Prevent removal of eventcpy directory after athena process finishes.") + # Commented, because I'm not sure how to implement this safely. + + args = flags.fillFromArgs(parser=parser) + + if "help" in args: + # No point doing more here, since we just want to print the help. + import sys + sys.exit() + + # Support the positional version of passing file name e.g. vp1 myESD.pool.root + if args.Filename and ( + flags.Input.Files == [] + or flags.Input.Files == ["_CALYPSO_GENERIC_INPUTFILE_NAME_"] + ): + flags.Input.Files = [args.Filename] + + _logger.verbose("+ About to set flags related to the input") + + + + + # Empty input is not normal for Athena, so we will need to check + # this repeatedly below + vti12_empty_input = False + # This covers the use case where we launch VP1 + # without input files; e.g., to check the detector description + if flags.Input.Files == [] or flags.Input.Files == [ + "_CALYPSO_GENERIC_INPUTFILE_NAME_" + ]: + from AthenaConfiguration.TestDefaults import defaultGeometryTags + + vti12_empty_input = True + # NB Must set e.g. ConfigFlags.Input.Runparse_args() Number and + # ConfigFlags.Input.TimeStamp before calling the + # MainServicesCfg to avoid it attempting auto-configuration + # from an input file, which is empty in this use case. + # If you don't have it, it (and/or other Cfg routines) complains and crashes. + # See also: + # https://acode-browser1.usatlas.bnl.gov/lxr/source/athena/InnerDetector/InDetConditions/SCT_ConditionsAlgorithms/python/SCT_DCSConditionsTestAlgConfig.py#0023 + flags.Input.ProjectName = "mc20_13TeV" + flags.Input.RunNumbers = [330000] + flags.Input.TimeStamps = [1] + flags.Input.TypedCollections = [] + + # set default CondDB and Geometry version + flags.IOVDb.GlobalTag = "OFLCOND-FASER-03" + flags.Input.isMC = True + flags.Input.MCCampaign = Campaign.Unknown + flags.GeoModel.FaserVersion = "FASERNU-04" + else: + # Now just check file exists, or fail gracefully + from os import path + + for file in flags.Input.Files: + if not path.exists(flags.Input.Files[0]): + _logger.warning("Input file", file, "does not exist") + import sys + sys.exit(1) + + # Set the online flag if we are running at P1 + # if args.online: + # flags.Common.isOnline = args.online + # elif "HLTP" in flags.IOVDb.GlobalTag: + # print( + # "HLTP detected in the global tag, but --online mode is not enabled. Enabling it now." + # ) + # flags.Common.isOnline = True + + _logger.verbose("+ ... Input flags done") + + _logger.verbose("+ About to set the detector flags") + # So we can now set up the geometry flags from the input + from CalypsoConfiguration.DetectorConfigFlags import setupDetectorsFromList + setupDetectorsFromList(flags, toggle_geometry = True) + # setupDetectorFlags( + # flags, + # None, + # use_metadata=not vp1_empty_input, + # toggle_geometry=True, + # keep_beampipe=True, + # ) + _logger.verbose("+ ... Detector flags done") + + # finalize setting flags: lock them. + flags.lock() + + # DEBUG -- inspect the flags + flags.dump() + # flags._loadDynaFlags('GeoModel') + # flags._loadDynaFlags('Detector') + # flags.dump('Detector.(Geometry|Enable)', True) + + # ++++ Now we setup the actual configuration ++++ + + # NB Must have set ConfigFlags.Input.RunNumber and + # ConfigFlags.Input.TimeStamp before calling to avoid + # attempted auto-configuration from an input file. + _logger.verbose("+ Setup main services, and input file reading") + + from CalypsoConfiguration.MainServicesConfig import MainServicesCfg + + cfg = MainServicesCfg(flags) + _logger.verbose("+ Back from MainServicesCfg") + if not vti12_empty_input: + # Only do this if we have input files, otherwise flags will try to read metadata + # Check if we are reading from POOL and setupo convertors if so + if flags.Input.Format is Format.POOL: + from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg + + cfg.merge(PoolReadCfg(flags)) + # Check if running on legacy inputs + if "EventInfo" not in flags.Input.Collections: + from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg + cfg.merge(EventInfoCnvAlgCfg(flags)) + + # from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg + # cfg.merge(TrackCollectionReadCfg(flags, "Tracks")) + + # from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg + # AtlasExtrapolationEngine = cfg.getPrimaryAndMerge(AtlasExtrapolationEngineCfg(flags)) + # cfg.addPublicTool(AtlasExtrapolationEngine) + + if flags.Input.isMC: + # AOD2xAOD Truth conversion + from xAODTruthCnv.xAODTruthCnvConfig import GEN_AOD2xAODCfg + + cfg.merge(GEN_AOD2xAODCfg(flags)) + _logger.verbose("+ ... Main services done") + + _logger.verbose("+ About to setup geometry") + configureGeometry(flags, cfg) + _logger.verbose("+ ... Geometry done") + + # Setup some VP1 specific stuff + vti12config = {} + if not args.verboseAthena: + # Suppress the output from Athena + print("Suppressing most messages from Athena.") + print("To see more, set the --verboseAthena flag to true.") + msgService = cfg.getService("MessageSvc") + msgService.OutputLevel = 4 + + if args.cruise: + vti12config.setdefault("InitialCruiseMode", "EVENT") + vti12config.setdefault("InitialCruiseModePeriod", args.cruise) + + if args.config: + print("Using config file", args.config) + vti12config.setdefault("InitialInputVTI12Files", args.config) + + # Batch mode + # if args.batch: + # setup_batch_mode(args) + + # Event copying and live + # if args.eventsrc: + # vti12config.setdefault("MultipleFilesON", True) + + # if args.live or args.livelocal: + # setup_live_mode(args, vp1config) + + # configure VTI12 + cfg.merge(VTI12AlgCfg(flags, **vti12config)) + cfg.run() + + +# def setup_live_mode(args, vp1config): +# vp1config.setdefault("MultipleFilesON", True) +# if args.eventcpy: +# vp1config.setdefault("vp1Alg.MFLocalCopyDir", args.eventcpy) +# if args.extraevtsrcdir: +# vp1config.setdefault("MFAvailableLocalInputDirectories", args.extraevtsrcdir) +# if args.live: +# vp1config.setdefault( +# "MFSourceDir", +# "https://atlas-live.cern.ch/event_files/L1MinBias/vp1fileinfo.txt", +# ) +# elif args.livelocal: +# vp1config.setdefault("MFSourceDir", "/VP1_events/") + + +# def setup_batch_mode(args): +# # BATCH-MODE +# # If "--batch" is True, then set the corresponding env var. +# # The GUI of VP1 will not be shown, but the config file will be taken +# # and in the end a render of the 3D window will be saved as PNG file. +# import os + +# if args.batch: +# os.putenv("VP1_BATCHMODE", "1") +# if args.batch_all_events: +# os.putenv("VP1_BATCHMODE_ALLEVENTS", "1") +# if args.batch_n_events: +# os.putenv("VP1_BATCHMODE_NEVENTS", str(args.batch_n_events)) +# if args.batch_output_folder: +# os.putenv("VP1_BATCHMODE_OUT_FOLDER", args.batch_output_folder) +# if args.batch_random_config: +# os.putenv("VP1_BATCHMODE_RANDOMCONFIG", "1") + + +if __name__ == "__main__": + # Run with e.g. + # python -m VTI12Algs.VTI12AlgConfig --filesInput=myESD_ca.pool.root + SetupVTI12() + import sys + + sys.exit() diff --git a/graphics/VTI12/VTI12Algs/share/vti12 b/graphics/VTI12/VTI12Algs/share/vti12 index ee3cf7c0f5f1afd20895c475e6a42f7f7d7d9caa..1d14b87d8d295a3aef58195e213dfce98f1b3153 100644 --- a/graphics/VTI12/VTI12Algs/share/vti12 +++ b/graphics/VTI12/VTI12Algs/share/vti12 @@ -1,1216 +1,36 @@ -#!/bin/bash - -# Script for constructing command which launches athena on vp1.py, with appropriate options (in the -c flag). -# -# Author: Thomas.Kittelmann@cern.ch -# First useful version: July 2007 -# -# Modified: Manuel.Proissl@cern.ch, March 2012 -# Riccardo.Maria.Bianchi@cern.ch, multiple times -# Edward.Moyse@cern.ch, multiple times -# -# Current Maintainers: -# - Riccardo.Maria.Bianchi@cern.ch -# - Edward.Moyse@cern.ch -# -# Questions: Riccardo.Maria.Bianchi@cern.ch -# -# - - -#fixme/todo: option to start cruise mode (event/second) -#fixme/todo: MULTINP_CPY should not be allowed to exist beforehand! - - -### TERMINAL COLORS ### -GREEN='\033[1;32m' -YELLOW='\033[1;33m' -LIGHTBLUE='\033[1;34m' -RED='\033[0;31m' -WHITE='\033[0;97m' -UNDERLINED='\033[4m' -BOLD='\033[1m' -NC='\033[0m' # No Color -# then use: -# - printf "I ${RED}love${NC} Stack Overflow\n" -# - echo -e "I ${RED}love${NC} Stack Overflow" - - - -echo -echo "******************************************" -echo -echo "Launching VTI12 - the FASER 3D event display" -echo -echo "******************************************" -echo -echo - -################################################## -# Workaraound for LD_PRELOAD # -# # -# Details: # -# https://its.cern.ch/jira/browse/ATLASVPONE-228 # -# # -################################################## -echo -e "${LIGHTBLUE}*** VP1 NOTE ***${NC} setting LD_PRELOAD=/usr/lib64/libGL.so.1 env var, to correctly load OpenGL before all other TLS libs. That is caused by a bug in Red Hat 6. For details, see: https://its.cern.ch/jira/browse/ATLASVPONE-228" -export LD_PRELOAD=/usr/lib64/libGL.so.1 -################################################## - -################################################## -# Workaraound for keyboard input issue on LXPLUS # -# # -# Details: # -# https://its.cern.ch/jira/browse/ATLASVPONE-380 # -# # -################################################## -if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - # We are on a GNU/Linux platform machine - if [[ $(hostname) == lxplus* ]]; then - # We are on a LXPLUS machine - echo "uname: " "$(expr substr $(uname -s) 1 5)" - echo "hostname: " "$(hostname)" - echo -e "${LIGHTBLUE}*** VP1 NOTE ***${NC} you are running VP1 remotely on a LXPLUS machine. Hence, we set the 'QT_XKB_CONFIG_ROOT environment variable to fix the problem LXPLUS machine have with the new Qt5 framework, which prevent a proper detection of keyboard events. For details, see: https://its.cern.ch/jira/browse/ATLASVPONE-380." - export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb - fi # closes "lxplus" -fi # closes "Linux" -################################################## - - - -APP=`basename $0` - -which athena.py > /dev/null 2>&1 -if [ $? != 0 ]; then - echo "Error: athena.py not found in path. Please setup atlas release before running" - exit 1 -fi - - -####################################### -## Warning Messages ## -####################################### -MUSTQUIT=0 -if [ -z ${Athena_VERSION+x} ]; then - echo "ERROR! The variable 'Athena_VERSION' is unset! Apparently Athena is not properly set. Quitting..." - MUSTQUIT=1 -else - if [[ ${Athena_VERSION} =~ ^21\. ]]; then - echo; echo -e " ${RED}${BOLD} *** WARNING! Release 21 detected! *** ${NC}"; echo - echo -e " Apparently, you are using the Release 21 of the Athena environment. Unfortunately, VP1 does not work in rel. 21. ${UNDERLINED}Please use a release >= 22, or the 'master' release${NC}. By using them, you can still access and visualize data produced with rel. 21, if you need that." - echo; echo -e " ${RED}${BOLD}--->${NC} Please refer to the instructions published at: ${NC}${BOLD}${UNDERLINED} http://atlas-vp1.web.cern.ch/atlas-vp1/home/documentation/running-the-latest-vp1-version/${NC} ${RED}${BOLD}<---${NC}"; echo; echo - MUSTQUIT=1 - fi -fi - -if [ $MUSTQUIT -eq 1 ]; then - exit 1; -fi - - - - -####################################### -## Init config variables ## -####################################### - -LIVEDEFAULTDETDESCR="ATLAS-GEO-10-00-00" -LIVEDEFAULTGLOBCOND="COMCOND-BLKPST-004-01" -LIVEDEFAULTEVENTSRC="https://atlas-live.cern.ch/event_files/L1MinBias/vp1fileinfo.txt" -LIVELOCALDEFAULTEVENTSRC="/VP1_events/" -LIVEBOOTSTRAPSRC="http://atlas-vp1.web.cern.ch/atlas-vp1/live-bootstrap/vp1fileinfo.txt" - -declare -a FILES_POOLROOT -declare -a FILES_VP1CFG -declare -a FILES_EXTRAJOBOPT -declare -a LOCALEVENTSRC_AVAILDIRS -FLAG_HELP=0 -FLAG_DATA=0 -FLAG_TEST=0 -ERRORS="" -DETDESCRTAG="" -GLOBCONDTAG="" -SKIPEVENTS="" -CRUISEWITHTIME="" -LOGFILE="" -FILTEREVENTS="" -FLAG_BATCH=0 -FLAG_BATCH_RANDOM_CONFIG=0 -FLAG_BATCH_ALL_EVENTS=0 -FLAG_BATCH_N_EVENTS=0 -FLAG_BATCH_OUT_FOLDER="" -FLAG_LARHV=0 -# FLAG_FULLTOROIDS=0 -FLAG_DONTCLEANUPEVTCPY=0 -FLAG_LIVE=0 -FLAG_LIVELOCAL=0 -FLAG_NOAUTOCONF=0 -FLAG_TRIG=0 -FLAG_NOCALO=0 -FLAG_NOID=0 -FLAG_NOSORTDBREPLICAS=0 -FLAG_NOMUON=0 -FLAG_LUCID=0 -FLAG_ONLINE=0 -FLAG_ALFA=0 -FLAG_FORWARD_REGION=0 -FLAG_ZDC=0 -FLAG_CAVERN=0 -FLAG_TOYDETECTOR=0 -FLAG_GEOMODELSTATS=0 -FLAG_EXTRAPOLATOR=0 -FLAG_NOEXTRAPOLATOR=0 -FLAG_FITTER=0 -FLAG_MC=0 -FLAG_FATRAS=0 -FLAG_NOGUI=0 -FLAG_CGAL=0 -FLAG_NSW=0 -FLAG_SLHC=0 -#FLAG_CUSTOMGEOMETRY=0 # currently not used -FLAG_ADVANCED_ANTIALIASING=0 -MULTINP_SRC="" -MULTINP_CPY="" -TRIGDEC="" -FATRAS_TRUTHKEY="" -ATHENAOPTS="" - -####################################### -## Decode command line options ## -####################################### - -#echo -e "\nnumber of positional parameters (args): " $# # for DEBUG only - -# index init -i=1 - -# start looping over the number of positional parameters ($#) -while [ $i -le $# ]; do - - # get the i-positional parameter - arg=${!i} - - #echo -e "\nevaluating arg: " $arg # for DEBUG only - - ################ - # HELP / USAGE # - ################ - if [ "x${arg}" == "x-h" -o "x${arg}" == "x-help" -o "x${arg}" == "x--help" ]; then - FLAG_HELP=1 - - - ######################## - # COMMAND-LINE OPTIONS # - ######################## - - elif [ "x${arg}" == "x-larhv" ]; then - FLAG_LARHV=1 - # elif [ "x${arg}" == "x-fulltoroids" ]; then - # FLAG_FULLTOROIDS=1 - elif [ "x${arg}" == "x-live" ]; then - FLAG_LIVE=1 - elif [ "x${arg}" == "x-livelocal" ]; then - FLAG_LIVELOCAL=1 - # - # - # - #----------- - # BATCH MODE - #----------- - # check if the user provided config files with -batch/-b options - elif [ "x${arg}" == "x-batch" -o "x${arg}" == "x-b" ]; then - if [[ "$*" == *.vp1* ]] - then - FLAG_BATCH=1 - # text in bold, note in bold and red. at the end we reset the text style - echo "" - echo -e "\e[1m\e[31m\e[4mNote!\e[24m You chose to run VP1 in 'batch-mode' ('${arg}').\e[39m" - echo -e "Thus, the main VP1 window will be not shown, but in the end you will get a PNG file with the rendered image of the 3D window, based on the configuration file you provided.\e[0m" - echo "" - else - ERRORS="$ERRORS\nBatch mode needs at least one configuration file ('.vp1')" - fi - elif [ "x${arg}" == "x-batch-all-events" ]; then - FLAG_BATCH_ALL_EVENTS=1 - elif [ "x${arg}" == "x-batch-random-config" ]; then - FLAG_BATCH_RANDOM_CONFIG=1 - elif [ "x${arg:0:21}" == "x-batch-output-folder=" ]; then - FLAG_BATCH_OUT_FOLDER=${arg:21:$((${#arg}-21))} - if [ "x$FLAG_BATCH_OUT_FOLDER" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -batch-output-folder. Ex: -batch-output-folder=myFolder" - fi - elif [ "x${arg:0:21}" == "x-batch-output-folder" ]; then # catch arg without '=' character - FLAG_BATCH_OUT_FOLDER_2=${arg:20:$((${#arg}-20))} - if [ "x$FLAG_BATCH_OUT_FOLDER_2" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -batch-output-folder. Ex: -batch-output-folder=path/to/myFolder" - fi - elif [ "x${arg:0:16}" == "x-batch-n-events=" ]; then - FLAG_BATCH_N_EVENTS=${arg:16:$((${#arg}-16))} - echo -e "\e[1m\e[31m\e[4mNote!\e[24m You chose to run VP1 in 'batch-mode' over ${FLAG_BATCH_N_EVENTS} events ('${arg}'). VP1 will exit after having processed the given number of events.\e[39m" - if [ "x$FLAG_BATCH_N_EVENTS" == "x" ]; then - ERRORS="$ERRORS\nNeed a numeric argument to -batch-n-events" - else - #check it is integer: - echo "$FLAG_BATCH_N_EVENTS" | grep '^[0-9][0-9]*$' > /dev/null 2>&1 || \ - ERRORS="$ERRORS\nArgument to -batch-n-events must be an integer!" - fi - #echo "(sleeping for 2 secs...)" - echo "" - sleep 2s # to let the user read the warning messages about the batch mode - ### end of batch mode settings - # - # - elif [ "x${arg}" == "x-noautoconf" ]; then - FLAG_NOAUTOCONF=1 - elif [ "x${arg}" == "x-nocleanupeventcpy" ]; then - FLAG_DONTCLEANUPEVTCPY=1 - elif [ "x${arg}" == "x-data" ]; then - FLAG_DATA=1 - elif [ "x${arg}" == "x-test" ]; then - FLAG_TEST=1 - elif [ "x${arg}" == "x-trig" ]; then - FLAG_TRIG=1 - elif [ "x${arg}" == "x-nocalo" ]; then - FLAG_NOCALO=1 - elif [ "x${arg}" == "x-noid" ]; then - FLAG_NOID=1 - elif [ "x${arg}" == "x-nomuon" ]; then - FLAG_NOMUON=1 - elif [ "x${arg}" == "x-nosortdbreplicas" ]; then - FLAG_NOSORTDBREPLICAS=1 - elif [ "x${arg}" == "x-lucid" ]; then - FLAG_LUCID=1 - elif [ "x${arg}" == "x-online" ]; then - FLAG_ONLINE=1 - elif [ "x${arg}" == "x-alfa" ]; then - FLAG_ALFA=1 - elif [ "x${arg}" == "x-forwardregion" ]; then - FLAG_FORWARD_REGION=1 - elif [ "x${arg}" == "x-zdc" ]; then - FLAG_ZDC=1 - elif [ "x${arg}" == "x-cavern" ]; then - FLAG_CAVERN=1 - elif [ "x${arg}" == "x-toy-detector" ]; then - FLAG_TOYDETECTOR=1 - elif [ "x${arg}" == "x-geomodel-stats" ]; then - FLAG_GEOMODELSTATS=1 - elif [ "x${arg}" == "x-extrapolator" ]; then - FLAG_EXTRAPOLATOR=1 - elif [ "x${arg}" == "x-noextrapolator" ]; then - FLAG_NOEXTRAPOLATOR=1 - elif [ "x${arg}" == "x-refit" ]; then - FLAG_FITTER=1 - elif [ "x${arg}" == "x-fatras" ]; then - FLAG_FATRAS=1 - elif [ "x${arg}" == "x-nogui" ]; then - FLAG_NOGUI=1 - elif [ "x${arg}" == "x-cgal" ]; then - FLAG_CGAL=1 - elif [ "x${arg}" == "x-nsw" ]; then - FLAG_NSW=1 - elif [ "x${arg}" == "x-slhc" ]; then - echo "SLHC" - FLAG_SLHC=1 - #elif [ "x${arg}" == "x-customgeom" ]; then - # FLAG_CUSTOMGEOMETRY=1 - elif [ "x${arg}" == "x-advanced-aa" ]; then - FLAG_ADVANCED_ANTIALIASING=1 - export VP1_ADVANCED_ANTIALIASING=1 - elif [ "x${arg}" == "x-mc" ]; then - FLAG_MC=1 - elif [ "x${arg}" == "x-multinp" ]; then - echo "IGNORING OBSOlETE FLAG -multinp" - elif [ "x${arg:0:10}" == "x-detdescr=" ]; then - DETDESCRTAG=${arg:10:$((${#arg}-10))} - if [ "x$DETDESCRTAG" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -detdescr" - fi - elif [ "x${arg:0:10}" == "x-detdescr" ]; then - DETDESCRTAG_2=${arg:9:$((${#arg}-9))} - if [ "x$DETDESCRTAG_2" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -detdescr. Example: -detdescr=ATLAS-GEO-20-00-01" - fi - elif [ "x${arg:0:10}" == "x-globcond=" ]; then - GLOBCONDTAG=${arg:10:$((${#arg}-10))} - if [ "x$GLOBCONDTAG" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -globcond" - fi - elif [ "x${arg:0:10}" == "x-eventsrc=" ]; then - MULTINP_SRC=${arg:10:$((${#arg}-10))} - if [ "x$MULTINP_SRC" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -eventsrc" - fi - elif [ "x${arg:0:10}" == "x-eventcpy=" ]; then - MULTINP_CPY=${arg:10:$((${#arg}-10))} - if [ "x$MULTINP_CPY" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -eventcpy" - fi - elif [ "x${arg:0:9}" == "x-logfile=" ]; then - LOGFILE=${arg:9:$((${#arg}-9))} - if [ "x$LOGFILE" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -logfile" - fi - elif [ "x${arg:0:9}" == "x-trigdec=" ]; then - TRIGDEC=${arg:9:$((${#arg}-9))} - if [ "x$TRIGDEC" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -trigdec" - fi - elif [ "x${arg:0:11}" == "x-fatraskey=" ]; then - FATRAS_TRUTHKEY=${arg:11:$((${#arg}-11))} - if [ "x$FATRAS_TRUTHKEY" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -fatraskey" - fi - elif [ "x${arg:0:12}" == "x-skipevents=" ]; then - SKIPEVENTS=${arg:12:$((${#arg}-12))} - if [ "x$SKIPEVENTS" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -skipevents" - else - #check it is integer: - echo "$SKIPEVENTS" | grep '^[0-9][0-9]*$' > /dev/null 2>&1 || \ - ERRORS="$ERRORS\nArgument to -skipevents must be an integer!" - fi - elif [ "x${arg:0:11}" == "x-evtfilter=" ]; then - FILTEREVENTS=${arg:11:$((${#arg}-11))} - if [ "x$FILTEREVENTS" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -evtfilter" - fi - elif [ "x${arg:0:8}" == "x-cruise=" ]; then - CRUISEWITHTIME=${arg:8:$((${#arg}-8))} - if [ "x$CRUISEWITHTIME" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -cruise" - else - #check it is integer: - echo "$CRUISEWITHTIME" | grep '^[0-9][0-9]*$' > /dev/null 2>&1 || \ - ERRORS="$ERRORS\nArgument to -cruise must be an integer!" - if [ "x$CRUISEWITHTIME" == "x0" ]; then - ERRORS="$ERRORS\nArgument to -cruise must be positive!" - fi - fi - elif [ "x${arg:0:12}" == "x-athenaopts=" ]; then - ATHENAOPTS=${arg:12:$((${#arg}-12))} - if [ "x$ATHENAOPTS" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -athenaopts" - fi - elif [ "x${arg:0:16}" == "x-extraevtsrcdir=" ]; then - EXTRADIR=${arg:16:$((${#arg}-16))} - if [ "x$EXTRADIR" == "x" ]; then - ERRORS="$ERRORS\nNeed argument to -extraevtsrcdir" - else - if [ ! -d $EXTRADIR ]; then - ERRORS="$ERRORS\nExtra event source directory $EXTRADIR does not exist" - else - LOCALEVENTSRC_AVAILDIRS[${#LOCALEVENTSRC_AVAILDIRS[@]}]="$EXTRADIR" - fi - fi - - - ################### - # VP1 CONFIG FILE # - ################### - elif [ ${#arg} -gt 4 -a ${arg:$((${#arg}-4)):4} == ".vp1" ]; then - FILES_VP1CFG[${#FILES_VP1CFG[@]}]="${arg}" - - - ##################### - # EXTRA JOB OPTIONS # - ##################### - elif [ ${#arg} -gt 3 -a ${arg:$((${#arg}-3)):3} == ".py" ]; then - FILES_EXTRAJOBOPT[${#FILES_EXTRAJOBOPT[@]}]="${arg}" - - - ######################## - # EOS / LFN INPUT DATA # - ######################## - - # NOTES: - # - about reg-exp matching: https://its.cern.ch/jira/browse/ATLASVPONE-314 - # - 'elif' first checks if argument length is > 3 and if not begins with "-", - # then it checks the match with the reg-exp - - elif [[ ${#arg} -gt 3 && ${arg:0:1} != "-" && ( "${arg}" =~ ^LFN: ) ]]; then - echo -e "\n\e[1;94mOpening a file through the \e[4m'LFN:'\e[24m protocol...\e[0m" - FILES_POOLROOT[${#FILES_POOLROOT[@]}]="${arg}" - echo -e "\e[94mOpening the file: " $FILES_POOLROOT "\e[0m\n" - - elif [[ ${#arg} -gt 3 && ${arg:0:1} != "-" && ( "${arg}" =~ ^root: ) ]]; then - echo -e "\n\e[1;94mOpening a file through the \e[4m'root:'\e[24m protocol...\e[0m" - FILES_POOLROOT[${#FILES_POOLROOT[@]}]="${arg}" - echo -e "\e[94mOpening the file: " $FILES_POOLROOT "\e[0m\n" - - #################### - # LOCAL INPUT DATA # - #################### - - # NOTES: - # - 'elif' first checks if argument length is > 3 and if not begins with "-", - # then it checks if the file exists - - elif [[ ${#arg} -gt 3 && ${arg:0:1} != "-" && ( -f "${arg}" ) ]]; then - FILES_POOLROOT[${#FILES_POOLROOT[@]}]="${arg}" - echo -e "\n\e[94mOpening the local file: " $FILES_POOLROOT "\e[0m\n" - - - ################### - # DEFAULT (ERROR) # - ################### - else - ERRORS="$ERRORS\nUnknown argument: ${arg}" - fi - - # INCREMENT THE INDEX - i=$((i+1)) -done - - - - - -######################## -### SETTINGS ### -######################## - - -# batch mode -if [ "x$FLAG_BATCH_N_EVENTS" != "x0" -a "x$FLAG_BATCH" == "x0" ]; then - ERRORS="$ERRORS\nOption '-batch-n-events' can't be used without '-batch'..." -fi -if [ "x$FLAG_BATCH_N_EVENTS" != "x0" -a "x$FLAG_BATCH_ALL_EVENTS" == "x1" ]; then - ERRORS="$ERRORS\nOption '-batch-n-events' can't be used together with '-batch-all-events'... Please choose one or the other." -fi -if [ "x$FLAG_BATCH_ALL_EVENTS" == "x1" -a "x$FLAG_BATCH" == "x0" ]; then - ERRORS="$ERRORS\nOption '-batch-all-events' can't be used without '-batch'..." -fi -if [ "x$FLAG_BATCH_RANDOM_CONFIG" == "x1" -a "x$FLAG_BATCH" == "x0" ]; then - ERRORS="$ERRORS\nOption '-batch-random-config' can't be used without '-batch'..." -fi -if [ "x$FLAG_BATCH_RANDOM_CONFIG" == "x1" ]; then - echo -e "\e[1m\e[31m\e[4mNote!\e[24m You chose the option '-batch-random-config'.\e[39m" - echo -e "Thus, for each event a different configuration file will be used, randomly picked from the configuration files (.vp1) you provided:\e[0m" - printf "["; printf '"%s", ' "${FILES_VP1CFG[@]}"; printf "]\n"; echo -fi -if [ "x$FLAG_BATCH_OUT_FOLDER" != "x" -a "x$FLAG_BATCH" == "x0" ]; then - ERRORS="$ERRORS\nOption '-batch-output-folder' can't be used without '-batch'..." -fi - - -#live & noautoconf flags (AutoConfiguration is disabled in live and livelocal modes) - -if [ "x$FLAG_LIVE" == "x1" ]; then - if [ "x$FLAG_MC" == "x1" ]; then - echo "Notice: -mc flag is ignored when -live is present" - fi - FLAG_MC=0 - if [ "x$FLAG_NOAUTOCONF" == "x1" ]; then - echo "Notice: -noautoconf flag is redundant when -live is present" - fi - FLAG_NOAUTOCONF=1 - if [ "x$MULTINP_SRC" == "x" ]; then - MULTINP_SRC="$LIVEDEFAULTEVENTSRC" - fi - if [ "x$DETDESCRTAG" == "x" ]; then - DETDESCRTAG="$LIVEDEFAULTDETDESCR" - fi - if [ "x$GLOBCONDTAG" == "x" ]; then - GLOBCONDTAG="$LIVEDEFAULTGLOBCOND" - fi -elif [ "x$FLAG_LIVELOCAL" == "x1" ]; then - if [ "x$FLAG_MC" == "x1" ]; then - echo "Notice: -mc flag is ignored when -livelocal is present" - fi - FLAG_MC=0 - if [ "x$FLAG_NOAUTOCONF" == "x1" ]; then - echo "Notice: -noautoconf flag is redundant when -livelocal is present" - fi - FLAG_NOAUTOCONF=1 - if [ "x$MULTINP_SRC" == "x" ]; then - MULTINP_SRC="$LIVELOCALDEFAULTEVENTSRC" - fi - if [ "x$DETDESCRTAG" == "x" ]; then - DETDESCRTAG="$LIVEDEFAULTDETDESCR" - fi - if [ "x$GLOBCONDTAG" == "x" ]; then - GLOBCONDTAG="$LIVEDEFAULTGLOBCOND" - fi -elif [ "x$FLAG_NOAUTOCONF" == "x0" -a ${#FILES_POOLROOT[@]} != 0 ]; then - if [ "x$FLAG_MC" == "x1" ]; then - echo "Notice: -mc flag is ignored when autoconfiguration is ON" - fi - FLAG_MC=0 -fi - -if [ "x$FLAG_LIVE" == "x1" -a "x$FLAG_LIVELOCAL" == "x1" ]; then - ERRORS="$ERRORS\nDon't specify both -live and -livelocal" -fi - -#default: -if [ "x$MULTINP_SRC" != "x" -a "x$MULTINP_CPY" == "x" ]; then - MULTINP_CPY="/tmp/$USER/vp1events/$RANDOM" -fi - -# Sanity checks: -if [ "x$MULTINP_SRC" == "x" -a "x$FLAG_DONTCLEANUPEVTCPY" == "x1" ]; then - ERRORS="$ERRORS\nOption -nocleanupeventcpy can't be set without -eventsrc=..." -fi -if [ "x$MULTINP_CPY" != "x" -a "x$MULTINP_SRC" == "x" ]; then - ERRORS="$ERRORS\nOption -eventcpy=... can't be set without -eventsrc=..." -fi - -if [ "x$FLAG_NOID" == "x1" -a "x$FLAG_FATRAS" == "x1" ]; then - ERRORS="$ERRORS\nOptions -fatras and -noid can not be applied simultaneously" -fi - -if [ "x$FLAG_LIVE" == "x1" -a "x$FLAG_FATRAS" == "x1" ]; then - ERRORS="$ERRORS\nOptions -fatras and -live can not be applied simultaneously" -fi - -if [ "x$FLAG_LIVELOCAL" == "x1" -a "x$FLAG_FATRAS" == "x1" ]; then - ERRORS="$ERRORS\nOptions -fatras and -livelocal can not be applied simultaneously" -fi - -if [ "x$FLAG_NOID" == "x1" -a "x$FLAG_NOMUON" == "x1" -a "x$FLAG_EXTRAPOLATOR" == "x1" ]; then - ERRORS="$ERRORS\nOptions -extrapolator can not be used when both -noid and -nomuon are specified" -fi - -if [ "x$FLAG_EXTRAPOLATOR" == "x1" -a "x$FLAG_NOEXTRAPOLATOR" == "x1" ]; then - ERRORS="$ERRORS\nOptions -extrapolator and -noextrapolator are incompatible" -fi - -if [ "x$FLAG_NOID" == "x1" -a "x$FLAG_NOMUON" == "x1" -a "x$FLAG_FITTER" == "x1" ]; then - ERRORS="$ERRORS\nOptions -refit can not be used when both -noid and -nomuon are specified" -fi - -if [ "x$MULTINP_CPY" != "x" -a -f "$MULTINP_CPY" ]; then - ERRORS="$ERRORS\n-eventcpy directory set to point to a file" -fi - -# TODO: Check this "bootstrap": what is it? Is it still needed? -BOOTSTRAPNAME="bootstrapevent.pool.root" -BOOTSTRAPFILE="${MULTINP_CPY}/${BOOTSTRAPNAME}" -BOOTSTRAP_HTTPFILEINFO="${MULTINP_CPY}/bootstrap_fileinfo.txt" -HTTPMODE=0 -if [ "x$MULTINP_SRC" != "x" ]; then - if [ ${#FILES_POOLROOT[@]} != 0 ]; then - #cant have input files. - ERRORS="$ERRORS\nPlease don't specify input files when running with -live, -livelocal or -eventsrc=..." - else - FILES_POOLROOT[${#FILES_POOLROOT[@]}]="${BOOTSTRAPFILE}" - fi - HTTPMODE=1 - echo $MULTINP_SRC|grep '^https://..*/..*' > /dev/null || HTTPMODE=0 - echo $MULTINP_SRC|grep '/$' > /dev/null && HTTPMODE=0 - if [ "x$HTTPMODE" == "x0" ]; then - if [ "x$MULTINP_SRC" != "x" -a ! -d "$MULTINP_SRC" ]; then - ERRORS="$ERRORS\n-eventsrc directory does not exists" - fi - elif [ "x$MULTINP_CPY" == "x$MULTINP_SRC" ]; then - #Fixme: Could probably cheat this check by presense of trailing '/', symlinks, etc. - ERRORS="$ERRORS\n-eventsrc and -eventcpy directories must be different" - fi -fi - -if [ ${#LOCALEVENTSRC_AVAILDIRS[@]} != 0 ]; then - if [ "x$MULTINP_SRC" == "x" ]; then - ERRORS="$ERRORS\n-extraevtsrcdir can not be specified without the -eventsrc flag" - fi - if [ "x$HTTPMODE" != "x0" ]; then - ERRORS="$ERRORS\n-extraevtsrcdir can not be used when -eventsrc is not a local directory" - fi -fi - -if [ "x$FLAG_EXTRAPOLATOR" == "x0" -a "x$FLAG_EXTRAPOLATOR" == "x0" ]; then - if [ "x$FLAG_NOID" == "x1" -a "x$FLAG_NOMUON" == "x1" ]; then - FLAG_NOEXTRAPOLATOR=1 - else - FLAG_EXTRAPOLATOR=1 - fi -fi - - -####################################### -## Possibly print out errors/usage ## -####################################### - -if [ "x$ERRORS" != "x" ]; then - echo "=================================================================" - echo "Errors found in commandline options!!!:" - echo -e "$ERRORS" - echo - echo "Run 'vp1 -h' for more information" - echo "=================================================================" - echo - exit 1 -fi - -if [ "x$FLAG_HELP" != "x0" ]; then - echo "The $APP script serves as a frontend which runs athena with vp1.py and appropriate options." - echo - echo "Usage: " - echo - echo "$APP [inputfiles] [configfiles] [jobopt fragments] [options]" - echo - echo "Config files must have the .vp1 extension, joboption fragments the .py extension," - echo "and any other argument which doesn't start with '-' is assumed to be an input file if such a file exists." - echo - echo " -h, -help, --help : Display this help (with examples) and exit." - echo - echo " -batch : Run VP1 in 'batch' mode with a given configuration file." - echo - echo " -batch-all-events : Process all events in the input data file in '-batch' mode. Use this together with '-batch'." - echo - echo " -batch-n-events=N : Process 'N' events in the input data file in '-batch' mode. Use this together with '-batch'." - echo - echo " -batch-output-folder : Specify an output folder to store the event displays produced with the '-batch' option." - echo - echo " -batch-random-config : Run VP1 in 'batch' mode; for each single event a configuration file will be randomly picked out of the configuration files provided by the user. Use this together with '-batch'." - echo - echo " -larhv : Access current LAr HV data in the DCS_OFL database via VP1 CaloReadout system." - echo - echo " -data : Input files are data [default assumption is simulation]. " - echo - echo " -detdescr=TAG : Set global geometry tag. Overrides autoconfiguration" - echo - echo " -globcond=TAG : Set global conditions tag. Overrides autoconfiguration" - echo - echo " -skipevents=N : Skip the first N events" - echo - echo " -evtfilter=FILTER : Only process the events in the FILTER list." - echo " Format is a comma separated list of event numbers, where each event number" - echo " can optionally be preceeded by a run number and a semicolon." - echo " Prepend the list with an \"%\" to instead exclude the events." - echo " For instance select a few nice events like: -evtfilter=7,13,5300:26,54" - echo " Or exclude a few bad events like: -evtfilter=%7,13,5300:26,54" - echo - echo " It is also possible to specify one or more files with run/evt numbers" - echo " specified on each line: -evtfilter=%7,13,5300:26,54,myevents1.txt" - echo - echo " -cruise=N : Start in cruise mode, changing events after N seconds" - echo - echo " -logfile=mylogfile.txt : Leave a copy of the output in mylogfile.txt (both stdout and stderr)" - echo - echo " -trig : Init trigger information to be displayed with the Trigger Plugin" - echo - echo " -nocalo : Don't init geometry and converters for calorimeter systems." - echo " -noid : Don't init geometry and converters for the inner detector." - echo " -nomuon : Don't init geometry and converters for muon systems." - # echo " -fulltoroids : Build complete and rather heavyweight description of muon dead materials." - # echo " A lightweight version is built by default" - echo " -lucid : Init geometry and converters for the LUCID forward detector." - echo " -alfa : Init geometry and converters for the ALFA forward detector." - echo " -forwardregion : Init geometry and converters for the FrwardRegion." - echo " -zdc : Init geometry and converters for the ZDC forward detector." - echo " -cavern : Init geometry for the cavern infrastructure." - echo - echo " -toy-detector : Let VP1 visualize the "ToyDetector" volumes of GeoModelExamples (as 'Other unrecognized volumes.' in the Geo system)" - echo - echo " -geomodel-stats : Write GeoModel stats to a file." - echo - echo " -extrapolator : Whether to configure an extrapolator for more precise track representation." - echo " -noextrapolator Default is -extrapolator unless both -nomuon and -noid are specified." - echo - echo " -refit : Allows VP1-controlled refit from PrepRawData." - echo - echo " -online : Use this flag for running VP1 at P1." - echo - echo " -mc : Tell VP1 that it is running over MC data. The flag is ignored when autoconfiguration is ON" - echo " (default mode when running over data files)" - echo - echo " -fatras : Use Fatras (in single-track-simulation mode if no input file with generated event)" - echo " -fatraskey=KEY : Optionally override truth key used by Fatras (typical values are BeamTruthEvent or TruthEvent)" - echo - echo " -eventsrc=DIR : Directory to take single event files from (do not specify input files in this case)." - echo " To get files from a web server (i.e. live events), put instead the url to the file" - echo " residing in the same directory (most users should just use the -live option instead)." - echo - echo " -extraevtsrcdir=DIR : Directory to add to the menu to allow user to change eventsrc on the fly." - echo " This argument can appear several times and should only be used when eventsrc is" - echo " a local directory" - echo - echo " -eventcpy=DIR : Directory to keep local copies of processed event files." - echo " If -eventsrc is set, then -eventcpy will default to /tmp/$USER/vp1events/$RANDOM " - echo " -nocleanupeventcpy : Prevent removal of eventcpy directory after athena process finishes." - echo - echo " -live : Run on live events from point 1. This is a convenience option which implies" - echo " other options [unless explicitly set]:" - echo " -noautoconf" - echo " -eventsrc=$LIVEDEFAULTEVENTSRC" - echo " -detdescr=$LIVEDEFAULTDETDESCR" - echo " -globcond=$LIVEDEFAULTGLOBCOND" - echo - echo " -livelocal : Run on live events from point 1 in local directory. This is a convenience option" - echo " which implies other options [unless explicitly set]:" - echo " -noautoconf" - echo " -eventsrc=$LIVELOCALDEFAULTEVENTSRC" - echo " -detdescr=$LIVEDEFAULTDETDESCR" - echo " -globcond=$LIVEDEFAULTGLOBCOND" - echo - echo " -noautoconf : Disable AutoConfiguration. VP1 runs in the 'data' mode by default" - echo " use '-mc' flag for switching to the MC mode" - echo - echo " -nosortdbreplicas : Do not attempt to sort DB replicas according to geographical proximity." - echo - echo " -trigdec=file.xml : Use file.xml as source of trigger decision category data." - echo " -trigdec=embedded : Trigger decision category data is embedded in the input file(s)." - echo " -trigdec=someserver.cern.ch : Trigger decision category data is available from the server someserver.cern.ch." - echo - echo " -athenaopts=<options> : Pass <options> onto athena invocation (type 'athena.py -h' to see available options)." - echo " NB: You can not use the -c option." - echo - echo " -cgal : Use CGAL boolean instead of vp1 boolean." - echo - echo " -nsw : Enable the Muon New Small Wheel geometry (and disable the existing small wheel)." - echo - echo " -slhc : Enable special configurations for SLHC studies." - echo - echo " -customgeom : Enable a custom geometry." - echo - echo " -advanced-aa : Enable advanced anti-aliasing for crisper, higher-quality images. DOES NOT WORK ON LXPLUS MACHINES!!!" - echo - echo " -test : Show the athena command instead of executing it." - echo - echo "Note that the order of specified files/options is not important, and that they can in general be mixed quite" - echo "liberally (when it makes sense - of course dont put e.g. both -trigdec=file.xml and -trigdec=embedded)" - echo - echo - echo "*********" - echo "Examples:" - echo - echo " * Simply run on the input files myevents1.pool.root and myevents2.pool.root" - echo - echo " \$>$APP myevents1.pool.root myevents2.pool.root" - echo - echo " * Simply run on the input file myevents.pool.root and have the joboption fragments myopts1.py and myopts2.py" - echo " included after the standard vp1 setup" - echo - echo " \$>$APP myevents.pool.root myopts1.py myopts2.py" - echo - echo " * Run on myevents1.pool.root, and use a file, mytrigger.xml, as source of trigger decision data:" - echo - echo " \$>$APP myevents1.pool.root -trigdec=mytrigger.xml" - echo - echo " * Run on myevents1.pool.root, don't init geometry and converters for the calorimeter systems:" - echo - echo " \$>$APP myevents1.pool.root -nocalo" - echo - echo " * Run on myevents1.pool.root, and use detector description tag \"ATLAS-GEO-10-00-00\":" - echo - echo " \$>$APP myevents1.pool.root -detdescr=ATLAS-GEO-10-00-00" - echo - echo " * Run on myevents1.pool.root, and pass on a couple of options to the athena invocation (in this case" - echo " we want to run with a debugger and also set the loglevel to WARNING):" - echo - echo " \$>$APP myevents1.pool.root -athenaopts='-d -l WARNING'" - echo - echo " * Run on myevents1.pool.root, and preload the tab/channel configuration files myconfig1.vp1 and myconfig2.vp1:" - echo - echo " \$>$APP myevents1.pool.root myconfig1.vp1 myconfig2.vp1" - echo - echo " * Run on myevents1.pool.root, and preload two tab/channel configuration files: myconfig1.vp1 and myconfig2.vp1; at start, VP1 will create multiple tabs, from the pieces of configuration information contained in both files:" - echo - echo " \$>$APP myevents1.pool.root myconfig1.vp1 myconfig2.vp1" - echo - echo " * Run in 'batch mode' on 'myevents1.pool.root' with the configuration file 'myconfig1.vp1'." - echo " No graphical window will appear, but in the end you will get the PNG file containing the render of the 3D window." - echo - echo " \$>$APP -batch myevents.pool.root myconfig1.vp1" - echo - echo " * Some more advanced examples, using several options at once:" - echo - echo " \$>$APP -detdescr=ATLAS-GEO-10-00-00 myevents1.pool.root myevents2.pool.root myconfig1.vp1 -athenaopts='-d'" - echo " \$>$APP -detdescr=ATLAS-GEO-10-00-00 myevents1.pool.root myconfig1.vp1 -nocalo -nomuon -trigdec=embedded" - echo - exit 0 -fi - -######################################## -## Setup & run according to options ## -######################################## - -if [ "x$FLAG_DONTCLEANUPEVTCPY" != "x1" -a "x$MULTINP_CPY" != "x" ]; then - if [ ${#MULTINP_CPY} -lt 8 -o "x$MULTINP_CPY" == "$HOME" -o "x$MULTINP_CPY" == "$HOME/" ]; then - echo "NOTICE: Turning off removal of ${MULTINP_CPY} since it seems to be too short or pointing at $HOME." - FLAG_DONTCLEANUPEVTCPY=1 - fi -fi - -if [ "x$FLAG_DATA" != "x0" ]; then - echo "Error: Support for the -data flag is actually not implemented yet!" - exit 1 -fi - -PYTHONFILES="" -i=0 -while [ $i -le $((${#FILES_VP1CFG[@]}-1)) ]; do - if [ "x$PYTHONFILES" == "x" ]; then - PYTHONFILES='vp1CfgFiles=["'"${FILES_VP1CFG[$i]}"'"' - else - PYTHONFILES="${PYTHONFILES}"',"'"${FILES_VP1CFG[$i]}"'"' - fi - i=$((i+1)) -done -if [ "x$PYTHONFILES" != "x" ]; then - PYTHONFILES="${PYTHONFILES}"']' -fi - - -POOLROOTFILES="" -i=0 -while [ $i -le $((${#FILES_POOLROOT[@]}-1)) ]; do - if [ "x$POOLROOTFILES" == "x" ]; then - POOLROOTFILES='vp1InputFiles=["'"${FILES_POOLROOT[$i]}"'"' - else - POOLROOTFILES="${POOLROOTFILES}"',"'"${FILES_POOLROOT[$i]}"'"' - fi - i=$((i+1)) -done -if [ "x$POOLROOTFILES" != "x" ]; then - POOLROOTFILES="${POOLROOTFILES}"']' -fi - -EXTRAINPUTDIRS="" -i=0 -while [ $i -le $((${#LOCALEVENTSRC_AVAILDIRS[@]}-1)) ]; do - if [ "x$EXTRAINPUTDIRS" == "x" ]; then - EXTRAINPUTDIRS='vp1MultiAvailableSrcDirs=["'"${LOCALEVENTSRC_AVAILDIRS[$i]}"'"' - else - EXTRAINPUTDIRS="${EXTRAINPUTDIRS}"',"'"${LOCALEVENTSRC_AVAILDIRS[$i]}"'"' - fi - i=$((i+1)) -done -if [ "x$EXTRAINPUTDIRS" != "x" ]; then - EXTRAINPUTDIRS="${EXTRAINPUTDIRS}"']' -fi - -EXTRAJOBOPT="" -i=0 -while [ $i -le $((${#FILES_EXTRAJOBOPT[@]}-1)) ]; do - if [ "x$EXTRAJOBOPT" == "x" ]; then - EXTRAJOBOPT="${FILES_EXTRAJOBOPT[$i]}" - else - EXTRAJOBOPT="${EXTRAJOBOPT} ${FILES_EXTRAJOBOPT[$i]}" - fi - i=$((i+1)) -done - -JOBOPT="VTI12Algs/vti12.py" -if [ -f vti12.py ]; then - JOBOPT=vti12.py -fi - -OPTS="$PYTHONFILES" -if [ "x$POOLROOTFILES" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}$POOLROOTFILES" -fi -if [ "x$EXTRAINPUTDIRS" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}$EXTRAINPUTDIRS" -fi -if [ "x$DETDESCRTAG" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}DetDescrVersion=\"$DETDESCRTAG\"" -fi -if [ "x$GLOBCONDTAG" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1GlobCond=\"$GLOBCONDTAG\"" -fi -if [ "x$SKIPEVENTS" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}skipEvents=$SKIPEVENTS" -fi -if [ "x$FILTEREVENTS" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1FilterEvents=\"$FILTEREVENTS\"" -fi -if [ "x$CRUISEWITHTIME" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1CruiseTime=$CRUISEWITHTIME" -fi -if [ "x$FLAG_TRIG" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Trig=True" -fi -if [ "x$FLAG_NOCALO" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Calo=False" -fi -if [ "x$FLAG_NOID" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1ID=False" -fi -if [ "x$FLAG_NOMUON" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Muon=False" -fi -if [ "x$FLAG_NOSORTDBREPLICAS" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1NoSortDBReplicas=True" -fi -if [ "x$FLAG_BATCH" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Batch=True" -fi -if [ "x$FLAG_BATCH_ALL_EVENTS" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1BatchAllEvents=True" -fi -if [ "x$FLAG_BATCH_N_EVENTS" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1BatchNEvents=$FLAG_BATCH_N_EVENTS" -fi -if [ "x$FLAG_BATCH_OUT_FOLDER" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1BatchOutFolder=\"$FLAG_BATCH_OUT_FOLDER\"" -fi -if [ "x$FLAG_BATCH_RANDOM_CONFIG" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1BatchRandomConfiguration=True" -fi -if [ "x$FLAG_LARHV" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1LarHvData=True" -fi -# if [ "x$FLAG_FULLTOROIDS" != "x0" ]; then -# if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi -# OPTS="${OPTS}vp1FullToroids=True" -# fi -if [ "x$FLAG_ONLINE" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Online=True" -fi -if [ "x$FLAG_LUCID" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1LUCID=True" -fi -if [ "x$FLAG_ALFA" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1ALFA=True" -fi -if [ "x$FLAG_FORWARD_REGION" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1ForwardRegion=True" -fi -if [ "x$FLAG_ZDC" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1ZDC=True" -fi -if [ "x$FLAG_CAVERN" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Cavern=True" -fi -if [ "x$FLAG_TOYDETECTOR" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1ToyDetector=True" -fi -if [ "x$FLAG_GEOMODELSTATS" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1GeoModelStats=True" -fi -if [ "x$FLAG_EXTRAPOLATOR" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Extrapolator=True" -fi -if [ "x$FLAG_NOEXTRAPOLATOR" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Extrapolator=False" -fi -if [ "x$FLAG_NOAUTOCONF" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1NoAutoConf=True" -fi -if [ "x$FLAG_FITTER" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - ERRORS="$ERRORS\nOption -refit is not currently supported." -fi -if [ "x$FLAG_FATRAS" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Fatras=True" -fi -if [ "x$FLAG_NSW" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1NSW=True" -fi -if [ "x$FLAG_SLHC" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1SLHC=True" -fi -#if [ "x$FLAG_CUSTOMGEOMETRY" != "x0" ]; then -# if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi -# OPTS="${OPTS}vp1CustomGeometry=True" -#fi -#if [ "x$FLAG_ADVANCED_ANTIALIASING" != "x0" ]; then -# if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi -# OPTS="${OPTS}vp1AdvancedAntialiasing=True" -#fi -if [ "x$FLAG_NOGUI" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1NoGui=True" -fi -if [ "x$FLAG_MC" != "x0" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Mc=True" -fi -if [ "x$MULTINP_SRC" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Multinp=True" -fi -if [ "x$MULTINP_SRC" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Multinpsrc=\"$MULTINP_SRC\"" -fi -if [ "x$MULTINP_CPY" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1Multinpcpy=\"$MULTINP_CPY\"" -fi -if [ "x$TRIGDEC" != "x" ]; then - if [ ${#TRIGDEC} -gt 5 -a ${TRIGDEC:$((${#TRIGDEC}-4)):4} == ".xml" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1TrigDecXML=\"$TRIGDEC\"" - else - echo "Error: Support for the -trigdec flag for embedded or server is actually not implemented in this script yet! So far only .xml sources work" - exit 1 - fi -fi -if [ "x$FATRAS_TRUTHKEY" != "x" ]; then - if [ "x$OPTS" != "x" ]; then OPTS="$OPTS;"; fi - OPTS="${OPTS}vp1FatrasTruthKey=\"$FATRAS_TRUTHKEY\"" -fi - -if [ "x$LOGFILE" != "x" ]; then - #Fixme: Check that this actually redirects stderr correctly!! - CMD="$CMD 2>&1|tee $LOGFILE" -fi -#Test mode: -if [ "x$FLAG_TEST" != "x0" ]; then - if [ "x$HTTPMODE" == "x1" ]; then - echo "--> Start by downloading a fresh file from $MULTINP_SRC to $BOOTSTRAPFILE" - fi - if [ "x$MULTINP_CPY" != "x" -a ! -d "$MULTINP_CPY" ]; then - echo mkdir -p $MULTINP_CPY - fi - if [ "x$LOGFILE" != "x" ]; then - echo athena.py $ATHENAOPTS -c "'$OPTS'" $JOBOPT $EXTRAJOBOPT "2>&1|tee $LOGFILE" - else - echo athena.py $ATHENAOPTS -c "'$OPTS'" $JOBOPT $EXTRAJOBOPT - fi - exit 0 -fi - -################################################## -## Possibly get boot-strap file for http mode ## -################################################## - -if [ "x$MULTINP_CPY" != "x" -a ! -d "$MULTINP_CPY" ]; then - mkdir -p $MULTINP_CPY - if [ $? != 0 ]; then - echo - echo "Failed to create $MULTINP_CPY" - echo - exit 1 - fi -fi - - -if [ "x$HTTPMODE" == "x1" ]; then - if [ -f $BOOTSTRAPFILE ]; then - echo - echo - echo "Using existing $BOOTSTRAPFILE as first event." - echo - echo "In case of problems, try first to remove this file and then restart" - echo - echo - else - echo "Need to acquire $BOOTSTRAPFILE" - while [ 1 ]; do - rm -f $BOOTSTRAP_HTTPFILEINFO - echo - echo "Executing wget $LIVEBOOTSTRAPSRC --output-document=$BOOTSTRAP_HTTPFILEINFO" - wget $LIVEBOOTSTRAPSRC --output-document=$BOOTSTRAP_HTTPFILEINFO - if [ $? != 0 ]; then - echo - echo "Download failed!" - echo - rm -f $BOOTSTRAP_HTTPFILEINFO - exit 1 - fi - echo "Download succesful" - #Check integrity of downloaded file: - OK=1 - grep '^vp1_.*_.*_.*.pool.root' $BOOTSTRAP_HTTPFILEINFO |grep -v "copy " > /dev/null || OK=0 - grep 'begin_checksums' $BOOTSTRAP_HTTPFILEINFO > /dev/null || OK=0 - grep 'end_checksums' $BOOTSTRAP_HTTPFILEINFO > /dev/null || OK=0 - if [ "x$OK" == "x1" ]; then - echo "Downloaded info file content seems sane." - break - else - echo "Problems with content of downloaded info file. Will retry in 5 seconds." - sleep 5 - fi - done - #Decode to find recent file: - FILELINE=`grep '^vp1_.*_.*_.*.pool.root' $BOOTSTRAP_HTTPFILEINFO |grep -v "copy "|head -1|tr '\t' ' '` - FILE=`echo $FILELINE|awk '{print $1}'` - SUM=`echo $FILELINE|awk '{print $2}'` - FILEURL=`echo $LIVEBOOTSTRAPSRC|sed 's#http://\(.*\)/.*$#http://\1/#'`$FILE - echo FILE=$FILE - echo FILEURL=$FILEURL - echo SUM=$SUM - OK=1 - BOOTSTRAPFILE_SUMFILE=$BOOTSTRAPFILE.md5sum - rm -f $BOOTSTRAPFILE $BOOTSTRAPFILE_SUMFILE - echo "Executing wget ${FILEURL} --output-document=$BOOTSTRAP_HTTPFILEINFO" - wget ${FILEURL} --output-document=$BOOTSTRAPFILE || OK=0 - if [ $? != 0 ]; then - echo - echo "Download failed!" - echo - rm -f $BOOTSTRAPFILE $BOOTSTRAPFILE_SUMFILE - exit 1 - fi - echo "$SUM $BOOTSTRAPFILE" > $BOOTSTRAPFILE_SUMFILE - if [ $? != 0 ]; then - echo - echo "Could not create md5sum check file" - echo - rm -f $BOOTSTRAPFILE $BOOTSTRAPFILE_SUMFILE - exit 1 - fi - md5sum --status --check $BOOTSTRAPFILE_SUMFILE - if [ $? != 0 ]; then - echo - echo "md5sum check of downloaded bootstrap event file failed!" - echo - rm -f $BOOTSTRAPFILE $BOOTSTRAPFILE_SUMFILE - exit 1 - fi - echo "Checksum of downloaded Bootstrap event file is OK. Proceeding to launch athena." - fi -elif [ "x$MULTINP_SRC" != "x" ]; then - NEWEST=`ls -1rt $MULTINP_SRC/*_*_*.pool.root |tail -1` - if [ ! -f $NEWEST ]; then - echo - echo "Could not find event file in $MULTINP_SRC to use to bootstrap athena. " - echo - exit 1 - fi - cp $NEWEST -f $BOOTSTRAPFILE - if [ $? != 0 -o ! -f $BOOTSTRAPFILE ]; then - echo - echo "Could not copy newest event file $BOOTSTRAPFILE!" - echo - rm -f $BOOTSTRAPFILE - exit 1 - fi -fi - -if [ "x$LOGFILE" != "x" ]; then - athena.py $ATHENAOPTS -c "$OPTS" $JOBOPT $EXTRAJOBOPT 2>&1|tee $LOGFILE -else - athena.py $ATHENAOPTS -c "$OPTS" $JOBOPT $EXTRAJOBOPT -fi - -if [ "x$FLAG_DONTCLEANUPEVTCPY" != "x1" -a "x$MULTINP_CPY" != "x" ]; then - if [ -d "${MULTINP_CPY}" -a -f "${MULTINP_CPY}/${BOOTSTRAPNAME}" ]; then - rm -rf "${MULTINP_CPY}" - fi -fi +#!/usr/bin/env python +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +# Simple wrapper to call actual VP1AlgConfig.SetupVP1() function + +intro_text = """ +****************************************** + + ___ ___ ________ _____ +|\ \ / /|\ __ \ / __ \ +\ \ \ / / | \ \|\ \|\/_|\ \ + \ \ \/ / / \ \ ____\|/ \ \ \ + \ \ / / \ \ \___| \ \ \ + \ \__/ / \ \__\ \ \__\ + \|__|/ \|__| \|__| + + +Launching VP1 - the ATLAS 3D event display + +****************************************** + +*IMPORTANT*: VP1 has now been migrated to use ComponentAccumulator. +At the same time, we have tried to simplify the configuration of VP1. +If you have any problems, or if you needed some of the removed configuration options, +please contact us on the JIRA ticket: +https://its.cern.ch/jira/browse/ATLASRECTS-7853 + +****************************************** + +""" +print(intro_text) + +from VTI12Algs.VTI12AlgConfig import SetupVTI12 +SetupVTI12() +import sys +sys.exit() diff --git a/graphics/VTI12/VTI12Algs/share/vti12.py b/graphics/VTI12/VTI12Algs/share/vti12.py deleted file mode 100644 index 07a3a97a2ca79ae0f920f1516590a03c55a2a13b..0000000000000000000000000000000000000000 --- a/graphics/VTI12/VTI12Algs/share/vti12.py +++ /dev/null @@ -1,456 +0,0 @@ -if not 'vp1InputFiles' in dir(): vp1InputFiles = [] -if not 'vp1CfgFiles' in dir(): vp1CfgFiles = [] -if not 'vp1ID' in dir(): vp1ID=False -if not 'vp1Calo' in dir(): vp1Calo=False -if not 'vp1Muon' in dir(): vp1Muon=False -if not 'vp1LUCID' in dir(): vp1LUCID=False -if not 'vp1ALFA' in dir(): vp1ALFA=False -if not 'vp1ForwardRegion' in dir(): vp1ForwardRegion=False -if not 'vp1ZDC' in dir(): vp1ZDC=False -if not 'vp1Extrapolator' in dir(): vp1Extrapolator=True -# if not 'vp1Fitter' in dir(): vp1Fitter=False -if not 'vp1Fatras' in dir(): vp1Fatras=False -if not 'vp1FatrasMuon' in dir(): vp1FatrasMuon=(vp1Fatras and vp1Muon) -if not 'vp1FatrasCalo' in dir(): vp1FatrasCalo=(vp1Fatras and vp1Calo) -if not 'vp1FatrasTruthKey' in dir(): vp1FatrasTruthKey="" -if not 'vp1Online' in dir(): vp1Online=False -if not 'vp1Mc' in dir(): vp1Mc=False -if not 'vp1Multinp' in dir(): vp1Multinp=False -if not 'vp1Multinpsrc' in dir(): vp1Multinpsrc="" -if not 'vp1Multinpcpy' in dir(): vp1Multinpcpy="" -if not 'vp1MultiAvailableSrcDirs' in dir(): vp1MultiAvailableSrcDirs = [] -if not 'vp1TrigDecXML' in dir(): vp1TrigDecXML="" -if not 'vp1Batch' in dir(): vp1Batch=False -if not 'vp1BatchAllEvents' in dir(): vp1BatchAllEvents=False -if not 'vp1BatchNEvents' in dir(): vp1BatchNEvents=0 -if not 'vp1BatchOutFolder' in dir(): vp1BatchOutFolder="" -if not 'vp1BatchRandomConfiguration' in dir(): vp1BatchRandomConfiguration=False -if not 'vp1LarHvData' in dir(): vp1LarHvData=False -# if not 'vp1FullToroids' in dir(): vp1FullToroids=False -if not 'vp1CruiseTime' in dir(): vp1CruiseTime=0 -if not 'vp1NoSortDBReplicas' in dir(): vp1NoSortDBReplicas=False -if not 'vp1FilterEvents' in dir(): vp1FilterEvents="" -if not 'vp1NoGui' in dir(): vp1NoGui=False -if not 'vp1SpacePoints' in dir(): vp1SpacePoints=False -# if not 'vp1Cavern' in dir(): vp1Cavern=False -vp1Cavern=True -if not 'vp1NoAutoConf' in dir(): vp1NoAutoConf=False -if not 'vp1Trig' in dir(): vp1Trig=False -if not 'vp1NSW' in dir(): vp1NSW=False - -def vp1CfgErr(s): printfunc ("VP1 CONFIGURATION ERROR: %s" % s) - -if (vp1Fatras and not vp1ID): - vp1CfgErr("Fatras can not be enabled without inner detector. Turning off Fatras.") - vp1Fatras=False -if (vp1FatrasMuon and not vp1Fatras): - vp1CfgErr("FatrasMuon can not be enabled without Fatras enabled. Turning off FatrasMuon.") - vp1FatrasMuon=False -if (vp1FatrasMuon and not vp1Muon): - vp1CfgErr("FatrasMuon can not be enabled without muon systems. Turning off FatrasMuon.") - vp1FatrasMuon=False -if (vp1FatrasCalo and not vp1Fatras): - vp1CfgErr("FatrasCalo can not be enabled without Fatras enabled. Turning off FatrasCalo.") - vp1FatrasCalo=False -if (vp1FatrasCalo and not vp1Calo): - vp1CfgErr("FatrasCalo can not be enabled without calo systems. Turning off FatrasCalo.") - vp1FatrasCalo=False -if ( vp1FatrasTruthKey != "" and not vp1Fatras ): - vp1CfgErr("FatrasTruthKey set but Fatras not enabled. Unsetting FatrasTruthKey.") - vp1FatrasTruthKey="" - -if (vp1NSW and not vp1Muon): - vp1CfgErr("Muon New Small Wheel (NSW) turned on, but no Muon geometry. Disabling NSW.") - vp1NSW=False - - - - -printfunc("*** VP1 NOTE *** setting COIN_GLXGLUE env vars to make screenshots working remotely...") -printfunc("*** VP1 NOTE *** COIN_GLXGLUE_NO_GLX13_PBUFFERS=1 - " + "COIN_GLXGLUE_NO_PBUFFERS=1") -os.putenv("COIN_GLXGLUE_NO_GLX13_PBUFFERS","1") -os.putenv("COIN_GLXGLUE_NO_PBUFFERS","1") - - - -#Set VP1ATLREL integer so we can do e.g. "if VP1ATLREL>=160002:" -include('VP1Algs/vp1FragmentConstructVP1ATLREL.py') - -#Disable FPE checks :-( -from RecExConfig.RecFlags import rec -rec.doFloatingPointException.set_Value_and_Lock(False) - -if (vp1InputFiles == []): - # Create an event selector: - import AthenaCommon.AtlasUnixGeneratorJob - # Configure GlobalFlags - from AthenaCommon.GlobalFlags import globalflags -# from CalypsoCommon.GlobalFlags import globalflags - globalflags.DetGeo.set_Value_and_Lock('atlas') - globalflags.DataSource.set_Value_and_Lock('geant4') - - # Set geometry version - if (not "DetDescrVersion" in dir()): - DetDescrVersion = "FASER-01" - globalflags.DetDescrVersion = DetDescrVersion - - # Set conditions tag - if not 'vp1GlobCond' in dir(): - vp1GlobCond="OFLCOND-FASER-01" - from IOVDbSvc.CondDB import conddb - conddb.setGlobalTag(vp1GlobCond) - - - ### NEW FOR REL. >= 22 - - # Conditions Service for reading conditions data in serial and MT Athena - from IOVSvc.IOVSvcConf import CondSvc - svcMgr += CondSvc() - - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - - # Conditions data access infrastructure for serial and MT Athena - from IOVSvc.IOVSvcConf import CondInputLoader - condSeq += CondInputLoader( "CondInputLoader") - - import StoreGate.StoreGateConf as StoreGateConf - svcMgr += StoreGateConf.StoreGateSvc("ConditionStore") - -else: - if(vp1NoAutoConf): - # AutoConfiguration disabled - import AthenaCommon.AtlasUnixStandardJob - - if(vp1Online): - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - athenaCommonFlags.isOnline = True - - from AthenaCommon.GlobalFlags import globalflags -# from CalypsoCommon.GlobalFlags import globalflags - globalflags.DetGeo.set_Value_and_Lock('atlas') - if(vp1Mc): - globalflags.DataSource.set_Value_and_Lock('geant4') - else: - globalflags.DataSource.set_Value_and_Lock('data') - globalflags.InputFormat.set_Value_and_Lock('pool') - globalflags.Luminosity.set_Value_and_Lock('zero') - from AthenaCommon.BeamFlags import jobproperties - jobproperties.Beam.beamType="collisions" - - # Set geometry version - if (not "DetDescrVersion" in dir()): - DetDescrVersion = "FASER-01" - globalflags.DetDescrVersion = DetDescrVersion - - # Set conditions tag - if not 'vp1GlobCond' in dir(): - if (vp1Mc): - vp1GlobCond="OFLCOND-FASER-01" - else: - vp1GlobCond="COMCOND-BLKPST-004-01" - - from IOVDbSvc.CondDB import conddb - conddb.setGlobalTag(vp1GlobCond) - - import AthenaPoolCnvSvc.ReadAthenaPool #sets up reading of any POOL files (but POOL is slow) - svcMgr.EventSelector.InputCollections = vp1InputFiles - - ### NEW FOR REL. >= 22 - - # Conditions Service for reading conditions data in serial and MT Athena - from IOVSvc.IOVSvcConf import CondSvc - svcMgr += CondSvc() - - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - - # Conditions data access infrastructure for serial and MT Athena - from IOVSvc.IOVSvcConf import CondInputLoader - condSeq += CondInputLoader( "CondInputLoader") - - import StoreGate.StoreGateConf as StoreGateConf - svcMgr += StoreGateConf.StoreGateSvc("ConditionStore") - - else: - # AutoConfiguration enabled - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - athenaCommonFlags.FilesInput=vp1InputFiles - - from RecExConfig.RecFlags import rec - rec.AutoConfiguration=['everything'] - rec.doAOD.set_Value_and_Lock(False) - rec.doESD.set_Value_and_Lock(False) - - # Override geometry tag from command line - if("DetDescrVersion" in dir()): - from AthenaCommon.GlobalFlags import globalflags -# from CalypsoCommon.GlobalFlags import globalflags - globalflags.DetDescrVersion = DetDescrVersion - #globalflags.DetDescrVersion.set_Value_and_Lock(DetDescrVersion) - - athenaCommonFlags.EvtMax=-1 - include('RecExCond/RecExCommon_flags.py') - - # Override global conditions tag from command line - if('vp1GlobCond' in dir()): - from IOVDbSvc.CondDB import conddb - conddb.setGlobalTag(vp1GlobCond) - - - ### NEW FOR REL. >= 22 - - # Conditions Service for reading conditions data in serial and MT Athena - from IOVSvc.IOVSvcConf import CondSvc - svcMgr += CondSvc() - - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - - # Conditions data access infrastructure for serial and MT Athena - from IOVSvc.IOVSvcConf import CondInputLoader - condSeq += CondInputLoader( "CondInputLoader") - - import StoreGate.StoreGateConf as StoreGateConf - svcMgr += StoreGateConf.StoreGateSvc("ConditionStore") - -if vp1FilterEvents: - import VP1Algs.VP1EvtFilter - vp1FilterEvents = VP1Algs.VP1EvtFilter.parseFilterString(vp1FilterEvents) - VP1Algs.VP1EvtFilter.installEventFilter(vp1FilterEvents) - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - - -#BATCH-MODE -# If "vp1Batch" is TRUE, then set the corresponding env var. -# The GUI of VP1 will not be shown, but the config file will be taken -# and in the end a render of the 3D window will be saved as PNG file. -# -# Moreover, if "vp1BatchAllEvents" is TRUE, then all the events -# in the provided data file will be processed with the same configuration -# file provided by the user. -# -if vp1Batch: - os.putenv("VP1_BATCHMODE","1") -if vp1BatchAllEvents: - os.putenv("VP1_BATCHMODE_ALLEVENTS","1") -if vp1BatchNEvents > 0: - os.putenv("VP1_BATCHMODE_NEVENTS", str(vp1BatchNEvents) ) -if (vp1BatchOutFolder != ""): - os.putenv("VP1_BATCHMODE_OUT_FOLDER", vp1BatchOutFolder) -if vp1BatchRandomConfiguration: - os.putenv("VP1_BATCHMODE_RANDOMCONFIG","1") - - - -#Detector setup: -from AthenaCommon.DetFlags import DetFlags -#from CalypsoCommon.DetFlags import DetFlags -if (vp1ID): DetFlags.ID_setOn() -else: vp1Extrapolator = False - -#watch LAr HV: -if ( vp1LarHvData ): - from time import time - svcMgr.AthenaSealSvc.CheckDictionary = TRUE - svcMgr.EventSelector.InitialTimeStamp = int (time()) - svcMgr.EventSelector.TimeStampInterval = 1 - from IOVDbSvc.CondDB import conddb - conddb.addFolder("DCS_OFL","/LAR/DCS/HV/BARREl/I16") - conddb.addFolder("DCS_OFL","/LAR/DCS/HV/BARREL/I8") -#------------ - -if (vp1Fatras): - include( "FatrasExample/Fatras_jobOptions.py" ) - -if (vp1TrigDecXML!=""): - include( "TrigConfigSvc/jobOptions_commonSetup.py" ) - include( "TrigConfigSvc/jobOptions_setupLVL1Svc.py" ) - include( "TrigConfigSvc/jobOptions_setupHLTSvc.py" ) - HLTConfigSvc.XMLMenuFile = vp1TrigDecXML - from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool - ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool") - -if (vp1Calo): - from AthenaCommon.GlobalFlags import globalflags -# from CalypsoCommon.GlobalFlags import globalflags - if globalflags.DataSource() == 'data' : - include ("LArConditionsCommon/LArIdMap_comm_jobOptions.py") - else: - include ("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") - include ("LArConditionsCommon/LArIdMap_MC_jobOptions.py") - -#Extrapolator: -if vp1Extrapolator and (vp1ID or vp1Muon): - # Force tool initializations needed by the extrapolator - from VP1TrkAuxAlgs.VP1TrkAuxAlgsConf import VP1TrkInitializer - VP1TrkInitializer = VP1TrkInitializer() - VP1TrkInitializer.ForceExtrapolatorTools = True - topSequence += VP1TrkInitializer - - if not vp1Fatras and vp1Mc: - include ('TrkDetDescrSvc/AtlasTrackingGeometrySvc.py') - - from TrkExTools.AtlasExtrapolator import AtlasExtrapolator - VP1ExtraPolatorName='VP1Extrapolator'; - VP1Extrapolator = AtlasExtrapolator(name=VP1ExtraPolatorName) - - from TrkExEngine.AtlasExtrapolationEngine import AtlasExtrapolationEngine - ExtrapolationEngine = AtlasExtrapolationEngine(name='Extrapolation', nameprefix='Atlas', ToolOutputLevel=INFO) - ToolSvc += ExtrapolationEngine - - # Previous config from SetupFitters.py - # from TrkExTools.TrkExToolsConf import Trk__Extrapolator as Extrapolator - # VP1Extrapolator = Extrapolator(name='VP1Extrapolator', - # Navigator = VP1Navigator, - # MaterialEffectsUpdators = [ VP1MaterialUpdator ], - # Propagators = [ VP1Propagator ] ) - - ToolSvc += VP1Extrapolator - #We should append to variable instead: - os.putenv("VP1_JOBCFG_EXTRA_VP1_EXTRAPOLATORS","Trk::Extrapolator/"+VP1ExtraPolatorName) - -#Fitter: -# if vp1Fitter and vp1Extrapolator and (vp1ID or vp1Muon): -# VP1TrkInitializer.ForceFitterTools = True -# os.putenv("VP1_DEVEL_ENABLEREFIT","1") -# ########################################################## -# # The Extrapolator -# include('TrkDetDescrSvc/AtlasTrackingGeometrySvc.py') -# -# from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator -# VP1Propagator = Propagator(name = 'VP1Propagator') -# ToolSvc += VP1Propagator -# -# # the Navigator has to get this one -# from TrkExTools.TrkExToolsConf import Trk__Navigator -# VP1Navigator = Trk__Navigator(name = 'VP1Navigator') -# VP1Navigator.TrackingGeometrySvc = svcMgr.AtlasTrackingGeometrySvc -# ToolSvc += VP1Navigator -# -# from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator as MatUpdator -# VP1MaterialUpdator = MatUpdator(name='VP1MaterialEffectsUpdator') -# ToolSvc += VP1MaterialUpdator -# -# from TrkMeasurementUpdator_xk.TrkMeasurementUpdator_xkConf import Trk__KalmanUpdator_xk -# VP1Updator = Trk__KalmanUpdator_xk(name = 'VP1Updator') -# ToolSvc += VP1Updator -# -# from TrkDynamicNoiseAdjustor.TrkDynamicNoiseAdjustorConf import Trk__InDetDynamicNoiseAdjustment -# VP1DNAdjustor = Trk__InDetDynamicNoiseAdjustment(name = 'VP1DNAdjustor') -# #yminmax = 100.0) -# ToolSvc += VP1DNAdjustor -# from TrkKalmanFitter.TrkKalmanFitterConf import Trk__ForwardKalmanFitter as PublicFKF -# VP1FKF = PublicFKF(name = 'VP1FKF', -# StateChi2PerNDFPreCut = 25.0) -# ToolSvc += VP1FKF -# -# from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanSmoother as PublicBKS -# VP1BKS = PublicBKS(name = 'VP1BKS', -# InitialCovarianceSeedFactor = 200.) -# ToolSvc += VP1BKS -# -# from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanOutlierLogic as PublicKOL -# VP1KOL = PublicKOL(name = 'VP1KOL', -# StateChi2PerNDFCut = 12.5) -# ToolSvc += VP1KOL -# -# #FIXME! Only do this for Muons? -# from MuonRecExample import MuonRecTools -# MdtTubeHitOnTrackCreator = MuonRecTools.getPublicTool("MdtTubeHitOnTrackCreator") -# -# from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator -# VP1RotCreator = Trk__RIO_OnTrackCreator(name = 'VP1RotCreator', -# ToolMuonDriftCircle = MdtTubeHitOnTrackCreator , -# Mode = 'all') -# ToolSvc += VP1RotCreator -# print VP1RotCreator -# print MdtTubeHitOnTrackCreator -# -# from TrkKalmanFitter.TrkKalmanFitterConf import Trk__KalmanFitter as ConfiguredKalmanFitter -# VP1KalmanFitter = ConfiguredKalmanFitter(name = 'VP1KalmanFitter', -# ExtrapolatorHandle = VP1Extrapolator, -# RIO_OnTrackCreatorHandle = VP1RotCreator, -# MeasurementUpdatorHandle = VP1Updator, -# ForwardKalmanFitterHandle = VP1FKF, -# KalmanSmootherHandle = VP1BKS, -# KalmanOutlierLogicHandle = VP1KOL, -# DynamicNoiseAdjustorHandle = None, -# AlignableSurfaceProviderHandle = None) -# -# ToolSvc += VP1KalmanFitter -# -# print VP1KalmanFitter -# os.putenv("VP1_JOBCFG_EXTRA_VP1_FITTERS",VP1KalmanFitter.name()) -# -# -# VP1KalmanFitterDNA = ConfiguredKalmanFitter(name = 'VP1KalmanFitterDNA', -# ExtrapolatorHandle = VP1Extrapolator, -# RIO_OnTrackCreatorHandle = VP1RotCreator, -# MeasurementUpdatorHandle = VP1Updator, -# ForwardKalmanFitterHandle = VP1FKF, -# KalmanSmootherHandle = VP1BKS, -# KalmanOutlierLogicHandle = VP1KOL, -# DynamicNoiseAdjustorHandle = VP1DNAdjustor, -# AlignableSurfaceProviderHandle = None) -# -# ToolSvc += VP1KalmanFitterDNA -# os.putenv("VP1_JOBCFG_EXTRA_VP1_FITTERS",VP1KalmanFitterDNA.name()) -# -# -# from TrkGlobalChi2Fitter.TrkGlobalChi2FitterConf import Trk__GlobalChi2Fitter -# VP1GlobalChi2Fitter = Trk__GlobalChi2Fitter(name = 'VP1GlobalChi2Fitter', -# ExtrapolationTool = VP1Extrapolator, -# NavigatorTool = VP1Navigator, -# PropagatorTool = VP1Propagator, -# RotCreatorTool = VP1RotCreator, -# MeasurementUpdateTool = VP1Updator, -# StraightLine = False, -# OutlierCut = 3.0, -# SignedDriftRadius = True, -# RecalculateDerivatives= True -# ) -# print VP1GlobalChi2Fitter -# ToolSvc += VP1GlobalChi2Fitter -# -# VP1GlobalChi2Fitter.OutputLevel=DEBUG -# -# os.putenv("VP1_JOBCFG_EXTRA_VP1_FITTERS","Trk::KalmanFitter/"+VP1KalmanFitter.name()+";"+"Trk::KalmanFitter/"+VP1KalmanFitterDNA.name()+";"+"Trk::GlobalChi2Fitter/"+VP1GlobalChi2Fitter.name()) - -#On a machine where the hostname does not indicate domain, pool will -#fail if trying to find nearest replica. In any case, dblookup.xml -#needs to be patched when running on real data: -include('VP1Algs/vp1FragmentFixDBReplica.py') - -if vp1NoSortDBReplicas: - PoolSvc = Service( "PoolSvc" ) - # PoolSvc.SortReplicas = False - -from FaserGeoModel import SetGeometryVersion -from FaserGeoModel import GeoModelInit - -from GeoModelSvc.GeoModelSvcConf import GeoModelSvc -GeoModelSvc = GeoModelSvc() -GeoModelSvc.PrintMaterials = True -GeoModelSvc.GeoExportFile = "faserGeo.db" - -#Finally, the VP1 algorithm itself: -from VTI12Algs.VTI12AlgsConf import VTI12Alg -topSequence += VTI12Alg("VTI12Alg") - -VTI12Alg.NoGui=vp1NoGui - -if vp1CruiseTime > 0: - VTI12Alg.InitialCruiseMode = "EVENT" - VTI12Alg.InitialCruiseModePeriod = vp1CruiseTime - -VTI12Alg.InitiallyLoadedVP1Files = vp1CfgFiles -if (vp1Multinp): - VTI12Alg.MultipleFilesON = True - VTI12Alg.MFSourceDir = vp1Multinpsrc - VTI12Alg.MFLocalCopyDir = vp1Multinpcpy - VTI12Alg.MFAvailableLocalInputDirectories = vp1MultiAvailableSrcDirs - -topSequence.TimeOut=0 diff --git a/graphics/VTI12/VTI12Gui/src/VP1Authenticator.cxx b/graphics/VTI12/VTI12Gui/src/VP1Authenticator.cxx index 16bf6bb96558f9bfcc6bdd707291a149fa39d279..1b11d70a74d181e53bfb1e34663221fd87e93fc6 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1Authenticator.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1Authenticator.cxx @@ -359,8 +359,7 @@ void VP1Authenticator::finished() } } - QByteArray newBody; - newBody=newBody.insert(0,newRequestBody); + QByteArray newBody = newRequestBody.toUtf8(); QString logMessage = "New Request Length: " + QString::number(newBody.size()) + "\n"; logMessage += ("New Request Body:\n" + newRequestBody.replace(inpPhr->text(),"xxx") + "\n"); @@ -484,8 +483,7 @@ void VP1Authenticator::finished() } } - QByteArray newBody; - newBody=newBody.insert(0,newRequestBody); + QByteArray newBody = newRequestBody.toUtf8(); QString logMessage = "New Request Length: " + QString::number(newBody.size()) + "\n"; logMessage += ("New Request Body:\n" + newRequestBody + "\n"); diff --git a/graphics/VTI12/VTI12Gui/src/VP1AvailEvents.cxx b/graphics/VTI12/VTI12Gui/src/VP1AvailEvents.cxx index eac6e48f21ed03ce6c27c396355c4180e2d79274..7d8cd2b426ae04f6857d29b3ea645ebd72e79d7a 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1AvailEvents.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1AvailEvents.cxx @@ -239,8 +239,8 @@ QList<VP1EventFile> VP1AvailEvents::allEventFilesInDir(const QString& dir) const message("Could not decode event file name: "+fn); } - qSort(l); - + std::sort(l.begin(), l.end()); + m_d->dircache[dir]=std::make_pair(modtime,l); return l; } diff --git a/graphics/VTI12/VTI12Gui/src/VP1DockWidget.cxx b/graphics/VTI12/VTI12Gui/src/VP1DockWidget.cxx index 3905767acaad0627e412e4ed1cdf4d1fedb5dd84..c5c4e03d66809ea720372b77bd8c8e394f6cd299 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1DockWidget.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1DockWidget.cxx @@ -143,10 +143,9 @@ VP1DockWidget::VP1DockWidget ( IVP1ChannelWidget * cw, VP1TabManager* tm ) //Figure out what margin our drawn frame imposes: setSelected(); - int marg_left, marg_top, marg_right, marg_bottom; - m_d->frame->getContentsMargins ( &marg_left, &marg_top, &marg_right, &marg_bottom ); - Q_ASSERT(marg_left==marg_top&&marg_left==marg_right&&marg_left==marg_bottom&&"Qt changed its margin behaviour for QFrame!!"); - m_d->unselectedmargin=marg_left; + QMargins marg = m_d->frame->contentsMargins(); + Q_ASSERT(marg.left()==marg.top()&&marg.left()==marg.right()&&marg.left()==marg.bottom()&&"Qt changed its margin behaviour for QFrame!!"); + m_d->unselectedmargin=marg.left(); //Channel starts unselected: setUnselected(); diff --git a/graphics/VTI12/VTI12Gui/src/VP1EventDisplaySceneView.cxx b/graphics/VTI12/VTI12Gui/src/VP1EventDisplaySceneView.cxx index aca3fdc77c0a5d9b921702c7fa4100bfa5490044..f8678a8901d9945d780b280e9bcac1ddb03e9c1b 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1EventDisplaySceneView.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1EventDisplaySceneView.cxx @@ -28,7 +28,7 @@ void GraphicsView::wheelEvent(QWheelEvent *e) { if (e->modifiers() & Qt::ControlModifier) { - if (e->delta() > 0) + if (e->angleDelta().y() > 0) m_view->zoomIn(6); else m_view->zoomOut(6); @@ -295,9 +295,9 @@ void VP1EventDisplaySceneView::setResetButtonEnabled() void VP1EventDisplaySceneView::setPreviewZoom(qreal xx) { if (m_preview) { - QMatrix matrix; + QTransform matrix; matrix.scale(xx, xx); - m_graphicsView->setMatrix(matrix); + m_graphicsView->setTransform(matrix); } else { VP1Msg::message("Warning!! using setPreviewZoom() on a full-size view has no effect."); } @@ -307,12 +307,12 @@ void VP1EventDisplaySceneView::setPreviewZoom(qreal xx) void VP1EventDisplaySceneView::setupMatrix() { if (!m_preview) { - QMatrix matrix; + QTransform matrix; qreal scale = qPow(qreal(2), (m_zoomSlider->value() - 250) / qreal(50)); matrix.scale(scale, scale); matrix.rotate(m_rotateSlider->value()); - m_graphicsView->setMatrix(matrix); + m_graphicsView->setTransform(matrix); setResetButtonEnabled(); } diff --git a/graphics/VTI12/VTI12Gui/src/VP1EventFile.cxx b/graphics/VTI12/VTI12Gui/src/VP1EventFile.cxx index dbf7acc976032e8ef3710ae58e2e00871dfbf1dd..3d3a5325f7fd6f6e6919c005911132a1b36b39e9 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1EventFile.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1EventFile.cxx @@ -43,7 +43,11 @@ VP1EventFile::VP1EventFile() //____________________________________________________________________ VP1EventFile::Imp * VP1EventFile::Imp::initFromFilename(const QString& filename, const QString& md5sum) { +#if QTCORE_VERSION >= 0x050E00 + QStringList filenameparts = filename.split('.', Qt::SkipEmptyParts ); +#else QStringList filenameparts = filename.split('.', QString::SkipEmptyParts ); +#endif if (filenameparts.isEmpty()) return new Imp; diff --git a/graphics/VTI12/VTI12Gui/src/VP1EvtsOnServerInfo.cxx b/graphics/VTI12/VTI12Gui/src/VP1EvtsOnServerInfo.cxx index b6e02cd07e510974aa15bad5233901dd9249f3fd..ed443383ad0408c05e75fd6cf6adc98b4674b4f4 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1EvtsOnServerInfo.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1EvtsOnServerInfo.cxx @@ -197,7 +197,11 @@ QString VP1EvtsOnServerInfo::Imp::init(const QString& infofile) /////////////////////////////// for (int i = i_begin_checksums+1;i < i_end_checksums; ++i) { +#if QTCORE_VERSION >= 0x050E00 + QStringList parts = lines.at(i).split ( ' ', Qt::SkipEmptyParts ); +#else QStringList parts = lines.at(i).split ( ' ', QString::SkipEmptyParts ); +#endif if (parts.count()!=2) return "Invalid line in checksums section"; QString filename(parts.at(0)); @@ -210,8 +214,8 @@ QString VP1EvtsOnServerInfo::Imp::init(const QString& infofile) events << evt; } - qSort(events); - + std::sort(events.begin(), events.end()); + if (hascopyresult) { //Todo: Use the copy result lines for a sanity check of that the //newest file is also the one copied last (if copy succesful). diff --git a/graphics/VTI12/VTI12Gui/src/VP1ExecutionScheduler.cxx b/graphics/VTI12/VTI12Gui/src/VP1ExecutionScheduler.cxx index 3a300d1d169480e335a12c1831e625d6b36a1126..303e3b32ffa08a86d4e9ac813e1219faa8b1f9aa 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1ExecutionScheduler.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1ExecutionScheduler.cxx @@ -1152,7 +1152,14 @@ void VP1ExecutionScheduler::actualUncreateAndDelete(IVP1ChannelWidget*cw) //___________________________________________________________________ void VP1ExecutionScheduler::Imp::warnIfWidgetsAlive() { - QSet<QWidget*> w_ignore, wl = QApplication::allWidgets().toSet(); + QSet<QWidget*> w_ignore; +#if QTCORE_VERSION >= 0x050E00 + QList<QWidget*> widgets = QApplication::allWidgets(); + QSet<QWidget*> wl (widgets.begin(), widgets.end()); +#else + QSet<QWidget*> wl = QApplication::allWidgets().toSet(); +#endif + w_ignore<<qApp->desktop(); foreach (QObject*o,qApp->children()) { if (o->isWidgetType()) diff --git a/graphics/VTI12/VTI12Gui/src/VP1MD5Sum.cxx b/graphics/VTI12/VTI12Gui/src/VP1MD5Sum.cxx index 952516c54416e54920a78d69901f9a028af333d4..8acc09d4bdde8376af01e2f39840274a1aae182e 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1MD5Sum.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1MD5Sum.cxx @@ -81,7 +81,7 @@ QString VP1MD5Sum::sumToString(const QByteArray& ba ) //____________________________________________________________________ QByteArray VP1MD5Sum::sumToByteArray(const QString& str ) { - return QByteArray::fromHex(QByteArray().append(str)); + return QByteArray::fromHex(str.toUtf8()); } //____________________________________________________________________ diff --git a/graphics/VTI12/VTI12Gui/src/VP1MainWindow.cxx b/graphics/VTI12/VTI12Gui/src/VP1MainWindow.cxx index f3f4dbe1b6de67bd31b732b0a5bf1b292c45018b..75799d2a06e9a42eb3154c1fac900ca51fa08694 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1MainWindow.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1MainWindow.cxx @@ -788,7 +788,15 @@ QMap<QString,QString> VP1MainWindow::availableFiles(const QString& extension, //Add directories from extradirenvvar (e.g. $VP1PLUGINPATH) - QStringList vp1pluginpath = extradirenvvar.isEmpty() ? QStringList() : QString(::getenv(extradirenvvar.toStdString().c_str())).split(":",QString::SkipEmptyParts); + QStringList vp1pluginpath = + extradirenvvar.isEmpty() ? + QStringList() : + QString(::getenv(extradirenvvar.toStdString().c_str())) . +#if QTCORE_VERSION >= 0x050E00 + split(":",Qt::SkipEmptyParts); +#else + split(":",QString::SkipEmptyParts); +#endif if(VP1Msg::debug()){ qDebug() << "extradirenvvar:" << extradirenvvar; qDebug() << "vp1pluginpath:" << vp1pluginpath; @@ -811,24 +819,45 @@ QMap<QString,QString> VP1MainWindow::availableFiles(const QString& extension, } //Add directories from pathvar (looking in subdir instareasubdir): - QString varStr = QString(::getenv(pathvar.toStdString().c_str())); - //VP1Msg::messageDebug("Add directories from pathvar... " + pathvar + " - " + varStr); - QString path = QString(::getenv(pathvar.toStdString().c_str())); - if (!path.isEmpty()) { - //!instareasubdir.isEmpty()&& - QStringList tmp = path.split(":",QString::SkipEmptyParts);//This 'tmp' is for SLC3 compilation. - foreach (QString dir,tmp) { - vp1pluginpath << ( instareasubdir.isEmpty() ? dir : dir+QDir::separator()+QDir::separator()+instareasubdir ); - } - } + QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); + VP1Msg::messageDebug("This is the 'pathvar' variable: " + pathvar); + QString path = env.value(pathvar); + VP1Msg::messageDebug("Add directories from 'pathvar' variable: " + path); + + if (!path.isEmpty()) { +#if QTCORE_VERSION >= 0x050E00 + VP1Msg::messageDebug("We're using Qt5..."); + QStringList tmp = path.split(":",Qt::SkipEmptyParts);//This 'tmp' is for SLC3 compilation. +#else + VP1Msg::messageDebug("We're using Qt older than 5..."); + QStringList tmp = path.split(":",QString::SkipEmptyParts);//This 'tmp' is for SLC3 compilation. +#endif + for (QString dir : tmp) { + vp1pluginpath << ( instareasubdir.isEmpty() ? dir : dir+QDir::separator()+instareasubdir ); + } + } + + // Remove duplicates + int nDuplicatesRemoved = vp1pluginpath.removeDuplicates(); + VP1Msg::messageDebug("Removed '" + QString::number(nDuplicatesRemoved) + "' duplicate paths."); //Remove all nonexisting directories: - foreach (QString plugindir, vp1pluginpath) { - QFileInfo fi(plugindir); - if (!fi.exists()||!fi.isDir()) { - vp1pluginpath.removeAll(plugindir); - } - } + unsigned idx=0; + for (const auto& plugindir : vp1pluginpath) { + VP1Msg::messageDebug("plugindir: '" + plugindir + "'"); + QFileInfo fi(plugindir); + if (!fi.exists()||!fi.isDir()) { + VP1Msg::messageDebug("list: " + vp1pluginpath.join(";")); + if (vp1pluginpath.contains(plugindir)) { + vp1pluginpath.removeAt(idx); // Note: do not use 'removeAll(string)' it has issues when run within loops + VP1Msg::messageDebug("Removed non-valid path: '" + plugindir + "'"); + } + else { + VP1Msg::messageDebug("plugindir not present; perhaps, it has been removed already. Skipping it..."); + } + } + ++idx; + } //Find all files with required extension in the directories (in case of duplicates - the ones appearing first are used): QMap<QString,QString> plugins2fullpath; diff --git a/graphics/VTI12/VTI12Gui/src/VP1Prioritiser.cxx b/graphics/VTI12/VTI12Gui/src/VP1Prioritiser.cxx index 1fa524816dba5200d6a90bb06a88dbd432b3c5e9..733106bdd2631e2d8901d8cdb936980efd3f3e92 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1Prioritiser.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1Prioritiser.cxx @@ -15,7 +15,7 @@ #include "VTI12Gui/VP1Prioritiser.h" #include "VP1Base/IVP1ChannelWidget.h" #include "VP1Base/IVP1System.h" -#include <QTime> +#include <QElapsedTimer> #include <QQueue> #include <QSet> #include <map> @@ -59,7 +59,7 @@ public: QHash<IVP1System*,SystemInfo*> sys2info; - QTime * stopwatch; + QElapsedTimer * stopwatch; IVP1System* currenttimedsystem; void updateSysinfoWithVisibilityState(const QSet<IVP1ChannelWidget*>& channels, @@ -128,7 +128,7 @@ inline void VP1Prioritiser::Imp::SystemInfo::addTimeMeasurement(const double&t) m_timemeasurements.dequeue(); QList<double> tmplist = m_timemeasurements; - qSort(tmplist.begin(), tmplist.end()); + std::sort(tmplist.begin(), tmplist.end()); switch(tmplist.count()) { case 1: m_timing = tmplist.at(0); break; @@ -191,7 +191,7 @@ VP1Prioritiser::VP1Prioritiser(QObject*parent) : QObject(parent), m_d(new Imp) { m_d->prioritiser=this; - m_d->stopwatch = new QTime(); + m_d->stopwatch = new QElapsedTimer(); m_d->currenttimedsystem=0; m_d->soonvisbonus=0; } diff --git a/graphics/VTI12/VTI12Gui/src/VP1TabManager.cxx b/graphics/VTI12/VTI12Gui/src/VP1TabManager.cxx index 58a127a995fe994c1643e138ba7ec5d541ad47ac..9efc4d27902691034850345830996b13eb15cba1 100644 --- a/graphics/VTI12/VTI12Gui/src/VP1TabManager.cxx +++ b/graphics/VTI12/VTI12Gui/src/VP1TabManager.cxx @@ -1524,7 +1524,7 @@ void VP1TabManager::executePendingChannelRemoval() //___________________________________________________________________________________ void VP1TabManager::serializeChannelState(IVP1ChannelWidget*cw,ChanState&state) { - QMap<QString,QByteArray> sysstate; + QMultiMap<QString,QByteArray> sysstate; std::set<IVP1System*>::const_iterator it, itE = cw->systems().end(); for (it=cw->systems().begin();it!=itE;++it) { unsigned nVP1Serialise = VP1Serialise::numberOfInstantiations();