Exemple #1
0
def addTT():
    import Gaudi
    from Gaudi.Configuration import ApplicationMgr, AuditorSvc
    try:
        from Configurables import LHCbTimingAuditor as TA
        from Configurables import LHCbSequencerTimerTool as STT
    except ImportError:
        from Configurables import TimingAuditor as TA
        from Configurables import SequencerTimerTool as STT
    timer=TA("TIMER")
    timer.addTool(STT,"TIMER")
    if hasattr(timer.TIMER, "SummaryFile") or "SummaryFile" in timer.TIMER.__slots__:
        timer.TIMER.SummaryFile=Gaudi.Diff["prefix"]+".csv"
    if  'AuditorSvc' not in ApplicationMgr().ExtSvc :
        ApplicationMgr().ExtSvc.append( 'AuditorSvc' )
    #swap your timer for mine ;)
    remove=[]
    for auditor in AuditorSvc().Auditors:
        sauditor=auditor
        if type(sauditor) is not str:
            sauditor=auditor.getFullName()
        
        if "TIMER" or "TimingAuditor" in auditor:
            remove.append(auditor)
    AuditorSvc().Auditors=[a for a in AuditorSvc().Auditors if a not in remove]
    AuditorSvc().Auditors.append(timer)
    timer.Enable=True
Exemple #2
0
 def addTupleAlg(self):
     """ Add TupleHltDecReports to TopAlg """
     alg = TupleHltDecReports(self._algName)
     seq = Sequence("Hlt")
     algSeq = Sequence("TupleSequence")
     algSeq.Members = [alg]
     seq.Members += [algSeq]
     ApplicationMgr().HistogramPersistency = "ROOT"
     tupleFile = self._filename
     ApplicationMgr().ExtSvc += [NTupleSvc()]
     tup = "FILE1 DATAFILE='" + tupleFile + "' TYP='ROOT' OPT='NEW'"
     NTupleSvc().Output = [tup]
     NTupleSvc().OutputLevel = 1
def configure(version):
    from Gaudi.Configuration import (importOptions, ApplicationMgr, MessageSvc)
    from Configurables import DDDBConf, CondDB, CondDBAccessSvc
    dddbConf = DDDBConf()
    cdb = CondDB()

    DBs = []
    for i in range(3):
        data = {"name": "TESTDB%d" % i}
        DBs.append(
            CondDBAccessSvc(
                data["name"],
                ConnectionString="sqlite_file:../data/%(name)s.db/%(name)s" %
                data))

    cdb.PartitionConnectionString["DDDB"] = DBs[0].ConnectionString
    cdb.Tags["DDDB"] = ""
    if version == 1:
        cdb.addAlternative(DBs[1], '/AutoMap/FolderSet2')
    elif version == 2:
        cdb.addAlternative(DBs[2], '/AutoMap/FolderSet3')
    elif version == 3:
        cdb.addAlternative(DBs[1], '/AutoMap/FolderSet2/ObjectA')
    elif version == 4:
        cdb.addLayer(DBs[1])
        cdb.addLayer(DBs[2])
    elif version != 0:
        raise RuntimeError("Invalid version number")

    ApplicationMgr(TopAlg=["LoadDDDB"], EvtSel="NONE")
Exemple #4
0
def testthisioh(ioh):
    ioh.outStream(filename='out1.dst',
                  writer='InputCopyStream/SomethingWeird' +
                  ioh._outputPersistency)
    ioh.outputAlgs(filename='out2.dst',
                   writer='TagCollectionStream/SomethingElseWeird' +
                   ioh._outputPersistency)
    from Gaudi.Configuration import ApplicationMgr
    print "- streams"
    print ApplicationMgr().OutStream

    print ioh.activeStreams()
    for stream in ioh.activeStreams():
        if hasattr(
                stream, "Output"
        ):  # or (hasattr(stream,"__slots__") and "Output" in stream.__slots__):
            print stream.Output
        elif hasattr(stream, "Connection"):
            print stream.Connection

    ioh.convertStreams()
    print "- after conversion"
    for stream in ioh.activeStreams():
        if hasattr(
                stream, "Output"
        ):  # or (hasattr(stream,"__slots__") and "Output" in stream.__slots__):
            print stream.Output
        elif hasattr(stream, "Connection"):
            print stream.Connection
