コード例 #1
0
def BasicTRTFastDigitizationTool(name, **kwargs):

    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested('/TRT/Calib/errors'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/errors",
                                    "/TRT/Calib/errors")
    if not conddb.folderRequested("/TRT/Calib/PID_vector"):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/PID_vector",
                                    "/TRT/Calib/PID_vector")
    if not conddb.folderRequested("/TRT/Calib/ToT/ToTVectors"):
        conddb.addFolder("TRT_OFL", "/TRT/Calib/ToT/ToTVectors")
    if not conddb.folderRequested("/TRT/Calib/ToT/ToTValue"):
        conddb.addFolder("TRT_OFL", "/TRT/Calib/ToT/ToTValue")
    #choose random number service
    from Digitization.DigitizationFlags import digitizationFlags
    kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc())
    streamName = kwargs.setdefault("RandomStreamName", "FastTRTDigitization")
    # set rndm seeds
    if not digitizationFlags.rndmSeedList.checkForExistingSeed(streamName):
        digitizationFlags.rndmSeedList.addSeed(streamName, 45123, 94345)

    from Digitization.DigitizationFlags import digitizationFlags
    if digitizationFlags.doXingByXingPileUp():
        kwargs.setdefault("FirstXing", FastTRT_FirstXing())
        kwargs.setdefault("LastXing", FastTRT_LastXing())

    from AthenaCommon import CfgMgr
    return CfgMgr.TRTFastDigitizationTool(name, **kwargs)
def getALFA_DetectorTool(name="ALFA_DetectorTool"):
    #conddb.addFolder("FWD_OFL","/FWD/ALFA/position_calibration")
    conddb.addFolderSplitOnline('FWD', '/FWD/Onl/ALFA/position_calibration',
                                '/FWD/ALFA/position_calibration')

    #instatiate the tool
    theALFA_DetectorTool = ALFA_DetectorTool(name)
    theALFA_DetectorTool.MetrologyType = 3

    #set 1 for nominal fiber positions or 2 for position by metrology
    theALFA_DetectorTool.B7L1U_MDGeometryType = 2
    theALFA_DetectorTool.B7L1U_ODGeometryType = 2
    theALFA_DetectorTool.B7L1L_MDGeometryType = 2
    theALFA_DetectorTool.B7L1L_ODGeometryType = 2
    theALFA_DetectorTool.A7L1U_MDGeometryType = 2
    theALFA_DetectorTool.A7L1U_ODGeometryType = 2
    theALFA_DetectorTool.A7L1L_MDGeometryType = 2
    theALFA_DetectorTool.A7L1L_ODGeometryType = 2
    theALFA_DetectorTool.A7R1U_MDGeometryType = 2
    theALFA_DetectorTool.A7R1U_ODGeometryType = 2
    theALFA_DetectorTool.A7R1L_MDGeometryType = 2
    theALFA_DetectorTool.A7R1L_ODGeometryType = 2
    theALFA_DetectorTool.B7R1U_MDGeometryType = 2
    theALFA_DetectorTool.B7R1U_ODGeometryType = 2
    theALFA_DetectorTool.B7R1L_MDGeometryType = 2
    theALFA_DetectorTool.B7R1L_ODGeometryType = 2

    return theALFA_DetectorTool
コード例 #3
0
    def __init__(self):

        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        from AthenaCommon.AppMgr import ToolSvc

        from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc

        # Init PixelLorentzAngleSvc
        if hasattr(svcMgr, 'PixelLorentzAngleSvc'):
            pixelLorentzAngleSvc = svcMgr.PixelLorentzAngleSvc
        else:
            pixelLorentzAngleSvc = SiLorentzAngleSvc(
                name="PixelLorentzAngleSvc", DetectorName="Pixel")
            svcMgr += pixelLorentzAngleSvc

        # Init PixelSiliconConditionsSvc
        if hasattr(svcMgr, 'PixelSiliconConditionsSvc'):
            pixelSiliconConditionsSvc = svcMgr.PixelSiliconConditionsSvc
        else:
            from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc
            pixelSiliconConditionsSvc = PixelSiliconConditionsSvc()
            svcMgr += pixelSiliconConditionsSvc

        pixelSiliconConditionsSvc.DepletionVoltage = 10.0

        from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc
        pixelSiPropertiesSvc = SiPropertiesSvc(
            name="PixelSiPropertiesSvc",
            DetectorName="Pixel",
            SiConditionsServices=pixelSiliconConditionsSvc)
        svcMgr += pixelSiPropertiesSvc

        # Pass the silicon conditions services to the Lorentz angle service
        # Also make sure UseMagFieldTool is True as AtlasGeoModel sets this to False
        # if loaded first.
        pixelLorentzAngleSvc.UseMagFieldSvc = True
        pixelLorentzAngleSvc.SiConditionsServices = pixelSiliconConditionsSvc
        pixelLorentzAngleSvc.SiPropertiesSvc = pixelSiPropertiesSvc
        #pixelLorentzAngleSvc.CorrectionFactor = 0.900
        #Load Correction factor from database
        from IOVDbSvc.CondDB import conddb
        #conddb.addFolder("","/PIXEL/LorentzAngleScale<db>sqlite://;schema=PixelLorentzAngle_MC.db;dbname=OFLP200</db><tag>PIXELLorentzAngleScale-Simu-001</tag>")
        #conddb.addFolder("PIXEL_OFL","/PIXEL/LorentzAngleScale")

        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        if athenaCommonFlags.isOnline():
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/LorentzAngleScale",
                                        "/PIXEL/LorentzAngleScale")
        else:
            conddb.addFolder("PIXEL_OFL", "/PIXEL/LorentzAngleScale")
        pixelLorentzAngleSvc.CorrDBFolder = "/PIXEL/LorentzAngleScale"

        self.PixelLorentzAngleSvc = pixelLorentzAngleSvc
        self.pixelSiliconConditionsSvc = pixelSiliconConditionsSvc
        self.PixelSiliconConditionsSvc = pixelSiliconConditionsSvc
        self.pixelSiPropertiesSvc = pixelSiPropertiesSvc
        self.PixelSiPropertiesSvc = pixelSiPropertiesSvc

        self.PixelSiPropertiesSvc.UseConditionsDB = True
コード例 #4
0
def getALFA_DetectorTool(name="ALFA_DetectorTool"):
    #conddb.addFolder("","<db>COOLOFL_FWD/COMP200</db>/FWD/ALFA/position_calibration<tag>FWDALFAposition_calibration-run373-v2</tag>")
    #conddb.addFolder("FWD_OFL","/FWD/ALFA/position_calibration")
    conddb.addFolderSplitOnline('FWD', '/FWD/Onl/ALFA/position_calibration',
                                '/FWD/ALFA/position_calibration')

    #instatiate the tool
    theALFA_DetectorTool = ALFA_DetectorTool(name)
    theALFA_DetectorTool.MetrologyType = 3

    theALFA_DetectorTool.B7L1U_MDGeometryType = 2
    theALFA_DetectorTool.B7L1U_ODGeometryType = 2
    theALFA_DetectorTool.B7L1L_MDGeometryType = 2
    theALFA_DetectorTool.B7L1L_ODGeometryType = 2
    theALFA_DetectorTool.A7L1U_MDGeometryType = 2
    theALFA_DetectorTool.A7L1U_ODGeometryType = 2
    theALFA_DetectorTool.A7L1L_MDGeometryType = 2
    theALFA_DetectorTool.A7L1L_ODGeometryType = 2
    theALFA_DetectorTool.A7R1U_MDGeometryType = 2
    theALFA_DetectorTool.A7R1U_ODGeometryType = 2
    theALFA_DetectorTool.A7R1L_MDGeometryType = 2
    theALFA_DetectorTool.A7R1L_ODGeometryType = 2
    theALFA_DetectorTool.B7R1U_MDGeometryType = 2
    theALFA_DetectorTool.B7R1U_ODGeometryType = 2
    theALFA_DetectorTool.B7R1L_MDGeometryType = 2
    theALFA_DetectorTool.B7R1L_ODGeometryType = 2

    return theALFA_DetectorTool
コード例 #5
0
def getTileCondProxy(technology, type, source, name, **kwargs):

    tool = None

    #=============================================================
    #=== FILE
    #=============================================================
    if technology == 'FILE':
        if type == 'Flt':
            tool = TileCondProxyFileFlt(name, Source=source)
        elif type == 'Bch':
            tool = TileCondProxyFileBch(name, Source=source)

    #=============================================================
    #=== COOL
    #=============================================================
    elif technology == 'COOL':

        from TileConditions.TileCoolMgr import tileCoolMgr
        folder = tileCoolMgr.getFolder(source)
        folder2 = tileCoolMgr.getFolderTwo(source)
        tag = tileCoolMgr.getTag(source)
        conn = tileCoolMgr.getDbConn(source)
        key = tileCoolMgr.getKey(source)

        folderstr = ""
        folderstr2 = ""

        if (len(tag)):
            folderstr = folder + " <tag>" + tag + "</tag> <key>" + key + "</key>"
            folderstr2 = folder2 + " <tag>" + tag + "</tag> <key>" + key + "</key>"
        else:
            folderstr = folder + " <key>" + folder + "</key>"
            folderstr2 = folder2 + " <key>" + folder2 + "</key>"

        #=== add folders according to their COOL schema split type
        if tileCoolMgr.isSplitMC(source):
            conddb.addFolderSplitMC(conn, folderstr, folderstr2)
        if tileCoolMgr.isOfflineOnly(source):
            conddb.addFolder(conn, folderstr)
        if tileCoolMgr.isSplitOnline(source):
            conddb.addFolderSplitOnline(conn, folderstr, folderstr2)
        if tileCoolMgr.isSqlite(source):
            conddb.addFolder(conn, folderstr)

        #=== create the proxies
        if type == 'Flt':
            tool = TileCondProxyCoolFlt(name, Source=key)
        elif type == 'Bch':
            tool = TileCondProxyCoolBch(name, Source=key)
        elif type == 'Ofc':
            tool = TileCondProxyCoolOfc(name, Source=key)

    return tool
コード例 #6
0
def getVertexBeamCondPositioner(name="VertexBeamCondPositioner", **kwargs):
    from G4AtlasApps.SimFlags import simFlags
    #simFlags.VertexTimeOffset.get_Value()
    kwargs.setdefault('RandomSvc', simFlags.RandomSvcMT.get_Value())
    # TODO This should really be with the BeamCondSvc configuration.
    # Conditions sequence for Athena MT
    from AthenaCommon.AlgSequence import AthSequencer
    condSeq = AthSequencer("AthCondSeq")
    if not hasattr(condSeq, "BeamSpotCondAlg"):
        from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg
        condSeq += BeamSpotCondAlg("BeamSpotCondAlg")
    from IOVDbSvc.CondDB import conddb
    conddb.addFolderSplitOnline("INDET",
                                "/Indet/Onl/Beampos",
                                "/Indet/Beampos",
                                className='AthenaAttributeList')
    return CfgMgr.Simulation__VertexBeamCondPositioner(name, **kwargs)
コード例 #7
0
    def __init__(self, name = 'ConfiguredTrigL2_Extrapolator') :
        Trk__Extrapolator.__init__(self, name)
        from AthenaCommon.AppMgr import ToolSvc
        from TrkDetDescrSvc.AtlasTrackingGeometrySvc import AtlasTrackingGeometrySvc

        from IOVDbSvc.CondDB import conddb
        if not (conddb.folderRequested( "/Indet/TrkErrorScaling" ) or conddb.folderRequested( "/Indet/Onl/TrkErrorScaling" )):
            conddb.addFolderSplitOnline("INDET", "/Indet/Onl/TrkErrorScaling", "/Indet/TrkErrorScaling" )
        
        from TrkExSTEP_Propagator.TrkExSTEP_PropagatorConf import Trk__STEP_Propagator
        TrigL2_StepPropagator = Trk__STEP_Propagator(name = 'TrigL2_StepPropagator')
        ToolSvc += TrigL2_StepPropagator
        from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator
        TrigL2_RKPropagator = Trk__RungeKuttaPropagator(name = 'TrigL2_RKPropagator')
        ToolSvc += TrigL2_RKPropagator
        from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags
        if InDetTrigFlags.propagatorType() is "STEP":
            TrigL2_Propagator = TrigL2_StepPropagator
        else:
            TrigL2_Propagator = TrigL2_RKPropagator
        
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        AtlasTrackingGeometrySvc  = svcMgr.AtlasTrackingGeometrySvc
        from TrkExTools.TrkExToolsConf import Trk__Navigator
        TrigL2_Navigator = Trk__Navigator(name = 'TrigL2_Navigator',TrackingGeometrySvc = AtlasTrackingGeometrySvc)
        ToolSvc += TrigL2_Navigator
        from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator
        TrigL2_MaterialUpdator = Trk__MaterialEffectsUpdator(name = "TrigL2_MaterialEffectsUpdator")
        ToolSvc += TrigL2_MaterialUpdator
        TrigL2_SubPropagators = []
        TrigL2_SubUpdators = []
        TrigL2_SubPropagators += [ TrigL2_Propagator.name() ]
        TrigL2_SubUpdators    += [ TrigL2_MaterialUpdator.name() ]
        TrigL2_SubPropagators += [ TrigL2_Propagator.name() ]
        TrigL2_SubUpdators    += [ TrigL2_MaterialUpdator.name() ]
        TrigL2_SubPropagators += [ TrigL2_StepPropagator.name() ]
        TrigL2_SubUpdators    += [ TrigL2_MaterialUpdator.name() ]
        self.Propagators             = [ TrigL2_RKPropagator, TrigL2_StepPropagator]
        self.MaterialEffectsUpdators = [ TrigL2_MaterialUpdator ]
        self.Navigator               = TrigL2_Navigator
        self.SubPropagators          = TrigL2_SubPropagators
        self.SubMEUpdators           = TrigL2_SubUpdators
