Esempio n. 1
0
    def initConfigTool(self, instanceName):
        "Init configuration conditions tool"

        # Set up SCT cabling
        from AthenaCommon.Include import include
        include('InDetRecExample/InDetRecCabling.py')

        from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
        from IOVDbSvc.CondDB import conddb
        if conddb.dbdata == "COMP200" or InDetTrigFlags.ForceCoraCool():
            sctdaqpath = '/SCT/DAQ/Configuration'
        else:
            sctdaqpath = '/SCT/DAQ/Config'

        if InDetTrigFlags.ForceCoolVectorPayload():
            sctdaqpath = '/SCT/DAQ/Config'

        from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup
        sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup(
        )
        sct_ConfigurationConditionsToolSetup.setChannelFolder(sctdaqpath +
                                                              "/Chip")
        sct_ConfigurationConditionsToolSetup.setModuleFolder(sctdaqpath +
                                                             "/Module")
        sct_ConfigurationConditionsToolSetup.setMurFolder(sctdaqpath + "/MUR")
        sct_ConfigurationConditionsToolSetup.setToolName(instanceName)
        sct_ConfigurationConditionsToolSetup.setup()
        configTool = sct_ConfigurationConditionsToolSetup.getTool()
        if self._print: print(configTool)
        if not (configTool.getFullName() in self.summaryTool.ConditionsTools):
            self.summaryTool.ConditionsTools += [configTool.getFullName()]

        if self._print: print(self.condDB)
        return configTool
Esempio n. 2
0
    def configureReco(self):
        from AthenaCommon.DetFlags import DetFlags
        DetFlags.Muon_setOn()
        DetFlags.Calo_setOff()

        recAlgsFlags.doMuonIDStandAlone = False
        recAlgsFlags.doMuonIDCombined = False

        # add some more flags available for standalone running
        import MuonRecExample.MuonRecStandaloneFlags

        # configure flags so that only Muon Standalone reco is run
        import MuonRecExample.MuonRecStandaloneOnlySetup

        muonRecFlags.useAlignmentCorrections = mualign.useOpticalAlignment()

        # cosmics setup
        #if align.dataType()=='cosmic' or align.dataType()=='simCosmic':

        ##### no more flags after this line #####
        print "align.dataType()=", align.dataType()
        if align.dataType() == 'data' or align.dataType() == 'cosmic':
            muonRecTopOptions = "MuonAlignGenTools/MuonDataRec_myTopOptions.py"
        else:
            muonRecTopOptions = "MuonRecExample/MuonRec_topOptions.py"
        try:
            include(muonRecTopOptions)

        ###### put any user finetuning before this line #####
        except:
            # always write config so far for debugging
            from AthenaCommon.ConfigurationShelve import saveToAscii
            saveToAscii("config.txt")
            # but still exit with error
            raise
Esempio n. 3
0
def checkForSpecialConfigurationMetadata():
    if metadata_full is not None:
        if 'specialConfiguration' in metadata_full['/TagInfo']:
            from G4AtlasApps.SimFlags import simFlags
            simFlags.specialConfiguration = dict()
            item = metadata_full['/TagInfo']['specialConfiguration']
            ## Parse the specialConfiguration string
            ## Format is 'key1=value1;key2=value2;...'. or just '
            spcitems = item.split(";")
            params = {}
            someIncludes = []
            for spcitem in spcitems:
                #print spcitem
                ## Ignore empty or "NONE" substrings, e.g. from consecutive or trailing semicolons
                if not spcitem or spcitem.upper() == "NONE":
                    continue
                ## If not in key=value format, treat as v, with k="preInclude"
                if "=" not in spcitem:
                    spcitem = "preInclude=" + spcitem
                ## Handle k=v directives
                k, v = spcitem.split("=")
                if k == "preInclude":
                    someIncludes += [v]
                else:
                    params[k] = v
            simMDlog.info(params)
            simFlags.specialConfiguration.get_Value().update(params)
            from AthenaCommon.Include import include
            for inc in someIncludes:
                include(inc)
    else:
        simMDlog.info(
            "No input Evgen  MetaData object available so skipping check for specialConfiguration metadata."
        )
Esempio n. 4
0
def SetupDPDIncludes(runArgs, flagContainerList, includeType):
    """This function can be used to include all the pre-include scripts
       defined for the requested DPD types.

       Returns a list of output types in which a pre/post-include was used."""
    # We must not produce multiple output types when pre/post-include
    # scripts are involved internally. This variable keeps track of
    # the output types which have used the pre/postInclude functionality
    includeTypeList = []
    # Make a logger for the function:
    from AthenaCommon.Logging import logging
    logger = logging.getLogger("SetupDPDIncludes")
    # Loop over all DPD job properties:
    for flagContainer in flagContainerList:
        for flagName in flagContainer.__dict__.keys():
            flag = getattr(flagContainer, flagName)
            # Check if this DPD type has been requested in the job:
            if hasattr(flag, "StreamName"):
                dpdName = flag.StreamName.lstrip("Stream")
                argName = 'output' + dpdName + 'File'
                if hasattr(runArgs, argName):
                    # We found a match for an output, however if there was already a script
                    # included, then we may be in trouble (note that we print an error even when
                    # the current output type does not itself have an include, because the include
                    # that already exists can even mess up this new output type).
                    if len(includeTypeList) > 0:
                        logger.error(
                            "Multiple output DPD types requested with "
                            "pre/post-includes present: {0} after includes from {1}"
                            .format(argName, includeTypeList))
                        logger.error(
                            "This will most probably lead to bad output")
                        pass
                    # Only some DPD types define pre/post-include scripts.
                    # It's okay if this one doesn't define any,
                    if not hasattr(flag, includeType):
                        continue
                    includeTypeList.append(argName)
                    # Make sure that we have a list of scripts, not just one:
                    includes = getattr(flag, includeType)
                    if type(includes) != list:
                        includes = [includes]
                        pass
                    # Now include all the specified scripts:
                    for incfile in includes:
                        logger.warning("Including script: {0} for {1}".format(
                            incfile, argName))
                        from AthenaCommon.Include import include
                        include(incfile)
                        pass
                    pass
                pass
            pass
        pass
    # Tell the caller which types used pre/postIncludes:
    return includeTypeList
Esempio n. 5
0
def __enableEgamma():
    " Local function to enable Egamma Reconstruction."
    # Set egamma flags to True
    rec.doEgamma = True
    from egammaRec.egammaRecFlags import jobproperties
    egammaRecFlags = jobproperties.egammaRecFlags
    egammaRecFlags.Enabled = True
    egammaRecFlags.doEgammaCaloSeeded = True
    egammaRecFlags.doEgammaForwardSeeded = False
    include("egammaRec/egammaRec_jobOptions.py")
    if not egammaBuilderAvailable():
        mlog.error("Couldn't add egamma reconstruction to joboptions")
        raise RuntimeError("Coudln't add egamma reconstruction to joboptions.")
