Пример #1
0
def ITkStripGeometryCfg(flags):
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg(flags)
    geoModelSvc = acc.getPrimary()
    GeometryDBSvc = CompFactory.GeometryDBSvc
    acc.addService(GeometryDBSvc("ITkGeometryDBSvc"))
    StripDetectorTool = CompFactory.StripDetectorTool
    ITkStripDetectorTool = StripDetectorTool()
    #ITkStripDetectorTool.useDynamicAlignFolders = flags.GeoModel.Align.Dynamic
    ITkStripDetectorTool.Alignable = False  # make this a flag? Set true as soon as decided on folder structure
    ITkStripDetectorTool.DetectorName = "ITkStrip"
    geoModelSvc.DetectorTools += [ITkStripDetectorTool]
    """
    # All this stuff probably needs revisting - comment for now...
    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.SimulateITkStrip) or flags.Detector.OverlayITkStrip:
            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 CavernGeometryCfg(flags):
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg(flags)
    geoModelSvc = acc.getPrimary()
    if (flags.Detector.Simulate
            and flags.Beam.Type == "cosmics") or flags.Detector.SimulateCavern:
        from CavernInfraGeoModel.CavernInfraGeoModelConf import CavernInfraDetectorTool
        geoModelSvc.DetectorTools += [CavernInfraDetectorTool()]
    return acc
Пример #3
0
def TileGMCfg(configFlags):
    result = GeoModelCfg(configFlags)

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

    return result
Пример #4
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
Пример #5
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
Пример #6
0
def InDetServiceMaterialCfg(flags):
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg(flags)
    geoModelSvc = acc.getPrimary()
    GeometryDBSvc = CompFactory.GeometryDBSvc
    acc.addService(GeometryDBSvc("InDetGeometryDBSvc"))
    InDetServMatTool = CompFactory.InDetServMatTool
    servMatTool = InDetServMatTool()
    geoModelSvc.DetectorTools += [servMatTool]
    acc.addService(geoModelSvc)
    return acc
Пример #7
0
def CaloEstimatedGainToolCfg(configFlags):
    result = ComponentAccumulator()

    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    result.merge(GeoModelCfg(configFlags))

    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
    from TileGeoModel.TileGMConfig import TileGMCfg

    result.merge(LArGMCfg(configFlags))
    result.merge(TileGMCfg(configFlags))

    from LArCabling.LArCablingConfig import LArFebRodMappingCfg, LArCalibIdMappingCfg
    result.merge(LArFebRodMappingCfg(configFlags))
    result.merge(LArCalibIdMappingCfg(configFlags))

    from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg
    result.merge(TileInfoLoaderCfg(configFlags))

    from TileConditions.TileEMScaleConfig import TileCondToolEmscaleCfg
    acc = TileCondToolEmscaleCfg(configFlags)
    emscaleTool = acc.popPrivateTools()
    result.merge(acc)

    from TileConditions.TileSampleNoiseConfig import TileCondToolNoiseSampleCfg
    acc = TileCondToolNoiseSampleCfg(configFlags)
    noiseSampleTool = acc.popPrivateTools()
    result.merge(acc)

    from LArRecUtils.LArADC2MeVCondAlgConfig import LArADC2MeVCondAlgCfg
    result.merge(LArADC2MeVCondAlgCfg(configFlags))
    adc2mev = result.getCondAlgo('LArADC2MeVCondAlg')

    TileCondIdTransforms = CompFactory.TileCondIdTransforms

    CaloEstimatedGainTool = CompFactory.CaloEstimatedGainTool
    tool = CaloEstimatedGainTool('CaloEstimatedGainTool',
                                 ADC2MeVKey=adc2mev.LArADC2MeVKey,
                                 TileCondIdTransforms=TileCondIdTransforms(),
                                 TileCondToolEmscale=emscaleTool,
                                 TileCondToolNoiseSample=noiseSampleTool)

    result.setPrivateTools(tool)

    return result
Пример #8
0
def DumpEventDataToJSONAlgCfg(configFlags, doExtrap=False, **kwargs):
    result = ComponentAccumulator()
    extrapolationEngine = ""
    if doExtrap:
        from AtlasGeoModel.GeoModelConfig import GeoModelCfg
        gmsAcc = GeoModelCfg(configFlags)
        result.merge(gmsAcc)

        from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
        extrapAcc = AtlasExtrapolationEngineCfg(configFlags)
        extrapolationEngine = extrapAcc.getPrimary()
        result.merge(extrapAcc)

        kwargs.setdefault('Extrapolator', extrapolationEngine)

    dumpAlg = DumpEventDataToJsonAlg(ExtrapolateTrackParticles=doExtrap,
                                     **kwargs)
    result.addEventAlgo(dumpAlg)
    return result
Пример #9
0
def SCT_TestCablingAlgCfg(configFlags):
    cfg = ComponentAccumulator()

    from SCT_Cabling.SCT_CablingConfig import SCT_CablingCondAlgCfg
    cfg.merge(SCT_CablingCondAlgCfg(configFlags))

    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    geoCfg = GeoModelCfg(configFlags)
    cfg.merge(geoCfg)

    from AthenaCommon.Constants import INFO
    SCT_CablingTool = CompFactory.SCT_CablingTool()
    SCT_CablingTool.DataSource = "COOLVECTOR"
    SCT_CablingTool.OutputLevel = INFO

    SCT_TestCablingAlg = CompFactory.SCT_TestCablingAlg
    testAlg = SCT_TestCablingAlg(SCT_CablingTool=SCT_CablingTool,
                                 OutputLevel=INFO)
    cfg.addEventAlgo(testAlg)

    return cfg
Пример #10
0
def TPCnvTest(infile,
              keys,
              useGeoModelSvc=False,
              useIOVDbSvc=False,
              doPixel=False,
              doSCT=False,
              doTRT=False,
              doLAr=False,
              doTile=False,
              doMuon=False):
    # Make sure we don't have a stale file catalog.
    if os.path.exists('PoolFileCatalog.xml'):
        os.remove('PoolFileCatalog.xml')

    if ('ATLAS_REFERENCE_TAG' not in globals()
            and 'ATLAS_REFERENCE_TAG' in os.environ):
        ATLAS_REFERENCE_TAG = os.environ['ATLAS_REFERENCE_TAG']  # noqa: F841

    refpaths = [
        os.environ.get('ATLAS_REFERENCE_DATA', None),
        '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art',
        '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs',
        '/afs/cern.ch/atlas/maxidisk/d33/referencefiles'
    ]

    if infile.startswith('rtt:'):
        infile = infile[4:]
    infile = find_file(infile, refpaths)

    # Provide MC input
    ConfigFlags.Input.Files = [infile]
    ConfigFlags.GeoModel.AtlasVersion = 'ATLAS-R1-2012-03-01-00'
    ConfigFlags.GeoModel.Align.Dynamic = False
    ConfigFlags.Detector.GeometryPixel = doPixel
    ConfigFlags.Detector.GeometrySCT = doSCT
    ConfigFlags.Detector.GeometryTRT = doTRT
    ConfigFlags.Detector.GeometryLAr = doLAr
    ConfigFlags.Detector.GeometryTile = doTile
    ConfigFlags.Detector.GeometryMuon = doMuon
    ConfigFlags.lock()

    # Construct ComponentAccumulator
    acc = MainServicesCfg(ConfigFlags)
    acc.merge(PoolReadCfg(ConfigFlags))
    if useIOVDbSvc:
        acc.merge(IOVDbSvcCfg(ConfigFlags))
    if useGeoModelSvc:
        if ConfigFlags.Detector.GeometryPixel:
            acc.merge(PixelGeometryCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometrySCT:
            acc.merge(SCT_GeometryCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryTRT:
            acc.merge(TRT_GeometryCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryLAr:
            acc.merge(LArGMCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryTile:
            acc.merge(TileGMCfg(ConfigFlags))
            useGeoModelSvc = True
        if ConfigFlags.Detector.GeometryMuon:
            acc.merge(MuonGeoModelCfg(ConfigFlags))
            useGeoModelSvc = True
        #acc.merge(ForDetGeometryCfg(ConfigFlags))
        acc.merge(GeoModelCfg(ConfigFlags))
        acc.getService("GeoModelSvc").IgnoreTagDifference = True
    acc.addEventAlgo(
        Dumper('dumper', ConfigFlags.Input.Files[0], keys, refpaths),
        'AthAlgSeq')
    return acc.run(maxEvents=10)
Пример #11
0
def EnvelopeDefSvcCfg(ConfigFlags,
                      name="AtlasGeometry_EnvelopeDefSvc",
                      **kwargs):
    result = ComponentAccumulator()

    kwargs.setdefault("DBInDetNode", 'InDetEnvelope')
    kwargs.setdefault("DBBeamPipeNode", 'BeamPipeEnvelope')
    kwargs.setdefault("DBCaloNode", 'CaloEnvelope')
    kwargs.setdefault("DBMSNode", 'MuonEnvelope')
    kwargs.setdefault("DBCavernNode", 'CavernEnvelope')

    # allow for python-based envelope definitions (see below)
    #  -> TODO: set this to False once the envelope definitions are tagged in the DDDB
    kwargs.setdefault("EnableFallback", True)

    # setup fallback BeamPipeEnvelope
    BeamPipe = Volume()
    BeamPipe.addRZ(34.3, 3475.0)

    if ConfigFlags.Detector.SimulateHGTD:
        BeamPipe.addRZ(47.0, 3475.0)
        BeamPipe.addRZ(47.0, 3535.0)
        BeamPipe.addRZ(120.0, 3535.0)
    else:
        BeamPipe.addRZ(120.0, 3475.0)
    BeamPipe.addRZ(120.0, 4185.0)
    BeamPipe.addRZ(41.0, 4185.0)
    BeamPipe.addRZ(41.0, 6783.0)
    BeamPipe.addRZ(70.0, 6783.0)
    BeamPipe.addRZ(70.0, 12900.0)
    BeamPipe.addRZ(279.0, 12900.0)
    BeamPipe.addRZ(279.0, 18650.0)
    BeamPipe.addRZ(436.0, 18650.0)
    BeamPipe.addRZ(436.0, 22030.0)
    BeamPipe.addRZ(1050.0, 22030.0)
    BeamPipe.addRZ(1050.0, 26046.0)
    BeamPipe.addRZ(0.0, 26046.0)

    kwargs.setdefault("FallbackBeamPipeR", BeamPipe.getRs())
    kwargs.setdefault("FallbackBeamPipeZ", BeamPipe.getZs())

    # setup fallback IDEnvelope
    InDet = Volume()
    InDet.addRZ(1148., 3475.)
    InDet.addRZ(34.3, 3475.)
    kwargs.setdefault("FallbackInDetR", InDet.getRs())
    kwargs.setdefault("FallbackInDetZ", InDet.getZs())

    # setup fallback CaloEnvelope
    Calo = Volume()
    Calo.addRZ(1148.0, 3475.0)

    if ConfigFlags.Detector.SimulateHGTD:
        Calo.addRZ(47.0, 3475.0)
        Calo.addRZ(47.0, 3535.0)
        Calo.addRZ(120.0, 3535.0)
    else:
        Calo.addRZ(120.0, 3475.0)
    Calo.addRZ(120.0, 4185.0)
    Calo.addRZ(41.0, 4185.0)
    Calo.addRZ(41.0, 6783.0)
    Calo.addRZ(420.0, 6783.0)
    Calo.addRZ(420.0, 6736.0)
    Calo.addRZ(3800.0, 6736.0)
    Calo.addRZ(3800.0, 6550.0)
    Calo.addRZ(4255.0, 6550.0)

    kwargs.setdefault("FallbackCaloR", Calo.getRs())
    kwargs.setdefault("FallbackCaloZ", Calo.getZs())

    # setup fallback MuonEnvelope
    Muon = Volume()
    Muon.addRZ(4255.0, 4000.0)
    Muon.addRZ(4255.0, 6550.0)
    Muon.addRZ(3800.0, 6550.0)
    Muon.addRZ(3800.0, 6736.0)
    Muon.addRZ(420.0, 6736.0)
    Muon.addRZ(420.0, 6783.0)
    Muon.addRZ(70.0, 6783.0)
    Muon.addRZ(70.0, 12900.0)
    Muon.addRZ(279.0, 12900.0)
    Muon.addRZ(279.0, 18650.0)
    Muon.addRZ(436.7, 18650.0)
    Muon.addRZ(436.7, 22030.0)
    Muon.addRZ(1050.0, 22030.0)
    Muon.addRZ(1050.0, 26046.0)
    Muon.addRZ(1500.0, 26046.0)
    Muon.addRZ(1500.0, 23001.0)
    Muon.addRZ(2750.0, 23001.0)
    Muon.addRZ(2750.0, 22030.0)
    Muon.addRZ(12650.0, 22030.0)
    Muon.addRZ(12650.0, 18650.0)
    Muon.addRZ(13400.0, 18650.0)
    Muon.addRZ(13400.0, 12900.0)
    Muon.addRZ(14200.0, 12900.0)
    Muon.addRZ(14200.0, 4000.0)
    Muon.addRZ(13000.0, 4000.0)
    kwargs.setdefault("FallbackMuonR", Muon.getRs())
    kwargs.setdefault("FallbackMuonZ", Muon.getZs())

    # setup fallback CavernEnvelope
    Cavern = Volume()
    Cavern.addRZ(13000.0, 4000.0)
    Cavern.addRZ(14200.0, 4000.0)
    Cavern.addRZ(14200.0, 12900.0)  # boundary with MS
    Cavern.addRZ(13400.0, 12900.0)  # boundary with MS
    Cavern.addRZ(13400.0, 18650.0)  # boundary with MS
    Cavern.addRZ(12650.0, 18650.0)  # boundary with MS
    Cavern.addRZ(12650.0, 22030.0)  # boundary with MS
    Cavern.addRZ(2750.0, 22030.0)  # boundary with MS
    Cavern.addRZ(2750.0, 23001.0)  # boundary with MS
    Cavern.addRZ(1500.0, 23001.0)  # boundary with MS
    Cavern.addRZ(1500.0, 26046.0)  # boundary with MS
    Cavern.addRZ(0.0, 26046.0)  #

    # the outer dimesions differ between collision and cosmics jobs
    if ConfigFlags.Beam.Type != 'cosmics':
        #  -> for collision jobs the 'cavern' envelope is much smaller
        Cavern.addRZ(0.0, 500000.0)  # z= +500m
        Cavern.addRZ(500000.0, 500000.0)  # r=  500m
    else:
        #  -> for cosmics simulation the 'cavern' envelope spans much further
        kwargs.setdefault("DBCavernNode", 'CavernEnvelopeNONE')
        kwargs.setdefault("EnableFallback", True)
        Cavern.addRZ(0.0, 3000000.0)  # z= +3km
        Cavern.addRZ(3000000.0, 3000000.0)  # r=  3km
    kwargs.setdefault("FallbackCavernR", Cavern.getRs())
    kwargs.setdefault("FallbackCavernZ", Cavern.getZs())

    #set the GeoModelSvc
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    acc = GeoModelCfg(ConfigFlags)
    kwargs.setdefault("GeoModelSvc", acc.getService("GeoModelSvc"))
    result.merge(acc)

    result.addService(DetDescrDBEnvelopeSvc(name, **kwargs), primary=True)
    return result
Пример #12
0
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import Logging
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory

if __name__=="__main__":
    # Setting needed for the ComponentAccumulator to do its thing
    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior=True
    
    # Set message levels
    from AthenaCommon import Constants
    msgLvl = "WARNING"
    from AthenaCommon.Logging import log
    log.setLevel(msgLvl)
    
    # Config flags steer the job at various levels
    from AthenaConfiguration.AllConfigFlags import ConfigFlags
    ConfigFlags.Input.isMC  = True
    ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"]
    
    # Flags relating to multithreaded execution
    nthreads=0
    ConfigFlags.Concurrency.NumThreads =nthreads
    if nthreads>0:
    	ConfigFlags.Concurrency.NumThreads = 1
    	ConfigFlags.Concurrency.NumConcurrentEvents = 1
    ConfigFlags.MET.UseTracks = True
    ConfigFlags.MET.DoPFlow = True
    if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Beam.Type == 'singlebeam':# used to have " or not rec.doInDet()" on the end
Пример #13
0
def BeamPipeGeometryCfg(flags):
    result = GeoModelCfg(flags)
    BeamPipeDetectorTool = CompFactory.BeamPipeDetectorTool
    result.getPrimary().DetectorTools += [BeamPipeDetectorTool()]
    return result
Пример #14
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
Пример #15
0
def CaloNoiseCondAlgCfg(configFlags,noisetype="totalNoise"):
    if noisetype not in ("electronicNoise","pileupNoise","totalNoise"):
        raise RuntimeError("Requested noise of unknown type %s" % noisetype)

    noiseAlgName="Calo_"+noisetype+"Alg"
    

    log = logging.getLogger("CaloNoiseToolCfg")
    result=ComponentAccumulator()

    isMC=configFlags.Input.isMC
    fixedLumi=configFlags.Calo.Noise.fixedLumiForNoise
    useCaloLumi=configFlags.Calo.Noise.useCaloNoiseLumi

    #CaloNoiseCondAlg needs Identifiers ... 
    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    gms=GeoModelCfg(configFlags)
    result.merge(gms)

    #... and cabling:
    from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
    result.merge(LArOnOffIdMappingCfg(configFlags))

    theCaloNoiseAlg=CaloNoiseCondAlg(noiseAlgName,OutputKey=noisetype)

    if configFlags.Common.isOnline:
        log.info("Configuring CaloNoiseCondAlg for online case")
        #online mode:
        result.merge(addFolders(configFlags,"/CALO/Noise/CellNoise",'CALO_ONL',className="CondAttrListCollection"))
        theCaloNoiseAlg.CaloNoiseFolder="/CALO/Noise/CellNoise"
        theCaloNoiseAlg.LArNoiseFolder=""
        theCaloNoiseAlg.TileNoiseFolder=""
        if fixedLumi >= 0 :
            theCaloNoiseAlg.Luminosity = fixedLumi
            log.info("online mode: use fixed luminosity for scaling pileup noise: %f", fixedLumi)
        else:
            if useCaloLumi:
                lumiFolder='/CALO/Noise/PileUpNoiseLumi'
                result.merge(addFolders(configFlags,lumiFolder,'CALO',className="CondAttrListCollection"))
                theCaloNoiseAlg.LumiFolder = lumiFolder
                theCaloNoiseAlg.Luminosity = -1.
                log.info("online mode: use luminosity from /CALO/Noise/PileUpNoiseLumi to scale pileup noise")
            else:
                theCaloNoiseAlg.Luminosity = 0.
                log.info("online mode: ignore pileup noise")
                pass
        result.addCondAlgo(theCaloNoiseAlg)
        return result

    #The not-online case:
    if isMC:
        log.info("Configuring CaloNoiseCondAlg for MC data processing")
        if fixedLumi >= 0 :
            theCaloNoiseAlg.Luminosity=fixedLumi
            log.info("Luminosity (in 10**33) units used for pileup noise from CaloNoiseFlags : %f", fixedLumi)
        else:
            if useCaloLumi:
                lumiFolder='/CALO/Ofl/Noise/PileUpNoiseLumi'
                result.merge(addFolders(configFlags,lumiFolder,'CALO_OFL',className="CondAttrListCollection"))
                log.info("offline mode: use luminosity from /CALO/Ofl/Noise/PileuUpNoiseLumi to scale pileup noise")
                theCaloNoiseAlg.LumiFolder = lumiFolder
                theCaloNoiseAlg.Luminosity=-1.
            else:
                estimatedLumi=configFlags.Beam.estimatedLuminosity
                theCaloNoiseAlg.Luminosity=estimatedLumi/1e+33
                log.info("  Luminosity (in 10**33) units used for pileup noise from Beam flags: %f", theCaloNoiseAlg.Luminosity)

        theCaloNoiseAlg.LArNoiseFolder="/LAR/NoiseOfl/CellNoise"
        result.merge(addFolders(configFlags,"/LAR/NoiseOfl/CellNoise","LAR_OFL",className="CondAttrListCollection"))
        theCaloNoiseAlg.TileNoiseFolder="/TILE/OFL02/NOISE/CELL"
        result.merge(addFolders(configFlags,"/TILE/OFL02/NOISE/CELL","TILE_OFL",className="CondAttrListCollection"))
        theCaloNoiseAlg.CaloNoiseFolder="/CALO/Ofl/Noise/CellNoise"
        result.merge(addFolders(configFlags,"/CALO/Ofl/Noise/CellNoise","CALO_OFL",className="CondAttrListCollection"))

        pass
    else: # Real data case:
        # for luminosity
        if fixedLumi >= 0 :
            theCaloNoiseAlg.Luminosity = fixedLumi
            log.info("offline mode: use fixed luminosity for scaling pileup noise: %f", fixedLumi)
        else :
            theCaloNoiseAlg.Luminosity = -1
            if useCaloLumi:
                lumiFolder='/CALO/Ofl/Noise/PileUpNoiseLumi'
                result.merge(addFolders(configFlags,lumiFolder,'CALO_OFL',className="CondAttrListCollection"))
                log.info("offline mode: use luminosity from /CALO/Ofl/Noise/PileUpNoiseLumi to scale pileup noise")
            else:
                lumiFolder = '/TRIGGER/LUMI/LBLESTONL'
                result.merge(addFolders(configFlags,lumiFolder,'TRIGGER_ONL',className="CondAttrListCollection"))
                log.info("offline mode: use luminosity = f(Lumiblock) to scale pileup noise")
            theCaloNoiseAlg.LumiFolder = lumiFolder

        if configFlags.IOVDb.DatabaseInstance=="CONDBR2": # Run2 case:
            log.info("Configuring CaloNoiseCondAlg for Run2 real data processing")
            theCaloNoiseAlg.CaloNoiseFolder=""
            theCaloNoiseAlg.LArNoiseFolder="/LAR/NoiseOfl/CellNoise"
            theCaloNoiseAlg.TileNoiseFolder="/TILE/OFL02/NOISE/CELL"
            result.merge(addFolders(configFlags,"/LAR/NoiseOfl/CellNoise","LAR_OFL",className="CondAttrListCollection"))
            result.merge(addFolders(configFlags,"/TILE/OFL02/NOISE/CELL","TILE_OFL",className="CondAttrListCollection"))


            if configFlags.LAr.doHVCorr:
                log.info("Run2 & doLArHVCorr=True: Will rescale noise automatically for HV trips")
                theCaloNoiseAlg.useHVCorr=True
                from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
                result.merge(LArHVScaleCfg(configFlags))
                pass
            pass
        else: #COMP200 case:
            log.info("Configuring CaloNoiseCondAlg for Run1 real data processing")
            #The noise for runs before 2012 is a different folder:
            theCaloNoiseAlg.CaloNoiseFolder="/CALO/Ofl/Noise/CellNoise"
            theCaloNoiseAlg.LArNoiseFolder="/LAR/NoiseOfl/CellNoise"
            theCaloNoiseAlg.TileNoiseFolder="/TILE/OFL02/NOISE/CELL"
            result.merge(addFolders(configFlags,"/CALO/Ofl/Noise/CellNoise","CALO_OFL",className="CondAttrListCollection"))
            result.merge(addFolders(configFlags,"LAR_OFL","/LAR/NoiseOfl/CellNoise",className="CondAttrListCollection"))
            result.merge(addFolders(configFlags,"TILE_OFL","/TILE/OFL02/NOISE/CELL",className="CondAttrListCollection"))

            
        pass #end of real data case
    
    result.addCondAlgo(theCaloNoiseAlg)
    return result
Пример #16
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
Пример #17
0
def MuonCombinedReconstructionCfg(flags):
    result = ComponentAccumulator()

    from AtlasGeoModel.GeoModelConfig import GeoModelCfg
    result.merge(GeoModelCfg(flags))

    from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
    result.merge(MuonGeoModelCfg(flags))

    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
    result.merge(LArGMCfg(flags))

    from TileGeoModel.TileGMConfig import TileGMCfg
    result.merge(TileGMCfg(flags))

    from BeamPipeGeoModel.BeamPipeGMConfig import BeamPipeGeometryCfg
    result.merge(BeamPipeGeometryCfg(flags))

    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    result.merge(PixelGeometryCfg(flags))

    from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
    result.merge(SCT_GeometryCfg(flags))

    from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg
    result.merge(TRT_GeometryCfg(flags))

    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    result.merge(TrackingGeometrySvcCfg(flags))

    muon_edm_helper_svc = CompFactory.Muon.MuonEDMHelperSvc("MuonEDMHelperSvc")
    result.addService(muon_edm_helper_svc)

    # Set up to read Tracks.
    from TrkConfig.TrackCollectionReadConfig import TrackCollectionReadCfg
    result.merge(TrackCollectionReadCfg(flags, 'Tracks'))

    result.merge(MuonCombinedInDetCandidateAlg(flags))
    result.merge(MuonCombinedMuonCandidateAlgCfg(flags))

    if flags.MuonCombined.doStatisticalCombination or flags.MuonCombined.doCombinedFit:
        result.merge(MuonCombinedAlgCfg(flags))

    if flags.MuonCombined.doMuGirl:
        result.merge(
            MuonInsideOutRecoAlgCfg(flags, name="MuonInsideOutRecoAlg"))
        if flags.MuonCombined.doMuGirlLowBeta:
            result.merge(MuGirlStauAlgCfg)

    if flags.MuonCombined.doCaloTrkMuId:
        result.merge(MuonCaloTagAlgCfg(flags))

    if flags.MuonCombined.doMuonSegmentTagger:
        result.merge(MuonSegmentTagAlgCfg(flags))

    # runs over outputs and create xAODMuon collection
    acc = MuonCreatorAlgCfg(flags)
    result.merge(acc)

    if flags.MuonCombined.doMuGirl and flags.MuonCombined.doMuGirlLowBeta:
        # Has to be at end if not using sequencer. If we drop this requirement, can be moved above
        result.merge(StauCreatorAlgCfg(flags))

    return result
Пример #18
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