コード例 #8
0
def setupMdtCondDB():
    global mdt_folder_name_appendix
    from IOVDbSvc.CondDB import conddb

    if mdtCalibFlags.mdtCalibrationSource() == "MDT":
        conddb.addFolderSplitOnline("MDT",
                                    '/MDT/Onl/RT' + mdt_folder_name_appendix,
                                    '/MDT/RT' + mdt_folder_name_appendix)
        conddb.addFolderSplitOnline("MDT",
                                    '/MDT/Onl/T0' + mdt_folder_name_appendix,
                                    '/MDT/T0' + mdt_folder_name_appendix)
    else:
        from AthenaCommon.AppMgr import ServiceMgr
        ServiceMgr.TagInfoMgr.ExtraTagValuePairs += [
            "MDTCalibrationSource",
            mdtCalibFlags.mdtCalibrationSource()
        ]
        specialAddFolderSplitOnline(mdtCalibFlags.mdtCalibrationSource(),
                                    '/MDT/Onl/RT' + mdt_folder_name_appendix,
                                    '/MDT/RT' + mdt_folder_name_appendix)
        specialAddFolderSplitOnline(mdtCalibFlags.mdtCalibrationSource(),
                                    '/MDT/Onl/T0' + mdt_folder_name_appendix,
                                    '/MDT/T0' + mdt_folder_name_appendix)
コード例 #9
0
    def createSvc(self):

        #
        # Load necessary conditions folders
        #

        # Calibration constants
        from IOVDbSvc.CondDB import conddb

        if not self._isMC:
            #only needed for data
            if not (conddb.folderRequested('/TRT/Onl/ROD/Compress')):
                conddb.addFolder("TRT_ONL",
                                 "/TRT/Onl/ROD/Compress",
                                 className='CondAttrListCollection')

        if not (conddb.folderRequested('/TRT/Calib/RT')
                or conddb.folderRequested('/TRT/Onl/Calib/RT')):
            conddb.addFolderSplitOnline(
                'TRT',
                '/TRT/Onl/Calib/RT',
                '/TRT/Calib/RT',
                className='TRTCond::RtRelationMultChanContainer')
        if not (conddb.folderRequested('/TRT/Calib/T0')
                or conddb.folderRequested('/TRT/Onl/Calib/T0')):
            conddb.addFolderSplitOnline(
                'TRT',
                '/TRT/Onl/Calib/T0',
                '/TRT/Calib/T0',
                className='TRTCond::StrawT0MultChanContainer')

        if not (conddb.folderRequested('/TRT/Calib/errors')
                or conddb.folderRequested('/TRT/Onl/Calib/errors')):
            conddb.addFolderSplitOnline(
                "TRT",
                "/TRT/Onl/Calib/errors",
                "/TRT/Calib/errors",
                className='TRTCond::RtRelationMultChanContainer')

        if not (conddb.folderRequested('/TRT/Calib/errors2d')
                or conddb.folderRequested('/TRT/Onl/Calib/errors2d')):
            conddb.addFolderSplitOnline(
                "TRT",
                "/TRT/Onl/Calib/errors2d",
                "/TRT/Calib/errors2d",
                className='TRTCond::RtRelationMultChanContainer')

        if not (conddb.folderRequested('/TRT/Calib/slopes')
                or conddb.folderRequested('/TRT/Onl/Calib/slopes')):
            conddb.addFolderSplitOnline(
                "TRT",
                "/TRT/Onl/Calib/slopes",
                "/TRT/Calib/slopes",
                className='TRTCond::RtRelationMultChanContainer')

        # Calibration DB Service
        from AthenaCommon.AppMgr import ServiceMgr

        # Dead/Noisy Straw Lists
        if not conddb.folderRequested('/TRT/Cond/Status'):
            conddb.addFolderSplitOnline(
                "TRT",
                "/TRT/Onl/Cond/Status",
                "/TRT/Cond/Status",
                className='TRTCond::StrawStatusMultChanContainer')
        if not conddb.folderRequested('/TRT/Cond/StatusPermanent'):
            conddb.addFolderSplitOnline(
                "TRT",
                "/TRT/Onl/Cond/StatusPermanent",
                "/TRT/Cond/StatusPermanent",
                className='TRTCond::StrawStatusMultChanContainer')

        # Argon straw list
        if not conddb.folderRequested('/TRT/Cond/StatusHT'):
            conddb.addFolderSplitOnline(
                "TRT",
                "/TRT/Onl/Cond/StatusHT",
                "/TRT/Cond/StatusHT",
                className='TRTCond::StrawStatusMultChanContainer')

        #these conditions were instantiated together with specific tools using them in InDetTrigRecLoadTools
        #now required for the condAlg
        if not (conddb.folderRequested("/TRT/Calib/PID_vector") or \
                conddb.folderRequested("/TRT/Onl/Calib/PID_vector")):
            conddb.addFolderSplitOnline("TRT",
                                        "/TRT/Onl/Calib/PID_vector",
                                        "/TRT/Calib/PID_vector",
                                        className='CondAttrListVec')
        if not (conddb.folderRequested("/TRT/Calib/ToT/ToTVectors") or \
                conddb.folderRequested("/TRT/Onl/Calib/ToT/ToTVectors")):
            conddb.addFolderSplitOnline("TRT",
                                        "/TRT/Onl/Calib/ToT/ToTVectors",
                                        "/TRT/Calib/ToT/ToTVectors",
                                        className='CondAttrListVec')
        if not (conddb.folderRequested("/TRT/Calib/ToT/ToTValue") or \
                conddb.folderRequested("/TRT/Onl/Calib/ToT/ToTValue")):
            conddb.addFolderSplitOnline("TRT",
                                        "/TRT/Onl/Calib/ToT/ToTValue",
                                        "/TRT/Calib/ToT/ToTValue",
                                        className='CondAttrListCollection')

        # Straw status tool (now private, cannot be passed by name)
        from InDetTrigRecExample.InDetTrigCommonTools import InDetTrigTRTStrawStatusSummaryTool

        # Alive straws algorithm
        from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTStrawCondAlg
        TRTStrawCondAlg = TRTStrawCondAlg(
            name="TRTStrawCondAlg",
            TRTStrawStatusSummaryTool=InDetTrigTRTStrawStatusSummaryTool,
            isGEANT4=self._isMC)
        # Active Fraction algorithm
        from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTActiveCondAlg
        TRTActiveCondAlg = TRTActiveCondAlg(
            name="TRTActiveCondAlg",
            TRTStrawStatusSummaryTool=InDetTrigTRTStrawStatusSummaryTool)

        # HT probability algorithm
        from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTHTCondAlg
        TRTHTCondAlg = TRTHTCondAlg(name="TRTHTCondAlg")

        from TRT_ConditionsAlgs.TRT_ConditionsAlgsConf import TRTToTCondAlg
        TRTToTCondAlg = TRTToTCondAlg(name="TRTToTCondAlg")

        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")

        # Condition algorithms for straw conditions
        if not hasattr(condSeq, "TRTStrawCondAlg"):
            condSeq += TRTStrawCondAlg
        if not hasattr(condSeq, "TRTActiveCondAlg"):
            condSeq += TRTActiveCondAlg
        # Condition algorithms for Pid
        if not hasattr(condSeq, "TRTHTCondAlg"):
            condSeq += TRTHTCondAlg

        if not hasattr(condSeq, "TRTToTCondAlg"):
            condSeq += TRTToTCondAlg

        from AthenaCommon.GlobalFlags import globalflags

        #
        # Load and Configure TRT Conditions Services
        #
        InDetTRTConditionsServices = []

        # Services which only run on raw data
        if (globalflags.InputFormat() == 'bytestream'
                and globalflags.DataSource() == 'data'):

            # Hardware Mapping Service
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_HWMappingSvc
            InDetTRT_HWMappingSvc = TRT_HWMappingSvc(
                name=self.instanceName("InDetTRT_HWMappingSvc"))
            ServiceMgr += InDetTRT_HWMappingSvc
            if self._print:
                print(InDetTRT_HWMappingSvc)

            # DCS Conditions Service
            if self.useDCS and not self.onlineMode:
                from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_DCS_ConditionsSvc
                InDetTRT_DCS_ConditionsSvc = TRT_DCS_ConditionsSvc(
                    name=self.instanceName("InDetTRT_DCS_ConditionsSvc"),
                    HWMapSvc=InDetTRT_HWMappingSvc,
                    #OutputLevel = VERBOSE,
                    EventInfoKey="ByteStreamEventInfo",
                    DoIOVChecking=True,
                    IOVmaxLength=7 * 24 * 60 * 60,
                    #FallBackOnCOOLChanName = False,
                )
                ServiceMgr += InDetTRT_DCS_ConditionsSvc
                if self._print:
                    print(InDetTRT_DCS_ConditionsSvc)
                InDetTRTConditionsServices.append(InDetTRT_DCS_ConditionsSvc)

        # TRT Conditions Summary Service
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_ConditionsSummarySvc
        InDetTRTConditionsSummaryService = TRT_ConditionsSummarySvc(
            name=self.instanceName("InDetTRTConditionsSummaryService"),
            ServiceList=InDetTRTConditionsServices,
        )
        ServiceMgr += InDetTRTConditionsSummaryService
        if self._print:
            print(InDetTRTConditionsSummaryService)
コード例 #10
0
globalflags.DataSource.set_Value_and_Lock("geant4")
#globalflags.DataSource.set_Value_and_Lock("data")


from AthenaCommon.DetFlags import DetFlags
DetFlags.TRT_setOn()
DetFlags.detdescr.TRT_setOn()

include ( "DetDescrCondAthenaPool/DetDescrCondAthenaPool_joboptions.py" )

from IOVDbSvc.CondDB import conddb

# These addFolder lines need to be outcommented if you want to dump your own sqlite db to text file.
# Dead/Noisy Straw Lists
if not conddb.folderRequested('/TRT/Cond/Status'):
    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status",className='TRTCond::StrawStatusMultChanContainer')
if not conddb.folderRequested('/TRT/Cond/StatusPermanent'):
    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent",className='TRTCond::StrawStatusMultChanContainer')
# Argon straw list
if not conddb.folderRequested('/TRT/Cond/StatusHT'):
    conddb.addFolderSplitOnline("TRT","/TRT/Onl/Cond/StatusHT","/TRT/Cond/StatusHT",className='TRTCond::StrawStatusMultChanContainer')

# Alignment folders (not dynamic)
if ((not DetFlags.simulate.SCT_on()) or (not DetFlags.simulate.pixel_on())) or (DetFlags.overlay.SCT_on() or DetFlags.overlay.pixel_on()):
    conddb.addFolderSplitOnline("INDET","/Indet/Onl/Align","/Indet/Align",className="AlignableTransformContainer")
else:
    conddb.addFolderSplitOnline("INDET","/Indet/Onl/Align","/Indet/Align")

    if (not DetFlags.simulate.TRT_on()) or DetFlags.overlay.TRT_on():
       conddb.addFolderSplitOnline("TRT","/TRT/Onl/Align","/TRT/Align",className="AlignableTransformContainer")
    else:
コード例 #11
0
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
athenaCommonFlags.PoolEvgenInput.set_Off()
athenaCommonFlags.PoolHitsOutput='MuonHits.root'
athenaCommonFlags.EvtMax=1000

#--- Simulation flags -----------------------------------------
from G4AtlasApps.SimFlags import simFlags
simFlags.load_atlas_flags()
simFlags.SimLayout.set_Value(DetDescrVersion) # specific value
#simFlags.SimLayout.set_On()                  # use the default value
#  sets the EtaPhi, VertexSpread and VertexRange checks on
simFlags.EventFilter.set_On()
#
printfunc ("Reading alignment constants from DB")
from IOVDbSvc.CondDB import conddb
conddb.addFolderSplitOnline('MUONALIGN','/MUONALIGN/Onl/MDT/BARREL','/MUONALIGN/MDT/BARREL',className='CondAttrListCollection')
conddb.addFolderSplitOnline('MUONALIGN','/MUONALIGN/Onl/MDT/ENDCAP/SIDEA','/MUONALIGN/MDT/ENDCAP/SIDEA',className='CondAttrListCollection')
conddb.addFolderSplitOnline('MUONALIGN','/MUONALIGN/Onl/MDT/ENDCAP/SIDEC','/MUONALIGN/MDT/ENDCAP/SIDEC',className='CondAttrListCollection')
conddb.addFolderSplitOnline('MUONALIGN','/MUONALIGN/Onl/TGC/SIDEA','/MUONALIGN/TGC/SIDEA',className='CondAttrListCollection')
conddb.addFolderSplitOnline('MUONALIGN','/MUONALIGN/Onl/TGC/SIDEC','/MUONALIGN/TGC/SIDEC',className='CondAttrListCollection')

from AthenaCommon.AlgSequence import AthSequencer
condSequence = AthSequencer("AthCondSeq")
from MuonCondAlg.MuonCondAlgConf import MuonAlignmentCondAlg
condSequence+=MuonAlignmentCondAlg('MuonAlignmentCondAlg')
MuonAlignmentCondAlg.ParlineFolders = ["/MUONALIGN/MDT/BARREL",
                                       "/MUONALIGN/MDT/ENDCAP/SIDEA",
                                       "/MUONALIGN/MDT/ENDCAP/SIDEC",
                                       "/MUONALIGN/TGC/SIDEA",
                                       "/MUONALIGN/TGC/SIDEC"]
コード例 #12
0
    ) + "</forceRunNumber>"

#Load Bad-Channel folder: (Should be move this elsewhere?)

#Hack following the Online/Offline split of the BadChannel database:
#Online applications read from COOLONL_LAR/COMP200, folder /LAR/BadChannels/BadChannels
#Offline applications read from COOLOFL_LAR/COMP200, folder /LAR/BadChannelsOfl/BadChannels
#But SG key(=Folder name) is expected to be the same in both cases
#Solution: Re-key the object when reading from offline DB
include(
    "LArConditionsCommon/LArIdMap_comm_jobOptions.py")  #Needed by BC cond alog
rekeyBC = "<key>/LAR/BadChannels/BadChannels</key>"
rekeyMF = "<key>/LAR/BadChannels/MissingFEBs</key>"
conddb.addFolderSplitOnline("LAR",
                            "/LAR/BadChannels/BadChannels",
                            "/LAR/BadChannelsOfl/BadChannels" + forceRN +
                            rekeyBC,
                            className="CondAttrListCollection")
from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg
condSeq += LArBadChannelCondAlg(ReadKey="/LAR/BadChannels/BadChannels")

conddb.addFolderSplitOnline("LAR",
                            "/LAR/BadChannels/MissingFEBs",
                            "/LAR/BadChannelsOfl/MissingFEBs" + forceRN +
                            rekeyMF,
                            className='AthenaAttributeList')
