예제 #1
0
def muonRdoDecodeTestMC():
    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior = 1

    from AthenaConfiguration.AllConfigFlags import ConfigFlags
    ConfigFlags.Input.Files = [
        "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"
    ]

    ConfigFlags.lock()
    ConfigFlags.dump()

    from AthenaCommon.Logging import log

    log.setLevel(DEBUG)
    log.info('About to setup Rpc RDO data decoding')

    cfg = ComponentAccumulator()

    # We are reading a pool file for this test
    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    cfg.merge(PoolReadCfg(ConfigFlags))

    # Schedule RDO conversion
    # RPC decoding
    rpcdecodingAcc = RpcRDODecodeCfg(ConfigFlags)
    cfg.merge(rpcdecodingAcc)

    # TGC decoding
    tgcdecodingAcc = TgcRDODecodeCfg(ConfigFlags)
    cfg.merge(tgcdecodingAcc)

    # MDT decoding
    mdtdecodingAcc = MdtRDODecodeCfg(ConfigFlags)
    cfg.merge(mdtdecodingAcc)

    # CSC decoding
    cscdecodingAcc = CscRDODecodeCfg(ConfigFlags)
    cfg.merge(cscdecodingAcc)

    cscbuildingAcc = CscClusterBuildCfg(ConfigFlags)
    cfg.merge(cscbuildingAcc)

    log.info('Print Config')
    cfg.printConfig(withDetails=True)

    # Store config as pickle
    log.info('Save Config')
    with open('MuonRdoDecode.pkl', 'wb') as f:
        cfg.store(f)
        f.close()
    return cfg
예제 #2
0
def SetupMuonStandaloneCA(args, ConfigFlags):
    # When running from a pickled file, athena inserts some services automatically. So only use this if running now.
    if args.run:
        from AthenaConfiguration.MainServicesConfig import MainServicesCfg
        cfg = MainServicesCfg(ConfigFlags)
        msgService = cfg.getService('MessageSvc')
        msgService.Format = "S:%s E:%e % F%128W%S%7W%R%T  %0W%M"
    else:
        cfg = ComponentAccumulator()

    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    cfg.merge(PoolReadCfg(ConfigFlags))
    return cfg
예제 #3
0
def OverlayMainCfg(configFlags):
    """Main overlay steering configuration"""

    # Construct our accumulator to run
    acc = OverlayMainServicesCfg(configFlags)
    acc.merge(PoolReadCfg(configFlags))
    acc.merge(PoolWriteCfg(configFlags))

    # Add event info overlay
    acc.merge(EventInfoOverlayCfg(configFlags))

    # Add truth overlay (needed downstream)
    acc.merge(CopyMcEventCollectionCfg(configFlags))
    acc.merge(CopyJetTruthInfoCfg(configFlags))
    acc.merge(CopyTimingsCfg(configFlags))
    acc.merge(CopyCaloCalibrationHitContainersCfg(configFlags))
    acc.merge(CopyTrackRecordCollectionsCfg(configFlags))

    # Inner detector
    if configFlags.Detector.OverlayBCM:
        acc.merge(BCMOverlayCfg(configFlags))
    if configFlags.Detector.OverlayPixel:
        acc.merge(PixelOverlayCfg(configFlags))
    if configFlags.Detector.OverlaySCT:
        acc.merge(SCTOverlayCfg(configFlags))
    if configFlags.Detector.OverlayTRT:
        acc.merge(TRTOverlayCfg(configFlags))

    # Calorimeters
    if configFlags.Detector.OverlayLAr:
        acc.merge(LArOverlayCfg(configFlags))
    if configFlags.Detector.OverlayTile:
        acc.merge(TileDigitizationCfg(configFlags))
    if configFlags.Detector.OverlayL1Calo:
        acc.merge(OverlayTTL1Cfg(configFlags))
        acc.merge(TileOverlayTriggerDigitizationCfg(configFlags))

    # Muon system
    if configFlags.Detector.OverlayCSC:
        acc.merge(CscOverlayCfg(configFlags))
    if configFlags.Detector.OverlayMDT:
        acc.merge(MdtOverlayCfg(configFlags))
    if configFlags.Detector.OverlayRPC:
        acc.merge(RpcOverlayCfg(configFlags))
    if configFlags.Detector.OverlayTGC:
        acc.merge(TgcOverlayCfg(configFlags))

    return acc
