def _action(): """ Reset all DaVinci sequences """ from Gaudi.Configuration import allConfigurables from Gaudi.Configuration import getConfigurable for seq in ('DaVinciInitSeq', 'DaVinciMainSequence', 'DaVinciSequence', 'MonitoringSequence', 'FilteredEventSeq'): if not seq in allConfigurables: continue cSeq = getConfigurable(seq) if cSeq and hasattr(cSeq, 'Members'): logger.info('Reset the sequence %s' % cSeq.name()) cSeq.Members = [] ## reset the list of top-level algorithms from Configurables import ApplicationMgr a = ApplicationMgr() a.TopAlg = [] a.OutputLevel = options.OutputLevel from Configurables import MessageSvc m = MessageSvc(OutputLevel=options.OutputLevel) from GaudiConf import IOHelper ioh = IOHelper() ioh.setupServices()
def configMonitor(): import os from Gaudi.Configuration import EventPersistencySvc, HistogramPersistencySvc from Configurables import (LHCbApp, LHCb__RawDataCnvSvc, GaudiSequencer, UpdateAndReset, createODIN, ApplicationMgr ) app = LHCbApp() app.DataType = '2015' app.EvtMax = -1 EventPersistencySvc().CnvServices.append( LHCb__RawDataCnvSvc('RawDataCnvSvc') ) HistogramPersistencySvc().OutputFile = '' HistogramPersistencySvc().Warnings = False UpdateAndReset().saveHistograms = 1 #UpdateAndReset().saverCycle = 3600 from Configurables import EventClockSvc EventClockSvc().EventTimeDecoder = 'OdinTimeDecoder' appMgr = ApplicationMgr() # Decoder from Configurables import HCRawBankDecoder decoder = HCRawBankDecoder() decoder.Monitoring = True # Monitor from Configurables import HCDigitMonitor monitor = HCDigitMonitor() monitor.CrateB = 0 monitor.CrateF = 1 monitor.ChannelsB0 = [47, 46, 45, 44] monitor.ChannelsB1 = [23, 22, 21, 20] monitor.ChannelsB2 = [11, 10, 9, 8] monitor.ChannelsF1 = [23, 22, 21, 46] monitor.ChannelsF2 = [11, 10, 9, 8] # Top level sequence topSeq = GaudiSequencer("TopSequence") topSeq.Members = [createODIN(), decoder, monitor] appMgr.TopAlg = [topSeq] return app, monitor
import os from GaudiKernel import SystemOfUnits as units from GaudiKernel import PhysicalConstants as constants from Gaudi.Configuration import * from Configurables import ApplicationMgr main = ApplicationMgr() main.EvtSel = 'NONE' main.EvtMax = 10 main.TopAlg = [] main.ExtSvc = [] # PODIO algorithm from Configurables import FCCDataSvc podioevent = FCCDataSvc("EventDataSvc") main.ExtSvc += [podioevent] ### Generation ################################################# from Configurables import GaussSmearVertex smeartool = GaussSmearVertex() smeartool.xVertexSigma = 0.5 * units.mm smeartool.yVertexSigma = 0.5 * units.mm smeartool.zVertexSigma = 40.0 * units.mm smeartool.tVertexSigma = 180.0 * units.picosecond from Configurables import ConstPtParticleGun pgun_tool = ConstPtParticleGun() pgun_tool.PdgCodes = [13] pgun_tool.PhiMin = 0.0
import os from Gaudi.Configuration import * from Configurables import ApplicationMgr app = ApplicationMgr() app.TopAlg = [] app.EvtSel = 'NONE' app.EvtMax = 1 app.ExtSvc = [] app.OutputLevel = INFO # DD4hep geometry service from Configurables import GeoSvc ## parse the given xml file path_to_detectors = os.environ.get("FCCDETECTORS", "") geoservice = GeoSvc("GeoSvc") geoservice.detectors = [ os.path.join(path_to_detectors, 'Detector/DetFCCeeCLD/compact/FCCee_o2_v02/FCCee_o2_v02.xml'), ] ApplicationMgr().ExtSvc += [geoservice] from Configurables import SimG4Svc geantservice = SimG4Svc("SimG4Svc") ApplicationMgr().ExtSvc += [geantservice] from Configurables import GeoToGdmlDumpSvc geodumpservice = GeoToGdmlDumpSvc() geodumpservice.gdml = "DetFCCeeCLD.gdml" ApplicationMgr().ExtSvc += [geodumpservice]
from Configurables import (ApplicationMgr, EventDataSvc, RecordOutputStream, ReplayOutputStream, GaudiSequencer, GaudiTesting__OddEventsFilter as OddEvents, GaudiTesting__EvenEventsFilter as EvenEvents, SubAlg as EmptyAlg) outDelegate = ReplayOutputStream() outDelegate.OutputStreams = [EmptyAlg('Stream1'), EmptyAlg('Stream2')] oddEvtSelect = GaudiSequencer('OddEventsSelection') oddEvtSelect.Members = [OddEvents('OddEvents'), RecordOutputStream('Rec1', OutputStreamName='Stream1')] evenEvtSelect = GaudiSequencer('EvenEventsSelection') evenEvtSelect.Members = [EvenEvents('EvenEvents'), RecordOutputStream('Rec2', OutputStreamName='Stream2')] app = ApplicationMgr(EvtSel='NONE', EvtMax=4) app.TopAlg = [EmptyAlg("EventInit"), evenEvtSelect, oddEvtSelect] app.OutStream = [outDelegate] EventDataSvc(ForceLeaves=True) #from Gaudi.Configuration import VERBOSE #from Configurables import MessageSvc #MessageSvc(OutputLevel=VERBOSE)