Esempio n. 6
0
def uglyHackedInclude(jobOptions):
    global ToolSvc, ServiceMgr
    from AthenaCommon.Include import include
    import __main__
    if not hasattr(__main__, 'include'):
        include.setShowIncludes(False)
        include.setClean(False)
        setattr(__main__, 'include', include)
    if not hasattr(__main__, "ToolSvc"):
        setattr(__main__, "ToolSvc", ToolSvc)
    if not hasattr(__main__, "ServiceMgr"):
        setattr(__main__, "ServiceMgr", ServiceMgr)

    include(jobOptions)
Esempio n. 7
0
    def setCombMuonTrackFitter(self):
        mlog = logging.getLogger(
            'AlignmentTrackFitter::setCombMuonTrackFitter')
        from AthenaCommon.Include import include
        include('MuonCombinedRecExample/CombinedMuonFitTools.py')

        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc.MuonCombinedTrackFitter.FillDerivativeMatrix = True

        self._fitter = ToolSvc.MuonCombinedTrackFitter
        self._fitter.OutputLevel = align.OutputLevel()

        if align.useSLFitter():
            mlog.warning("SL Fitter set to default (curved) fitter!")
            self._slfitter = ToolSvc.MuonCombinedTrackFitter
Esempio n. 8
0
def MdtPrepDataProviderTool(name="MdtPrepDataProviderTool", **kwargs):
    global source, include, getService, getPrivateTool

    # setup dependencies which are not yet in C++
    import MuonCnvExample.MuonCablingConfig
    from MuonRecExample import MuonAlignConfig
    from MuonCnvExample import MuonCalibConfig
    MuonCalibConfig.setupMdtCondDB()
    include("AmdcAth/AmdcAth_jobOptions.py")

    if source == 'data':
        kwargs.setdefault("UseTwin", True)

    from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import Muon__MdtRdoToPrepDataToolMT
    return Muon__MdtRdoToPrepDataToolMT(name, **kwargs)
def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs):
    from Digitization.DigitizationFlags import digitizationFlags
    #FIXME: at some point we should move away from being dependent on the experimentalDigi flags.
    if 'doFastSCT_Digi' in digitizationFlags.experimentalDigi(
    ) and not 'doFastPixelDigi' in digitizationFlags.experimentalDigi():
        kwargs.setdefault("UsePixelCalibCondDB", False)
        kwargs.setdefault("PixelCalibSvc", "")
        kwargs.setdefault("PixelOfflineCalibSvc", "")
    else:
        from AthenaCommon.Include import include
        include("PixelConditionsServices/PixelDCSSvc_jobOptions.py")
        include.block("PixelConditionsServices/PixelDCSSvc_jobOptions.py")
        from AthenaCommon.AppMgr import ToolSvc
        if not hasattr(ToolSvc, "PixelRecoDbTool"):
            from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool
            ToolSvc += PixelRecoDbTool()
        ToolSvc.PixelRecoDbTool.InputSource = 1

        # setup PixelCalibDbTool in ToolSvc
        if not hasattr(ToolSvc, "PixelCalibDbTool"):
            from PixelConditionsTools.PixelConditionsToolsConf import PixelCalibDbTool
            ToolSvc += PixelCalibDbTool()

        from IOVDbSvc.CondDB import conddb
        if not conddb.folderRequested('/PIXEL/PixCalib'):
            conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib")
        if not conddb.folderRequested('/PIXEL/ReadoutSpeed'):
            conddb.addFolder("PIXEL_OFL", "/PIXEL/ReadoutSpeed")
        from AthenaCommon.AppMgr import ServiceMgr
        if not hasattr(ServiceMgr, "PixelCalibSvc"):
            from PixelConditionsServices.PixelConditionsServicesConf import PixelCalibSvc
            InDetPixelCalibSvc = PixelCalibSvc()
            ServiceMgr += InDetPixelCalibSvc
        if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"):
            from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc
            from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc
            PixelSiPropertiesSvc = SiPropertiesSvc(
                name="PixelSiPropertiesSvc",
                DetectorName="Pixel",
                SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc)
            ServiceMgr += PixelSiPropertiesSvc
        if not hasattr(ServiceMgr, "PixelOfflineCalibSvc"):
            from PixelConditionsServices.PixelConditionsServicesConf import PixelOfflineCalibSvc
            ServiceMgr += PixelOfflineCalibSvc()
            ServiceMgr.PixelOfflineCalibSvc.HDCFromCOOL = False

    from AthenaCommon import CfgMgr
    return CfgMgr.InDet__ClusterMakerTool(name, **kwargs)
Esempio n. 10
0
def setupCostJob(config='OPI ROB NOPS'):

    log = logging.getLogger('setupCostJob')

    if config.count('OPI'):
        log.info('Configure TrigSteer algorithm(s)')

        from AthenaCommon.AlgSequence import AlgSequence
        topSeq = AlgSequence()

        from TriggerJobOpts.TriggerFlags import TriggerFlags
        if TriggerFlags.doHLT():
            configSteeringOPI(topSeq, 'TrigSteer_HLT', config, log)
        else:
            if TriggerFlags.doEF():
                configSteeringOPI(topSeq, 'TrigSteer_EF', config, log)
            if TriggerFlags.doLVL2():
                configSteeringOPI(topSeq, 'TrigSteer_L2', config, log)

    if config.count('ROB'):
        log.info(
            'Will try to configure online monitoring for ROBDataProviderSvc...'
        )
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr

        try:
            log.info('ROBDataProviderSvc type: ' +
                     svcMgr.ROBDataProviderSvc.getType())

            if svcMgr.ROBDataProviderSvc.getType() == 'Lvl2ROBDataProviderSvc':
                log.info('Job already uses online version ROBDataProvider')
            else:
                from AthenaCommon.Include import include
                include('TrigDataAccessMonitoring/MonROBDataProviderSvc.py')
                log.info('Setup "online" monitoring for ROBDataProvider')
        except:
            log.warning('Failed to setup "online" version of ROBDataProvider')

        try:
            from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ROBDataProviderSvc
            svcMgr.ROBDataProviderSvc.doDetailedROBMonitoring = True
            log.info('Set ROBDataProviderSvc.doDetailedROBMonitoring=True')
        except:
            log.warning(
                'Failed to set ROBDataProviderSvc.doDetailedROBMonitoring')