예제 #4
0
def PrepareStandAloneBTagCfg(inputFlags):
    result = ComponentAccumulator()

    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    result.merge(PoolReadCfg(inputFlags))

    from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg
    acc = TrackingGeometrySvcCfg(inputFlags)
    result.merge(acc)

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

    GeometryDBSvc = CompFactory.GeometryDBSvc
    result.addService(GeometryDBSvc("InDetGeometryDBSvc"))

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

    # get standard config for magnetic field - map and cache
    from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg
    result.merge(MagneticFieldSvcCfg(inputFlags))

    from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline

    #load folders needed for Run2 ID alignment
    result.merge(
        addFoldersSplitOnline(inputFlags,
                              "INDET",
                              "/Indet/Onl/Align",
                              "/Indet/Align",
                              className="AlignableTransformContainer"))
    result.merge(addFolders(inputFlags, ['/TRT/Align'], 'TRT_OFL'))

    #load folders needed for IBL
    result.merge(addFolders(inputFlags, ['/Indet/IBLDist'], 'INDET_OFL'))

    return result
예제 #5
0
def InDetClusterizationAlgorithmsCfg(flags, **kwargs):
    top_acc = ComponentAccumulator()
    ### configure top_acc to be able to read input file
    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    top_acc.merge(PoolReadCfg(flags))

    ### obtain pixel and SCT geometry
    from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg
    from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg
    top_acc.merge(PixelGeometryCfg(flags))
    top_acc.merge(SCT_GeometryCfg(flags))

    #redoPatternRecoAndTracking = kwargs.pop('redoPatternRecoAndTracking')
    # @TODO propagate suffix and/or prefix ?
    top_acc.merge(BCM_ZeroSuppressionCfg(flags))

    # Pixel clusterization
    ## @TODO is this correct flag to be used here to turn on pixel clusterization
    if flags.Detector.GeometryPixel:
        top_acc.merge(PixelClusterizationCfg(flags, **kwargs))
        if flags.InDet.doSplitReco:
            top_acc.merge(PixelClusterizationPUCfg(flags, **kwargs))

    # SCT clusterization
    ## @TODO is this correct flag to be used here to turn on SCT clusterization
    if flags.Detector.GeometrySCT:
        top_acc.merge(SCTClusterizationCfg(flags, **kwargs))
        if flags.InDet.doSplitReco:
            top_acc.merge(SCTClusterizationPUCfg(flags, **kwargs))

    # from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg
    # top_acc.merge( PixelConditionsSummaryCfg(flags))
    # FIXME - the above returns a tool. Need to do something with it!

    from SiLorentzAngleTool.SCT_LorentzAngleConfig import SCT_LorentzAngleCfg
    top_acc.popToolsAndMerge(SCT_LorentzAngleCfg(flags))
    return top_acc
예제 #6
0
    result.addEventAlgo(getOfflinePFAlgorithm(inputFlags))

    from eflowRec.PFCfg import getChargedPFOCreatorAlgorithm, getNeutralPFOCreatorAlgorithm
    result.addEventAlgo(getChargedPFOCreatorAlgorithm(inputFlags, ""))
    result.addEventAlgo(getNeutralPFOCreatorAlgorithm(inputFlags, ""))

    return result


if __name__ == "__main__":

    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior = True

    from AthenaConfiguration.AllConfigFlags import ConfigFlags as cfgFlags

    cfgFlags.Input.isMC = True
    cfgFlags.Input.Files = [
        "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc16_13TeV.361022.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ2W.recon.ESD.e3668_s3170_r10572_homeMade.pool.root"
    ]
    cfgFlags.lock()

    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
    cfg = MainServicesCfg(cfgFlags)

    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    cfg.merge(PoolReadCfg(cfgFlags))
    cfg.merge(PFCfg(cfgFlags))

    cfg.run()
예제 #7
0
    # Setup logs
    from AthenaCommon.Logging import log
    from AthenaCommon.Constants import INFO
    log.setLevel(INFO)

    # Set the Athena configuration flags
    from AthenaConfiguration.AllConfigFlags import ConfigFlags

    path = '/afs/cern.ch/work/j/jodafons/public/valid_sampleA/AOD.20745922._000041.pool.root.1'
    ConfigFlags.Input.Files = [path]
    ConfigFlags.Input.isMC = False
    ConfigFlags.Output.HISTFileName = 'TrigEgammaMonitorOutput.root'

    ConfigFlags.lock()

    # Initialize configuration object, add accumulator, merge, and run.
    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    cfg = MainServicesCfg(ConfigFlags)
    cfg.merge(PoolReadCfg(ConfigFlags))

    trigEgammaMonitorAcc = TrigEgammaMonConfig(ConfigFlags)
    cfg.merge(trigEgammaMonitorAcc)

    # If you want to turn on more detailed messages ...
    #trigEgammaMonitorAcc.getEventAlgo('TrigEgammaMonAlg').OutputLevel = 2 # DEBUG
    cfg.printConfig(withDetails=False)  # set True for exhaustive info

    cfg.run(10)  #use cfg.run(20) to only run on first 20 events
예제 #8
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
예제 #9
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)