Пример #1
0
def SCT_GeometryCfg(flags):
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg(flags)
    geoModelSvc = acc.getPrimary()
    GeometryDBSvc = CompFactory.GeometryDBSvc
    acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
    SCT_DetectorTool = CompFactory.SCT_DetectorTool
    sctDetectorTool = SCT_DetectorTool()
    sctDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
    sctDetectorTool.Alignable = True  # make this a flag?
    sctDetectorTool.DetectorName = "SCT"
    geoModelSvc.DetectorTools += [sctDetectorTool]
    if flags.GeoModel.Align.Dynamic:
        acc.merge(
            addFoldersSplitOnline(flags,
                                  "INDET",
                                  "/Indet/Onl/AlignL1/ID",
                                  "/Indet/AlignL1/ID",
                                  className="CondAttrListCollection"))
        acc.merge(
            addFoldersSplitOnline(flags,
                                  "INDET",
                                  "/Indet/Onl/AlignL2/SCT",
                                  "/Indet/AlignL2/SCT",
                                  className="CondAttrListCollection"))
        acc.merge(
            addFoldersSplitOnline(flags,
                                  "INDET",
                                  "/Indet/Onl/AlignL3",
                                  "/Indet/AlignL3",
                                  className="AlignableTransformContainer"))
    else:
        if (not flags.Detector.SimulateSCT) or flags.Detector.OverlaySCT:
            acc.merge(
                addFoldersSplitOnline(flags,
                                      "INDET",
                                      "/Indet/Onl/Align",
                                      "/Indet/Align",
                                      className="AlignableTransformContainer"))
        else:
            acc.merge(
                addFoldersSplitOnline(flags, "INDET", "/Indet/Onl/Align",
                                      "/Indet/Align"))
    if flags.Common.Project != "AthSimulation":  # Protection for AthSimulation builds
        if (not flags.Detector.SimulateSCT) or flags.Detector.OverlaySCT:
            SCT_AlignCondAlg = CompFactory.SCT_AlignCondAlg
            sctAlignCondAlg = SCT_AlignCondAlg(
                name="SCT_AlignCondAlg",
                UseDynamicAlignFolders=flags.GeoModel.Align.Dynamic)
            acc.addCondAlgo(sctAlignCondAlg)
            SCT_DetectorElementCondAlg = CompFactory.SCT_DetectorElementCondAlg
            sctDetectorElementCondAlg = SCT_DetectorElementCondAlg(
                name="SCT_DetectorElementCondAlg")
            acc.addCondAlgo(sctDetectorElementCondAlg)
    return acc
Пример #2
0
def ForDetGeometryCfg(ConfigFlags):
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg(ConfigFlags)
    geoModelSvc = acc.getPrimary()
    GeometryDBSvc = CompFactory.GeometryDBSvc
    acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
    # LUCID
    if ConfigFlags.Detector.GeometryLucid:
        LUCID_DetectorTool = CompFactory.LUCID_DetectorTool
        geoModelSvc.DetectorTools += [LUCID_DetectorTool()]
    # ALFA
    if ConfigFlags.Detector.GeometryALFA:
        #from ALFA_GeoModel.ALFA_GeoModelConf import ALFA_DetectorTool
        ALFA_DetectorTool = CompFactory.ALFA_DetectorTool
        theALFA_DetectorTool = ALFA_DetectorTool(name="ALFA_DetectorTool")
        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
        geoModelSvc.DetectorTools += [theALFA_DetectorTool]
        acc.merge(
            addFoldersSplitOnline(ConfigFlags, 'FWD',
                                  '/FWD/Onl/ALFA/position_calibration',
                                  '/FWD/ALFA/position_calibration'))
    # ForwardRegion
    if ConfigFlags.Detector.GeometryFwdRegion:
        ForwardRegionGeoModelTool = CompFactory.ForwardRegionGeoModelTool
        geoModelSvc.DetectorTools += [ForwardRegionGeoModelTool()]
    # ZDC
    if ConfigFlags.Detector.GeometryZDC:
        ZDC_DetTool = CompFactory.ZDC_DetTool
        geoModelSvc.DetectorTools += [ZDC_DetTool()]
    # AFP
    if ConfigFlags.Detector.GeometryAFP:
        AFP_GeoModelTool = CompFactory.AFP_GeoModelTool
        geoModelSvc.DetectorTools += [AFP_GeoModelTool()]
    acc.addService(geoModelSvc)
    return acc