Esempio n. 11
0
def sync_Trigger2Reco():
    from AthenaCommon.Include import include
    from RecExConfig.RecAlgsFlags import recAlgs
    from AthenaCommon.GlobalFlags import globalflags
    from RecExConfig.RecFlags import rec

    if recAlgs.doTrigger() and rec.readRDO(
    ) and not globalflags.InputFormat() == 'bytestream':
        include("TriggerJobOpts/TransientBS_DetFlags.py")

    if globalflags.InputFormat() == 'bytestream':
        TriggerFlags.readBS = True
        TriggerFlags.doLVL1 = False
        TriggerFlags.doLVL2 = False
        TriggerFlags.doEF = False

    if rec.doWriteBS():
        TriggerFlags.writeBS = True
Esempio n. 12
0
    def configure(self):
        mlog = logging.getLogger( 'DetStatusMapGetter::configure :' )
        mlog.info ('entering')

                
        

        # now configure the algorithm
        try:        
            from DetectorStatus.DetectorStatusConf import DetStatusAlg               
        except Exception:
            mlog.error("could not import DetStatusAlg")
            mlog.error (traceback.format_exc())
            return False

        # sets up cond db
        # still use old include for time being
        from AthenaCommon.Include import include        
        include("DetectorStatus/DetStatusSvc_CondDB.py")


        # instantiate algorithm with default properties
        theDetStatusAlg=DetStatusAlg(Write=True)
        self._DetStatusAlgHandle = theDetStatusAlg


        # register output in objKeyStore
        from RecExConfig.ObjKeyStore import objKeyStore

        # output both in ESD and AOD
        objKeyStore.addStreamESD(self.outputType(),self.outputKey())
        objKeyStore.addStreamAOD(self.outputType(),self.outputKey())        


        
        # now add algorithm to topSequence
        # this should always come at the end

        mlog.info(" now adding to topSequence")        
        from __main__ import topSequence
        topSequence += theDetStatusAlg
        
        return True
Esempio n. 13
0
def doSpecialConfiguration(f):
    #safety checks before trying to access metadata
    if "tag_info" in f.infos.keys():
        if "specialConfiguration" in f.infos["tag_info"]:
            item = f.infos["tag_info"]["specialConfiguration"]
            logDigitizationReadMetadata.info(
                "specialConfiguration directive: %s" % item)
            spcitems = item.split(";")
            preIncludes = []
            params = {}
            from Digitization.DigitizationFlags import digitizationFlags
            if digitizationFlags.specialConfiguration.statusOn:
                logDigitizationReadMetadata.info(
                    "some spcialConfiguration metadata already exists: %s",
                    str(params))
                params = digitizationFlags.specialConfiguration.get_Value()
            for spcitem in spcitems:
                ## Ignore empty (e.g. from consecutive or trailing semicolons) or "NONE" substrings
                if not spcitem or spcitem == "NONE":
                    continue
                ## If not in key=value format, treat as v, with k="preInclude"
                if "=" not in spcitem:
                    spcitem = "preInclude=" + spcitem
                ## Handle k=v directives
                k, v = spcitem.split("=")
                logDigitizationReadMetadata.info(
                    "specialConfiguration metadata item: %s => %s" % (k, v))
                ## Store preIncludes for including later.
                if k == "preInclude":
                    incfiles = v.split(",")
                    preIncludes += incfiles
                else:
                    params[k] = v
            digitizationFlags.specialConfiguration = params
            ## Now that we've looked at and stored all the evgen metadata keys, we should do any requested preIncludes
            from AthenaCommon.Include import include
            for incfile in preIncludes:
                logDigitizationReadMetadata.info(
                    "Including %s as instructed by specialConfiguration metadata"
                    % incfile)
                include(incfile)
            del preIncludes
            del params
Esempio n. 14
0
    def configure(self):
        #         from AthenaServices.AthenaServicesConf import AthenaOutputStream
        #         from AthenaCommon.AppMgr import ServiceMgr
        #         from AthenaCommon.AlgSequence import AlgSequence
        #         topSequence = AlgSequence()

        #         ### the following was gotten from the LVL1TriggerGetter not sure if needed when not simulation
        #         if not (TriggerFlags.fakeLVL1() or TriggerFlags.doLVL1()):
        #            DetFlags.readRIOPool.LVL1_setOn()

        #         # ***Temp : needed to enable required combination of thresholds
        #         #           mu4,mu6,mu10,mu11,mu20,mu40
        #         # Will be replaced by config. from Lvl1ConfigSvc
        #         if hasattr(ServiceMgr,'RPCcablingSimSvc'):
        #             ServiceMgr.RPCcablingSimSvc.HackFor1031 = True
        if jobproperties.Global.InputFormat() == 'bytestream':
            theApp.Dlls += ["TrigT1Calo"]
            include("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py")
        #         ###

        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        if recAlgs.doTrigger():
            if (rec.doESD() or rec.doAOD()) and (not(rec.readAOD() or \
                                                         rec.readESD())):
                if jobproperties.Global.InputFormat() == 'bytestream':
                    # Decode ROIB::RoIBResult from ByteStream
                    from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1ByteStreamDecodersRecExSetup
                    L1ByteStreamDecodersRecExSetup()
                from AnalysisTriggerAlgs.AnalysisTriggerAlgsConfig import \
                    RoIBResultToAOD
                topSequence += RoIBResultToAOD("RoIBResultToxAOD")
                pass
            pass

        from TrigEDMConfig.TriggerEDM import getLvl1ESDList
        objKeyStore.addManyTypesStreamESD(getLvl1ESDList())
        from TrigEDMConfig.TriggerEDM import getLvl1AODList
        objKeyStore.addManyTypesStreamAOD(getLvl1AODList())

        return True
Esempio n. 15
0
    def _do_external(self):
        """ Place to handle the external services: GeoModel, CondDB, etc.
        """
        AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_external '+\
                                       'starting')

        #from LArH6Detectors import Det_Layouts
        from tbLArH6_calo import Det_Layouts

        from AthenaCommon.AppMgr import ServiceMgr
        from Geo2G4.Geo2G4Conf import Geo2G4Svc
        Geo2G4Svc = Geo2G4Svc()
        theApp.CreateSvc += ["Geo2G4Svc"]
        ServiceMgr += Geo2G4Svc
        # We do not use top transforms for the CTB geometry
        Geo2G4Svc.GetTopTransform = False

        #--- GeoModel stuff ----------------------------------------------------
        from AtlasGeoModel import SetGeometryVersion
        from AtlasGeoModel import GeoModelInit

        from AthenaCommon.Configurable import Configurable
        if Configurable.allConfigurables.get('GeoModelSvc'):
            GeoModelSvc = Configurable.allConfigurables.get('GeoModelSvc')
        else:
            GeoModelSvc = theApp.service('GeoModelSvc')
        GeoModelSvc.AlignCallbacks = False

        if (DetFlags.Calo_on()):
            # Common for the Calo
            include(
                "CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py")
            include("CaloIdCnv/CaloIdCnv_joboptions.py")

        ## Explicitly create DetectorGeometrySvc - temporary fix
        from AthenaCommon.CfgGetter import getService, getPublicTool
        from AthenaCommon.AppMgr import ServiceMgr
        ServiceMgr += getService('DetectorGeometrySvc')
        ServiceMgr.ToolSvc += getPublicTool('PhysicsListToolBase')
        AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_external '+\
                                       'done')