from LArBadChannelTool.LArBadChannelToolConf import LArBadFebCondAlg
condSeq += LArBadFebCondAlg(ReadKey="/LAR/BadChannels/MissingFEBs")

if (rec.doESD() or rec.doRDOTrigger()):
    if 'COMP200' not in conddb.GetInstance():
コード例 #13
0
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration

from IOVDbSvc.CondDB import conddb

# Inner Detector alignment
#conddb.addFolderSplitOnline("INDET","/Indet/Onl/Align","/Indet/Align")
#conddb.addFolderSplitOnline("TRT","/TRT/Onl/Align","/TRT/Align")
conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/DX", "/TRT/Calib/DX")
conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusHT",
                            "/TRT/Cond/StatusHT")
conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/Status", "/TRT/Cond/Status")
conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusPermanent",
                            "/TRT/Cond/StatusPermanent")
# Pixel module distortions
conddb.addFolderSplitOnline("INDET", "/Indet/Onl/PixelDist",
                            "/Indet/PixelDist")
# IBL stave distortions
conddb.addFolderSplitOnline("INDET", "/Indet/Onl/IBLDist", "/Indet/IBLDist")

# Adding protection against new dynamic folder scheme;
# In future we might want to add also to MC DB
# Solution below is not pretty but in response to JIRA ATLASSIM-2746

from AtlasGeoModel.InDetGMJobProperties import GeometryFlags as geoFlags
if geoFlags.useDynamicAlignFolders():
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL1/ID",
                                "/Indet/AlignL1/ID")
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL2/PIX",
                                "/Indet/AlignL2/PIX")
    conddb.addFolderSplitOnline("INDET", "/Indet/Onl/AlignL2/SCT",
                                "/Indet/AlignL2/SCT")
コード例 #14
0
DetFlags.TRT_setOn()
DetFlags.detdescr.TRT_setOn()

from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit

include("AthenaPoolCnvSvc/WriteAthenaPool_jobOptions.py")
include("RegistrationServices/RegistrationServices_jobOptions.py")
#
# --- Load necessary TRT conditions folders
#

if not conddb.folderRequested('/TRT/Calib/RT'):
    conddb.addFolderSplitOnline(
        "TRT",
        "/TRT/Onl/Calib/RT",
        "/TRT/Calib/RT",
        className='TRTCond::RtRelationMultChanContainer')

if not conddb.folderRequested('/TRT/Calib/T0'):
    conddb.addFolderSplitOnline("TRT",
                                "/TRT/Onl/Calib/T0",
                                "/TRT/Calib/T0",
                                className='TRTCond::StrawT0MultChanContainer')

if not conddb.folderRequested('/TRT/Calib/errors2d'):
    TRTErrorsFolder = conddb.addFolderSplitOnline(
        "TRT",
        "/TRT/Onl/Calib/errors2d",
        "/TRT/Calib/errors2d",
        className='TRTCond::RtRelationMultChanContainer')
コード例 #15
0
topSequence = AlgSequence()
from AthenaCommon.AlgSequence import AthSequencer

condSeq = AthSequencer("AthCondSeq")

# Set up EventInfo
if not hasattr(topSequence, "xAODMaker::EventInfoCnvAlg") and not hasattr(
        condSeq, "xAODMaker::EventInfoCnvAlg"):
    from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
    topSequence += xAODMaker__EventInfoCnvAlg()

# Set up BeamSpot
if doBeamSpot:
    if not hasattr(condSeq, "BeamSpotCondAlg"):
        conddb.addFolderSplitOnline("INDET",
                                    "/Indet/Onl/Beampos",
                                    "/Indet/Beampos",
                                    className="AthenaAttributeList")
        from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg
        condSeq += BeamSpotCondAlg("BeamSpotCondAlg")

from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags
from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags

do_runI = commonGeoFlags.Run() not in ["RUN2", "RUN3"]
if do_runI:
    sys.exit("RUN1 is not supported. Bye.")

# Set up cabling
include("InDetRecExample/InDetRecCabling.py")

