Exemplo n.º 1
0
def getPhotonCaloRingsBuilder():
    "Return the photon CaloRings builder "
    if caloRingerFlags.buildPhotonCaloRings():
        from CaloRingerTools.CaloRingerBuilderFactories import PhotonCaloRingsBuilder, \
                                                               PhotonCaloAsymRingsBuilder
        if caloRingerFlags.useAsymBuilder():
            return PhotonCaloAsymRingsBuilder()
        else:
            return PhotonCaloRingsBuilder()
    else:
        return PublicToolHandle('')
Exemplo n.º 2
0
def getElectronCaloRingsBuilder():
    "Return the electrons CaloRings builder "
    if caloRingerFlags.buildElectronCaloRings():
        from CaloRingerTools.CaloRingerBuilderFactories import ElectronCaloRingsBuilder, \
                                                               ElectronCaloAsymRingsBuilder
        if caloRingerFlags.useAsymBuilder():
            return ElectronCaloAsymRingsBuilder()
        else:
            return ElectronCaloRingsBuilder()
    else:
        return PublicToolHandle('')
Exemplo n.º 3
0
# end computation of TileRawChannel to TTL1

from MuonByteStream.MuonByteStreamFlags import muonByteStreamFlags
muonByteStreamFlags.RpcDataType = 'atlas'
muonByteStreamFlags.MdtDataType = 'atlas'
muonByteStreamFlags.TgcDataType = 'atlas'

from MuonCnvExample.MuonCnvFlags import muonCnvFlags
if hasattr(muonCnvFlags, 'RpcCablingMode'):
    muonCnvFlags.RpcCablingMode.set_Value_and_Lock('new')

from TrigmuFast.TrigmuFastConfig import TrigmuFastConfig
theTrigmuFast900GeV = TrigmuFastConfig('900GeV')
theTrigmuFast900GeV.DomuFastESD = False
theTrigmuFast900GeV.ROBmapperFile = "AtlasRoiROBmap.data"
theTrigmuFast900GeV.BackExtrapolator = PublicToolHandle(
    'TrigMuonBackExtrapolator/MisalignedBackExtrapolator')

from TileRecAlgs.TileRecAlgsConf import TileRawChannelToTTL1
theTileRawChannelToTTL1 = TileRawChannelToTTL1()

theTileRawChannelToTTL1.TileRawChannelContainer = "TileRawChannelCnt"
theTileRawChannelToTTL1.TileTTL1Container = "TileTTL1Cnt"
theTileRawChannelToTTL1.maskBadChannels = True

# this causes "dupe ignored" error message
# from TrigT1MBTS.TrigT1MBTSConf import LVL1__TrigT1MBTS
# topSequence += LVL1__TrigT1MBTS()

topSequence.DoBCM = True
topSequence.DoBPTX = True
topSequence.DoLUCID = True
Exemplo n.º 4
0
    def setDefaultProperty(cls, propertyName, value):
        #  choose according to expected type
        try:
            prop = cls._properties[propertyName]
        except KeyError:
            raise AttributeError("%s does not have property %s" %
                                 (cls.__name__, propertyName))

        errorAllowedTypes = None
        cxxdefault = prop.default
        if type(cxxdefault) == type(value):
            cls._userDefaults[propertyName] = copy.copy(value)
        elif isinstance(cxxdefault, PublicToolHandle):
            if value is None:
                cls._userDefaults[propertyName] = PublicToolHandle("")
            elif type(value) == str:
                cls._userDefaults[propertyName] = PublicToolHandle(value)
            elif isinstance(value, ConfigurableAlgTool):
                cls._userDefaults[propertyName] = PublicToolHandle(
                    value.getFullName())
            elif isinstance(value, PublicToolHandle):
                cls._userDefaults[propertyName] = copy.copy(value)
            else:
                errorAllowedTypes = "str,PublicToolHandle,ConfigurableAlgTool"

        elif isinstance(cxxdefault, PublicToolHandleArray):
            if value is None:
                cls._userDefaults[propertyName] = PublicToolHandleArray()
            elif type(value) == list:
                cls._userDefaults[propertyName] = PublicToolHandleArray(value)
            elif isinstance(value, PublicToolHandleArray):
                cls._userDefaults[propertyName] = copy.copy(value)
            else:
                errorAllowedTypes = "list,PublicToolHandleArray"

        elif isinstance(cxxdefault, PrivateToolHandle):
            if value is None:
                cls._userDefaults[propertyName] = PrivateToolHandle("")
            elif type(value) == str:
                cls._userDefaults[propertyName] = PrivateToolHandle(value)
            elif isinstance(value, ConfigurableAlgTool):
                cls._userDefaults[propertyName] = copy.deepcopy(value)
            elif isinstance(value, PrivateToolHandle):
                cls._userDefaults[propertyName] = copy.copy(value)
            else:
                errorAllowedTypes = "str,PrivateToolHandle,ConfigurableAlgTool"

        elif isinstance(cxxdefault, PrivateToolHandleArray):
            if value is None:
                cls._userDefaults[propertyName] = PrivateToolHandleArray()
            elif type(value) == list:
                cls._userDefaults[propertyName] = PrivateToolHandleArray(value)
            elif isinstance(value, PrivateToolHandleArray):
                cls._userDefaults[propertyName] = copy.copy(value)
            else:
                errorAllowedTypes = "list,PrivateToolHandleArray"

        elif isinstance(cxxdefault, ServiceHandle):
            if value is None:
                cls._userDefaults[propertyName] = ServiceHandle("")
            elif type(value) == str:
                cls._userDefaults[propertyName] = ServiceHandle(value)
            elif isinstance(value, ConfigurableService):
                cls._userDefaults[propertyName] = ServiceHandle(
                    value.getFullName())
            elif isinstance(value, ServiceHandle):
                cls._userDefaults[propertyName] = copy.copy(value)
            else:
                errorAllowedTypes = "str,ServiceHandle,ConfigurableService"

        else:
            cls._userDefaults[propertyName] = value

        if errorAllowedTypes:
            raise TypeError(
                "Setting default property %s.%s with wrong type. Expected %s got %s"
                % (cls.__name__, propertyName, errorAllowedTypes,
                   type(value).__name__))