コード例 #1
0
def inputFileNames():
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags

    if athenaCommonFlags.FilesInput() != []:
        return athenaCommonFlags.FilesInput()
    from RecExConfig.RecFlags import rec
    inFiles = None

    # highest flag have precedence
    if rec.readTAG():
        inFiles = athenaCommonFlags.PoolTAGInput()
    elif rec.readAOD():
        inFiles = athenaCommonFlags.PoolAODInput()
    elif rec.readESD():
        inFiles = athenaCommonFlags.PoolESDInput()
    elif rec.readRDO():
        from AthenaCommon.GlobalFlags import globalflags
        if globalflags.InputFormat == 'bytestream':
            inFiles = athenaCommonFlags.BSRDOInput()
        else:
            inFiles = athenaCommonFlags.PoolRDOInput()
    else:
        raise RutimeError("Unable to determine input file")

    return inFiles
コード例 #2
0
    def checkInput(self):

        self.checkFileMetaData()

        log = logging.getLogger("TriggerConfigGetter.py")
        if "ReadPool" in self._environment or "WritePool" in self._environment:
            log.info(
                "Flags are ignored, since 'ReadPool' or  'WritePool' is specified"
            )
            return True

        if rec.readESD() or rec.readAOD(
        ):  # and globalflags.DataSource()=='data':  # need this for MC as well
            protectedInclude("TrigTier0/TriggerConfigCheckMetadata.py")

        if rec.readRDO() and globalflags.InputFormat(
        ) == 'bytestream' and globalflags.DataSource() == 'data':
            protectedInclude("TrigTier0/TriggerConfigCheckHLTpsk.py")

        log.info("The following flags are set:")
        log.info("globalflags.InputFormat             : %s" %
                 globalflags.InputFormat())
        log.info(
            "rec.read.*                          : RDO: %s, ESD: %s, AOD: %s, TAG: %s"
            % (rec.readRDO(), rec.readESD(), rec.readAOD(), rec.readTAG()))
        log.info(
            "rec.doWrite.*                       : ESD: %s, AOD: %s, TAG: %s" %
            (rec.doWriteESD(), rec.doWriteAOD(), rec.doWriteTAG()))
        log.info("globalflags.DataSource              : %s" %
                 globalflags.DataSource())
        log.info("TriggerFlags.configForStartup       : %s" %
                 TriggerFlags.configForStartup())
        log.info("TriggerFlags.dataTakingConditions   : %s" %
                 TriggerFlags.dataTakingConditions())
        log.info("TriggerFlags.configurationSourceList: %s" %
                 TriggerFlags.configurationSourceList())

        count = len(
            [1 for x in [rec.readRDO(
            ), rec.readESD(), rec.readAOD()]
             if x])  #readTAG is only set with another input
        if count == 0:
            log.warning("Don't know what the input format is.")
            return False
        if count >= 2:
            log.warning(
                "More than one input format specified, please set only the appropriate one."
            )
            return False
        return True
コード例 #3
0
def InputFileNames():
    from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
    if athenaCommonFlags.FilesInput() != []:
        return athenaCommonFlags.FilesInput()
    from RecExConfig.RecFlags import rec
    inFiles = None

    ## FIXME
    ##     if (not athenaCommonFlags.PoolTAGInput.isDefault() or rec.readTAG() ):
    ##         inFiles=athenaCommonFlags.PoolTAGInput()
    ##     elif (not athenaCommonFlags.PoolAODInput.isDefault() or rec.readAOD() ):
    ##         inFiles=athenaCommonFlags.PoolAODInput()
    ##     elif (not athenaCommonFlags.PoolESDInput.isDefault() or rec.readESD() ):
    ##         inFiles=athenaCommonFlags.PoolESDInput()
    ##     elif not athenaCommonFlags.BSRDOInput.isDefault():
    ##         inFiles=athenaCommonFlags.BSRDOInput()
    ##     elif not athenaCommonFlags.PoolRDOInput.isDefault():
    ##         inFiles=athenaCommonFlags.PoolRDOInput()

    if rec.readTAG():
        inFiles = athenaCommonFlags.PoolTAGInput()
    elif rec.readAOD():
        inFiles = athenaCommonFlags.PoolAODInput()
    elif rec.readESD():
        inFiles = athenaCommonFlags.PoolESDInput()

    elif rec.readRDO():
        from AthenaCommon.GlobalFlags import globalflags
        if globalflags.InputFormat == 'bytestream':
            inFiles = athenaCommonFlags.BSRDOInput()
        else:
            inFiles = athenaCommonFlags.PoolRDOInput()
    else:
        raise RuntimeError("Unable to determine input file")

    return inFiles