Пример #3
0
def MuonGeoModelCfg(flags):
    acc = GeoModelCfg(flags)
    gms = acc.getPrimary()
    detTool = acc.popToolsAndMerge(MuonDetectorToolCfg(flags))
    gms.DetectorTools += [detTool]
    enableAlignment = flags.Common.Project != 'AthSimulation' and not flags.Detector.SimulateMuon and not (
        flags.Detector.OverlayMuon and flags.Input.isMC)
    if enableAlignment:
        acc.merge(MuonDetectorCondAlgCfg(flags))

    acc.merge(
        MuonIdHelperSvcCfg(flags)
    )  # This line can be removed once the configuration methods for all 258 components which directly use this service are updated!!
    return acc
Пример #4
0
def LArGMCfg(configFlags):

    result = GeoModelCfg(configFlags)

    doAlignment = configFlags.LAr.doAlign

    LArDetectorToolNV = CompFactory.LArDetectorToolNV
    result.getPrimary().DetectorTools += [
        LArDetectorToolNV(ApplyAlignments=doAlignment)
    ]
    if not configFlags.Detector.SimulateCalo:
        result.getPrimary(
        ).DetectorTools["LArDetectorToolNV"].GeometryConfig = "RECO"

    if doAlignment:
        if configFlags.Input.isMC:
            #Monte Carlo case:
            result.merge(
                addFolders(configFlags,
                           ["/LAR/Align", "/LAR/LArCellPositionShift"],
                           "LAR_OFL"))
        else:
            if configFlags.Overlay.DataOverlay:
                #Data overlay
                result.merge(addFolders(configFlags, ["/LAR/Align"],
                                        "LAR_ONL"))
                result.merge(
                    addFolders(configFlags, ["/LAR/LArCellPositionShift"],
                               "LAR_OFL",
                               tag="LArCellPositionShift-ideal",
                               db="OFLP200"))
            else:
                #Regular offline data processing
                result.merge(
                    addFolders(configFlags,
                               ["/LAR/Align", "/LAR/LArCellPositionShift"],
                               "LAR_ONL"))

    return result
Пример #5
0
def TRT_GeometryCfg( flags ):
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg( flags )
    geoModelSvc=acc.getPrimary()
    GeometryDBSvc=CompFactory.GeometryDBSvc
    acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
    TRT_DetectorTool=CompFactory.TRT_DetectorTool
    trtDetectorTool = TRT_DetectorTool()
    trtDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
    geoModelSvc.DetectorTools += [ trtDetectorTool ]
    acc.addService(geoModelSvc)
    # Inner Detector alignment
    acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Calib/DX","/TRT/Calib/DX"))
    if flags.Detector.SimulateTRT: # revert to old style CondHandle in case of simulation
        # Dead/Noisy Straw Lists
        acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status"))
        acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent"))
        # Argon straw list
        acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusHT","/TRT/Cond/StatusHT"))
    else:
        # Dead/Noisy Straw Lists
        acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/Status","/TRT/Cond/Status",className='TRTCond::StrawStatusMultChanContainer'))
        acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusPermanent","/TRT/Cond/StatusPermanent",className='TRTCond::StrawStatusMultChanContainer'))
        # Argon straw list
        acc.merge(addFoldersSplitOnline(flags, "TRT","/TRT/Onl/Cond/StatusHT","/TRT/Cond/StatusHT",className='TRTCond::StrawStatusMultChanContainer'))
    # TRT Condition Algorithm
    TRTAlignCondAlg=CompFactory.TRTAlignCondAlg
    TRTAlignCondAlg = TRTAlignCondAlg(name = "TRTAlignCondAlg",
                                      UseDynamicFolders = flags.GeoModel.Align.Dynamic)
    if flags.GeoModel.Align.Dynamic:
        acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/AlignL1/TRT","/TRT/AlignL1/TRT",className="CondAttrListCollection"))
        acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/AlignL2","/TRT/AlignL2",className="AlignableTransformContainer"))
        TRTAlignCondAlg.ReadKeyDynamicGlobal = "/TRT/AlignL1/TRT"
        TRTAlignCondAlg.ReadKeyDynamicRegular = "/TRT/AlignL2"
    else:
        if (not flags.Detector.SimulateTRT) or flags.Detector.OverlayTRT:
            acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Align","/TRT/Align",className="AlignableTransformContainer"))
        else:
            acc.merge(addFoldersSplitOnline(flags,"TRT","/TRT/Onl/Align","/TRT/Align"))
    if flags.Common.Project != "AthSimulation": # Protection for AthSimulation builds
        if (not flags.Detector.SimulateTRT) or flags.Detector.OverlayTRT:
            acc.addCondAlgo(TRTAlignCondAlg)

    return acc