예제 #1
0
def convert_clusters(seq, xaod_key, key):
    from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator
    alg = ClusterCreator(xaod_key + 'Cnv',
                         AODContainerNames=[key],
                         xAODContainerNames=[xaod_key])
    seq += alg
    return
예제 #2
0
from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg

if (objKeyStore.isInInput("<McEventCollection", "TruthEvent")):
    from xAODTruthCnv.xAODTruthCnvConf import xAODMaker__xAODTruthCnvAlg
    topSequence += xAODMaker__xAODTruthCnvAlg("GEN_AOD2xAOD")

    #EventInfo:
    if (objKeyStore.isInInput("EventInfo")
            and not objKeyStore.isInInput("xAOD::EventInfo")):
        from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg
        topSequence += xAODMaker__EventInfoCnvAlg()
#CaloClusters:
if (objKeyStore.isInInput("CaloClusterContainer")):
    from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator
    topSequence += ClusterCreator(
    )  #Converts all CaloClusterContainers it finds in SG to xAOD
    pass

#SA
if objKeyStore.isInInput("Rec::TrackParticleContainer",
                         MuonCbKeys.ExtrapolatedMSParticles()):
    from xAODTrackingCnv.xAODTrackingCnvConf import xAODMaker__TrackParticleCnvAlg
    alg1 = xAODMaker__TrackParticleCnvAlg("TrackParticleCnvAlg_ExtrapolatedMS")
    alg1.AODContainerName = MuonCbKeys.ExtrapolatedMSParticles(
    )  #ExtrapolatedMuonSpectrometerParticles
    alg1.xAODContainerName = MuonCbKeys.ExtrapolatedMSParticles()
    #alg1.OutputLevel = VERBOSE
    topSequence += alg1
    pass

# StatCombined
예제 #3
0
        CaloTowerContainer="CmbTowers",
        #                                        doCrossChecks=True
    )

if jobproperties.CaloRecFlags.doCaloTowerFromCluster(
) and rec.doESD and rec.doCalo():
    from CaloRec.CaloRecConf import CaloTowerxAODFromClusters
    topSequence += CaloTowerxAODFromClusters(
        CaloTowerContainer="CmbTopoTowers",
        #                                           doCrossChecks=True
    )

#Convert clusters to xAOD::CaloCluster (temporary solution)
if rec.doWritexAOD():
    from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator
    topSequence += ClusterCreator("CaloCluster2xAOD")

    #CaloClusterKeys=("CaloCalTopoCluster", "CaloTopoCluster", "EMTopoCluster430", "LArClusterEM", "LArClusterEM7_11Nocorr",
    #                 "CombinedCluster","EMTopoSW35","egClusterCollection","LArClusterEMSofte")
    #for k in CaloClusterKeys:
    #    itemname="CaloClusterContainer#"+k
    #    if objKeyStore["transient"].has_item(itemname):#  "CaloClusterContainer",k):
    #        print "Scheduling xAOD converter for CaloClusterContainer with key",k
    #        topSequence+=ClusterCreator("ClusterxAOD_"+k,AODContainerName=k,xAODContainerName=k,CellContainerName="AllCalo")
    #    else:
    #        print "CaloClusterContainer with key",k,"not found, no xAOD converter scheduled"
    #        pass
    #    pass

#L1Calo Trigger tower decoration
if globalflags.DataSource() == 'data' and rec.doESD() and rec.doCalo(
예제 #4
0
#include( "AthenaPython/iread_file.py" )

# Access the algorithm sequence:
from AthenaCommon.AlgSequence import AlgSequence
theJob = AlgSequence()

#cont="egClusterCollection"
cont = "CaloCalTopoCluster"

import AthenaPoolCnvSvc.ReadAthenaPool
svcMgr.EventSelector.InputCollections = [
    FNAME,
]
# Add the xAOD container creator algorithm:
from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator
alg = ClusterCreator(AODContainerName=cont)
#alg.OutputLevel = DEBUG
theJob += alg

import JetRec.JetEventSetup  # IMPORTANT ! this setups a necessary alg.
from xAODJetCnv.xAODJetCnvConf import xAODMaker__JetCnvAlg
jcnv = xAODMaker__JetCnvAlg(OutputLevel=2, ConstituentContainer="Clusters")
theJob += jcnv

# Create a POOL output file with the StoreGate contents:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
xaodStream = MSMgr.NewPoolStream("StreamXAOD", "xAOD.pool.root")

# compactify calo cell
from CaloTools.CaloToolsConf import CaloCompactCellTool
svcMgr.ToolSvc += CaloCompactCellTool()
예제 #5
0
# Set up the reading of the input AOD:
FNAME = "AOD.pool.root"
#include( "AthenaPython/iread_file.py" )

# Access the algorithm sequence:
from AthenaCommon.AlgSequence import AlgSequence
theJob = AlgSequence()

import AthenaPoolCnvSvc.ReadAthenaPool
svcMgr.EventSelector.InputCollections = [
    FNAME,
]
# Add the xAOD container creator algorithm:
from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator, ClusterDumper
alg = ClusterCreator(AODContainerNames=["CaloCalTopoCluster"],
                     OutputLevel=DEBUG)
#alg = ClusterCreator(OutputLevel=DEBUG)

theJob += alg

theJob += ClusterDumper("TopoDumper",
                        ContainerName="CaloCalTopoCluster",
                        FileName="TopoCluster.txt")

# Create a POOL output file with the StoreGate contents:
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
xaodStream = MSMgr.NewPoolStream("StreamXAOD", "xAOD.pool.root")

# Set up its contents:
xaodStream.AddItem("xAOD::CaloClusterContainer_v1#*")
xaodStream.AddItem("xAOD::CaloClusterAuxContainer_v1#*")
# Define input
import os

testdata = os.environ.get('D3PDTESTDATA',
                          '/afs/cern.ch/atlas/maxidisk/d33/referencefiles')
svcMgr.EventSelector.InputCollections = [
    testdata + '/aod/AOD-17.2.9.1/AOD-17.2.9.1-full.pool.root'
]

from AthenaCommon.AlgSequence import AlgSequence

topSequence = AlgSequence()

from xAODCaloEventCnv.xAODCaloEventCnvConf import ClusterCreator, ClusterDumper

topSequence += ClusterCreator(AODContainerNames=["CaloCalTopoCluster"])
topSequence += ClusterDumper("TopoDumper",
                             ContainerName="CaloCalTopoCluster",
                             FileName="TopoCluster.txt")


def compare():
    import os
    reffile = 'TopoCluster.txt.bz2'
    refpath = '../test/%s' % reffile
    if not os.path.exists(refpath):
        refpath = '../../test/%s' % reffile
    os.system('bzdiff -u %s %s' % ('TopoCluster.txt', refpath))


import atexit