Exemple #5
0
    def setupServices(self):
        '''Services:  Setup the pool/Root services, to be done by LHCbApp'''

        from Gaudi.Configuration import (EventDataSvc, ApplicationMgr,
                                         EventPersistencySvc)
        # Set up the TES
        EventDataSvc(ForceLeaves=True, RootCLID=1, EnableFaultHandler=True)

        # Set up the IO
        ApplicationMgr().ExtSvc += [
            "Gaudi::MultiFileCatalog/FileCatalog",
            "Gaudi::IODataManager/IODataManager"
        ]

        # Set up the persistency
        if self._inputPersistency == 'ROOT' or self._outputPersistency == 'ROOT':
            from Configurables import Gaudi__RootCnvSvc
            #it's important also to enable the incidents for FSRs
            rootSvc = Gaudi__RootCnvSvc("RootCnvSvc", EnableIncident=1)
            # disable caches by default
            if not rootSvc.isPropertySet("VetoBranches"):
                rootSvc.VetoBranches = ["*"]
            if not rootSvc.isPropertySet("CacheBranches"):
                rootSvc.CacheBranches = []
            EventPersistencySvc().CnvServices += [rootSvc]
            ApplicationMgr().ExtSvc += [rootSvc]

            fileSvc = Gaudi__RootCnvSvc("FileRecordCnvSvc")
            #optimization, see Core Soft meeting, indico.cern.ch/conferenceDisplay?confId=207776
            if hasattr(fileSvc, "BufferSize"):
                fileSvc.BufferSize = 512

            self._doConfFileRecords(fileSvc)

        # Always enable reading/writing of MDF
        EventPersistencySvc().CnvServices.append("LHCb::RawDataCnvSvc")

        #always convert the event selector
        #if this is a PostConfigAction, then conversion will happen as a posConfig also
        #if this is a normal job with no flattened files, UserConfigurables are anyway called last
        #and so converting when the services are established is the best way.
        self.convertSelector()

        #always convert defined streams
        self.convertStreams()
Exemple #6
0
    def clearServices(self):
        '''Services:  remove all persistency services'''
        from Gaudi.Configuration import ApplicationMgr

        active = self.activeServices()

        ApplicationMgr().ExtSvc = [
            svc for svc in ApplicationMgr().ExtSvc if svc not in active
        ]

        extsvc = self.externalServices()

        for svc in extsvc:
            if hasattr(svc, "CnvServices") or "CnvServices" in svc.__slots__:
                svc.CnvServices = [
                    asvc for asvc in svc.CnvServices if asvc not in active
                ]

        removeConfigurables(active)
Exemple #7
0
    def outStream(self, filename, writer="OutputStream", writeFSR=True):
        '''Output:  Create a output stream and FSR writing algorithm instance
        to write into the given file.

        Any class inheriting from OutputStream can be used, with an instance name or configurable.

        e.g. ioh.outputAlgs("test.dst","InputCopyStream/Spam")
        e.g. ioh.outputAlgs("test.dst",InputCopyStream("Spam"))

        Adds these streams directly to the Application manager OutStream
        '''
        from Gaudi.Configuration import ApplicationMgr

        algs = self.outputAlgs(filename, writer, writeFSR)

        if ApplicationMgr().OutStream is None or len(
                ApplicationMgr().OutStream) == 0:
            ApplicationMgr().OutStream = []

        for alg in algs:
            ApplicationMgr().OutStream.append(alg)