# Set up Pixel conditions
コード例 #16
0
def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs):
    from Digitization.DigitizationFlags import digitizationFlags

    #################################
    # Config pixel conditions setup #
    #################################
    from IOVDbSvc.CondDB import conddb
    from AthenaCommon.AlgSequence import AthSequencer
    condSeq = AthSequencer("AthCondSeq")
    #################
    # Module status #
    #################
    useNewChargeFormat  = False

    if not hasattr(condSeq, "PixelConfigCondAlg"):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg

        IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_2016.dat"
        rodIDForSingleLink40=0
        # ITk:
        if geoFlags.isSLHC():
            IdMappingDat = "ITk_Atlas_IdMapping.dat"
            if "BrlIncl4.0_ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat"
            elif "IBrlExt4.0ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat"
            elif "BrlExt4.0_ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat"
            elif "BrlExt3.2_ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat"
        elif (geoFlags.isIBL() == False):
            IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping.dat"
        else:
            # Planar IBL
            if (geoFlags.IBLLayout() == "planar"):
                if (geoFlags.isDBM() == True):
                    IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat"
                else:
                    IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat"
            # Hybrid IBL plus DBM
            elif (geoFlags.IBLLayout() == "3D"):
                IdMappingDat="PixelCabling/Pixels_Atlas_IdMapping_Run2.dat"
        
        condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg", 
                                      UseDeadmapConditions=False,
                                      UseDCSStateConditions=False,
                                      UseDCSStatusConditions=False,
                                      UseTDAQConditions=False,
                                      UseCalibConditions=True,
                                      UseCablingConditions=False,
                                      CablingMapFileName=IdMappingDat)

    #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():
        PixelConfigCondAlg.UseCalibConditions=False
    else:
        #####################
        # Calibration Setup #
        #####################
        if not useNewChargeFormat:
            if not conddb.folderRequested("/PIXEL/PixCalib"):
                conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixCalib", "/PIXEL/PixCalib", className="CondAttrListCollection")
            if not hasattr(condSeq, 'PixelChargeCalibCondAlg'):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg
                condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib")
        else:
            if not conddb.folderRequested("/PIXEL/ChargeCalibration"):
                conddb.addFolder("PIXEL_OFL", "/PIXEL/ChargeCalibration", className="CondAttrListCollection")
            if not hasattr(condSeq, 'PixelChargeLUTCalibCondAlg'):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeLUTCalibCondAlg
                condSeq += PixelChargeLUTCalibCondAlg(name="PixelChargeLUTCalibCondAlg", ReadKey="/PIXEL/ChargeCalibration")

        #####################
        # Cabling map Setup #
        #####################
        if (conddb.dbmc=="OFLP200" and geoFlags.isIBL()==True) and not conddb.folderRequested("/PIXEL/HitDiscCnfg"):
            conddb.addFolderSplitMC("PIXEL","/PIXEL/HitDiscCnfg","/PIXEL/HitDiscCnfg", className="AthenaAttributeList")

            if not hasattr(condSeq, 'PixelHitDiscCnfgAlg'):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg
                condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg")

        if not conddb.folderRequested("/PIXEL/ReadoutSpeed"):
            conddb.addFolderSplitMC("PIXEL","/PIXEL/ReadoutSpeed","/PIXEL/ReadoutSpeed", className="AthenaAttributeList")

        if not hasattr(condSeq, 'PixelReadoutSpeedAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg
            condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg")

        if not hasattr(condSeq, 'PixelCablingCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg
            condSeq += PixelCablingCondAlg(name="PixelCablingCondAlg",
                                           MappingFile=IdMappingDat,
                                           RodIDForSingleLink40=rodIDForSingleLink40)

        if not conddb.folderRequested('/PIXEL/PixdEdx'):
            conddb.addFolder("PIXEL_OFL", "/PIXEL/PixdEdx", className="AthenaAttributeList")

        if not conddb.folderRequested("/PIXEL/PixReco"):
            conddb.addFolder("PIXEL_OFL", "/PIXEL/PixReco", className="DetCondCFloat")

        if not conddb.folderRequested("/Indet/PixelDist"):
            conddb.addFolder("INDET", "/Indet/PixelDist", className="DetCondCFloat")

        if not hasattr(condSeq, 'PixelOfflineCalibCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelOfflineCalibCondAlg
            condSeq += PixelOfflineCalibCondAlg(name="PixelOfflineCalibCondAlg", ReadKey="/PIXEL/PixReco")
            PixelOfflineCalibCondAlg.InputSource = 2

        if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
            from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup
            pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup()

        if not hasattr(condSeq, 'PixelDistortionAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDistortionAlg
            condSeq += PixelDistortionAlg(name="PixelDistortionAlg")

        if not hasattr(condSeq, 'PixeldEdxAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixeldEdxAlg
            condSeq += PixeldEdxAlg(name="PixeldEdxAlg")
            PixeldEdxAlg.ReadFromCOOL = True

        from AthenaCommon.AppMgr import ToolSvc
        if not hasattr(ToolSvc, "PixelRecoDbTool"):
            from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool
            ToolSvc += PixelRecoDbTool()
        ToolSvc.PixelRecoDbTool.InputSource = 1

    from AthenaCommon import CfgMgr
    return CfgMgr.InDet__ClusterMakerTool(name,**kwargs)
コード例 #17
0
    IOVDbSvc = Service("IOVDbSvc")
    from IOVDbSvc.CondDB import conddb

#
# --- Setup BeamSpot data
#
try:
    # If express processing, point beam spot to online folder results
    from RecExConfig.RecFlags import rec
    if (rec.doExpressProcessing()):
        conddb.addFolder('INDET_ONL',
                         '/Indet/Onl/Beampos <key>/Indet/Beampos</key>',
                         className="AthenaAttributeList")
    else:
        conddb.addFolderSplitOnline("INDET",
                                    "/Indet/Onl/Beampos",
                                    "/Indet/Beampos",
                                    className="AthenaAttributeList")

except ImportError:
    # Protection for AthSimulationBase release which does not contain RecExConfig
    conddb.addFolderSplitOnline("INDET",
                                "/Indet/Onl/Beampos",
                                "/Indet/Beampos",
                                className="AthenaAttributeList")

# Conditions sequence for Athena MT
from AthenaCommon.AlgSequence import AthSequencer
condSeq = AthSequencer("AthCondSeq")
if not hasattr(condSeq, "BeamSpotCondAlg"):
    from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg
    condSeq += BeamSpotCondAlg("BeamSpotCondAlg")
コード例 #18
0
def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs):
    from AthenaCommon.AppMgr import ServiceMgr
    from AthenaCommon.AppMgr import ToolSvc
    from IOVDbSvc.CondDB import conddb
    from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags
    from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags
    from AthenaCommon.GlobalFlags import globalflags

    ############################################################################################
    # Set up Pixel Module data (2018 condition)
    ############################################################################################
    from AthenaCommon.AlgSequence import AthSequencer
    condSeq = AthSequencer("AthCondSeq")

    #################
    # Module status #
    #################
    useNewDeadmapFormat = False
    useNewChargeFormat = False

    if not useNewDeadmapFormat:
        if not (conddb.folderRequested("/PIXEL/PixMapOverlay")
                or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/PixMapOverlay",
                                        "/PIXEL/PixMapOverlay",
                                        className='CondAttrListCollection')

    if not hasattr(condSeq, 'PixelConfigCondAlg'):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg

        PixelConfigCondAlg.UseCalibConditions = True
        PixelConfigCondAlg.UseDeadmapConditions = True
        PixelConfigCondAlg.UseDCSStateConditions = False
        PixelConfigCondAlg.UseDCSStatusConditions = False
        PixelConfigCondAlg.UseDCSHVConditions = True
        PixelConfigCondAlg.UseDCSTemperatureConditions = True
        PixelConfigCondAlg.UseTDAQConditions = False
        PixelConfigCondAlg.UseCablingConditions = False

        from AthenaCommon.BeamFlags import jobproperties
        if jobproperties.Beam.beamType == "cosmics":
            PixelConfigCondAlg.UseComTime = True
            PixelConfigCondAlg.BarrelTimeJitter = [25.0, 25.0, 25.0, 25.0]
            PixelConfigCondAlg.EndcapTimeJitter = [25.0, 25.0, 25.0]
            PixelConfigCondAlg.DBMTimeJitter = [25.0, 25.0, 25.0]
            PixelConfigCondAlg.BarrelNumberOfBCID = [8, 8, 8, 8]
            PixelConfigCondAlg.EndcapNumberOfBCID = [8, 8, 8]
            PixelConfigCondAlg.DBMNumberOfBCID = [8, 8, 8]
            PixelConfigCondAlg.BarrelTimeOffset = [100.0, 100.0, 100.0, 100.0]
            PixelConfigCondAlg.EndcapTimeOffset = [100.0, 100.0, 100.0]
            PixelConfigCondAlg.DBMTimeOffset = [100.0, 100.0, 100.0]
        else:
            PixelConfigCondAlg.UseComTime = False
            PixelConfigCondAlg.BarrelTimeJitter = [0.0, 0.0, 0.0, 0.0]
            PixelConfigCondAlg.EndcapTimeJitter = [0.0, 0.0, 0.0]
            PixelConfigCondAlg.DBMTimeJitter = [0.0, 0.0, 0.0]
            PixelConfigCondAlg.BarrelNumberOfBCID = [1, 1, 1, 1]
            PixelConfigCondAlg.EndcapNumberOfBCID = [1, 1, 1]
            PixelConfigCondAlg.DBMNumberOfBCID = [1, 1, 1]
            PixelConfigCondAlg.BarrelTimeOffset = [5.0, 5.0, 5.0, 5.0]
            PixelConfigCondAlg.EndcapTimeOffset = [5.0, 5.0, 5.0]
            PixelConfigCondAlg.DBMTimeOffset = [5.0, 5.0, 5.0]

        PixelConfigCondAlg.BunchSpace = 25.0
        PixelConfigCondAlg.FEI4BarrelHitDiscConfig = [2]

        #====================================================================================
        # Run-dependent SIMULATION(digitization) parameters:
        #====================================================================================
        # RUN2 2015/2016
        PixelConfigCondAlg.BarrelToTThreshold2016 = [-1, 5, 5, 5]
        PixelConfigCondAlg.FEI3BarrelLatency2016 = [0, 151, 256, 256]
        PixelConfigCondAlg.FEI3BarrelHitDuplication2016 = [
            False, False, False, False
        ]
        PixelConfigCondAlg.FEI3BarrelSmallHitToT2016 = [-1, -1, -1, -1]
        PixelConfigCondAlg.FEI3BarrelTimingSimTune2016 = [-1, 2015, 2015, 2015]
        PixelConfigCondAlg.BarrelCrossTalk2016 = [0.30, 0.06, 0.06, 0.06]
        PixelConfigCondAlg.BarrelNoiseOccupancy2016 = [5e-8, 5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.BarrelDisableProbability2016 = [
            9e-3, 9e-3, 9e-3, 9e-3
        ]

        PixelConfigCondAlg.EndcapToTThreshold2016 = [5, 5, 5]
        PixelConfigCondAlg.FEI3EndcapLatency2016 = [256, 256, 256]
        PixelConfigCondAlg.FEI3EndcapHitDuplication2016 = [False, False, False]
        PixelConfigCondAlg.FEI3EndcapSmallHitToT2016 = [-1, -1, -1]
        PixelConfigCondAlg.FEI3EndcapTimingSimTune2016 = [2015, 2015, 2015]
        PixelConfigCondAlg.EndcapCrossTalk2016 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.EndcapNoiseOccupancy2016 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.EndcapDisableProbability2016 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.DBMToTThreshold2016 = [-1, -1, -1]
        PixelConfigCondAlg.DBMCrossTalk2016 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.DBMNoiseOccupancy2016 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.DBMDisableProbability2016 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.IBLNoiseShape2016 = [
            0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
        ]
        PixelConfigCondAlg.BLayerNoiseShape2016 = [
            0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0
        ]
        PixelConfigCondAlg.PixelNoiseShape2016 = [
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949,
            0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0
        ]
        # Layer-2 noise shape                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2129, 0.4016, 0.5477, 0.6599, 0.7435, 0.8160, 0.8779, 0.9340, 0.9798, 1.0]

        # So far, Gaudi::Property does not support 2D vector.
        #PixelConfigCondAlg.EndcapNoiseShape=[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1748, 0.3409, 0.4760, 0.5850, 0.6754, 0.7538, 0.8264, 0.8962, 0.9655, 1.0],
        #                                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1852, 0.3528, 0.4881, 0.5961, 0.6855, 0.7640, 0.8374, 0.9068, 0.9749, 1.0],
        #                                     [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1735, 0.3380, 0.4733, 0.5829, 0.6730, 0.7516, 0.8234, 0.8916, 0.9595, 1.0]]

        #====================================================================================
        # RUN2 2017
        PixelConfigCondAlg.BarrelToTThreshold2017 = [-1, 5, 5, 5]
        PixelConfigCondAlg.FEI3BarrelLatency2017 = [0, 151, 256, 256]
        PixelConfigCondAlg.FEI3BarrelHitDuplication2017 = [
            False, False, False, False
        ]
        PixelConfigCondAlg.FEI3BarrelSmallHitToT2017 = [-1, -1, -1, -1]
        PixelConfigCondAlg.FEI3BarrelTimingSimTune2017 = [-1, 2018, 2018, 2018]
        PixelConfigCondAlg.BarrelCrossTalk2017 = [0.30, 0.06, 0.06, 0.06]
        PixelConfigCondAlg.BarrelNoiseOccupancy2017 = [5e-8, 5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.BarrelDisableProbability2017 = [
            9e-3, 9e-3, 9e-3, 9e-3
        ]

        PixelConfigCondAlg.EndcapToTThreshold2017 = [5, 5, 5]
        PixelConfigCondAlg.FEI3EndcapLatency2017 = [256, 256, 256]
        PixelConfigCondAlg.FEI3EndcapHitDuplication2017 = [False, False, False]
        PixelConfigCondAlg.FEI3EndcapSmallHitToT2017 = [-1, -1, -1]
        PixelConfigCondAlg.FEI3EndcapTimingSimTune2017 = [2018, 2018, 2018]
        PixelConfigCondAlg.EndcapCrossTalk2017 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.EndcapNoiseOccupancy2017 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.EndcapDisableProbability2017 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.DBMToTThreshold2017 = [-1, -1, -1]
        PixelConfigCondAlg.DBMCrossTalk2017 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.DBMNoiseOccupancy2017 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.DBMDisableProbability2017 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.IBLNoiseShape2017 = [
            0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
        ]
        PixelConfigCondAlg.BLayerNoiseShape2017 = [
            0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0
        ]
        PixelConfigCondAlg.PixelNoiseShape2017 = [
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949,
            0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0
        ]

        #====================================================================================
        # RUN2 2018
        PixelConfigCondAlg.BarrelToTThreshold2018 = [-1, 3, 5, 5]
        PixelConfigCondAlg.FEI3BarrelLatency2018 = [0, 151, 256, 256]
        PixelConfigCondAlg.FEI3BarrelHitDuplication2018 = [
            False, False, False, False
        ]
        PixelConfigCondAlg.FEI3BarrelSmallHitToT2018 = [-1, -1, -1, -1]
        PixelConfigCondAlg.FEI3BarrelTimingSimTune2018 = [-1, 2018, 2018, 2018]
        PixelConfigCondAlg.BarrelCrossTalk2018 = [0.30, 0.06, 0.06, 0.06]
        PixelConfigCondAlg.BarrelNoiseOccupancy2018 = [5e-8, 5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.BarrelDisableProbability2018 = [
            9e-3, 9e-3, 9e-3, 9e-3
        ]

        PixelConfigCondAlg.EndcapToTThreshold2018 = [5, 5, 5]
        PixelConfigCondAlg.FEI3EndcapLatency2018 = [256, 256, 256]
        PixelConfigCondAlg.FEI3EndcapHitDuplication2018 = [False, False, False]
        PixelConfigCondAlg.FEI3EndcapSmallHitToT2018 = [-1, -1, -1]
        PixelConfigCondAlg.FEI3EndcapTimingSimTune2018 = [2018, 2018, 2018]
        PixelConfigCondAlg.EndcapCrossTalk2018 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.EndcapNoiseOccupancy2018 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.EndcapDisableProbability2018 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.DBMToTThreshold2018 = [-1, -1, -1]
        PixelConfigCondAlg.DBMCrossTalk2018 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.DBMNoiseOccupancy2018 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.DBMDisableProbability2018 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.IBLNoiseShape2018 = [
            0.0, 0.0330, 0.0, 0.3026, 0.5019, 0.6760, 0.8412, 0.9918, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
        ]
        PixelConfigCondAlg.BLayerNoiseShape2018 = [
            0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0
        ]
        PixelConfigCondAlg.PixelNoiseShape2018 = [
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949,
            0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0
        ]

        #====================================================================================
        # RUN1
        PixelConfigCondAlg.BarrelToTThresholdRUN1 = [3, 3, 3]
        PixelConfigCondAlg.FEI3BarrelLatencyRUN1 = [256, 256, 256]
        PixelConfigCondAlg.FEI3BarrelHitDuplicationRUN1 = [True, True, True]
        PixelConfigCondAlg.FEI3BarrelSmallHitToTRUN1 = [7, 7, 7]
        PixelConfigCondAlg.FEI3BarrelTimingSimTuneRUN1 = [2009, 2009, 2009]
        PixelConfigCondAlg.BarrelCrossTalkRUN1 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.BarrelNoiseOccupancyRUN1 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.BarrelDisableProbabilityRUN1 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.EndcapToTThresholdRUN1 = [3, 3, 3]
        PixelConfigCondAlg.FEI3EndcapLatencyRUN1 = [256, 256, 256]
        PixelConfigCondAlg.FEI3EndcapHitDuplicationRUN1 = [True, True, True]
        PixelConfigCondAlg.FEI3EndcapSmallHitToTRUN1 = [7, 7, 7]
        PixelConfigCondAlg.FEI3EndcapTimingSimTuneRUN1 = [2009, 2009, 2009]
        PixelConfigCondAlg.EndcapCrossTalkRUN1 = [0.06, 0.06, 0.06]
        PixelConfigCondAlg.EndcapNoiseOccupancyRUN1 = [5e-8, 5e-8, 5e-8]
        PixelConfigCondAlg.EndcapDisableProbabilityRUN1 = [9e-3, 9e-3, 9e-3]

        PixelConfigCondAlg.BLayerNoiseShapeRUN1 = [
            0.0, 0.0, 0.0, 0.0, 0.2204, 0.5311, 0.7493, 0.8954, 0.9980, 1.0
        ]
        PixelConfigCondAlg.PixelNoiseShapeRUN1 = [
            0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.2418, 0.4397, 0.5858, 0.6949,
            0.7737, 0.8414, 0.8959, 0.9414, 0.9828, 1.0
        ]

        #====================================================================================
        # ITK
        PixelConfigCondAlg.BarrelToTThresholdITK = [3, 3, 3, 3, 3]
        PixelConfigCondAlg.BarrelCrossTalkITK = [0.06, 0.06, 0.06, 0.06, 0.06]
        PixelConfigCondAlg.BarrelNoiseOccupancyITK = [
            5e-8, 5e-8, 5e-8, 5e-8, 5e-8
        ]
        PixelConfigCondAlg.BarrelDisableProbabilityITK = [
            9e-3, 9e-3, 9e-3, 9e-3, 9e-3
        ]

        PixelConfigCondAlg.EndcapToTThresholdITK = [
            3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
        ]
        PixelConfigCondAlg.EndcapCrossTalkITK = [
            0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06, 0.06,
            0.06, 0.06, 0.06
        ]
        PixelConfigCondAlg.EndcapNoiseOccupancyITK = [
            5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8, 5e-8,
            5e-8, 5e-8, 5e-8
        ]
        PixelConfigCondAlg.EndcapDisableProbabilityITK = [
            9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3, 9e-3,
            9e-3, 9e-3, 9e-3
        ]

        PixelConfigCondAlg.InnermostNoiseShapeITK = [0.0, 1.0]
        PixelConfigCondAlg.NextInnermostNoiseShapeITK = [0.0, 1.0]
        PixelConfigCondAlg.PixelNoiseShapeITK = [0.0, 1.0]

        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_2016.dat"

        # ITk:
        if geoFlags.isSLHC():
            IdMappingDat = "ITk_Atlas_IdMapping.dat"
            if "BrlIncl4.0_ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat"
            elif "IBrlExt4.0ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat"
            elif "BrlExt4.0_ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat"
            elif "BrlExt3.2_ref" == commonGeoFlags.GeoType():
                IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat"
        elif not geoFlags.isIBL():
            IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping.dat"
        else:
            # Planar IBL
            if (geoFlags.IBLLayout() == "planar"):
                if geoFlags.isDBM():
                    IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat"
                else:
                    IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat"
            # Hybrid IBL plus DBM
            elif (geoFlags.IBLLayout() == "3D"):
                IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_Run2.dat"

        PixelConfigCondAlg.CablingMapFileName = IdMappingDat

        condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg")

    ############################################################################################
    # Set up Conditions DB
    ############################################################################################
    if useNewDeadmapFormat:
        if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"):
            conddb.addFolder("PIXEL_OFL",
                             "/PIXEL/PixelModuleFeMask",
                             className="CondAttrListCollection")
        if not hasattr(condSeq, "PixelDeadMapCondAlg"):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg
            condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg")

    if not hasattr(condSeq, "PixelDCSCondStateAlg"):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg
        condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg",
                                        ReadKeyState='')

    if not hasattr(condSeq, "PixelDCSCondStatusAlg"):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStatusAlg
        condSeq += PixelDCSCondStatusAlg(name="PixelDCSCondStatusAlg",
                                         ReadKeyStatus='')

    if not conddb.folderRequested("/PIXEL/DCS/HV"):
        conddb.addFolder("DCS_OFL",
                         "/PIXEL/DCS/HV",
                         className="CondAttrListCollection")

    if not hasattr(condSeq, "PixelDCSCondHVAlg"):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg
        condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg")

    if not conddb.folderRequested("/PIXEL/DCS/TEMPERATURE"):
        conddb.addFolder("DCS_OFL",
                         "/PIXEL/DCS/TEMPERATURE",
                         className="CondAttrListCollection")

    if not hasattr(condSeq, "PixelDCSCondTempAlg"):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg
        condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg")

    #####################
    # Calibration Setup #
    #####################
    if not useNewChargeFormat:
        if not conddb.folderRequested("/PIXEL/PixCalib"):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/PixCalib",
                                        "/PIXEL/PixCalib",
                                        className="CondAttrListCollection")
        if not hasattr(condSeq, 'PixelChargeCalibCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg
            condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg",
                                               ReadKey="/PIXEL/PixCalib")
    else:
        if not conddb.folderRequested("/PIXEL/ChargeCalibration"):
            conddb.addFolder("PIXEL_OFL",
                             "/PIXEL/ChargeCalibration",
                             className="CondAttrListCollection")
        if not hasattr(condSeq, 'PixelChargeLUTCalibCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeLUTCalibCondAlg
            condSeq += PixelChargeLUTCalibCondAlg(
                name="PixelChargeLUTCalibCondAlg",
                ReadKey="/PIXEL/ChargeCalibration")

    #####################
    # Cabling map Setup #
    #####################
    if geoFlags.isIBL() and not conddb.folderRequested("/PIXEL/HitDiscCnfg"):
        conddb.addFolderSplitMC("PIXEL",
                                "/PIXEL/HitDiscCnfg",
                                "/PIXEL/HitDiscCnfg",
                                className="AthenaAttributeList")

    if geoFlags.isIBL() and not hasattr(condSeq, 'PixelHitDiscCnfgAlg'):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg
        condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg")

    if not conddb.folderRequested("/PIXEL/ReadoutSpeed"):
        conddb.addFolderSplitMC("PIXEL",
                                "/PIXEL/ReadoutSpeed",
                                "/PIXEL/ReadoutSpeed",
                                className="AthenaAttributeList")

    if not hasattr(condSeq, 'PixelReadoutSpeedAlg'):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg
        condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg")

    pixelReadKey = ''
    if (globalflags.DataSource == 'data'
            and conddb.dbdata == 'CONDBR2'):  # for data overlay
        if not conddb.folderRequested("/PIXEL/CablingMap"):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/CablingMap",
                                        "/PIXEL/CablingMap",
                                        className="AthenaAttributeList")

    if not hasattr(condSeq, 'PixelCablingCondAlg'):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg
        condSeq += PixelCablingCondAlg(
            name="PixelCablingCondAlg",
            ReadKey=pixelReadKey,
            MappingFile=IdMappingDat,
            RodIDForSingleLink40=0,
            RecordInInitialize=not globalflags.isOverlay())

    if not conddb.folderRequested("/PIXEL/PixReco"):
        conddb.addFolder("PIXEL_OFL",
                         "/PIXEL/PixReco",
                         className="DetCondCFloat")

    if not hasattr(condSeq, 'PixelOfflineCalibCondAlg'):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelOfflineCalibCondAlg
        condSeq += PixelOfflineCalibCondAlg(name="PixelOfflineCalibCondAlg",
                                            ReadKey="/PIXEL/PixReco")
        PixelOfflineCalibCondAlg.InputSource = 2

    if not conddb.folderRequested("/Indet/PixelDist"):
        conddb.addFolder("INDET",
                         "/Indet/PixelDist",
                         className="DetCondCFloat")

    if not hasattr(condSeq, 'PixelDistortionAlg'):
        from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDistortionAlg
        condSeq += PixelDistortionAlg(name="PixelDistortionAlg",
                                      ReadKey="/Indet/PixelDist")

    #######################
    # Setup Lorentz angle #
    #######################
    if not hasattr(condSeq, "PixelSiPropertiesCondAlg"):
        from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
        condSeq += PixelSiPropertiesCondAlg(name="PixelSiPropertiesCondAlg")

    if not hasattr(ToolSvc, "PixelSiPropertiesTool"):
        from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
        ToolSvc += SiPropertiesTool(name="PixelSiPropertiesTool",
                                    DetectorName="Pixel",
                                    ReadKey="PixelSiliconPropertiesVector")

    if not hasattr(condSeq, "PixelSiLorentzAngleCondAlg"):
        from SiLorentzAngleTool.SiLorentzAngleToolConf import PixelSiLorentzAngleCondAlg
        condSeq += PixelSiLorentzAngleCondAlg(
            name="PixelSiLorentzAngleCondAlg",
            SiPropertiesTool=ToolSvc.PixelSiPropertiesTool,
            UseMagFieldCache=True,
            UseMagFieldDcs=True)

    if not hasattr(ToolSvc, "PixelLorentzAngleTool"):
        from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
        ToolSvc += SiLorentzAngleTool(
            name="PixelLorentzAngleTool",
            DetectorName="Pixel",
            UseMagFieldCache=True,
            SiLorentzAngleCondData="PixelSiLorentzAngleCondData")


############################################################################################
# Set up Tool/Service
############################################################################################

#####################
# Setup Cabling Svc #
#####################
    from PixelCabling.PixelCablingConf import PixelCablingSvc
    PixelCablingSvc = PixelCablingSvc()
    ServiceMgr += PixelCablingSvc
    print(PixelCablingSvc)
    kwargs.setdefault("InputObjectName", "PixelHits")

    chargeTools = []
    feSimTools = []
    if geoFlags.isSLHC():
        chargeTools += ['SensorSimPlanarTool']
        feSimTools += ['BarrelRD53SimTool']
        feSimTools += ['EndcapRD53SimTool']
    else:
        chargeTools += ['SensorSimPlanarTool']
        chargeTools += ['SensorSim3DTool']
        feSimTools += ['BarrelFEI4SimTool']
        feSimTools += ['DBMFEI4SimTool']
        feSimTools += ['BarrelFEI3SimTool']
        feSimTools += ['EndcapFEI3SimTool']
    kwargs.setdefault("ChargeTools", chargeTools)
    kwargs.setdefault("FrontEndSimTools", feSimTools)
    kwargs.setdefault("EnergyDepositionTool", "EnergyDepositionTool")
    if digitizationFlags.doXingByXingPileUp():  # PileUpTool approach
        kwargs.setdefault("FirstXing", Pixel_FirstXing())
        kwargs.setdefault("LastXing", Pixel_LastXing())
    return CfgMgr.PixelDigitizationTool(name, **kwargs)
コード例 #19
0
def setupMdtCondDB():

    global mdt_folder_name_appendix
    from IOVDbSvc.CondDB import conddb

    if mdtCalibFlags.mdtCalibrationSource() == "MDT":
        if not conddb.folderRequested(
                '/MDT/Onl/RT' + mdt_folder_name_appendix
        ) and not conddb.folderRequested('/MDT/RT' + mdt_folder_name_appendix):
            conddb.addFolderSplitOnline("MDT",
                                        '/MDT/Onl/RT' +
                                        mdt_folder_name_appendix,
                                        '/MDT/RT' + mdt_folder_name_appendix,
                                        className='CondAttrListCollection')
        if not conddb.folderRequested(
                '/MDT/Onl/T0' + mdt_folder_name_appendix
        ) and not conddb.folderRequested('/MDT/T0' + mdt_folder_name_appendix):
            conddb.addFolderSplitOnline("MDT",
                                        '/MDT/Onl/T0' +
                                        mdt_folder_name_appendix,
                                        '/MDT/T0' + mdt_folder_name_appendix,
                                        className='CondAttrListCollection')
    else:
        from AthenaCommon.AppMgr import ServiceMgr
        ServiceMgr.TagInfoMgr.ExtraTagValuePairs.update(
            {"MDTCalibrationSource": mdtCalibFlags.mdtCalibrationSource()})
        if not conddb.folderRequested(
                '/MDT/Onl/RT' + mdt_folder_name_appendix
        ) and not conddb.folderRequested('/MDT/RT' + mdt_folder_name_appendix):
            specialAddFolderSplitOnline(
                mdtCalibFlags.mdtCalibrationSource(),
                '/MDT/Onl/RT' + mdt_folder_name_appendix,
                '/MDT/RT' + mdt_folder_name_appendix)
        if not conddb.folderRequested(
                '/MDT/Onl/T0' + mdt_folder_name_appendix
        ) and not conddb.folderRequested('/MDT/T0' + mdt_folder_name_appendix):
            specialAddFolderSplitOnline(
                mdtCalibFlags.mdtCalibrationSource(),
                '/MDT/Onl/T0' + mdt_folder_name_appendix,
                '/MDT/T0' + mdt_folder_name_appendix)

    from AthenaCommon.AlgSequence import AthSequencer
    from MuonCondAlg.MuonCondAlgConf import MdtCalibDbAlg
    condSequence = AthSequencer("AthCondSeq")
    if not hasattr(condSequence, "MdtCalibDbAlg"):
        condSequence += MdtCalibDbAlg("MdtCalibDbAlg")

    if conddb.isOnline and not conddb.isMC:
        MdtCalibDbAlg.TubeFolder = "/MDT/T0"
        MdtCalibDbAlg.RtFolder = "/MDT/RT"
        MdtCalibDbAlg.ReadKeyTube = "/MDT/T0"
        MdtCalibDbAlg.ReadKeyRt = "/MDT/RT"
    else:
        MdtCalibDbAlg.TubeFolder = "/MDT/T0" + mdt_folder_name_appendix
        MdtCalibDbAlg.RtFolder = "/MDT/RT" + mdt_folder_name_appendix
        MdtCalibDbAlg.ReadKeyTube = "/MDT/T0" + mdt_folder_name_appendix
        MdtCalibDbAlg.ReadKeyRt = "/MDT/RT" + mdt_folder_name_appendix
    MdtCalibDbAlg.RT_InputFiles = ["Muon_RT_default.data"]
    if globalflags.DataSource == 'data':
        MdtCalibDbAlg.defaultT0 = 40
    elif globalflags.DataSource == 'geant4':
        MdtCalibDbAlg.defaultT0 = 799
    MdtCalibDbAlg.UseMLRt = mdtCalibFlags.useMLRt()
    MdtCalibDbAlg.TimeSlewingCorrection = mdtCalibFlags.correctMdtRtForTimeSlewing(
    )
    MdtCalibDbAlg.MeanCorrectionVsR = [
        -5.45973, -4.57559, -3.71995, -3.45051, -3.4505, -3.4834, -3.59509,
        -3.74869, -3.92066, -4.10799, -4.35237, -4.61329, -4.84111, -5.14524
    ]
    MdtCalibDbAlg.PropagationSpeedBeta = mdtCalibFlags.mdtPropagationSpeedBeta(
    )
    # the same as MdtCalibrationDbTool
    MdtCalibDbAlg.CreateBFieldFunctions = mdtCalibFlags.correctMdtRtForBField()
    MdtCalibDbAlg.CreateWireSagFunctions = mdtCalibFlags.correctMdtRtWireSag()
    MdtCalibDbAlg.CreateSlewingFunctions = mdtCalibFlags.correctMdtRtForTimeSlewing(
    )

    from MdtCalibSvc.MdtCalibSvcConf import MdtCalibrationTool
    MdtCalibrationTool.DoSlewingCorrection = mdtCalibFlags.correctMdtRtForTimeSlewing(
    )
    # Hack to use DoTemperatureCorrection for applyRtScaling; but applyRtScaling should not be used anyway, since MLRT can be used
    MdtCalibrationTool.DoTemperatureCorrection = mdtCalibFlags.applyRtScaling()
    MdtCalibrationTool.DoWireSagCorrection = mdtCalibFlags.correctMdtRtWireSag(
    )
    # for collisions cut away hits that are far outside of the MDT time window
    if beamFlags.beamType() == 'collisions':
        MdtCalibrationTool.DoTofCorrection = True
        if globalflags.DataSource() == 'geant4':
            MdtCalibrationTool.TimeWindowSetting = mdtCalibWindowNumber(
                'Collision_G4')
        elif globalflags.DataSource() == 'data':
            MdtCalibrationTool.TimeWindowSetting = mdtCalibWindowNumber(
                'Collision_G4')
    else:  # cosmics or single beam
        MdtCalibrationTool.DoTofCorrection = False

    from MdtCalibSvc.MdtCalibSvcConf import MdtCalibrationDbTool
    MdtCalibrationDbTool.CreateBFieldFunctions = mdtCalibFlags.correctMdtRtForBField(
    )
    MdtCalibrationDbTool.CreateWireSagFunctions = mdtCalibFlags.correctMdtRtWireSag(
    )
    MdtCalibrationDbTool.CreateSlewingFunctions = mdtCalibFlags.correctMdtRtForTimeSlewing(
    )
def getALFA_DetectorTool(name="ALFA_DetectorTool"):
    #conddb.addFolder("FWD_OFL","/FWD/ALFA/position_calibration")
    conddb.addFolderSplitOnline('FWD', '/FWD/Onl/ALFA/position_calibration',
                                '/FWD/ALFA/position_calibration')

    #instatiate the tool
    theALFA_DetectorTool = ALFA_DetectorTool(name)
    theALFA_DetectorTool.MetrologyType = 1

    #set 1 for nominal fiber positions or 2 for position by metrology
    theALFA_DetectorTool.B7L1U_MDGeometryType = 2
    theALFA_DetectorTool.B7L1U_ODGeometryType = 2
    theALFA_DetectorTool.B7L1L_MDGeometryType = 2
    theALFA_DetectorTool.B7L1L_ODGeometryType = 2
    theALFA_DetectorTool.A7L1U_MDGeometryType = 2
    theALFA_DetectorTool.A7L1U_ODGeometryType = 2
    theALFA_DetectorTool.A7L1L_MDGeometryType = 2
    theALFA_DetectorTool.A7L1L_ODGeometryType = 2
    theALFA_DetectorTool.A7R1U_MDGeometryType = 2
    theALFA_DetectorTool.A7R1U_ODGeometryType = 2
    theALFA_DetectorTool.A7R1L_MDGeometryType = 2
    theALFA_DetectorTool.A7R1L_ODGeometryType = 2
    theALFA_DetectorTool.B7R1U_MDGeometryType = 2
    theALFA_DetectorTool.B7R1U_ODGeometryType = 2
    theALFA_DetectorTool.B7R1L_MDGeometryType = 2
    theALFA_DetectorTool.B7R1L_ODGeometryType = 2

    # --------- Transformations -----------------------------------------------------------------------

    # transformations in the detector and/or in the station
    # if yes True, else False                  [B7L1U, B7L1L, A7L1U, A7L1L, A7R1U, A7R1L, B7R1U, B7R1L]
    theALFA_DetectorTool.bIsTransformInDetector = [
        False, False, True, False, False, False, False, False
    ]
    theALFA_DetectorTool.bIsTransformInStation = [
        False, False, True, False, False, False, False, False
    ]

    # rotation point for the transformations in the detector
    # point(x,y,z)[mm] - with respect to the RPPin1
    theALFA_DetectorTool.pointTransformInDetectorB7L1U = [0.0, 0.0, 0.0]
    theALFA_DetectorTool.pointTransformInDetectorB7L1L = [0.0, 0.0, 0.0]
    theALFA_DetectorTool.pointTransformInDetectorA7L1U = [-77.5, -170.2, 114.0]
    theALFA_DetectorTool.pointTransformInDetectorA7L1L = [0.0, 0.0, 0.0]
    theALFA_DetectorTool.pointTransformInDetectorA7R1U = [0.0, 0.0, 0.0]
    theALFA_DetectorTool.pointTransformInDetectorA7R1L = [0.0, 0.0, 0.0]
    theALFA_DetectorTool.pointTransformInDetectorB7R1U = [0.0, 0.0, 0.0]
    theALFA_DetectorTool.pointTransformInDetectorB7R1L = [0.0, 0.0, 0.0]

    # transformation parametres for the transformations in the detector
    # angle[rad], vecRotation(x,y,z), vecTranslation(x,y,z)[mm]
    theALFA_DetectorTool.vecTransformInDetectorB7L1U = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInDetectorB7L1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInDetectorA7L1U = [
        0.009, 0.0, 0.0, 1.0, 0.1, -0.3, 0.2
    ]
    theALFA_DetectorTool.vecTransformInDetectorA7L1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInDetectorA7R1U = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInDetectorA7R1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInDetectorB7R1U = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInDetectorB7R1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]

    # transformation parametres for the transformations in the station
    # angle[rad], vecRotation(x,y,z), vecTranslation(x,y,z)[mm]
    theALFA_DetectorTool.vecTransformInStationB7L1U = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInStationB7L1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInStationA7L1U = [
        0.0, 0.0, 0.0, 0.0, 1.0, -2.0, 5.0
    ]
    theALFA_DetectorTool.vecTransformInStationA7L1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInStationA7R1U = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInStationA7R1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInStationB7R1U = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]
    theALFA_DetectorTool.vecTransformInStationB7R1L = [
        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
    ]

    return theALFA_DetectorTool
コード例 #21
0
    def createSvc(self):
        from AthenaCommon.AppMgr import ToolSvc, ServiceMgr, theApp
        from IOVDbSvc.CondDB import conddb

        from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc as pixSummarySvc
        PixelConditionsSummarySvc = \
            pixSummarySvc(name=self.instanceName('PixelConditionsSummarySvc'),
                          UseDCS = self.useDCS,
                          UseByteStream=self.useBS,
                          #UseSpecialPixelMap= not self.onlineMode,
                          UseSpecialPixelMap=True,
                          UseTDAQ=self.useTDAQ
                          )
        #active states used by dcs (if on)
        if self.useDCS and not self.onlineMode:
            PixelConditionsSummarySvc.IsActiveStates = ['READY', 'ON']
            PixelConditionsSummarySvc.IsActiveStatus = ['OK', 'WARNING']

        ServiceMgr += PixelConditionsSummarySvc

        if self._print: print PixelConditionsSummarySvc

        # #create another instance of the PixelConditionsSummarySvc w/o BS
        # #   service to be used with RegionSelector
        # InDetTrigRSPixelConditionsSummarySvc = pixSummarySvc(name='InDetTrigRSPixelConditionsSummarySvc',
        #                                                      UseDCS = self.useDCS,
        #                                                      UseByteStream=self.useBS
        #                                                      UseSpecialPixelMap= True,
        #                                                      )
        # ServiceMgr += InDetTrigRSPixelConditionsSummarySvc
        # if self._print: print InDetTrigRSPixelConditionsSummarySvc

        if not self.onlineMode:
            from PixelConditionsServices.PixelConditionsServicesConf import PixelCalibSvc
            PixelCalibSvc = PixelCalibSvc(
                name=self.instanceName('PixelCalibSvc'))

            if not conddb.folderRequested("/PIXEL/PixCalib"):
                conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib")

            if self._print: print PixelCalibSvc

            #only when inputsource=1
            #if not conddb.folderRequested("/PIXEL/PixReco"):
            #  conddb.addFolder("PIXEL_OFL","/PIXEL/PixReco")

        if not conddb.folderRequested("/PIXEL/PixReco"):
            conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixReco",
                                        "/PIXEL/PixReco")

        #Configure PixelRecoDbTool
        from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool
        PixelRecoDbTool = PixelRecoDbTool(
            name=self.instanceName('PixelRecoDbTool'))
        ToolSvc += PixelRecoDbTool
        PixelRecoDbTool.InputSource = 2
        # if self.onlineMode:
        #   PixelRecoDbTool.InputSource = 1      #after change of run1 conditions
        # else:
        #   PixelRecoDbTool.InputSource = 2

        if self._print: print PixelRecoDbTool

        #use corresponding PixelRecoDBTool
        from PixelConditionsServices.PixelConditionsServicesConf import PixelOfflineCalibSvc
        PixelOfflineCalibSvc = PixelOfflineCalibSvc(
            self.instanceName('PixelOfflineCalibSvc'))
        PixelOfflineCalibSvc.PixelRecoDbTool = PixelRecoDbTool
        ServiceMgr += PixelOfflineCalibSvc

        if self._print: print PixelOfflineCalibSvc

        ### configure the special pixel map service
        if not (conddb.folderRequested("/PIXEL/PixMapShort")
                or conddb.folderRequested("/PIXEL/Onl/PixMapShort")):
            conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixMapShort",
                                        "/PIXEL/PixMapShort")
        if not (conddb.folderRequested("/PIXEL/PixMapLong")
                or conddb.folderRequested("/PIXEL/Onl/PixMapLong")):
            conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixMapLong",
                                        "/PIXEL/PixMapLong")
        if not (conddb.folderRequested("/PIXEL/NoiseMapShort")
                or conddb.folderRequested("/PIXEL/Onl/NoiseMapShort")):
            conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/NoiseMapShort",
                                        "/PIXEL/NoiseMapShort")
        if not (conddb.folderRequested("/PIXEL/NoiseMapLong")
                or conddb.folderRequested("/PIXEL/Onl/NoiseMapLong")):
            conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/NoiseMapLong",
                                        "/PIXEL/NoiseMapLong")
        if not (conddb.folderRequested("/PIXEL/PixMapOverlay")
                or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")):
            conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixMapOverlay",
                                        "/PIXEL/PixMapOverlay")

        from PixelConditionsServices.PixelConditionsServicesConf import SpecialPixelMapSvc

        SpecialPixelMapSvc = SpecialPixelMapSvc(name='SpecialPixelMapSvc')
        ServiceMgr += SpecialPixelMapSvc

        SpecialPixelMapSvc.DBFolders = [
            "/PIXEL/PixMapShort", "/PIXEL/PixMapLong"
        ]
        SpecialPixelMapSvc.SpecialPixelMapKeys = [
            "SpecialPixelMap", "SpecialPixelMapLong"
        ]

        SpecialPixelMapSvc.DBFolders += [
            "/PIXEL/NoiseMapShort", "/PIXEL/NoiseMapLong"
        ]
        SpecialPixelMapSvc.SpecialPixelMapKeys += [
            "NoiseMapShort", "NoiseMapLong"
        ]

        SpecialPixelMapSvc.OverlayKey = "PixMapOverlay"
        SpecialPixelMapSvc.OverlayFolder = "/PIXEL/PixMapOverlay"

        ServiceMgr += SpecialPixelMapSvc
        #theApp.CreateSvc += [ 'SpecialPixelMapSvc/%s' % self.instanceName('SpecialPixelMapSvc') ]

        if self._print: print SpecialPixelMapSvc

        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        from AthenaCommon.GlobalFlags import globalflags
        if self.useDCS or self.onlineMode:
            #sim
            if globalflags.DataSource() == 'geant4' or (
                    not athenaCommonFlags.isOnline()):
                if not conddb.folderRequested('/PIXEL/DCS/TEMPERATURE'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/TEMPERATURE")
                if not conddb.folderRequested('/PIXEL/DCS/HV'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/HV")
                if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATUS")
                if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'):
                    conddb.addFolder("DCS_OFL", "/PIXEL/DCS/FSMSTATE")
            else:
                if not conddb.folderRequested('/PIXEL/HLT/DCS/TEMPERATURE'):
                    conddb.addFolder("PIXEL_ONL", "/PIXEL/HLT/DCS/TEMPERATURE")
                    #conddb.addFolder("PIXEL","/PIXEL/HLT/DCS/TEMPERATURE <tag>PixDCSTemp-UPD1-00</tag>")
                if not conddb.folderRequested('/PIXEL/HLT/DCS/HV'):
                    conddb.addFolder("PIXEL_ONL", "/PIXEL/HLT/DCS/HV")
                    #conddb.addFolder("PIXEL","/PIXEL/HLT/DCS/HV <tag>PixDCSHV-UPD1-00</tag>")

            from PixelConditionsServices.PixelConditionsServicesConf import PixelDCSSvc
            InDetPixelDCSSvc = PixelDCSSvc(
                name='TrigPixelDCSSvc',
                RegisterCallback=True,
                TemperatureFolder="/PIXEL/DCS/TEMPERATURE",
                HVFolder="/PIXEL/DCS/HV",
                FSMStatusFolder="/PIXEL/DCS/FSMSTATUS",
                FSMStateFolder="/PIXEL/DCS/FSMSTATE",
                TemperatureFieldName="temperature",
                HVFieldName="HV",
                FSMStatusFieldName="FSM_status",
                FSMStateFieldName="FSM_state",
                UseFSMStatus=False,
                UseFSMState=False)

            if globalflags.DataSource() == 'data':
                if (not athenaCommonFlags.isOnline()):
                    InDetPixelDCSSvc.TemperatureFolder = "/PIXEL/DCS/TEMPERATURE"
                    InDetPixelDCSSvc.HVFolder = "/PIXEL/DCS/HV"
                else:
                    InDetPixelDCSSvc.TemperatureFolder = "/PIXEL/HLT/DCS/TEMPERATURE"
                    InDetPixelDCSSvc.HVFolder = "/PIXEL/HLT/DCS/HV"

            ServiceMgr += InDetPixelDCSSvc

        if self.useDCS or self.onlineMode:
            if self._print: print InDetPixelDCSSvc

        #this needs also updates how LorentzAngleSvc is accessed ()
        from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc
        PixelLorentzAngleSvc = SiLorentzAngleSvc(name='PixelLorentzAngleSvc')
        from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc
        pixelSiliconConditionsSvc = PixelSiliconConditionsSvc(
            name=self.instanceName('PixelSiliconConditionsSvc'),
            PixelDCSSvc='TrigPixelDCSSvc')
        pixelSiliconConditionsSvc.ForceUseGeoModel = False
        pixelSiliconConditionsSvc.UseDBForHV = True
        pixelSiliconConditionsSvc.UseDBForTemperature = True
        ServiceMgr += pixelSiliconConditionsSvc

        PixelLorentzAngleSvc.SiConditionsServices = pixelSiliconConditionsSvc
        PixelLorentzAngleSvc.UseMagFieldSvc = True  #may need also MagFieldSvc instance

        #if self.useDCS or self.onlineMode:
        #if (globalflags.DataSource() == 'data'):
        #else:
        #pixelSiliconConditionsSvc.ForceUseGeoModel = True
        #PixelLorentzAngleSvc.pixelForceUseGeoModel()
        if self._print:
            print pixelSiliconConditionsSvc
            print PixelLorentzAngleSvc
コード例 #22
0
        if (globalflags.DataSource() == 'data'):
            sctLorentzAngleSvcSetup.forceUseDB()
    else:
        sctLorentzAngleSvcSetup.forceUseGeoModel()

#
# --- Load necessary TRT conditions folders
#
if DetFlags.haveRIO.TRT_on():
    # Compression table
    if (globalflags.DataSource() == 'data'):
        if not conddb.folderRequested('/TRT/Onl/ROD/Compress'):
            conddb.addFolder("TRT_ONL", "/TRT/Onl/ROD/Compress")
    # Calibration constants
    if not conddb.folderRequested('/TRT/Calib/RT'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/RT",
                                    "/TRT/Calib/RT")
    if not conddb.folderRequested('/TRT/Calib/T0'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/T0",
                                    "/TRT/Calib/T0")

    # --- reenambe new TRT errors
    if not conddb.folderRequested('/TRT/Calib/errors2d'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/errors2d",
                                    "/TRT/Calib/errors2d")

    if not conddb.folderRequested('/TRT/Calib/slopes'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/slopes",
                                    "/TRT/Calib/slopes")

    if not conddb.folderRequested('/TRT/Calib/ToTCalib'):
        conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/ToTCalib",
コード例 #23
0
    def createSvc(self):

        #
        # Load necessary conditions folders
        #

        # Calibration constants
        from IOVDbSvc.CondDB import conddb

        if not self._isMC:
            #only needed for data
            if not (conddb.folderRequested('/TRT/Onl/ROD/Compress')):
                conddb.addFolder("TRT_ONL", "/TRT/Onl/ROD/Compress")

        if not (conddb.folderRequested('/TRT/Calib/RT')
                or conddb.folderRequested('/TRT/Onl/Calib/RT')):
            conddb.addFolderSplitOnline('TRT', '/TRT/Onl/Calib/RT',
                                        '/TRT/Calib/RT')
        if not (conddb.folderRequested('/TRT/Calib/T0')
                or conddb.folderRequested('/TRT/Onl/Calib/T0')):
            conddb.addFolderSplitOnline('TRT', '/TRT/Onl/Calib/T0',
                                        '/TRT/Calib/T0')

        if not (conddb.folderRequested('/TRT/Calib/errors')
                or conddb.folderRequested('/TRT/Onl/Calib/errors')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/errors",
                                        "/TRT/Calib/errors")
            # not needed anymore conddb.addOverride('/TRT/Onl/Calib/errors','TrtCalibErrorsOnl-ErrorVal-00-00')

        if not (conddb.folderRequested('/TRT/Calib/ToTCalib')
                or conddb.folderRequested('/TRT/Onl/Calib/ToTCalib')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/ToTCalib",
                                        "/TRT/Calib/ToTCalib")

        if not (conddb.folderRequested('/TRT/Calib/HTCalib')
                or conddb.folderRequested('/TRT/Onl/Calib/HTCalib')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/HTCalib",
                                        "/TRT/Calib/HTCalib")

        # Calibration DB Service
        from AthenaCommon.AppMgr import ServiceMgr
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc
        #InDetTRTCalDbSvc = TRT_CalDbSvc(self.instanceName('TRT_CalDbSvc'))    #
        InDetTRTCalDbSvc = TRT_CalDbSvc('TRT_CalDbSvc')
        ServiceMgr += InDetTRTCalDbSvc
        if self._print:
            print InDetTRTCalDbSvc

        # Dead/Noisy Straw Lists
        if not (conddb.folderRequested('/TRT/Cond/Status')
                or conddb.folderRequested('/TRT/Onl/Cond/Status')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/Status",
                                        "/TRT/Cond/Status")
        #there used to be an additional tag here!
        #conddb.addFolder("TRT","/TRT/Cond/StatusPermanent<tag>TrtStrawStatusPermanent-01</tag>")
        if not (conddb.folderRequested('/TRT/Cond/StatusPermanent')
                or conddb.folderRequested('/TRT/Onl/Cond/StatusPermanent')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusPermanent",
                                        "/TRT/Cond/StatusPermanent")

        #high threshold capabilities
        if not (conddb.folderRequested('/TRT/Cond/StatusHT')
                or conddb.folderRequested('/TRT/Onl/Cond/StatusHT')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Cond/StatusHT",
                                        "/TRT/Cond/StatusHT")

        # DCS Data Folders
        from AthenaCommon.GlobalFlags import globalflags
        if (globalflags.InputFormat() == 'bytestream'
                and globalflags.DataSource() == 'data'):
            if self.useDCS and not self.onlineMode:
                if not conddb.folderRequested(
                        '/TRT/DCS/HV/BARREL <cache>600</cache>'):
                    conddb.addFolder('DCS_OFL',
                                     "/TRT/DCS/HV/BARREL <cache>600</cache>")
                if not conddb.folderRequested(
                        '/TRT/DCS/HV/ENDCAPA <cache>600</cache>'):
                    conddb.addFolder('DCS_OFL',
                                     "/TRT/DCS/HV/ENDCAPA <cache>600</cache>")
                if not conddb.folderRequested(
                        '/TRT/DCS/HV/ENDCAPC <cache>600</cache>'):
                    conddb.addFolder('DCS_OFL',
                                     "/TRT/DCS/HV/ENDCAPC <cache>600</cache>")

        # TRT PID tools
        if not (conddb.folderRequested('/TRT/Calib/PID')
                or conddb.folderRequested('/TRT/Onl/Calib/PID')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/PID",
                                        "/TRT/Calib/PID")
        if not (conddb.folderRequested('/TRT/Calib/PIDver_New')
                or conddb.folderRequested('/TRT/Onl/Calib/PIDver_New')):
            conddb.addFolderSplitOnline("TRT", "/TRT/Onl/Calib/PIDver_New",
                                        "/TRT/Calib/PIDver_New")
        if not (conddb.folderRequested('/TRT/Calib/PID_RToTver_New')
                or conddb.folderRequested('/TRT/Onl/Calib/PID_RToTver_New')):
            conddb.addFolderSplitOnline("TRT",
                                        "/TRT/Onl/Calib/PID_RToTver_New",
                                        "/TRT/Calib/PID_RToTver_New")

        #
        # Load and Configure TRT Conditions Services
        #
        InDetTRTConditionsServices = []

        # Dead/Noisy Straw Service
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummarySvc
        InDetTRTStrawStatusSummarySvc = \
            TRT_StrawStatusSummarySvc(name=self.instanceName("InDetTRTStrawStatusSummarySvc"))
        ServiceMgr += InDetTRTStrawStatusSummarySvc
        InDetTRTConditionsServices.append(InDetTRTStrawStatusSummarySvc)

        if self._print:
            print InDetTRTStrawStatusSummarySvc

        # Services which only run on raw data
        if (globalflags.InputFormat() == 'bytestream'
                and globalflags.DataSource() == 'data'):

            # Hardware Mapping Service
            from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_HWMappingSvc
            InDetTRT_HWMappingSvc = TRT_HWMappingSvc(
                name=self.instanceName("InDetTRT_HWMappingSvc"))
            ServiceMgr += InDetTRT_HWMappingSvc
            if self._print:
                print InDetTRT_HWMappingSvc

            # DCS Conditions Service
            if self.useDCS and not self.onlineMode:
                from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_DCS_ConditionsSvc
                InDetTRT_DCS_ConditionsSvc = TRT_DCS_ConditionsSvc(
                    name=self.instanceName("InDetTRT_DCS_ConditionsSvc"),
                    HWMapSvc=InDetTRT_HWMappingSvc,
                    #OutputLevel = VERBOSE,
                    EventInfoKey="ByteStreamEventInfo",
                    DoIOVChecking=True,
                    IOVmaxLength=7 * 24 * 60 * 60,
                    #FallBackOnCOOLChanName = False,
                )
                ServiceMgr += InDetTRT_DCS_ConditionsSvc
                if self._print:
                    print InDetTRT_DCS_ConditionsSvc
                InDetTRTConditionsServices.append(InDetTRT_DCS_ConditionsSvc)

        # TRT Conditions Summary Service
        from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_ConditionsSummarySvc
        InDetTRTConditionsSummaryService = TRT_ConditionsSummarySvc(
            name=self.instanceName("InDetTRTConditionsSummaryService"),
            ServiceList=InDetTRTConditionsServices,
        )
        ServiceMgr += InDetTRTConditionsSummaryService
        if self._print:
            print InDetTRTConditionsSummaryService

        from TRT_RecoConditionsServices.TRT_RecoConditionsServicesConf import TRT_ActiveFractionSvc
        InDetTRT_ActiveFractionSvc = TRT_ActiveFractionSvc(
            name=self.instanceName("InDetTRTActiveFractionSvc"),
            #missing link to TRTSummarySvc
        )
        ServiceMgr += InDetTRT_ActiveFractionSvc
コード例 #24
0
AddressRemappingSvc.addInputRename("xAOD::EventInfo", "EventInfo", "Sig_EventInfo")
AddressRemappingSvc.addInputRename("xAOD::EventAuxInfo", "EventInfoAux.", "Sig_EventInfoAux.")

#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
theApp.EvtMax = 100

#--------------------------------------------------------------
# Algorithms
#--------------------------------------------------------------
# Beam spot conditions
from AthenaCommon.AlgSequence import AthSequencer
condSeq = AthSequencer("AthCondSeq")
from IOVDbSvc.CondDB import conddb
conddb.addFolderSplitOnline("INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList")
from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg
condSeq += BeamSpotCondAlg("BeamSpotCondAlg")

# Run the overlay
from AthenaCommon import CfgGetter
EventInfoOverlay = CfgGetter.getAlgorithm("EventInfoOverlay")
EventInfoOverlay.OutputLevel = DEBUG
topSequence += EventInfoOverlay

#--------------------------------------------------------------
# EventLoop
#--------------------------------------------------------------
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
nThreads = jp.ConcurrencyFlags.NumThreads()
if nThreads > 0:
コード例 #25
0
include.block("PixelConditionsServices/SpecialPixelMapSvc_jobOptions.py")

### set up IOVDbSvc folder

from IOVDbSvc.CondDB import conddb

conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixMapShort",
                            "/PIXEL/PixMapShort")
conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixMapLong",
                            "/PIXEL/PixMapLong")
conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/NoiseMapShort",
                            "/PIXEL/NoiseMapShort")
conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/NoiseMapLong",
                            "/PIXEL/NoiseMapLong")
conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixMapOverlay",
                            "/PIXEL/PixMapOverlay")

### configure the special pixel map service

from PixelConditionsServices.PixelConditionsServicesConf import SpecialPixelMapSvc

ServiceMgr += SpecialPixelMapSvc()
SpecialPixelMapSvc = ServiceMgr.SpecialPixelMapSvc

SpecialPixelMapSvc.DBFolders = ["/PIXEL/PixMapShort", "/PIXEL/PixMapLong"]
SpecialPixelMapSvc.SpecialPixelMapKeys = [
    "SpecialPixelMap", "SpecialPixelMapLong"
]

SpecialPixelMapSvc.DBFolders += ["/PIXEL/NoiseMapShort", "/PIXEL/NoiseMapLong"]
SpecialPixelMapSvc.SpecialPixelMapKeys += ["NoiseMapShort", "NoiseMapLong"]
コード例 #26
0
ファイル: dumpR07.py プロジェクト: rushioda/PIXELVALID_athena
#MessageSvc.Format = "% F%30W%S%7W%R%T %0W%M"
#MessageSvc.useColors = True

#***************************************************** HERE override MuonSpectrometer tag
from AtlasGeoModel import SetGeometryVersion
from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
GeoModelSvc = GeoModelSvc()
GeoModelSvc.MuonVersionOverride = "MuonSpectrometer-R.07.00"