Esempio n. 16
0
def MdtPrepDataProviderTool(name="MdtPrepDataProviderTool", **kwargs):
    global source, include, getService

    # setup dependencies which are not yet in C++
    import MuonCnvExample.MuonCablingConfig
    getService("MdtCalibrationSvc")
    include("AmdcAth/AmdcAth_jobOptions.py")

    # If we run trigger from BS, then the RDO to PRD tools need to automatically run BS to RDO tools
    kwargs.setdefault("useBStoRdoTool",
                      DetFlags.readRDOBS.MDT_on() and recAlgs.doTrigger())
    kwargs.setdefault("RawDataProviderTool", "MdtRawDataProviderTool")
    ### TODO: in C++ do not retrieve tool if useBStoRdoTool==False
    ##  if not kwargs["useBStoRdoTool"]:
    ##    kwargs["RawDataProviderTool"] = None # empty tool

    if source == 'data':
        kwargs.setdefault("UseTwin", True)

    from MuonMDT_CnvTools.MuonMDT_CnvToolsConf import Muon__MdtRdoToPrepDataTool
    return Muon__MdtRdoToPrepDataTool(name, **kwargs)
Esempio n. 17
0
    def __init__(self, name='LocalExtrapolator'):

        # get the correct TrackingGeometry setup
        include('TrkDetDescrSvc/LocalTrackingGeometrySvc.py')
        from __main__ import LocalTrackingGeometrySvc
        from __main__ import ToolSvc

        # the Navigator has to get this one
        from TrkExTools.TrkExToolsConf import Trk__Navigator
        LocalNavigator = Trk__Navigator(name='LocalNavigator')
        LocalNavigator.TrackingGeometryName = LocalTrackingGeometrySvc.TrackingGeometryName
        ToolSvc += LocalNavigator

        # the standard RungeKuttaPropagator
        from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator
        LocalPropagator = Propagator(name='LocalPropagator')
        ToolSvc += LocalPropagator
        # call the base class constructor
        Trk__Extrapolator.__init__(self,
                                   name,
                                   Navigator=LocalNavigator,
                                   Propagators=[LocalPropagator])
Esempio n. 18
0
def MuonStandaloneTrackParticleCnvAlg( name="MuonStandaloneTrackParticleCnvAlg",**kwargs):
    from AthenaCommon.Include import include
    include("InDetBeamSpotService/BeamCondSvc.py" )        
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg, xAODMaker__TrackCollectionCnvTool, xAODMaker__RecTrackParticleContainerCnvTool

    muonParticleCreatorTool = getPublicTool("MuonParticleCreatorTool")
    muonTrackCollectionCnvTool = xAODMaker__TrackCollectionCnvTool( name = "MuonTrackCollectionCnvTool", TrackParticleCreator = muonParticleCreatorTool )
    muonRecTrackParticleContainerCnvTool = xAODMaker__RecTrackParticleContainerCnvTool(name = "MuonRecTrackParticleContainerCnvTool", TrackParticleCreator = muonParticleCreatorTool )

    kwargs.setdefault("TrackParticleCreator", muonParticleCreatorTool)
    kwargs.setdefault("RecTrackParticleContainerCnvTool", muonRecTrackParticleContainerCnvTool)
    kwargs.setdefault("TrackCollectionCnvTool", muonTrackCollectionCnvTool)
    kwargs.setdefault("RecTrackParticleContainerCnvTool", muonRecTrackParticleContainerCnvTool)
    kwargs.setdefault("TrackContainerName", "MuonSpectrometerTracks")
    kwargs.setdefault("xAODTrackParticlesFromTracksContainerName", "MuonSpectrometerTrackParticles")
    kwargs.setdefault("AODContainerName", "")
    kwargs.setdefault("AODTruthContainerName", "")
    kwargs.setdefault("xAODTruthLinkVector",  "")
    kwargs.setdefault("ConvertTrackParticles", False)
    kwargs.setdefault("ConvertTracks", True)

    return xAODMaker__TrackParticleCnvAlg( name = "MuonStandaloneTrackParticleCnvAlg",**kwargs)
Esempio n. 19
0
def _setupDetStoreConfig():
    from AthenaCommon.AppMgr import theApp
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr

    # first, make sure we create a DetectorStore
    import AthenaCommon.AtlasUnixStandardJob
    #theApp.CreateSvc += [ svcMgr.DetectorStore.getFullName() ]

    # now configure the Detector Description converter service
    from DetDescrCnvSvc.DetDescrCnvSvcConf import DetDescrCnvSvc
    # Create DetDescrCnvSvc and add to SvcMgr
    # Specify primary Identifier dictionary to be used
    svcMgr += DetDescrCnvSvc(IdDictName = "IdDictParser/ATLAS_IDS.xml")

    #theApp.CreateSvc += [ svcMgr.DetDescrCnvSvc.getFullName() ]
    svcMgr.EventPersistencySvc.CnvServices += [ "DetDescrCnvSvc" ]

    # Always include the IdDict jobOptions
    from AthenaCommon.Include import include
    include( "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" )

    pass
Esempio n. 20
0
#
# e.g. level=L2, type=muon, threshold=30, isIsolated=None
#      level=EF, type=egamma, threshold=20, isIsolated=isolated
#
# Methods:
# instanceName() : returns name of algorithm instance
# classAndInstanceName() : returns a string to be entered in the sequence file. This string
#              defines the class and instance name
#

#
from AthenaCommon.Include import include

include.block("InDetTrigRecExample/EFInDetConfig.py")

include("InDetTrigRecExample/InDetTrigRec_jobOptions.py"
        )  # this is needed to get InDetTrigFlags

from AthenaCommon.Logging import logging
log = logging.getLogger("EFInDetConfig.py")

from InDetTrigRecExample.InDetTrigConfigRecPreProcessing import *

from InDetTrigRecExample.InDetTrigConfigRecNewTracking import \
     SiTrigTrackFinder_EF, SiTrigTrackSeededFinder_EF, SiTrigSimpleTrackFinder_EF, \
     TrigAmbiguitySolver_EF,TRTTrackExtAlg_EF,\
     TrigExtProcessor_EF, InDetTrigDetailedTrackTruthMaker_EF