def recurseConfigurables(func,
                         head=None,
                         descend_properties=[],
                         descend_tools=False):
    """Recursively visit configurables and call a function for each.
    
    Note that the function is called before recursing over properties
    or tools, so if it modifies them (e.g. adds tools), this will be
    reflected in the recursion.
    The behaviour of the removed forAllConf / postConfForAll can be
    achieved with:
    
    func = partial(setPropertiesAndAddTools, properties=..., tools_per_type=..., force=...)
    descend_properties = ['Members', 'Filter0', 'Filter1', 'TopAlg']
    appendPostConfigAction(partial(recurseConfigurables, func, descend_properties=descend_properties, descend_tools=...))
    
    Args:
        func: A function taking a single argument to be called for each
            visited configurable.
        head: A configurable or a list of configurables from which to
            start recursing. If None is given (default), all instantiated
            configurables plus ApplicationMgr().TopAlg will be used.
        descend_properties: List of properties to recurse over.
        descend_tools: Whether to recurse over tools or not.
    
    Returns:
        A set of all configurables that were visited.
    """

    if head is None:
        from Gaudi.Configuration import ApplicationMgr
        head = [ApplicationMgr()] + ApplicationMgr().TopAlg
        head += GaudiConfigurables.allConfigurables.values()

    visited = set()
    __recurseConfigurables(func, head, descend_properties, descend_tools,
                           visited)
    return visited
def configureFileStager(keep=False, tmpdir=None, garbageCommand='garbage.exe'):
    import os
    if os.name != 'posix': return

    from Gaudi.Configuration import ApplicationMgr, EventSelector
    from Configurables import FileStagerSvc
    from Configurables import Gaudi__StagedIODataManager as IODataManager
    from Configurables import LHCb__RawDataCnvSvc as RawDataCnvSvc

    ApplicationMgr().ExtSvc += ['FileStagerSvc']

    # Remove existing IODataManager
    name = 'Gaudi::IODataManager/IODataManager'
    if name in ApplicationMgr().ExtSvc:
        ApplicationMgr().ExtSvc.remove(name)

    # Remove existing IODataManager
    from Gaudi.Configuration import allConfigurables
    if "IODataManager" in allConfigurables:
        del allConfigurables["IODataManager"]
    # Add our datamanager
    mgr = IODataManager("IODataManager")

    ApplicationMgr().ExtSvc += [mgr.getFullName()]

    from os import environ, listdir
    svc = FileStagerSvc()
    if tmpdir:
        svc.Tempdir = tmpdir
    svc.KeepFiles = keep
    svc.GarbageCollectorCommand = garbageCommand
    svc.CheckForLocalGarbageCollector = True

    # Configure other services to use the correct ones
    RawDataCnvSvc('RawDataCnvSvc').DataManager = mgr.getFullName()
    EventSelector().StreamManager = "StagedStreamTool"

    return svc
Exemple #10
0
    def _doConfFileRecords(self, fileSvc):
        '''Helper:   create the file records service, should always be done.
        '''
        from Gaudi.Configuration import (FileRecordDataSvc, ApplicationMgr,
                                         PersistencySvc)
        # Set up the FileRecordDataSvc
        FileRecordDataSvc(
            ForceLeaves=True,
            EnableFaultHandler=True,
            RootCLID=1,  #was the next line missed accidentally?
            PersistencySvc="PersistencySvc/FileRecordPersistencySvc")

        fileSvc.ShareFiles = "YES"
        ApplicationMgr().ExtSvc += [fileSvc]
        PersistencySvc("FileRecordPersistencySvc").CnvServices += [fileSvc]
Exemple #11
0
    def activeStreams(self):
        '''Output:  Find the list of Output Stream-type objects,
        search through allConfigurables AppMgr.TopAlg and and AppMgr.OutStream
        also search all gaudi sequencers'''
        streams = []
        from Gaudi.Configuration import ApplicationMgr
        for alg in ApplicationMgr().TopAlg:
            algname = alg
            if type(algname) is not str:
                algname = alg.getFullName()
            if self._isOutputStream(algname):
                streams.append(alg)

        #everything in OutStream is an output stream
        if ApplicationMgr().OutStream is not None:
            streams += ApplicationMgr().OutStream

        #all defined configurables which match my expressions are output streams
        allConfigurables = fullNameConfigurables()
        for key in allConfigurables:
            if self._isOutputStream(key):
                if key not in streams and allConfigurables[key] not in streams:
                    streams.append(allConfigurables[key])

        #all streams added to GaudiSequencers are Output Streams...
        for sequencer in allConfigurables:
            if self._isSequencer(sequencer):
                if (not hasattr(allConfigurables[sequencer], "Members")) or (
                        allConfigurables[sequencer].Members is None):
                    continue
                for member in allConfigurables[sequencer].Members:
                    membername = nameFromConfigurable(member)
                    if self._isOutputStream(membername):
                        if member not in streams and membername not in streams:
                            streams.append(member)
        return streams