print GeoModelSvc

#***************************************************** HERE define alignment data from cond. tags
if useAlign:
    from IOVDbSvc.CondDB import conddb
    conddb.dbname = "COMP200"
    conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/MDT/BARREL',
                                '/MUONALIGN/MDT/BARREL')
    conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/MDT/ENDCAP/SIDEA',
                                '/MUONALIGN/MDT/ENDCAP/SIDEA')
    conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/MDT/ENDCAP/SIDEC',
                                '/MUONALIGN/MDT/ENDCAP/SIDEC')
    conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/TGC/SIDEA',
                                '/MUONALIGN/TGC/SIDEA')
    conddb.addFolderSplitOnline('MUONALIGN', '/MUONALIGN/Onl/TGC/SIDEC',
                                '/MUONALIGN/TGC/SIDEC')
    from MuonCondTool.MuonCondToolConf import MuonAlignmentDbTool
    MuonAlignmentDbTool = MuonAlignmentDbTool("MGM_AlignmentDbTool")
    MuonAlignmentDbTool.ParlineFolders = [
        "/MUONALIGN/MDT/BARREL", "/MUONALIGN/MDT/ENDCAP/SIDEA",
        "/MUONALIGN/MDT/ENDCAP/SIDEC", "/MUONALIGN/TGC/SIDEA",
        "/MUONALIGN/TGC/SIDEC"
    ]
