Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 08:13:06

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