Exemple #12
0
def configure():
    from Gaudi.Configuration import (ApplicationMgr, MessageSvc, ERROR)
    from Configurables import DDDBConf, CondDB, CondDBAccessSvc, EventClockSvc, FakeEventTime
    dddbConf = DDDBConf()
    cdb = CondDB()

    cdb.PartitionConnectionString[
        "DQFLAGS"] = "sqlite_file:../data/DQFLAGS.db/DQFLAGS"
    cdb.Tags["DQFLAGS"] = ""

    ecs = EventClockSvc(InitialTime=toTimeStamp(datetime(2012, 1, 1, 12)))
    ecs.addTool(FakeEventTime, "EventTimeDecoder")
    ecs.EventTimeDecoder.StartTime = ecs.InitialTime
    ecs.EventTimeDecoder.TimeStep = toTimeStamp(timedelta(days=1))

    ApplicationMgr(TopAlg=["LoadDDDB"], EvtSel="NONE")
    MessageSvc(OutputLevel=ERROR)
Exemple #13
0
    def activeServices(self):
        '''Services:  return all configured persistency services which depend on the persistency'''
        from Gaudi.Configuration import ApplicationMgr

        retlist = []
        extsvc = self.externalServices()

        for svc in extsvc:
            if hasattr(svc, "CnvServices") or "CnvServices" in svc.__slots__:
                retlist += self._getSvcList(svc.CnvServices)

        retlist += self._getSvcList(ApplicationMgr().ExtSvc)

        reducedList = []
        for svc in retlist:
            if svc not in reducedList:
                reducedList.append(svc)

        return reducedList
#!/usr/bin/env gaudirun.py
from Gaudi.Configuration import ApplicationMgr, EventSelector
from GaudiConf import IOHelper
from Configurables import createODIN, HltLumiSummaryDecoder
from Configurables import DumpLumiEvents

IOHelper(None, None).setupServices()
#IOHelper(Input='MDF').inputFiles(inputs, clear=True)

dumpLumiEvents = DumpLumiEvents()
dumpLumiEvents.OutputFileName = "output.bz2"

ApplicationMgr().TopAlg = [
    createODIN(), HltLumiSummaryDecoder(), dumpLumiEvents
]
ApplicationMgr().HistogramPersistency = 'NONE'
EventSelector().PrintFreq = 100000
Exemple #15
0
def findalg(head=None, find=""):
    """ Find a given algoritm, return a tuple
    (found_yet?,before,contained_in,after,contains_stuff)
    """
    from GaudiConf.Manipulations import configurableInstanceFromString, nameFromConfigurable, postConfigCallable, configurableClassFromString
    if type(head) is list:
        raise TypeError("findalg, you need to send me one object at a time!")

    if head is None:
        from Gaudi.Configuration import ApplicationMgr
        head = ApplicationMgr()

    headname = nameFromConfigurable(head)

    itsme = False

    if headname is None or head is None:
        return (False, [], [], [])
    if headname == find:
        itsme = True

    head = configurableInstanceFromString(headname)
    found = itsme
    before = []
    contained = []
    after = []
    contains_stuff = []

    orderedkids = []

    for p in ['Members', 'Filter0', 'Filter1', 'TopAlg', 'OutStream']:
        if not hasattr(head, p): continue
        orderedkids = orderedkids + getattr(head, p)
    from Configurables import ProcessPhase
    if type(head) is ProcessPhase:
        orderedkids += [
            "GaudiSequencer/" + headname.split("/")[-1] + d + "Seq"
            for d in head.getProp("DetectorList")
        ]

    if itsme:
        contains_stuff = orderedkids

    for s in orderedkids:
        ifound, ibefore, icontained, iafter, istuff = findalg(s, find)
        if (found and ifound):
            print "#WARNING The algorithm you asked for appears twice! I cannot excise it properly like that. I take the first occurance"
        if ifound and itsme:
            raise NameError(
                "Recursion detected, somehow the algorithm is a container which contains itself, that's really a problem."
            )

        if itsme:
            contains_stuff = contains_stuff + ibefore + icontained + iafter + istuff
        elif found:
            after = after + ibefore + icontained + iafter
        elif ifound:
            before = before + ibefore
            contained = icontained
            after = after + iafter
            found = True
            contains_stuff = contains_stuff + istuff
        else:
            before += ibefore
            if len(iafter) or len(icontained):
                raise ValueError(
                    "I didn't expect sequencers when the alg was said not to be found yet"
                )
    if itsme:
        return (True, [], [], [], contains_stuff)

    #if I found it, register me as containing the thing
    if found:
        contained = [headname] + contained
    else:
        before = [headname] + before

    return (found, before, contained, after, contains_stuff)