コード例 #27
0
) != "":
    forceRN = "<forceRunNumber>" + larCondFlags.LArForceIOVRunNumber(
    ) + "</forceRunNumber>"

#Load Bad-Channel folder: (Should be move this elsewhere?)

#Hack following the Online/Offline split of the BadChannel database:
#Online applications read from COOLONL_LAR/COMP200, folder /LAR/BadChannels/BadChannels
#Offline applications read from COOLOFL_LAR/COMP200, folder /LAR/BadChannelsOfl/BadChannels
#But SG key(=Folder name) is expected to be the same in both cases (default set in LArBadChanTool.cxx)
#Solution: Re-key the object when reading from offline DB

rekeyBC = "<key>/LAR/BadChannels/BadChannels</key>"
rekeyMF = "<key>/LAR/BadChannels/MissingFEBs</key>"
conddb.addFolderSplitOnline(
    "LAR", "/LAR/BadChannels/BadChannels",
    "/LAR/BadChannelsOfl/BadChannels" + forceRN + rekeyBC)
conddb.addFolderSplitOnline(
    "LAR", "/LAR/BadChannels/MissingFEBs",
    "/LAR/BadChannelsOfl/MissingFEBs" + forceRN + rekeyMF)
# and the same for Known Noisy and MNB FEBs
if (rec.doESD() or rec.doRDOTrigger()) and ('COMP200'
                                            not in conddb.GetInstance()):
    rekeyBADF = "<key>/LAR/BadChannels/KnownBADFEBs</key>"
    rekeyMNBF = "<key>/LAR/BadChannels/KnownMNBFEBs</key>"
    conddb.addFolderSplitOnline(
        "LAR", "/LAR/BadChannels/KnownBADFEBs",
        "/LAR/BadChannelsOfl/KnownBADFEBs" + forceRN + rekeyBADF)
    conddb.addFolderSplitOnline(
        "LAR", "/LAR/BadChannels/KnownMNBFEBs",
        "/LAR/BadChannelsOfl/KnownMNBFEBs" + forceRN + rekeyMNBF)
コード例 #28
0
    else:
        egSCT_ClusterOnTrackTool = None

    # default ROT creator, not smart !
    from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator
    egRotCreator = Trk__RIO_OnTrackCreator(
        name='egRotCreator',
        ToolPixelCluster=egPixelClusterOnTrackTool,
        ToolSCT_Cluster=egSCT_ClusterOnTrackTool,
        Mode='indet')
    ToolSvc += egRotCreator
    # load error scaling
    from IOVDbSvc.CondDB import conddb
    if not conddb.folderRequested('Indet/TrkErrorScaling'):
        conddb.addFolderSplitOnline('INDET', '/Indet/Onl/TrkErrorScaling',
                                    '/Indet/TrkErrorScaling')
##################End of e/gamma Rot Creator ###################

#
#
# Extrapolator to be used for tracking inside egamma i.e GSF , conversions
# Set up AtlasExtrapolator
if not hasattr(ToolSvc, 'AtlasExtrapolator'):
    from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
    ToolSvc += AtlasExtrapolator()

from AthenaCommon.AppMgr import ServiceMgr as svcMgr