from InDetTrigRecExample.InDetTrigConfigRecNewTracking import SimpleTrigTrackCollMerger_EF

from InDetTrigRecExample.InDetTrigConfigRecBackTracking import *
from InDetTrigRecExample.InDetTrigConfigRecPostProcessing import *
Esempio n. 21
0
### file inclusion and tracing -----------------------------------------------
from AthenaCommon.Include import Include, IncludeError, include
include.setShowIncludes( False )

### gaudi --------------------------------------------------------------------
from GaudiPython import *

from AthenaCommon.Configurable import *
from AthenaCommon.OldStyleConfig import *
from AthenaCommon.Constants import *

preconfig = "AthenaCommon"
### Athena configuration -----------------------------------------------------
theApp = iService( "ApplicationMgr" )       # proxy
theApp.Dlls += [ 'AthenaServices' ]
include( "%s/Bootstrap.py" % preconfig )

## create the application manager and start in a non-initialised state
from AthenaCommon.AppMgr import theApp, ToolSvc, ServiceMgr, theAuditorSvc


## basic job configuration
include( "AthenaCommon/Atlas.UnixStandardJob.py" )
include.block( "AthenaCommon/Atlas.UnixStandardJob.py" )


EventLoopMgr = iService( 'EventLoopMgr' )
AthenaEventLoopMgr = EventLoopMgr                       # for historic reasons

### execution ----------------------------------------------------------------
from AthenaCommon.ResourceLimits import SetMaxLimits
Esempio n. 22
0
                        writePartons=True,
                        writeGeant=False)

JetROID3PDObject.defineBlock(0,
                             "myKinematics",
                             EventCommonD3PDMaker.FourMomFillerTool,
                             WriteM=False,
                             WritePt=True,
                             prefix="myKin_")
#TrackParticleD3PDObject.defineBlock( 99, "TJVAperigee",
#                                     TauD3PDMaker.TrackParticleAtTJVAFillerTool, prefix = 'atTJVA_')

# Special muon isolation variables
#from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.Include import include
include("MuonIsolationTools/MuonIsolationTool_jobOptions.py")
myMuonD3PDObject.defineBlock(0,
                             "miniiso10",
                             BoostedTopD3PDMaker.MiniIsolationMuonFillerTool,
                             MuIsolationTool=ToolSvc.MuonIsolationTool,
                             KtDist=10.,
                             prefix="MI10_")
myMuonD3PDObject.defineBlock(0,
                             "miniiso15",
                             BoostedTopD3PDMaker.MiniIsolationMuonFillerTool,
                             MuIsolationTool=ToolSvc.MuonIsolationTool,
                             KtDist=15.,
                             prefix="MI15_")