Exemple #16
0
def configure(**kwargs):
    # Add some expected stuff to OnlineEnv
    import OnlineEnv
    from Gaudi.Configuration import INFO, WARNING
    output_level = kwargs.pop('OutputLevel', WARNING)
    OnlineEnv.OutputLevel = output_level

    moore_tests = __import__("MooreTests", globals(), locals(),
                             [kwargs.get('UserPackage')])
    user_package = getattr(moore_tests, kwargs.pop('UserPackage'))
    input_type = kwargs.pop('InputType', 'MEP')

    # Only a single setting directly for Moore
    from Moore.Configuration import Moore, MooreExpert
    moore = Moore()
    moore.OutputLevel = output_level
    moore.RunOnline = True

    # We need MooreOnline to setup the buffer manager infrastructure etc, but we
    # don't want to use things like the RunChangeHandler and database snapshots.
    from MooreOnlineConf.Configuration import MooreOnline
    mooreOnline = MooreOnline()
    mooreOnline.RunOnline = False
    mooreOnline.EnableTimer = False
    mooreOnline.EnableRunChangeHandler = None
    mooreOnline.UseDBSnapshot = False
    mooreOnline.CheckOdin = False
    mooreOnline.EnableUpdateAndReset = False

    # Add the timing auditor by hand with output level INFO, as Moore is never
    # going to do it for us if the rest is at WARNING
    from Gaudi.Configuration import ApplicationMgr, AuditorSvc
    from Configurables import LHCbTimingAuditor, LHCbSequencerTimerTool
    ApplicationMgr().AuditAlgorithms = 1
    ta = LHCbTimingAuditor('TIMER')
    ta.OutputLevel = INFO
    ta.addTool(LHCbSequencerTimerTool, name='TIMER')
    ta.TIMER.NameSize = 90
    ta.TIMER.OutputLevel = INFO
    if 'AuditorSvc' not in ApplicationMgr().ExtSvc:
        ApplicationMgr().ExtSvc.append('AuditorSvc')
    AuditorSvc().Auditors.append(ta)
    ta.Enable = True

    # Hack the shit out of the CondDB services to stop them from spawning a
    # thread that will segfault on finalize with forking
    def no_timeout():
        from Gaudi.Configuration import allConfigurables
        from Configurables import CondDBAccessSvc
        for conf in allConfigurables.itervalues():
            if type(conf) == CondDBAccessSvc:
                conf.ConnectionTimeOut = 0

    from Gaudi.Configuration import appendPostConfigAction
    appendPostConfigAction(no_timeout)

    ## from Gaudi.Configuration import appendPostConfigAction
    ## def info_dammit():
    ##     from Configurables import LHCbTimingAuditor, LHCbSequencerTimerTool
    ##     ta = LHCbTimingAuditor('TIMER')
    ##     ta.OutputLevel = OnlineEnv.OutputLevel
    ##     ta.addTool(LHCbSequencerTimerTool, name = 'TIMER')
    ##     ta.TIMER.OutputLevel = OnlineEnv.OutputLevel
    ## appendPostConfigAction(info_dammit)

    userOptions = user_package.MooreOptions
    # This is the stuff that should come from the PRConfig user module
    # This is the stuff that should come from the PRConfig user module
    for conf, d in {
            moore: {
                'DDDBtag': str,
                'CondDBtag': str
            },
            mooreOnline: {
                'UseTCK': bool,
                'Simulation': bool,
                'DataType': tuple(str(y) for y in range(2011, 2017)),
                'HltLevel': ('Hlt1', 'Hlt2', 'Hlt1Hlt2')
            }
    }.iteritems():
        for a, t in d.iteritems():
            ua = userOptions.pop(a)
            if hasattr(t, '__iter__'):
                if ua not in t:
                    raise ValueError(
                        'Property %s should be one of %s, not %s.' %
                        (a, t, ua))
            else:
                if type(ua) != t:
                    raise ValueError(
                        'Property %s should be of type %s, not %s.' %
                        (a, t, ua))
            conf.setProp(a, ua)

    if 'InitialTCK' in userOptions:
        moore.setProp('InitialTCK', userOptions['InitialTCK'])

    if userOptions.pop('Split', None):
        print 'WARNING: Split property is ignored, value from HltLevel will be used instead.'

    if mooreOnline.getProp('HltLevel') == 'Hlt1Hlt2':
        moore.setProp('Split', '')
    else:
        moore.setProp('Split', mooreOnline.getProp('HltLevel'))

    if input_type == 'MEP' and 'Hlt1' in mooreOnline.HltLevel:
        mooreOnline.REQ1 = "EvType=1;TriggerMask=0xffffffff,0xffffffff,0xffffffff,0xffffffff;VetoMask=0,0,0,0;MaskType=ANY;UserType=ONE;Frequency=PERC;Perc=100.0"
    elif input_type == 'MDF' and 'Hlt1' in mooreOnline.HltLevel:
        mooreOnline.ForceMDFInput = True
        mooreOnline.REQ1 = "EvType=2;TriggerMask=0xffffffff,0xffffffff,0xffffffff,0xffffffff;VetoMask=0,0,0,0;MaskType=ANY;UserType=ONE;Frequency=PERC;Perc=100.0"
    elif mooreOnline.HltLevel == 'Hlt2':
        mooreOnline.REQ1 = "EvType=2;TriggerMask=0xffffffff,0xffffffff,0xffffffff,0xffffffff;VetoMask=0,0,0,0;MaskType=ANY;UserType=ONE;Frequency=PERC;Perc=100.0"

    # Apparently we need to set this, otherwise something goes wrong with
    # default properties being retrieved that have the wrong type.
    from Gaudi.Configuration import EventSelector
    moore.inputFiles = []
    EventSelector().Input = []

    # Extra options
    from Configurables import MooreExpert
    userOptions.update(kwargs)
    for k, v in userOptions.iteritems():
        #iterate through the available configurables to set required properties
        found = False
        for conf in [mooreOnline, moore, MooreExpert()]:
            if k in conf.__slots__ or hasattr(conf, k):
                conf.setProp(k, v)
                found = True
                break
        if not found:
            print "# WARNING: skipping setting '" + str(k) + ":" + str(
                v) + "' because no configurable has that option"

    user_package.configure()
    OnlineEnv.end_config(False)