AtlasTrackingGeometrySvc = svcMgr.AtlasTrackingGeometrySvc
# get propagator
from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator
コード例 #29
0
    def createTool(self):
        from AthenaCommon.AppMgr import ToolSvc

        #############################
        # Setup Pixel Configuration #
        #############################
        from AthenaCommon.AlgSequence import AthSequencer
        condSeq = AthSequencer("AthCondSeq")

        from IOVDbSvc.CondDB import conddb
        from AthenaCommon.GlobalFlags import globalflags
        from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags
        from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags

        useNewDeadmapFormat = False
        useNewChargeFormat = False

        if not useNewDeadmapFormat:
            if not (conddb.folderRequested("/PIXEL/PixMapOverlay")
                    or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")):
                conddb.addFolderSplitOnline("PIXEL",
                                            "/PIXEL/Onl/PixMapOverlay",
                                            "/PIXEL/PixMapOverlay",
                                            className='CondAttrListCollection')

        if not hasattr(condSeq, 'PixelConfigCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg

            useCablingConditions = False
            IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_2016.dat"
            rodIDForSingleLink40 = 0
            if (globalflags.DataSource() == 'geant4'):
                # ITk:
                if geoFlags.isSLHC():
                    IdMappingDat = "ITk_Atlas_IdMapping.dat"
                    if "BrlIncl4.0_ref" == commonGeoFlags.GeoType():
                        IdMappingDat = "ITk_Atlas_IdMapping_InclBrl4.dat"
                    elif "IBrlExt4.0ref" == commonGeoFlags.GeoType():
                        IdMappingDat = "ITk_Atlas_IdMapping_IExtBrl4.dat"
                    elif "BrlExt4.0_ref" == commonGeoFlags.GeoType():
                        IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl4.dat"
                    elif "BrlExt3.2_ref" == commonGeoFlags.GeoType():
                        IdMappingDat = "ITk_Atlas_IdMapping_ExtBrl32.dat"
                elif (geoFlags.isIBL() == False):
                    IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping.dat"
                else:
                    # Planar IBL
                    if (geoFlags.IBLLayout() == "planar"):
                        if (geoFlags.isDBM() == True):
                            IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_inclIBL_DBM.dat"
                        else:
                            IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_inclIBL.dat"
                    # Hybrid IBL plus DBM
                    elif (geoFlags.IBLLayout() == "3D"):
                        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_Run2.dat"

            elif (globalflags.DataSource == 'data'):
                from RecExConfig.AutoConfiguration import GetRunNumber
                runNum = GetRunNumber()
                if (runNum < 222222):
                    useCablingConditions = False
                    IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_May08.dat"
                    rodIDForSingleLink40 = 1300000
                else:
                    useCablingConditions = True
                    rodIDForSingleLink40 = 1300000
                    # Even though we are reading from COOL, set the correct fallback map.
                    if (runNum >= 344494):
                        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_344494.dat"
                    elif (runNum >= 314940 and runNum < 344494):
                        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_314940.dat"
                    elif (runNum >= 289350 and runNum < 314940):  # 2016
                        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_2016.dat"
                    elif (runNum >= 222222 and runNum < 289350):  # 2015
                        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_Run2.dat"
                    else:
                        IdMappingDat = "PixelCabling/Pixels_Atlas_IdMapping_344494.dat"

            condSeq += PixelConfigCondAlg(
                name="PixelConfigCondAlg",
                UseDeadmapConditions=self.usePixMap,
                UseDCSStateConditions=self.useDCS,
                UseDCSStatusConditions=self.useDCS,
                UseTDAQConditions=self.
                useTDAQ,  # should be false. This is only valid in RUN-1.
                UseCalibConditions=True,
                UseCablingConditions=useCablingConditions,
                CablingMapFileName=IdMappingDat)

        #########################
        # Deadmap Setup (RUN-3) #
        #########################
        if useNewDeadmapFormat:
            if not conddb.folderRequested("/PIXEL/PixelModuleFeMask"):
                conddb.addFolder("PIXEL_OFL",
                                 "/PIXEL/PixelModuleFeMask",
                                 className="CondAttrListCollection")
            if not hasattr(condSeq, "PixelDeadMapCondAlg"):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDeadMapCondAlg
                condSeq += PixelDeadMapCondAlg(name="PixelDeadMapCondAlg")

        ########################
        # DCS Conditions Setup #
        ########################
        PixelHVFolder = "/PIXEL/DCS/HV"
        PixelTempFolder = "/PIXEL/DCS/TEMPERATURE"
        PixelDBInstance = "DCS_OFL"

        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        if athenaCommonFlags.isOnline():
            PixelHVFolder = "/PIXEL/HLT/DCS/HV"
            PixelTempFolder = "/PIXEL/HLT/DCS/TEMPERATURE"
            PixelDBInstance = "PIXEL_ONL"

        if not conddb.folderRequested(PixelHVFolder):
            conddb.addFolder(PixelDBInstance,
                             PixelHVFolder,
                             className="CondAttrListCollection")
        if not conddb.folderRequested(PixelTempFolder):
            conddb.addFolder(PixelDBInstance,
                             PixelTempFolder,
                             className="CondAttrListCollection")

        if not self.onlineMode:  #this is only for testing in offline like setup
            if not conddb.folderRequested("/PIXEL/DCS/FSMSTATE"):
                conddb.addFolder("DCS_OFL",
                                 "/PIXEL/DCS/FSMSTATE",
                                 className="CondAttrListCollection")
            if not conddb.folderRequested("/PIXEL/DCS/FSMSTATUS"):
                conddb.addFolder("DCS_OFL",
                                 "/PIXEL/DCS/FSMSTATUS",
                                 className="CondAttrListCollection")

        if not hasattr(condSeq, 'PixelDCSCondStateAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg
            condSeq += PixelDCSCondStateAlg(name="PixelDCSCondStateAlg")

        if not hasattr(condSeq, 'PixelDCSCondStatusAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStatusAlg
            condSeq += PixelDCSCondStatusAlg(name="PixelDCSCondStatusAlg")

        if not hasattr(condSeq, 'PixelDCSCondHVAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg
            condSeq += PixelDCSCondHVAlg(name="PixelDCSCondHVAlg",
                                         ReadKey=PixelHVFolder)

        if not hasattr(condSeq, 'PixelDCSCondTempAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg
            condSeq += PixelDCSCondTempAlg(name="PixelDCSCondTempAlg",
                                           ReadKey=PixelTempFolder)

        #########################
        # TDAQ Conditions Setup #
        #########################
        if self.useTDAQ:
            PixelTDAQFolder = "/TDAQ/Resources/ATLAS/PIXEL/Modules"
            PixelTDAQInstance = "TDAQ_ONL"
            if not conddb.folderRequested(PixelTDAQFolder):
                conddb.addFolder(PixelTDAQInstance,
                                 PixelTDAQFolder,
                                 className="CondAttrListCollection")

            if not hasattr(condSeq, "PixelTDAQCondAlg"):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg
                condSeq += PixelTDAQCondAlg(name="PixelTDAQCondAlg",
                                            ReadKey=PixelTDAQFolder)

        ############################
        # Conditions Summary Setup #
        ############################
        # This is future replacement of the PixelConditionsSummaryTool...

        from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool
        TrigPixelConditionsSummaryTool = PixelConditionsSummaryTool(
            name=self.instanceName('PixelConditionsSummaryTool'),
            UseByteStream=self.useBS)

        if self.useDCS and not self.onlineMode:
            TrigPixelConditionsSummaryTool.IsActiveStates = ['READY', 'ON']
            TrigPixelConditionsSummaryTool.IsActiveStatus = ['OK', 'WARNING']

        self.summaryTool = TrigPixelConditionsSummaryTool

        if self._print: print(TrigPixelConditionsSummaryTool)

        #####################
        # Calibration Setup #
        #####################
        if not useNewChargeFormat:
            if not conddb.folderRequested("/PIXEL/PixCalib"):
                conddb.addFolderSplitOnline("PIXEL",
                                            "/PIXEL/Onl/PixCalib",
                                            "/PIXEL/PixCalib",
                                            className="CondAttrListCollection")
            if not hasattr(condSeq, 'PixelChargeCalibCondAlg'):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg
                condSeq += PixelChargeCalibCondAlg(
                    name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib")
        else:
            if not conddb.folderRequested("/PIXEL/ChargeCalibration"):
                conddb.addFolder("PIXEL_OFL",
                                 "/PIXEL/ChargeCalibration",
                                 className="CondAttrListCollection")
            if not hasattr(condSeq, 'PixelChargeLUTCalibCondAlg'):
                from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeLUTCalibCondAlg
                condSeq += PixelChargeLUTCalibCondAlg(
                    name="PixelChargeLUTCalibCondAlg",
                    ReadKey="/PIXEL/ChargeCalibration")

        #####################
        # Cabling map Setup #
        #####################
        if (conddb.dbdata == "CONDBR2" or
            (conddb.dbmc == "OFLP200" and geoFlags.isIBL()
             == True)) and not conddb.folderRequested("/PIXEL/HitDiscCnfg"):
            conddb.addFolderSplitMC("PIXEL",
                                    "/PIXEL/HitDiscCnfg",
                                    "/PIXEL/HitDiscCnfg",
                                    className="AthenaAttributeList")

        if not hasattr(condSeq, 'PixelHitDiscCnfgAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelHitDiscCnfgAlg
            condSeq += PixelHitDiscCnfgAlg(name="PixelHitDiscCnfgAlg")

        if not conddb.folderRequested("/PIXEL/ReadoutSpeed"):
            if not (globalflags.DataSource() == 'geant4'):
                conddb.addFolder("PIXEL",
                                 "/PIXEL/ReadoutSpeed",
                                 className="AthenaAttributeList")
            else:
                conddb.addFolderSplitMC("PIXEL",
                                        "/PIXEL/ReadoutSpeed",
                                        "/PIXEL/ReadoutSpeed",
                                        className="AthenaAttributeList")

        if not hasattr(condSeq, 'PixelReadoutSpeedAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelReadoutSpeedAlg
            condSeq += PixelReadoutSpeedAlg(name="PixelReadoutSpeedAlg")

        if (globalflags.DataSource == 'data'):
            if not conddb.folderRequested("/PIXEL/CablingMap"):
                conddb.addFolderSplitOnline("PIXEL",
                                            "/PIXEL/Onl/CablingMap",
                                            "/PIXEL/CablingMap",
                                            className="AthenaAttributeList")

        if not hasattr(condSeq, 'PixelCablingCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelCablingCondAlg
            condSeq += PixelCablingCondAlg(
                name="PixelCablingCondAlg",
                MappingFile=IdMappingDat,
                RodIDForSingleLink40=rodIDForSingleLink40)

        #############################
        # Offline calibration Setup #
        #############################
        if not conddb.folderRequested("/PIXEL/PixReco"):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/PixReco",
                                        "/PIXEL/PixReco",
                                        className="DetCondCFloat")

        if not hasattr(condSeq, 'PixelOfflineCalibCondAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelOfflineCalibCondAlg
            condSeq += PixelOfflineCalibCondAlg(
                name="PixelOfflineCalibCondAlg", ReadKey="/PIXEL/PixReco")
            PixelOfflineCalibCondAlg.InputSource = 2

        if not conddb.folderRequested("/Indet/PixelDist"):
            conddb.addFolderSplitOnline("INDET",
                                        "/Indet/Onl/PixelDist",
                                        "/Indet/PixelDist",
                                        className="DetCondCFloat")

        if not hasattr(condSeq, 'PixelDistortionAlg'):
            from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDistortionAlg
            condSeq += PixelDistortionAlg(name="PixelDistortionAlg",
                                          ReadKey="/Indet/PixelDist")

        ### configure the special pixel map service
        if not (conddb.folderRequested("/PIXEL/PixMapShort")
                or conddb.folderRequested("/PIXEL/Onl/PixMapShort")):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/PixMapShort",
                                        "/PIXEL/PixMapShort",
                                        className='CondAttrListCollection')
        if not (conddb.folderRequested("/PIXEL/PixMapLong")
                or conddb.folderRequested("/PIXEL/Onl/PixMapLong")):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/PixMapLong",
                                        "/PIXEL/PixMapLong",
                                        className='CondAttrListCollection')
        if not (conddb.folderRequested("/PIXEL/NoiseMapShort")
                or conddb.folderRequested("/PIXEL/Onl/NoiseMapShort")):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/NoiseMapShort",
                                        "/PIXEL/NoiseMapShort",
                                        className='CondAttrListCollection')
        if not (conddb.folderRequested("/PIXEL/NoiseMapLong")
                or conddb.folderRequested("/PIXEL/Onl/NoiseMapLong")):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/NoiseMapLong",
                                        "/PIXEL/NoiseMapLong",
                                        className='CondAttrListCollection')
        if not (conddb.folderRequested("/PIXEL/PixMapOverlay")
                or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")):
            conddb.addFolderSplitOnline("PIXEL",
                                        "/PIXEL/Onl/PixMapOverlay",
                                        "/PIXEL/PixMapOverlay",
                                        className='CondAttrListCollection')

        #######################
        # Lorentz Angle Setup #
        #######################
        if not hasattr(condSeq, 'PixelSiPropertiesCondAlg'):
            from SiPropertiesTool.SiPropertiesToolConf import PixelSiPropertiesCondAlg
            condSeq += PixelSiPropertiesCondAlg(
                name="PixelSiPropertiesCondAlg")

        from SiPropertiesTool.SiPropertiesToolConf import SiPropertiesTool
        TrigSiPropertiesTool = SiPropertiesTool(
            name="PixelSiPropertiesTool",
            DetectorName="Pixel",
            ReadKey="PixelSiliconPropertiesVector")

        ToolSvc += TrigSiPropertiesTool

        if not hasattr(condSeq, 'PixelSiLorentzAngleCondAlg'):
            from SiLorentzAngleTool.SiLorentzAngleToolConf import PixelSiLorentzAngleCondAlg
            condSeq += PixelSiLorentzAngleCondAlg(
                name="PixelSiLorentzAngleCondAlg",
                SiPropertiesTool=TrigSiPropertiesTool,
                UseMagFieldCache=True,
                UseMagFieldDcs=(not athenaCommonFlags.isOnline()))

        from SiLorentzAngleTool.SiLorentzAngleToolConf import SiLorentzAngleTool
        TrigPixelLorentzAngleTool = SiLorentzAngleTool(
            name=self.instanceName('PixelLorentzAngleTool'),
            DetectorName="Pixel",
            SiLorentzAngleCondData="PixelSiLorentzAngleCondData")

        ToolSvc += TrigPixelLorentzAngleTool
コード例 #30
0
rec.doWriteESD.set_Value_and_Lock(False)
rec.doWriteAOD.set_Value_and_Lock(False)
rec.doAOD.set_Value_and_Lock(False)
rec.doESD.set_Value_and_Lock(False)
rec.doDPD.set_Value_and_Lock(False)
rec.doWriteTAG.set_Value_and_Lock(False)
rec.doForwardDet.set_Value_and_Lock(False)
include ("RecExCommon/RecExCommon_topOptions.py")

# Load the conditions stuff for TRT and Tile timing
from AthenaCommon.DetFlags import DetFlags
DetFlags.ID_setOn()
DetFlags.Calo_setOn()
DetFlags.Muon_setOn()

if not ('conddb' in dir()):
 IOVDbSvc = Service("IOVDbSvc")
 from IOVDbSvc.CondDB import conddb
conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/RT","/TRT/Calib/RT")
conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/T0","/TRT/Calib/T0")

####### Reduce output
#turn off perfmon
from PerfMonComps.PerfMonFlags import jobproperties as jp
jp.PerfMonFlags.doMonitoring = False
jp.PerfMonFlags.doFastMon = False
###################################################################

from MuonD3PDMaker.muonD3PD import muonD3PD
alg = muonD3PD (tupleFileOutput)
コード例 #31
0
        if (globalflags.DataSource() == 'data'):            
            sctLorentzAngleSvcSetup.forceUseDB()
    else:
        sctLorentzAngleSvcSetup.forceUseGeoModel()
            
#
# --- Load necessary TRT conditions folders
#
if DetFlags.haveRIO.TRT_on():
    # Compression table
    if (globalflags.DataSource() == 'data'): 
        if not conddb.folderRequested('/TRT/Onl/ROD/Compress'):
            conddb.addFolder("TRT_ONL","/TRT/Onl/ROD/Compress")
    # Calibration constants
    if not conddb.folderRequested('/TRT/Calib/RT'):
        conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/RT","/TRT/Calib/RT")
    if not conddb.folderRequested('/TRT/Calib/T0'):
        conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/T0","/TRT/Calib/T0")

    # --- reenambe new TRT errors      
    if not conddb.folderRequested('/TRT/Calib/errors'):
        conddb.addFolderSplitOnline ("TRT","/TRT/Onl/Calib/errors","/TRT/Calib/errors")
#        conddb.addOverride('/TRT/Calib/errors','TrtCalibErrors-ErrorVal-00-00')
        
    if not conddb.folderRequested('/TRT/Calib/ToTCalib'):
        conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/ToTCalib","/TRT/Calib/ToTCalib")
#        conddb.addFolder("TRT_OFL","/TRT/Calib/ToTCalib")

    if not conddb.folderRequested('/TRT/Calib/HTCalib'):
      conddb.addFolderSplitOnline("TRT","/TRT/Onl/Calib/HTCalib","/TRT/Calib/HTCalib")