#Add new triggers at request of HSG6
defineTriggerBits(
Esempio n. 23
0
    for s in dictchain.sequenceList:
        print "Step::%i  [\033[1;34m%s\033[1;m]%4s [\033[1;32m%s\033[1;m]   " % (k,s['input'],"-->",s['output'])
        #alg = "    ::--- Algorithm(s): \n"
        alg = ""
        if type(s['algorithm']) == list:
            for j in s['algorithm']:
                alg += "     |--- %s  (Package: %s)\n" % (j.getFullName(),j.getDlls())
            alg = alg[:-1]
        else:
            j = s['algorithm']
            alg = "     |--- %s  (Package: %s) " % (j.getFullName(),j.getDlls())
        print alg
        k+=1


include("RecExCond/RecExCommon_flags.py")

from TriggerMenu.test.TestSliceFlags import * 
#from TriggerMenu.bjet.BjetSliceFlags import * 
#from TriggerJobOpts.TriggerFlags import TriggerFlags  <-- already imported in the line above

# Test the current chains in the Bjet slice taking the MC_pp_v5 menu 
# --> Too slow
#TriggerFlags.triggerMenuSetup='MC_pp_v5'
#TriggerFlags.readHLTconfigFromXML=False
#TriggerFlags.readLVL1configFromXML=False
#TriggerFlags.BjetSlice.setAll()
#
#
#def dvonly():
#    TriggerFlags.Slices_all_setOff()
Esempio n. 24
0
if geo:
    from AthenaCommon.DetFlags import DetFlags
    DetFlags.Calo_setOn()

from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit
from AtlasGeoModel import SetupRecoGeometry

ServiceMgr.IOVDbSvc.GlobalTag = tag
ServiceMgr.IOVDbSvc.DBInstance = ""
ServiceMgr.EventSelector.RunNumber = run
#ServiceMgr+=CfgMgr.PyAthenaEventLoopMgr(EventPrintoutInterval=0)

#Get identifier mapping
include("LArConditionsCommon/LArIdMap_comm_jobOptions.py")
include("LArIdCnv/LArIdCnv_joboptions.py")

include("IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py")
include("CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py")

#include("CaloIdCnv/CaloIdCnv_joboptions.py")

include("LArConditionsCommon/LArConditionsCommon_comm_jobOptions.py")

#if dspth:
#    conddb.addFolder("LAR_ONL","/LAR/Configuration/DSPThreshold/Templates<tag>LARConfigurationDSPThresholdTemplates-Qt5sigma-samp5sigma</tag>")

from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
Esempio n. 25
0
try:
   _msg.setLevel (getattr(logging, opts.msg_lvl))
except:
   _help_and_exit()


### default file name for ease of use ----------------------------------------
if not opts.scripts and os.path.exists(opts.default_jobopt):
   _msg.info("using default file %s", opts.default_jobopt)
   opts.scripts.append(opts.default_jobopt)

if not (opts.scripts or opts.fromdb) and opts.run_batch:
   _msg.error( "batch mode requires at least one script" )
   from AthenaCommon.ExitCodes import INCLUDE_ERROR
   _help_and_exit( INCLUDE_ERROR )
del _help_and_exit


### file inclusion and tracing -----------------------------------------------
from AthenaCommon.Include import IncludeError, include
include.setShowIncludes(opts.showincludes)
include.setClean(opts.drop_cfg)


### pre-execution step -------------------------------------------------------
include( "AthenaCommon/Preparation.py" )


### execution of user script and drop into batch or interactive mode ---------
include( "AthenaCommon/Execution.py" )
if len(listOfRuns)==0:
    print 'Usage: makeSLHAFilesForSM.py run1 run2 run3,run4,run5 run6...'
    sys.exit(0)
print 'Getting SLHA files for run(s)',listOfRuns

# Fake some things that we won't need later
from PyJobTransforms.trfJobOptions import RunArguments
runArgs = RunArguments()
runArgs.randomSeed = 1234
from AthenaCommon import Logging
evgenLog = Logging.logging.getLogger('SLHAGetter')

# only really need this once
from AthenaCommon.Include import IncludeError, include
include.setShowIncludes(False)
include('/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/susycontrol/MadGraphControl_SimplifiedModelPreInclude.py')
include.block('MC12JobOptions/MadGraphControl_SimplifiedModelPreInclude.py')
include.block('MC12JobOptions/MadGraphControl_SimplifiedModelPostInclude.py')

for run in listOfRuns:
    loc_l = glob.glob('/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/share/DSID'+run[0:3]+'xxx/MC12.'+run+'.*')
    if 0==len(loc_l):
        print 'Run not found:',run,'in','/cvmfs/atlas.cern.ch/repo/sw/Generators/MC12JobOptions/latest/share/DSID'+run[0:3]+'xxx/MC12.'+run+'.*'
        continue
    if len(loc_l)>1:
        print 'Multiple runs found:',loc_l,'for run',run,'- Using first.'
    loc = loc_l[0]

    jobO = open(loc,'r')
    main_jobO = ''
    for line in jobO:
Esempio n. 27
0
#! /usr/bin/env python

# @file:    chappy.py
# @purpose: wrapper script to launch ChapPy scripts
# @author:  Sebastien Binet <*****@*****.**>
# @date:    November 2006
#
# @example:
# lxplus> chappy McParticleAlgs/rwtest_genEvent.py
#

import sys

from AthenaCommon.Include import include
include.setShowIncludes( False )

print ":"*80
print "::: ChapPy is launching script [%s] :::" % sys.argv[1]
include( sys.argv[1] )
print ":"*80
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import ToolSvc, ServiceMgr, theAuditorSvc

## These properties have alread been set on the C++ ApplicationMgr in the Psc
## but the configurable needs to have them set as well
theApp.MessageSvcType = PscConfig.optmap["MESSAGESVCTYPE"]
theApp.JobOptionsSvcType = PscConfig.optmap["JOBOPTIONSSVCTYPE"]

## add the MessageSvc and the JobOptionsSvc to the ServiceMgr
from AthenaCommon.ConfigurableDb import getConfigurable
ServiceMgr += getConfigurable(theApp.JobOptionsSvcType)("JobOptionsSvc")
ServiceMgr += getConfigurable(theApp.MessageSvcType)("MessageSvc")

## set the default values
try:
    include(pscBootstrapFile)
except Exception, e:
    if isinstance(e, IncludeError):
        print sys.exc_type, e
        theApp._exitstate = ExitCodes.INCLUDE_ERROR
        sys.exit(ExitCodes.INCLUDE_ERROR)
    raise

## properties of the application manager
theApp.StatusCodeCheck = False  # enabled via TriggerFlags.Online.doValidation (see below)
theApp.setOutputLevel(OUTPUTLEVEL)

# Configure the CoreDumpSvc
if not hasattr(ServiceMgr, "CoreDumpSvc"):
    from AthenaServices.Configurables import CoreDumpSvc
    ServiceMgr += CoreDumpSvc()
Esempio n. 29
0
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration

from AthenaCommon.Include import include

include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py")
from AthenaCommon.Logging import logging
from LArRecUtils.LArRecUtilsConf import LArOFCCondAlg 
from AthenaCommon.AlgSequence import AthSequencer
from LArCabling.LArCablingAccess import LArOnOffIdMapping
condSeq = AthSequencer("AthCondSeq")


def LArOFCCondAlgDefault():

    mlog = logging.getLogger('LArOFCCondAlg')
    mlog.info("entering LArOFCCondAlgDefault")

    LArOnOffIdMapping()
    condSeq = AthSequencer("AthCondSeq")
    if hasattr (condSeq,"LArOFCCondAlg"):
        return getattr(condSeq,"LArOFCCondAlg")

    theOFCCondAlg=LArOFCCondAlg()
    #theOFCCondAlg.MCSym = True
    theOFCCondAlg.isMC  = True
    from LArROD.LArRODFlags import larRODFlags
    from AthenaCommon.BeamFlags import jobproperties

    theOFCCondAlg.firstSample = larRODFlags.firstSample()
    theOFCCondAlg.useHighestGainAutoCorr = larRODFlags.useHighestGainAutoCorr()
### This is a temp include to get ROS cost from offline running of the trigger with 2012 data. When we have a map for 2015 data, we will integrate this 
### into the cost infrastructure such that it becomes automatic

try:
	from AthenaCommon.Logging import logging
	log = logging.getLogger('offlineROSCost2012.py')
	log.info('Enabling offline ROS cost monitoring for run 1 data.')	

	from AthenaCommon.Include import include, IncludeError
	include("TrigROBDataProviderSvc/TrigROBDataProviderSvc.py")
	svcMgr.ROBDataProviderSvc.PrintStackTraceGetROBData = False

	# This ROB-ROS map was generated by generate-rob-ros-map-from-data.py
	# Current date and time is 2014-11-10 11:23:52.444569
	#
	# These unique identifiers were extracted from:
	# root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/validation/test_data/data12_8TeV.00212967.physics_eb_zee_zmumu_cc._0001.data
	#
	svcMgr.ROBDataProviderSvc.RobRosMapping = {
	#
	# ROB id   : ROS id = SubDetector Id 
	#
	# 01 : Sub Detector = PIXEL_BARREL
	  0x111705 : 0x11 ,
	  0x111706 : 0x11 ,
	  0x111707 : 0x11 ,
	  0x111708 : 0x11 ,
	  0x111709 : 0x11 ,
	  0x111710 : 0x11 ,
	  0x111711 : 0x11 ,
	  0x111712 : 0x11 ,
Esempio n. 31
0
rec.AutoConfiguration.set_Value_and_Lock(["everything"])

rec.doCBNT.set_Value_and_Lock(False)
rec.doESD.set_Value_and_Lock(False)
rec.doHist.set_Value_and_Lock(False)
rec.doPerfMon.set_Value_and_Lock(False)

rec.doWriteAOD.set_Value_and_Lock(False)
rec.doWriteESD.set_Value_and_Lock(False)
rec.doWriteTAG.set_Value_and_Lock(False)
rec.doWriteTAGCOM.set_Value_and_Lock(False)

#
from AthenaCommon.Include import include

include("RecExCommon/RecExCommon_topOptions.py")

#
for i in ServiceMgr:
    i.OutputLevel = INFO

##############################
# Output file
##############################
OutputFile = 'Output_HLT_MetMon.root'

from GaudiSvc.GaudiSvcConf import THistSvc

svcMgr += THistSvc()
svcMgr.THistSvc.Output += [
    "MonitorHLTmet DATAFILE='" + OutputFile + "' OPT='RECREATE'"
Esempio n. 32
0
    def configure(self):

        log = logging.getLogger("Lvl1TriggerOnlineGetter.py")

        from AthenaServices.AthenaServicesConf import AthenaOutputStream
        from AthenaCommon.AppMgr import ServiceMgr
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        # initialize LVL1ConfigSvc
        if not hasattr(ServiceMgr, 'LVL1ConfigSvc'):
            from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc
            LVL1ConfigSvc = LVL1ConfigSvc("LVL1ConfigSvc")
            LVL1ConfigSvc.XMLMenuFile = TriggerFlags.inputLVL1configFile()
            ServiceMgr += LVL1ConfigSvc
        else:
            log.info( "LVL1ConfigSvc already created. Will ignore configuration from xml file="+TriggerFlags.inputLVL1configFile()\
                      +" and use file="+ServiceMgr.LVL1ConfigSvc.XMLFile )

        if (not TriggerFlags.fakeLVL1()) and TriggerFlags.doLVL1():
            if TriggerFlags.useCaloTTL():
                include("TrigT1CaloSim/TrigT1CaloSimJobOptions_TTL1.py")
            else:
                include("TrigT1CaloSim/TrigT1CaloSimJobOptions_Cell.py")
            topSequence += LVL1__TrigT1MBTS()

            topSequence += L1Muctpi()

            if TriggerFlags.doL1Topo():
                log.info("adding l1topo simulation to the topSequence")
                from L1TopoSimulation.L1TopoSimulationConfig import L1TopoSimulation
                topSequence += L1TopoSimulation()
                topSequence.L1TopoSimulation.OutputLevel = DEBUG

                try:  # this is temporary until TrigT1Muctpi-00-06-29 is in the release
                    from TrigT1Muctpi.TrigT1MuctpiConfig import L1MuctpiTool
                    from AthenaCommon.AppMgr import ToolSvc
                    ToolSvc += L1MuctpiTool()
                    topSequence.L1TopoSimulation.MuonInputProvider.MuctpiSimTool = L1MuctpiTool(
                    )
                except ImportError:
                    pass

                # enable the reduced (coarse) granularity topo simulation
                # currently only for MC
                from AthenaCommon.GlobalFlags import globalflags
                if globalflags.DataSource() != 'data':
                    log.info(
                        "Muon eta/phi encoding with reduced granularity for MC (L1 Simulation)"
                    )
                    topSequence.L1TopoSimulation.MuonInputProvider.MuonEncoding = 1
                else:
                    log.info(
                        "Muon eta/phi encoding with full granularity for data (L1 Simulation) - should be faced out"
                    )
                    topSequence.L1TopoSimulation.MuonInputProvider.MuonEncoding = 1

            log.info("adding ctp simulation to the topSequence")
            topSequence += CTPSimulation("CTPSimulation")

            log.info("adding ROIB simulation to the topSequence")
            topSequence += ROIB__RoIBuilder("RoIBuilder")

        return True
Esempio n. 33
0
from AthenaCommon.Logging import *
_msg = log  # from above import...

## test and set log level
try:
    _msg.setLevel(getattr(logging, opts.msg_lvl))
except:
    _help_and_exit()

### default file name for ease of use ----------------------------------------
if not opts.scripts and os.path.exists(opts.default_jobopt):
    _msg.info("using default file %s", opts.default_jobopt)
    opts.scripts.append(opts.default_jobopt)

if not (opts.scripts or opts.fromdb) and opts.run_batch:
    _msg.error("batch mode requires at least one script")
    from AthenaCommon.ExitCodes import INCLUDE_ERROR
    _help_and_exit(INCLUDE_ERROR)
del _help_and_exit

### file inclusion and tracing -----------------------------------------------
from AthenaCommon.Include import IncludeError, include
include.setShowIncludes(opts.showincludes)
include.setClean(opts.drop_cfg)

### pre-execution step -------------------------------------------------------
include("AthenaCommon/Preparation.py")

### execution of user script and drop into batch or interactive mode ---------
include("AthenaCommon/Execution.py")
Esempio n. 34
0
    def configure(self):

        if self._done:
            log.info("configuration already done, who is calling it again?")
            return True
        self._done = True

        # start with print some information what this will do
        log.info(
            "Basic configuration flags RecAlgsFlag.doTrigger: %d   RecFlags.doTrigger: %d TriggerFlags.doTriggerConfigOnly %d"
            % (recAlgs.doTrigger(), rec.doTrigger(), TF.doTriggerConfigOnly()))
        log.info(
            "TriggerFlags: doL1Topo: %s, doLVL1: %s, doLVL2: %s, doEF: %s, doHLT: %s"
            % (TF.doL1Topo(), TF.doLVL1(), TF.doLVL2(), TF.doEF(), TF.doHLT()))

        willGenerateMenu = recAlgs.doTrigger() and (
            TF.doLVL1() or TF.doLVL2() or TF.doEF()
            or TF.doHLT()) and not TF.doTriggerConfigOnly()
        willRunTriggerConfigGetter = recAlgs.doTrigger() or rec.doTrigger(
        ) or TF.doTriggerConfigOnly()
        willRunLVL1SimulationGetter = recAlgs.doTrigger(
        ) and not TF.doTriggerConfigOnly()
        willRunHLTSimulationGetter = willRunLVL1SimulationGetter and (
            TF.doLVL2() or TF.doEF() or TF.doHLT())

        log.info("Will run: %s%s%s%s" % (
            "GenerateMenu " if willGenerateMenu else "",
            "TriggerConfigGetter " if willRunTriggerConfigGetter else "",
            "LVL1SimulationGetter " if willRunLVL1SimulationGetter else "",
            "HLTSimulationGetter " if willRunHLTSimulationGetter else "",
        ))
        log.info("Will not run: %s%s%s%s" % (
            "GenerateMenu " if not willGenerateMenu else "",
            "TriggerConfigGetter " if not willRunTriggerConfigGetter else "",
            "LVL1SimulationGetter " if not willRunLVL1SimulationGetter else "",
            "HLTSimulationGetter " if not willRunHLTSimulationGetter else "",
        ))

        if recAlgs.doTrigger():

            # setup the trigger from the DB
            if TF.readConfigFromTriggerDb():
                return self.configureTriggerFromDB()

            if ((TF.doLVL1() == True or TF.doLVL2() == True
                 or TF.doEF() == True or TF.doHLT() == True)
                    and TF.doTriggerConfigOnly() == False):
                log.info("generating menu")
                # trigger menu files generation
                g = GenerateMenu()
                g.generate()

                # after the menu xml file has been created or the TriggerDB access is configured,
                # the COOL/SQlite db can be written
                # TB this needs to be optimized -- we do not need ti always but only when AOD or ESD are created

        if recAlgs.doTrigger() or rec.doTrigger() or TF.doTriggerConfigOnly():
            # setup configuration services
            from TriggerJobOpts.TriggerConfigGetter import TriggerConfigGetter
            cfg = TriggerConfigGetter()

            from TrigConfigSvc.TrigConf2COOL import theConfCOOLWriter
            theConfCOOLWriter.writeConf2COOL()

        # preconfigure TrigDecisionTool
        from TrigDecisionTool.TrigDecisionToolConf import Trig__TrigDecisionTool
        from AthenaCommon.AppMgr import ToolSvc
        ToolSvc += Trig__TrigDecisionTool("TrigDecisionTool")
        # tell tdt to use TrigConfigSvc (Since TrigDecisionTool-00-03-40, defaults to not use it)
        ToolSvc.TrigDecisionTool.TrigConfigSvc = "Trig::TrigConfigSvc/TrigConfigSvc"

        from TrigEDMConfig.TriggerEDM import EDMLibraries
        ToolSvc.TrigDecisionTool.Navigation.Dlls = [
            e for e in EDMLibraries if 'TPCnv' not in e
        ]

        # actuall trigger simulation running
        if recAlgs.doTrigger() and not TF.doTriggerConfigOnly():
            # setup Lvl1
            # initialize LVL1ConfigSvc
            log.info("configuring lvl1")
            from TriggerJobOpts.Lvl1TriggerGetter import Lvl1SimulationGetter
            lvl1 = Lvl1SimulationGetter()

            if jobproperties.Global.InputFormat() != 'bytestream' and (
                    TF.doLVL2 == True or TF.doEF == True or TF.doHLT == True):
                # Transient BS construction and intialization
                from ByteStreamCnvSvc import WriteByteStream
                StreamBS = WriteByteStream.getStream("Transient", "StreamBS")
                StreamBS.ForceRead = True
                StreamBS.ItemList += [
                    "DataVector<LVL1::TriggerTower>#TriggerTowers"
                ]
                StreamBS.ItemList += ["TRT_RDO_Container#TRT_RDOs"]
                StreamBS.ItemList += ["SCT_RDO_Container#SCT_RDOs"]
                StreamBS.ItemList += ["PixelRDO_Container#PixelRDOs"]
                # StreamBS.ItemList +=["LArRawChannelContainer#*"]
                StreamBS.ItemList += ["2721#*"]
                # StreamBS.ItemList +=["TileRawChannelContainer#*"]
                StreamBS.ItemList += ["2927#*"]
                StreamBS.ItemList += [
                    "2934#*"
                ]  # added on request from: Arantxa Ruiz Martinez for TileRODMu

                # don't need Muons in transient BS
                # StreamBS.ItemList +=["MdtCsmContainer#*"]
                # StreamBS.ItemList +=["RpcPadContainer#*"]
                # StreamBS.ItemList +=["TgcRdoContainer#*"]
                # StreamBS.ItemList +=["CscRawDataContainer#*"]

                from AthenaCommon.Include import include
                # setup trans BS for the ID
                include("InDetRecExample/InDetRecCabling.py")

            # setup HLT
            # initialize HLT config svc
            log.info("TriggerFlags: doLVL2 %r" % TF.doLVL2())
            log.info("TriggerFlags: doEF   %r" % TF.doEF())
            log.info("TriggerFlags: doHLT  %r" % TF.doHLT())
            if TF.doLVL2() == True or TF.doEF() == True or TF.doHLT() == True:
                log.info("configuring hlt")
                from TriggerJobOpts.HLTTriggerGetter import HLTSimulationGetter
                hlt = HLTSimulationGetter(g)
            else:
                from RegionSelector.RegSelSvcDefault import RegSelSvcDefault
                from AthenaCommon.AppMgr import ServiceMgr
                ServiceMgr += RegSelSvcDefault()
                ServiceMgr.RegSelSvc.enablePixel = False
                ServiceMgr.RegSelSvc.enableSCT = False

        # prepare result making of L1
        from TriggerJobOpts.Lvl1ResultBuilderGetter import Lvl1ResultBuilderGetter
        hltouput = Lvl1ResultBuilderGetter()

        # prepare result making of HLT
        if TF.doLVL2() == True or TF.doEF() == True or TF.doHLT() or (
                recAlgs.doTrigger() and TF.readBS()):
            from TriggerJobOpts.HLTTriggerResultGetter import HLTTriggerResultGetter
            hltouput = HLTTriggerResultGetter()

        return True
Esempio n. 35
0
    theApp.setEvent = setEvent

from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
#athenaCommonFlags.isOnline = True
athenaCommonFlags.BSRDOInput=BSRDOInput


from RecExConfig.RecFlags import rec
rec.readRDO = False
rec.AutoConfiguration=['everything']


#----------------------------------------------------------------------
# Set services for reading BS files
#
include("ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py")

svcMgr.ByteStreamCnvSvc.InitCnvs += [ "EventInfo",
                                      "HLT::HLTResult"]

svcMgr.ByteStreamAddressProviderSvc.TypeNames += [ "HLT::HLTResult/HLTResult_L2",
                                                   "HLT::HLTResult/HLTResult_EF",
                                                   "HLT::HLTResult/HLTResult_HLT"]


#----------------------------------------------------------------------
# Set input files
#
if ('BSRDOInput' in dir()):
    svcMgr.ByteStreamInputSvc.FullFileName = BSRDOInput
Esempio n. 36
0
globalflags.InputFormat = "bytestream"

#-------------------------------------------------------------------------------

#####################################################
#
# LVL1 simulation
#
#####################################################

from TrigConfigSvc.TrigConfigSvcConfig import LVL1ConfigSvc
LVL1ConfigSvc = LVL1ConfigSvc("LVL1ConfigSvc")
LVL1ConfigSvc.XMLFile = TriggerFlags.inputLVL1configFile()
#LVL1ConfigSvc.CreateLegacyObjects=True

include("TrigT1CaloByteStream/ReadLVL1CaloBS_jobOptions.py")
include("TrigT1CaloSim/TrigT1CaloSimJobOptions.py")

print "JOERG after including T1Calo simulation"
print topSequence.getChildren()

toRemove = [
    c for c in topSequence.getChildren() if c.name() == 'TriggerTowerMaker'
]
for x in toRemove:
    topSequence.remove(x)

print "JOERG after removing TriggerTowerMaker"
print topSequence.getChildren()

from TrigT1MBTS.TrigT1MBTSConf import LVL1__TrigT1MBTS