#!/usr/bin/env gaudirun.py
from Gaudi.Configuration import ApplicationMgr, EventSelector, FileCatalog, DEBUG
from GaudiConf import IOHelper
from Configurables import createODIN, HltLumiSummaryDecoder
from Configurables import DumpLumiEvents

FileCatalog().Catalogs = ["xmlcatalog_file:MyCatalog.xml"]

inputs = ["lfn:/lhcb/data/2012/RAW/FULL/LHCb/COLLISION12/114753/114753_0000000298.raw"]

IOHelper(None, None).setupServices()

dumpLumiEvents = DumpLumiEvents()
dumpLumiEvents.OutputLevel = DEBUG
dumpLumiEvents.OutputFileName = "testDumpLumiEvents.bz2"
dumpLumiEvents.NEventsHint = 100

ApplicationMgr().TopAlg = [createODIN(), HltLumiSummaryDecoder(), dumpLumiEvents]
ApplicationMgr().HistogramPersistency = 'NONE'
ApplicationMgr().EvtMax = 100
IOHelper(Input='MDF').inputFiles(inputs, clear=True)
EventSelector().PrintFreq = 1
Exemple #18
0
                stream, "Output"
        ):  # or (hasattr(stream,"__slots__") and "Output" in stream.__slots__):
            print stream.Output
        elif hasattr(stream, "Connection"):
            print stream.Connection