コード例 #4
0
    # Input='simrdo'

if not 'Debug' in dir():
    Debug = True  # change to True to have printout information

#specify beam type (default is "collisions", other values "cosmics" "singlebeam"
# pick the correct one
jobproperties.Beam.beamType = 'cosmics'
# singlebeam not tested recently
#jobproperties.Beam.beamType = 'singlebeam'

# input configuration (lock to prevent override)
# note that if reading from TAG, the input file spec is ignored,
#   however the flag settings should still be consistent
if Input == 'data':
    if rec.readTAG():
        # read TAG, navigate to ESD
        athenaCommonFlags.PoolTAGInput = ['../cosm/myTAGCOMM.root']
        athenaCommonFlags.PoolInputQuery.set_Value_and_Lock("TRTTracks>0")
    if rec.readRDO():
        if jobproperties.Beam.beamType() == 'cosmics':
            if RTTdata:
                # this is ignored if TAG are read
                athenaCommonFlags.BSRDOInput.set_Value_and_Lock([
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-1._0001.data',
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-1._0002.data',
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-1._0003.data',
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-2._0001.data',
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-2._0002.data',
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-2._0003.data',
                    '/castor/cern.ch/grid/atlas/DAQ/2008/91900/physics_IDCosmic/daq.ATLAS.0091900.physics.IDCosmic.LB0001.SFO-3._0001.data',
コード例 #5
0
def ConfigureInputType():
    from PyUtils.MetaReaderPeeker import metadata

    from AthenaCommon.GlobalFlags import globalflags
    streamsName = []

    if metadata['file_type'] == 'BS':
        #byte stream
        logAutoConfiguration.info("Input BS detected")
        globalflags.InputFormat = 'bytestream'
        rec.readRDO = True
        rec.readESD = False
        rec.readAOD = False
        rec.doAOD = False
        rec.doESD = True
        rec.doWriteAOD = False
        logAutoConfiguration.info(
            "BS format: setting globalflags.InputFormat=%s " %
            globalflags.InputFormat())
        logAutoConfiguration.info("BS format: setting rec.readRDO=%s " %
                                  rec.readRDO())
        logAutoConfiguration.info("BS format: setting rec.doAOD=%s " %
                                  rec.doAOD())
        logAutoConfiguration.info("BS format: setting rec.doESD=%s " %
                                  rec.doESD())
        logAutoConfiguration.info("BS format: setting rec.doWriteAOD=%s " %
                                  rec.doWriteAOD())
    else:
        globalflags.InputFormat = 'pool'
        #Get streamsName
        streamsName = []
        if 'processingTags' in metadata:
            streamsName = metadata['processingTags']
        if streamsName == None:
            streamsName = []
        logAutoConfiguration.info("Extracted streams %s from input file " %
                                  streamsName)

        if len(streamsName) == 0:
            logAutoConfiguration.warning(
                "ConfigureInputType: no stream in input file.")
        elif len(streamsName) > 1:
            logAutoConfiguration.warning(
                "ConfigureInputType: more than one stream: %s in input file. Default action. Consider the highest one."
            )
        else:
            rec.mergingStreamName = streamsName[0]

    from RecExConfig.RecoFunctions import OverlapLists
    try:
        from PrimaryDPDMaker.PrimaryDPDFlags import listRAWtoDPD, listESDtoDPD, listAODtoDPD
    except:
        logAutoConfiguration.warning(
            "Unable to import PrimaryDPDFlags. OK for ATN tests below AtlasAnalysis, otherwise suspicious."
        )
        listRAWtoDPD = []
        listESDtoDPD = []
        listAODtoDPD = []

    ## these lines have been added to guarantee the backward compatibility for the old DPD naming convention cosmics
    try:
        from PrimaryDPDMaker.PrimaryDPDFlags import listBackwardCompatibleAODtoDPD, listBackwardCompatibleESDtoDPD
        listESDtoDPD.extend(listBackwardCompatibleESDtoDPD)
        listAODtoDPD.extend(listBackwardCompatibleAODtoDPD)
    except:
        logAutoConfiguration.warning(
            "Primary DPDMake does not support the old naming convention!!")

    if 'TagStreamsRef' in metadata and metadata['TagStreamsRef'] != None:
        logAutoConfiguration.info("Input TAG detected")
        rec.readTAG = True
        logAutoConfiguration.info("Auto configured rec.readTAG=%s " %
                                  rec.readTAG())

    from RecExConfig.RecoFunctions import ItemInListStartsWith
    if ItemInListStartsWith("StreamAOD", streamsName) or ItemInListStartsWith(
            'StreamDAOD', streamsName) or ItemInListStartsWith(
                'StreamD2AOD', streamsName) or OverlapLists(
                    streamsName, listAODtoDPD) or ItemInListStartsWith(
                        'DAOD', streamsName) or ItemInListStartsWith(
                            'D2AOD', streamsName):
        logAutoConfiguration.info("Input AOD detected")
        rec.readRDO = False
        rec.readESD = False
        rec.readAOD = True
        rec.doAOD = False
        rec.doESD = False
        logAutoConfiguration.info("setting rec.readAOD=%s " % rec.readAOD())
    elif ItemInListStartsWith(
            "StreamESD", streamsName) or ItemInListStartsWith(
                'StreamDESD', streamsName) or ItemInListStartsWith(
                    'StreamD2ESD', streamsName) or OverlapLists(
                        streamsName, listESDtoDPD) or ItemInListStartsWith(
                            'DESD', streamsName) or ItemInListStartsWith(
                                'D2ESD', streamsName):
        logAutoConfiguration.info("Input ESD detected")
        rec.readRDO = False
        rec.readESD = True
        rec.readAOD = False
        rec.doAOD = True
        rec.doESD = False
        logAutoConfiguration.info("setting rec.readESD=%s " % rec.readESD())
        logAutoConfiguration.info("setting rec.doAOD=%s " % rec.doAOD())
    elif ItemInListStartsWith("Stream1", streamsName) or ItemInListStartsWith(
            "StreamRDO", streamsName) or ItemInListStartsWith(
                "OutputStreamRDO", streamsName) or OverlapLists(
                    streamsName, listRAWtoDPD):
        logAutoConfiguration.info("Input RDO detected")
        rec.readRDO = True
        rec.readESD = False
        rec.readAOD = False
        rec.doAOD = False
        rec.doESD = True
        logAutoConfiguration.info("setting rec.readRDO=%s " % rec.readRDO())
        logAutoConfiguration.info("setting rec.doESD=%s " % rec.doESD())
    elif ItemInListStartsWith("StreamEVGEN", streamsName):
        logAutoConfiguration.info("Input EVGEN detected")
        rec.readRDO = False
        rec.readESD = False
        rec.readAOD = False
        rec.doAOD = False
        rec.doESD = False
        logAutoConfiguration.info(
            "setting all unlocked rec.readXXX and rec.doXXX to False")
    elif ItemInListStartsWith("StreamHITS", streamsName):
        logAutoConfiguration.info("Input StreamEVGEN detected")

    elif metadata['file_type'] != 'BS':
        raise RuntimeError("ConfigureInputType cannot handle streamsName==%s" %
                           streamsName)
    return
コード例 #6
0
    def configure(self):
        log = logging.getLogger("TriggerConfigGetter.py")

        # first check the input
        if "HIT2RDO" in self._environment:
            TriggerFlags.doLVL2 = False
            TriggerFlags.doEF = False
            log.info("For simulation jobs the following flags are set:")
            log.info("globalflags.InputFormat             : %s" %
                     globalflags.InputFormat())
            log.info("globalflags.DataSource              : %s" %
                     globalflags.DataSource())
            log.info("TriggerFlags.configForStartup       : %s" %
                     TriggerFlags.configForStartup())
            log.info("TriggerFlags.dataTakingConditions   : %s" %
                     TriggerFlags.dataTakingConditions())
            log.info("TriggerFlags.doLVL2                 : %s" %
                     TriggerFlags.doLVL2())
            log.info("TriggerFlags.doEF                   : %s" %
                     TriggerFlags.doEF())
        else:
            if not self.checkInput():
                log.error(
                    "Could not determine job input. Can't setup trigger configuration and will return!"
                )
                return

        self.readPool = globalflags.InputFormat() == 'pool'
        self.readRDO = rec.readRDO()
        self.writeESDAOD = rec.doWriteESD() or rec.doWriteAOD(
        ) or rec.doWriteDPD()
        self.ConfigSrcList = TriggerFlags.configurationSourceList()
        self.readMC = globalflags.DataSource(
        ) == 'geant3' or globalflags.DataSource() == 'geant4'
        self.readTriggerDB = TriggerFlags.readMenuFromTriggerDb(
        ) and self.readRDO
        self.isCommisioning = globalflags.DataSource(
        ) == 'data' and globalflags.DetGeo() == 'commis'
        self.l1Folders = TriggerFlags.dataTakingConditions(
        ) == 'FullTrigger' or TriggerFlags.dataTakingConditions() == 'Lvl1Only'
        self.hltFolders = TriggerFlags.dataTakingConditions(
        ) == 'FullTrigger' or TriggerFlags.dataTakingConditions() == 'HltOnly'
        self.isRun1Data = False
        if globalflags.DataSource() == 'data':
            from RecExConfig.AutoConfiguration import GetRunNumber
            runNumber = GetRunNumber()
            if runNumber > 0 and runNumber < 230000:
                self.isRun1Data = True
        self.isTriggerReprocessing = False

        # the TriggerFlags.readMenuFromTriggerDb() tells us that we read the trigger menu from the database
        # the connection itself is defined in TriggerFlags.triggerDbConnection()

        # reading from the TriggerDB can mean different things:

        # a) TriggerFlags doLVL2() and doEF() are both False:
        #    - create a tmp sqlite file with the conditions (menu)
        #    - use DSConfigSvc

        # b) TriggerFlags doLVL2() or doEF() is True:
        #    - use HLTConfigSvc
        if self.readTriggerDB and (TriggerFlags.doLVL2()
                                   or TriggerFlags.doEF()
                                   or TriggerFlags.doHLT()):

            self.ConfigSrcList = [
                'xml'
            ]  # to use L1/HLTConfigSvc and not DSConfigSvc, but only if we are running the HLT

        if self._environment:  # I don't think anyone calls TriggerConfigGetter with an argument
            self.readPool = False
            self.writeESDAOD = False
            self.readHits = False
            if "ReadPoolRDO" in self._environment:
                self.readPool = True
                self.readRDO = True
            elif "ReadPool" in self._environment:
                self.readPool = True
                self.readRDO = False
            if "WritePool" in self._environment:
                self.writeESDAOD = True
            if "HIT2RDO" in self._environment:
                self.readRDO = False
                self.readHits = True

        # define ConfigSvc
        if not self.ConfigSrcList:
            if (self.readPool and not self.readRDO) or (
                    self.readRDO
                    and not self.readPool):  # (ESD, AOD, DPD) or (RDO-BS)
                self.ConfigSrcList = ['ds']
            elif (self.readRDO and self.readPool
                  ) or rec.readTAG() or self.readHits:  # (RDO-MC) or TAG
                self.ConfigSrcList = ['xml']
            else:  # should not get here: should be found by checkInput
                log.fatal('no reading of BS, RDO, AOD, ESD, or TAG specified')

        # we need the temporary COOL database, if we read the configuration from XML and write ESD/AOD (or have 'ds' set for some reason)
        self.makeTempCool   = self.readRDO and \
                              ( self.writeESDAOD or 'ds' in self.ConfigSrcList ) and \
                              ( self.readMC \
                                or (self.isCommisioning and (TriggerFlags.readLVL1configFromXML() and TriggerFlags.readHLTconfigFromXML())) \
                                or TriggerFlags.readMenuFromTriggerDb() )

        log.info("Need to create temporary cool file? : %r" %
                 self.makeTempCool)

        log.info('Creating the Trigger Configuration Services')
        self.svc = SetupTrigConfigSvc()

        #set the merged system
        #self.svc.doMergedHLT = TriggerFlags.doHLT()

        if 'xml' in self.ConfigSrcList or self.makeTempCool:
            # sets them if plain XML reading is to be used
            self.svc.l1topoXmlFile = TriggerFlags.outputL1TopoConfigFile(
            )  # generated in python
            self.svc.l1XmlFile = TriggerFlags.outputLVL1configFile(
            )  # generated in python
            self.svc.hltXmlFile = TriggerFlags.outputHLTconfigFile(
            )  # generated in python
            if TriggerFlags.readL1TopoConfigFromXML():
                self.svc.l1topoXmlFile = TriggerFlags.inputL1TopoConfigFile(
                )  # given XML
            if TriggerFlags.readLVL1configFromXML():
                self.svc.l1XmlFile = TriggerFlags.inputLVL1configFile(
                )  # given XML
            if TriggerFlags.readHLTconfigFromXML():
                self.svc.hltXmlFile = TriggerFlags.inputHLTconfigFile(
                )  # given XML

        ### preparations are done!
        try:
            self.svc.SetStates(self.ConfigSrcList)
        except:
            log.error('Failed to set state of TrigConfigSvc to %r' %
                      self.ConfigSrcList)
        else:
            log.info('The following configuration services will be tried: %r' %
                     self.ConfigSrcList)

        try:
            self.svc.InitialiseSvc()
        except Exception, ex:
            log.error('Failed to activate TrigConfigSvc: %r' % ex)
コード例 #7
0
    def configure(self):
        log = logging.getLogger( "TriggerConfigGetter.py" )
        from PyUtils.MetaReaderPeekerFull import metadata

        # first check the input
        if "HIT2RDO" in self._environment:
            TriggerFlags.doLVL2 = False
            TriggerFlags.doEF = False
            log.info("For simulation jobs the following flags are set:")
            log.info("globalflags.InputFormat             : %s", globalflags.InputFormat())
            log.info("globalflags.DataSource              : %s", globalflags.DataSource())
            log.info("TriggerFlags.configForStartup       : %s", TriggerFlags.configForStartup())
            log.info("TriggerFlags.dataTakingConditions   : %s", TriggerFlags.dataTakingConditions())
            log.info("TriggerFlags.doLVL2                 : %s", TriggerFlags.doLVL2())
            log.info("TriggerFlags.doEF                   : %s", TriggerFlags.doEF())
        else:
            if not self.checkInput():
                log.error("Could not determine job input. Can't setup trigger configuration and will return!")
                return
            # self.checkInput() may call TriggerConfigCheckMetadata, this can in turn set "rec.doTrigger.set_Value_and_Lock(False)"
            # but TriggerConfigGetter might have only been called in the first place due to this flag having been true, 
            # so re-check that we're still OK to be executing here
            if not (recAlgs.doTrigger() or rec.doTrigger() or TriggerFlags.doTriggerConfigOnly()):
                log.info("Aborting TriggerConfigGetter as the trigger flags were switched to false in checkInput()")
                return True

        self.readPool       = globalflags.InputFormat() == 'pool'
        self.readRDO        = rec.readRDO()
        self.writeESDAOD    = rec.doWriteESD() or rec.doWriteAOD() or rec.doWriteDPD()
        self.writeAOD       = rec.doWriteAOD() or rec.doWriteDPD()
        self.ConfigSrcList  = TriggerFlags.configurationSourceList()
        self.readMC         = globalflags.DataSource()=='geant3' or globalflags.DataSource()=='geant4'
        self.readTriggerDB  = TriggerFlags.readMenuFromTriggerDb() and self.readRDO
        self.isCommisioning = globalflags.DataSource()=='data' and globalflags.DetGeo()=='commis' 
        self.l1Folders      = TriggerFlags.dataTakingConditions()=='FullTrigger' or TriggerFlags.dataTakingConditions()=='Lvl1Only'
        self.hltFolders     = TriggerFlags.dataTakingConditions()=='FullTrigger' or TriggerFlags.dataTakingConditions()=='HltOnly'
        self.isRun1Data     = False 
        self.hasxAODMeta    = ("metadata_items" in metadata and any(('TriggerMenu' in key) for key in metadata["metadata_items"].keys()))
        if globalflags.DataSource()=='data':
            from RecExConfig.AutoConfiguration  import GetRunNumber
            runNumber = GetRunNumber()
            if runNumber is not None and runNumber > 0 and runNumber < 230000 :
                self.isRun1Data = True
        self.isTriggerReprocessing = False

        # the TriggerFlags.readMenuFromTriggerDb() tells us that we read the trigger menu from the database
        # the connection itself is defined in TriggerFlags.triggerDbConnection()

        # reading from the TriggerDB can mean different things:

        # a) TriggerFlags doLVL2() and doEF() are both False:
        #    - create a tmp sqlite file with the conditions (menu)
        #    - use DSConfigSvc


        # b) TriggerFlags doLVL2() or doEF() is True:
        #    - use HLTConfigSvc
        if self.readTriggerDB and (TriggerFlags.doLVL2() or TriggerFlags.doEF() or TriggerFlags.doHLT()):

            self.ConfigSrcList = ['xml'] # to use L1/HLTConfigSvc and not DSConfigSvc, but only if we are running the HLT


        if self._environment: # I don't think anyone calls TriggerConfigGetter with an argument
            self.readPool  = False
            self.writeESDAOD = False
            self.readHits = False
            if "ReadPoolRDO" in self._environment:
                self.readPool = True
                self.readRDO = True
            elif "ReadPool" in self._environment:
                self.readPool = True
                self.readRDO = False
            if "WritePool" in self._environment:
                self.writeESDAOD = True
            if "HIT2RDO" in self._environment:
                self.readRDO = False
                self.readHits = True


        # define ConfigSvc
        if not self.ConfigSrcList:
            if (self.readPool and not self.readRDO) or (self.readRDO and not self.readPool): # (ESD, AOD, DPD) or (RDO-BS)
                self.ConfigSrcList = ['ds']
            elif (self.readRDO and self.readPool) or rec.readTAG() or self.readHits:           # (RDO-MC) or TAG
                self.ConfigSrcList = ['xml']
            else: # should not get here: should be found by checkInput
                log.fatal('no reading of BS, RDO, AOD, ESD, or TAG specified')

        # we need the temporary COOL database, if we read the configuration from XML and write ESD/AOD (or have 'ds' set for some reason)
        self.makeTempCool   = self.readRDO and \
                              ( self.writeESDAOD or 'ds' in self.ConfigSrcList ) and \
                              ( self.readMC \
                                or (self.isCommisioning and (TriggerFlags.readLVL1configFromXML() and TriggerFlags.readHLTconfigFromXML())) \
                                or TriggerFlags.readMenuFromTriggerDb() )

        log.info("Need to create temporary cool file? : %r", self.makeTempCool)

        log.info('Creating the Trigger Configuration Services')

        from AthenaCommon.AppMgr import ServiceMgr as svcMgr

        ########################################################################
        # START OF TEMPORARY SOLUTION FOR RUN-3 TRIGGER DEVELOPMENT
        ########################################################################
        from TriggerJobOpts.HLTTriggerResultGetter import EDMDecodingVersion
        EDMDecodingVersion()  # In most use cases this needs to be called much earlier than in HLTTriggerResultGetter

        if TriggerFlags.EDMDecodingVersion() >= 3:
            if self.hasxAODMeta:
                if not hasattr(svcMgr, 'xAODConfigSvc'):
                    from TrigConfxAOD.TrigConfxAODConf import TrigConf__xAODConfigSvc
                    svcMgr += TrigConf__xAODConfigSvc('xAODConfigSvc')
            else: # Does not have xAODMeta
                # Run-3 Trigger Configuration Services
                from TrigConfigSvc.TrigConfigSvcCfg import getL1ConfigSvc, getHLTConfigSvc
                from AthenaConfiguration.AllConfigFlags import ConfigFlags
                svcMgr += getL1ConfigSvc(ConfigFlags)
                svcMgr += getHLTConfigSvc(ConfigFlags)

                # Needed for TrigConf::xAODMenuWriterMT
                from TrigConfigSvc.TrigConfigSvcConfig import TrigConfigSvc
                svcMgr += TrigConfigSvc("TrigConfigSvc")
                svcMgr.TrigConfigSvc.PriorityList = ["none", "ds", "xml"]

        else:
            # non-MT (Run-2) Trigger Configuration
            self.svc = SetupTrigConfigSvc()

            if 'xml' in self.ConfigSrcList or self.makeTempCool:
                # sets them if plain XML reading is to be used
                self.svc.l1topoXmlFile = TriggerFlags.outputL1TopoConfigFile()  # generated in python
                self.svc.l1XmlFile     = TriggerFlags.outputLVL1configFile()    # generated in python
                self.svc.hltXmlFile    = TriggerFlags.outputHLTconfigFile()     # generated in python
                if TriggerFlags.readL1TopoConfigFromXML():
                    self.svc.l1topoXmlFile  = TriggerFlags.inputL1TopoConfigFile() # given XML
                if TriggerFlags.readLVL1configFromXML():
                    self.svc.l1XmlFile  = TriggerFlags.inputLVL1configFile() # given XML
                if TriggerFlags.readHLTconfigFromXML():
                    self.svc.hltXmlFile  = TriggerFlags.inputHLTconfigFile()   # given XML

            try:
                self.svc.SetStates( self.ConfigSrcList )
            except Exception:
                log.error( 'Failed to set state of TrigConfigSvc to %r', self.ConfigSrcList )
            else:
                log.info('The following configuration services will be tried: %r', self.ConfigSrcList )

            try:
                self.svc.InitialiseSvc()
            except Exception as ex:
                log.error( 'Failed to activate TrigConfigSvc: %r', ex )
        ########################################################################
        # END OF TEMPORARY SOLUTION FOR RUN-3 TRIGGER DEVELOPMENT
        ########################################################################

        if self.readTriggerDB:
            log.info( "Using TriggerDB connection '%s'", TriggerFlags.triggerDbConnection() )
            self.trigDbConnectionParameters = interpretConnection(TriggerFlags.triggerDbConnection(), resolveAlias=False)
            self.setConfigSvcConnParams(self.trigDbConnectionParameters)

        log.info("TriggerFlags.triggerCoolDbConnection is '%s' [default: '']", TriggerFlags.triggerCoolDbConnection())
        TrigCoolDbConnection = TriggerFlags.triggerCoolDbConnection()

        if self.makeTempCool:
            TrigCoolDbConnection = self.setupTempCOOLWriting(TrigCoolDbConnection)

        if ('ds' in self.ConfigSrcList) and not self.hasxAODMeta:
            self.setupCOOLReading(TrigCoolDbConnection)

        if hasattr(svcMgr, 'DSConfigSvc'):
            db = 'TRIGGERDB'
            if self.isRun1Data:
                db = 'TRIGGERDB_RUN1'
            elif self.readMC:
                db = 'TRIGGERDBMC'
            elif self.isTriggerReprocessing:
                db = 'TRIGGERDBREPR'
            svcMgr.DSConfigSvc.ConfigSource = 'dblookup'
            svcMgr.DSConfigSvc.DBServer = db
            log.info("DSConfigSvc trigger database is '%s'", db)
        
        if not self.hasxAODMeta:
            self.setupxAODWriting()


        # all went fine we are configured
        return True