Example #1
0
             using input file containers."""

from AthenaCommon.Logging import logging

mlog = logging.getLogger('CaloRinger_in2out.py')
mlog.info('Entering')

from CaloRingerAlgs.CaloRingerFlags import caloRingerFlags
caloRingerFlags.Enabled = True
caloRingerFlags.doWriteRingsToFile = True

# Make sure we have the main algorithm disabled:
from CaloRingerAlgs.CaloRingerAlgorithmBuilder import CaloRingerAlgorithmBuilder
CRAlgBuilder = CaloRingerAlgorithmBuilder(disable=True)
from CaloRingerAlgs.CaloRingerMetaDataBuilder import CaloRingerMetaDataBuilder
CRMetaBuilder = CaloRingerMetaDataBuilder()

# Make sure all MetaData algoritms have the ringerOutputLevel
if CRMetaBuilder.usable():
    ringerOutputLevel = caloRingerFlags.OutputLevel()
    # Get the ringer configuration writter handle
    configWriter = CRMetaBuilder.getConfigWriterHandle()

    if configWriter:
        # Change its output level
        mlog.verbose('Changing %r output level to %s', configWriter,
                     ringerOutputLevel)
        configWriter.OutputLevel = ringerOutputLevel

# And then include the output item list joboption to check for
# available ringer containers:
Example #2
0
    from PyUtils.MetaReaderPeeker import convert_metadata_items, metadata
    metaItemDict = convert_metadata_items(layout='dict')

    if any(['RingSetConf' in key for key in metaItemDict]):
        l.append('%s#*' % outputRingSetConfType())
        l.append('%s#*' % outputRingSetConfAuxType())


# Add itens into lists
if (rec.doWriteAOD()
        or rec.doWriteESD()) and caloRingerFlags.doWriteRingsToFile():
    # Get instance to the builder:
    CRBuilder = CaloRingerAlgorithmBuilder()
    # Get instance to the metadata builder:
    CRMetaBuilder = CaloRingerMetaDataBuilder(disable=True)

    if CRBuilder.usable():
        for cType, cKeys in CRBuilder.output().items():
            for cKey in cKeys:
                for dictKey, value in CaloRingerKeysDict.outputs.items():
                    if value[0] == cType:
                        auxOption = CaloRingerKeysDict.outputs[dictKey][2]
                        addOutputToList(caloRingerAODList, cType, cKey,
                                        auxOption)
                        mlog.debug(
                            "Added container with type/key %s/%s to StoreGateSvc",
                            cType, cKey)
                        break
    if rec.readESD() or rec.readAOD():  # In this case, we assume that the
        # joboption was added to add input file ringer containers
Example #3
0
        selectorHandles = CRAlgBuilder.getRingerSelectors()
        for selector in selectorHandles:
            # Change the builders output level
            mlog.verbose('Changing %r output level to %s', selector,
                         ringerOutputLevel)
            selector.OutputLevel = ringerOutputLevel
else:
    # Otherwise we disable the main algorithm
    CRAlgBuilder = CaloRingerAlgorithmBuilder(disable=True)

from PyUtils.MetaReaderPeeker import convert_metadata_items, metadata
metaItemDict = convert_metadata_items(layout='dict')

if CRAlgBuilder.usable() or (metaItemDict and any(
    ['RingSetConf' in key for key in metaItemDict])):
    MetaDataBuilder = CaloRingerMetaDataBuilder(disable=True)

    # Make sure all MetaData algoritms have the ringerOutputLevel
    if MetaDataBuilder.usable():
        # Get the ringer configuration writter handle
        configWriter = MetaDataBuilder.getConfigWriterHandle()

        if configWriter:
            # Change its output level
            mlog.verbose('Changing %r output level to %s', configWriter,
                         ringerOutputLevel)
            configWriter.OutputLevel = ringerOutputLevel
else:
    # Otherwise we disable the metadata algorith:
    MetaDataBuilder = CaloRingerMetaDataBuilder(disable=True)
Example #4
0
mlog = logging.getLogger('CaloRingerLock_joboptions')
mlog.info("Entering")

from RecExConfig.RecFlags import rec

from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()

from CaloRingerAlgs.CaloRingerFlags import caloRingerFlags
from CaloRingerAlgs.CaloRingerKeys import CaloRingerKeysDict

# Get CaloRinger algorithm handles
from CaloRingerAlgs.CaloRingerAlgorithmBuilder import CaloRingerAlgorithmBuilder
CRAlgBuilder = CaloRingerAlgorithmBuilder()
from CaloRingerAlgs.CaloRingerMetaDataBuilder import CaloRingerMetaDataBuilder
CRMetaDataBuilder = CaloRingerMetaDataBuilder(disable=True)

if rec.doESD() and caloRingerFlags.buildCaloRingsOn() and CRAlgBuilder.usable(
):
    LastCRWriter = CRMetaDataBuilder.getLastWriterHandle()
    CRMainAlg = CRAlgBuilder.getCaloRingerAlgHandle()
    CRMetaDataWriterAlg = CRMetaDataBuilder.getMetaDataWriterHandle()
    try:
        # FIXME: It seems that the python implementation takes a lot of memory
        # (https://its.cern.ch/jira/browse/ATLASRECTS-2769?filter=-1),
        # replace it as egamma is doing to use a C++ implementation
        pass
        # Make sure we add it before streams:
        for pos, alg in enumerate(topSequence):
            if LastCRWriter.getName() == alg.getName():
                from CaloRingerAlgs.CaloRingerLocker import CaloRingerLocker