Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14:48

0001 ###############################################################################
0002 # File for running Brunel with default options (2008 real data,.mdf in,.dst out)
0003 ###############################################################################
0004 # Syntax is:
0005 #   gaudirun.py Brunel-Default.py <someDataFiles>.py
0006 ###############################################################################
0007 from __future__ import absolute_import, unicode_literals
0008 import os
0009 from GaudiConf import IOHelper
0010 from Gaudi.Configuration import *  # noqa: F403
0011 from Configurables import LHCbConfigurableUser, LHCbApp, CondDB, ToolSvc, EventSelector
0012 from Configurables import LoadDD4hepDet, LbDD4hepExample
0013 
0014 # import DD4hep
0015 # DD4hep.setPrintLevel(DD4hep.OutputLevel.DEBUG)
0016 
0017 
0018 class MyTest(LHCbConfigurableUser):
0019   # Steering options
0020   __slots__ = {"DDDBtag": "", "CondDBtag": "", "UseDBSnapshot": False,
0021                "PartitionName": "LHCb", "DBSnapshotDirectory": "/group/online/hlt/conditions"
0022                }
0023 
0024   _propertyDocDct = {'DDDBtag': """ Tag for DDDB """, 'CondDBtag': """ Tag for CondDB """,
0025                      "UseDBSnapshot":
0026                      """Use a snapshot for velo position and rich pressure""",
0027                      "PartitionName":
0028                      """Name of the partition when running (needed to find DB: '', 'FEST', or 'LHCb'""",
0029                      "DBSnapshotDirectory": """Local Directory where the snapshot is"""
0030                      }
0031 
0032   # Apply the configuration
0033   def __apply_configuration__(self):
0034     actor = LoadDD4hepDet()
0035     actor.OutputLevel = DEBUG  # noqa: F405
0036     # actor.SetupPlugins    = ['DDCondDetElementMapping','DDDB_AssignConditions','DDDB_DetectorConditionKeysDump']
0037     actor.SetupPlugins = ['DDDB_DetectorDump', 'DD4hep_InteractiveUI', 'DD4hep_Rint']
0038     actor.DumpDetElements = 0
0039     actor.DumpDetVolumes = 0
0040     actor.DumpConditions = ""
0041     # actor.DumpConditions  = "DDDB_DetElementConditionDump"
0042     # actor.DumpAlignments  = "DDDB_AlignmentDump"
0043     # actor.DumpAlignments  = "DDDB_DerivedCondTest"
0044     actor.ScanConditions = 0
0045     pxml = None
0046     try:
0047       pxml = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Parameters.xml")
0048     except Exception:
0049       pxml = os.path.join(os.getcwd(), "Parameters.xml")
0050     actor.Parameters = "file://" + pxml
0051     actor.VisAttrs = os.path.join(os.getcwd(), "Visattrs.xml")
0052     # actor.Config     = [os.path.join(os.getcwd(), "apps/DD4hep/examples/DDDB/data/VPOnly.xml")]
0053 
0054     example_alg = LbDD4hepExample()
0055     ApplicationMgr().TopAlg = [actor, example_alg]  # noqa: F405
0056 
0057 
0058 # Just instantiate the configurable...
0059 theApp = MyTest()
0060 ToolSvc.LogLevel = DEBUG  # noqa: F405
0061 cdb = CondDB()
0062 tag = {"DDDB": '', "LHCBCOND": 'default',  # "SIMCOND" : 'upgrade/dd4hep',
0063        "SIMCOND": '', "ONLINE": 'fake'
0064        }
0065 cdb.Tags = tag
0066 cdb.setProp('IgnoreHeartBeat', True)
0067 cdb.setProp('EnableRunChangeHandler', True)
0068 # cdb.LogFile = "/tmp/cdb.log"
0069 cdb.Upgrade = True
0070 theApp.setOtherProps(cdb, ['UseDBSnapshot',
0071                            'DBSnapshotDirectory',
0072                            'PartitionName'])
0073 
0074 # -- Use latest database tags for real data
0075 # LHCbApp().DDDBtag   = ""
0076 # LHCbApp().CondDBtag = "default"
0077 LHCbApp().EvtMax = 5
0078 LHCbApp().DataType = "Upgrade"
0079 LHCbApp().Simulation = True
0080 EventSelector().PrintFreq = 1
0081 
0082 IOHelper('ROOT').inputFiles([
0083     'PFN:Gauss/Boole.xdigi',
0084     ])