#preload with some MDFs, check they make it through the conversions
ioh = IOHelper("MDF", "MDF")
ioh.outputAlgs("file1.mdf", writeFSR=False)
ioh.outputAlgs("file2.mdf", "LHCb::MDFWriter", writeFSR=False)

#add a bare InputCopyStream to a GaudiSequencer, check it's OK
from Gaudi.Configuration import ApplicationMgr
from Configurables import GaudiSequencer
ApplicationMgr().TopAlg = ["Rubbish", GaudiSequencer("MoreRubbish")]
GaudiSequencer("MoreRubbish").Members = ["InputCopyStream"]

persistencies = [None, "ROOT", "MDF"]
if IOHelper().isPoolSupported():
    persistencies.append("POOL")

for persistency in persistencies:
    print '============================='
    print persistency
    print '============================='

    ioh = IOHelper(persistency, persistency)

    testthisioh(ioh)
Exemple #19
0
#-------------- EXTRA LINES TO RUN MONITOR SERVICE ONLINE --------------#
import os
from Gaudi.Configuration import ApplicationMgr

from Configurables import LHCb__EventRunable
ApplicationMgr().Runable= LHCb__EventRunable("Runable",NumErrorToStop=1)

from Configurables import MonitorSvc
ApplicationMgr().ExtSvc += ["MonitorSvc"]
MonitorSvc().ExpandNameInfix=os.environ["UTGID"]+"/"
MonitorSvc().ExpandCounterServices = 1
MonitorSvc().DimUpdateInterval = 1

def run():
  import OnlineEnv as Online
  Online.end_config(False)



#----------------------- USER JOB CONFIGURATION ------------------------#
import example
Exemple #20
0
from Configurables import L0MuonAlg
L0MuonAlg("L0Muon").L0DUConfigProviderType="L0DUConfigProvider"
from Configurables import L0Conf
L0Conf().EnableL0DecodingOnDemand = True
L0Conf().FastL0DUDecoding = True
L0Conf().DecodeL0DU = True
L0Conf().TCK = '0x0045'

#from Configurables import Hlt2Conf
#Hlt2Conf().Hlt1TrackOption = "Rerun"

import GaudiPython
from Gaudi.Configuration import ApplicationMgr
from Configurables import LoKiSvc

appMgr = ApplicationMgr()
#
from Configurables import EventNodeKiller
enk = EventNodeKiller('KillTrigRawEvent')
enk.Nodes = [ "Hlt","Hlt1","Hlt2" ]
appMgr.TopAlg.insert( 0,  enk.getFullName() ) 
#
appMgr.ExtSvc += ['DataOnDemandSvc'] #breaks for real data
appMgr.ExtSvc += ['ToolSvc', 'DataOnDemandSvc', LoKiSvc()]
#appMgr.TopAlg += [ seq ]
gaudi = GaudiPython.AppMgr(outputlevel=4)
gaudi.initialize()

gaudi.algorithm('Hlt').Enable = False
gaudi.algorithm('KillTrigRawEvent').Enable = False
triggerTisTosTool = gaudi.toolsvc().create('TriggerTisTos', interface='ITriggerTisTos')
# Test of UnpackTrack on SDST contaning a track with more than 65k LHCbIDs
from PRConfig import TestFileDB
from Gaudi.Configuration import ApplicationMgr
from Configurables import DumpTracks, UnpackTrack
from GaudiConf.IOHelper import IOHelper

upkTr = UnpackTrack()
ApplicationMgr().TopAlg += [ upkTr, DumpTracks() ]

ioh = IOHelper('ROOT')
ioh.setupServices()
ioh.inputFiles(['PFN:root://eoslhcb.cern.ch//eos/lhcb/grid/prod/lhcb/swtest/lhcb/swtest/Reco10-sdst-10events/00011652_00000001_1-evt-18641to18650.sdst'])


#TestFileDB.test_file_db["Reco10-sdst-10events"].run()