Example #1
0
 def evgen_persistency(cls):
     """ EVGEN POOL file persistency
     """
     from G4AtlasApps.SimFlags import simFlags
     from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
     ## NB. Two-arg constructor is needed, since otherwise metadata writing fails!
     if hasattr(simFlags, "WriteTR") and simFlags.WriteTR.statusOn:
         stream2 = AthenaPoolOutputStream("StreamEVGEN", simFlags.WriteTR.get_Value())
         stream2.ItemList += ["IOVMetaDataContainer#*",
                              "EventInfo#*"]
         if simFlags.CavernBG.statusOn and 'Write' in simFlags.CavernBG.get_Value():
             stream2.ItemList += ["TrackRecordCollection#NeutronBG"]
         else:
             stream2.ItemList += ["TrackRecordCollection#CosmicRecord"]
         stream2.AcceptAlgs = ["G4AtlasAlg"]
     if hasattr(simFlags,'StoppedParticleFile') and simFlags.StoppedParticleFile.statusOn:
         stream2 = AthenaPoolOutputStream("StreamEVGEN", simFlags.StoppedParticleFile.get_Value())
         stream2.ItemList += ["IOVMetaDataContainer#*",
                              "EventInfo#*"]
         stream2.ItemList += ["TrackRecordCollection#StoppingPositions"]
         stream2.AcceptAlgs = ["G4AtlasAlg"]
Example #2
0
#theApp.Dlls                += [ "RootHistCnv" ]
# Change the following line to "ROOT" for ROOT persistency
theApp.HistogramPersistency = "ROOT"
#--------------------------------------------------------------
# NTuple output file
#--------------------------------------------------------------
#RootHistSvc = Service( "RootHistSvc" )
#HbookHistSvc.NPAWC = 1500000
#HistogramPersistencySvc = Service( "HistogramPersistencySvc" )
#HistogramPersistencySvc.OutputFile  = "histo.root"
svcMgr.NTupleSvc.Output = [ "FILE1  DATAFILE='pythiaB.root'  OPT='NEW'  TYP='ROOT'" ]

###############################################################
# Add POOL persistency

from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
include( "GeneratorObjectsAthenaPool/GeneratorObjectsAthenaPool_joboptions.py" )

Stream1 = AthenaPoolOutputStream( "Stream1" )
Stream1.OutputFile = "pythiaB.pool.root"
# 2101 = EventInfo
# 133273 = MCTruth (HepMC)
Stream1.ItemList += [ "2101#*", "133273#*" ]
Stream1.AcceptAlgs = [ "BSignalFilter" ]

#==============================================================
#
# End of job options file
#
###############################################################
if not hasattr(runArgs,"outputHitsFile"):
    raise RuntimeError("No outputHitsFile provided.")
Out = runArgs.outputHitsFile 
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
try: 
  StreamHITS = AthenaPoolOutputStream( "StreamHITS", Out, True )
except:
  StreamHITS = AthenaPoolOutputStream( "StreamHITS", "DidNotSetOutputName.root", True )
StreamHITS.TakeItemsFromInput=TRUE;
StreamHITS.ForceRead=TRUE;  #force read of output data objs
# The next line is an example on how to exclude clid's if they are causing a  problem
#StreamHITS.ExcludeList = ['6421#*']

# Look for lists of filter algorithms
try:
  StreamHITS.AcceptAlgs = AcceptList
except:
  print "No accept algs indicated in AcceptList"
try:
  StreamHITS.RequireAlgs = RequireList
except:
  print "No accept algs indicated in RequireList"
try:
  StreamHITS.VetoAlgs = VetoList
except:
  print "No accept algs indicated in VetoList"


MessageSvc = ServiceMgr.MessageSvc
MessageSvc.OutputLevel = INFO
Example #4
0
                                noTag=False)
Others.CheckNumberOfWrites = False
# Events that failed at least one filter
Bad = AthenaPoolOutputStream("Bad",
                             "AthenaPoolMultiTest_Missed.root",
                             False,
                             noTag=False)
Bad.CheckNumberOfWrites = False

# Configure them using filter methods and itemlist
# Must make sure that no OutStream's have been declared
#theApp.OutStream    = [];

# bit 2
Stream2.TakeItemsFromInput = True
Stream2.AcceptAlgs = ["Splitter2"]
Stream2.VetoAlgs = ["Splitter1"]
Stream2.WritingTool.SaveDecisions = True
# bit 1
Stream1.TakeItemsFromInput = True
Stream1.AcceptAlgs = ["Splitter1"]
# bit 3
Stream3.TakeItemsFromInput = True
Stream3.AcceptAlgs = ["Splitter3"]
Stream3.VetoAlgs = ["Splitter1"]
Stream3.VetoAlgs += ["Splitter2"]
# missed
Others.TakeItemsFromInput = True
Others.ExcludeList = ['FauxTriggerMap#ExcludeTestTrigMap']
Others.AcceptAlgs = ["Triggered"]
Others.VetoAlgs = ["Splitter1"]
Example #5
0
if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi():
  from OverlayCommonAlgs.OverlayFlags import overlayFlags
  eventInfoKey = overlayFlags.bkgPrefix() + "EventInfo"
else:
  eventInfoKey = "EventInfo"

from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
StreamRDO = AthenaPoolOutputStream( "StreamRDO", outputFile, asAlg=True, noTag=True, eventInfoKey=eventInfoKey )
StreamRDO.TakeItemsFromInput=TRUE;
# The next line is an example on how to exclude clid's if they are causing a  problem
#StreamRDO.ExcludeList = ['6421#*']

# Look for lists of filter algorithms
try:
  StreamRDO.AcceptAlgs = AcceptList
except:
  print("No accept algs indicated in AcceptList")
try:
  StreamRDO.RequireAlgs = RequireList
except:
  print("No accept algs indicated in RequireList")
try:
  StreamRDO.VetoAlgs = VetoList
except:
  print("No accept algs indicated in VetoList")

# Perfmon
from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
pmon_properties.PerfMonFlags.doMonitoring=True
pmon_properties.PerfMonFlags.doSemiDetailedMonitoring=True
Example #6
0
    def hits_persistency():
        """ HITS POOL file persistency
        """
        from G4AtlasApps.SimFlags import simFlags
        from AthenaCommon.DetFlags import DetFlags
        from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
        from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream

        ## Not yet understood, but need to treat StreamHITS as alg in Hive.
        ## Seems to also work fine outside of Hive, but to be extra safe I'm
        ## only changing it in Hive.
        from AthenaCommon.ConcurrencyFlags import jobproperties as concurrencyProps
        if concurrencyProps.ConcurrencyFlags.NumThreads() > 0:
            as_alg = True
        else:
            as_alg = False
        ## NB. Two-arg constructor is needed, since otherwise metadata writing fails!
        stream1 = AthenaPoolOutputStream("StreamHITS",
                                         athenaCommonFlags.PoolHitsOutput(),
                                         asAlg=as_alg)

        ## Write geometry tag info - move to main method
        #import EventInfoMgt.EventInfoMgtInit

        ## EventInfo & TruthEvent always written by default
        stream1.ForceRead = True
        stream1.ItemList = [
            "EventInfo#*", "McEventCollection#TruthEvent", "JetCollection#*"
        ]

        ## If we are running quasi-stable particle simulation, include the original event record
        if hasattr(
                simFlags, 'IncludeParentsInG4Event'
        ) and simFlags.IncludeParentsInG4Event.statusOn and simFlags.IncludeParentsInG4Event(
        ):
            stream1.ItemList += ["McEventCollection#GEN_EVENT"]

        stream1.ItemList += ["xAOD::JetContainer#*", "xAOD::JetAuxContainer#*"]

        ## Make stream aware of aborted events
        stream1.AcceptAlgs = ["G4AtlasAlg"]

        ## Detectors

        ## Inner Detector
        if DetFlags.ID_on():
            stream1.ItemList += [
                "SiHitCollection#*", "TRTUncompressedHitCollection#*",
                "TrackRecordCollection#CaloEntryLayer"
            ]
        ## Calo
        if DetFlags.Calo_on():
            stream1.ItemList += [
                "CaloCalibrationHitContainer#*",
                "LArHitContainer#*",
                "TileHitVector#*",
                #"SimpleScintillatorHitCollection#*",
                "TrackRecordCollection#MuonEntryLayer"
            ]
        ## Muon
        if DetFlags.Muon_on():
            stream1.ItemList += [
                "RPCSimHitCollection#*", "TGCSimHitCollection#*",
                "CSCSimHitCollection#*", "MDTSimHitCollection#*",
                "TrackRecordCollection#MuonExitLayer"
            ]
            if hasattr(simFlags, 'SimulateNewSmallWheel'):
                if simFlags.SimulateNewSmallWheel():
                    stream1.ItemList += ["GenericMuonSimHitCollection#*"]
        ## Lucid
        if DetFlags.Lucid_on():
            stream1.ItemList += ["LUCID_SimHitCollection#*"]

        ## FwdRegion
        if DetFlags.FwdRegion_on():
            stream1.ItemList += ["SimulationHitCollection#*"]

        ## ZDC
        if DetFlags.ZDC_on():
            stream1.ItemList += [
                "ZDC_SimPixelHit_Collection#*", "ZDC_SimStripHit_Collection#*"
            ]
        ## ALFA
        if DetFlags.ALFA_on():
            stream1.ItemList += [
                "ALFA_HitCollection#*", "ALFA_ODHitCollection#*"
            ]

        ## AFP
        if DetFlags.AFP_on():
            stream1.ItemList += [
                "AFP_TDSimHitCollection#*", "AFP_SIDSimHitCollection#*"
            ]

        ### Ancillary scintillators
        #stream1.ItemList += ["ScintillatorHitCollection#*"]

        ## TimingAlg
        stream1.ItemList += ["RecoTimingObj#EVNTtoHITS_timings"]

        ## Add cosmics and test beam configuration hit persistency if required cf. geom tag
        layout = simFlags.SimLayout.get_Value()
        if "tb" not in layout:
            from AthenaCommon.BeamFlags import jobproperties
            if jobproperties.Beam.beamType() == 'cosmics' or \
                    (hasattr(simFlags, "WriteTR") and simFlags.WriteTR.statusOn) or \
                    (hasattr(simFlags, "ReadTR") and simFlags.ReadTR.statusOn):
                stream1.ItemList += [
                    "TrackRecordCollection#CosmicRecord",
                    "TrackRecordCollection#CosmicPerigee"
                ]
        else:
            ## CTB-specific
            if layout.startswith("ctb"):
                if simFlags.LArFarUpstreamMaterial.statusOn and simFlags.LArFarUpstreamMaterial.get_Value(
                ):
                    stream1.ItemList.append(
                        "TrackRecordCollection#LArFarUpstreamMaterialExitLayer"
                    )
            ## Persistency of test-beam layout
            if layout.startswith('ctb') or layout.startswith('tb_Tile2000_'):
                stream1.ItemList += ["TBElementContainer#*"]
Example #7
0
svcMgr.PoolSvc.WriteCatalog = "xmlcatalog_file:SplittableData.xml"

from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc
svcMgr += AthenaPoolCnvSvc()
svcMgr.AthenaPoolCnvSvc.CommitInterval = 10

include("AthenaPoolMultiTest/ExampleStreamConfig.py")

from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
DataStream = AthenaPoolOutputStream("DataStream",
                                    "AthenaPoolMultiTest_Splittable0.root",
                                    True)
DataStream.ItemList = exampleItemList  # comes from ExampleStreamConfig
DataStream.ItemList += ["FauxTriggerMap#*"]  # add item not in StreamConfig
DataStream.MetadataItemList += exampleMetadataList
DataStream.AcceptAlgs = ["PassAllFilter"]
DataStream.RequireAlgs = ["PassAllFilter"]
DataStream.VetoAlgs = ["PassNoneFilter"]

#--------------------------------------------------------------
# Consequently, should have 3 output files
#    Numbers 3, 4, from PassAll and 1 from Passnone
#--------------------------------------------------------------
#
#  Now configure output collection
#
#--------------------------------------------------------------
from RegistrationServices.RegistrationServicesConf import RegistrationStream
from RegistrationServices.RegistrationServicesConf import RegistrationStreamTagTool

TagTool = RegistrationStreamTagTool("TagTool")
Example #8
0
StreamDPD.ItemList += ['MissingET#MET_LocHadObj']
StreamDPD.ItemList += ['CaloClusterContainer#CaloCalTopoCluster']
StreamDPD.ItemList += ['Analysis::MuonContainer#StacoMuonCollection']
StreamDPD.ItemList += ['JetCollection#Kt4LCTopoJets']
StreamDPD.ItemList += ['JetCollection#Kt4TruthJets']
#StreamDPD.ItemList += ['JetCollection#Cone4H1TowerJets']
StreamDPD.ItemList += ['JetKeyDescriptor#JetKeyMap']
StreamDPD.ItemList += ['Rec::TrackParticleContainer#TrackParticleCandidate']
StreamDPD.ItemList += ['Rec::TrackParticleContainer#StacoTrackParticles']
StreamDPD.ItemList += ['TruthParticleContainer#SpclMC']
StreamDPD.ItemList += ['McEventCollection#GEN_AOD']

StreamDPD.OutputFile = "SkimmedThin.AOD.pool.root"
#StreamDPD.OutputFile = outFileName
StreamDPD.ForceRead = TRUE
#force read of output data objs
StreamDPD.AcceptAlgs = ["ttbarFilter"]

ChronoStatSvc = Service("ChronoStatSvc")
ChronoStatSvc.ChronoDestinationCout = True

ChronoStatSvc.PrintUserTime = True
ChronoStatSvc.PrintSystemTime = True
ChronoStatSvc.PrintEllapsedTime = True
AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc")
AthenaPoolCnvSvc.UseDetailChronoStat = True

#MessageSvc = Service("MessageSvc")
#MessageSvc.OutputLevel = DEBUG
#MessageSvc.OutputLevel = ERROR
Example #9
0
Out = runArgs.outputHITS_MRGFile
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
try:
    StreamHITS = AthenaPoolOutputStream("StreamHITS", Out, True)
except:
    StreamHITS = AthenaPoolOutputStream("StreamHITS",
                                        "DidNotSetOutputName.root", True)
StreamHITS.TakeItemsFromInput = TRUE
StreamHITS.ForceRead = TRUE
#force read of output data objs
# The next line is an example on how to exclude clid's if they are causing a  problem
#StreamHITS.ExcludeList = ['6421#*']

# Look for lists of filter algorithms
try:
    StreamHITS.AcceptAlgs = AcceptList
except:
    print "No accept algs indicated in AcceptList"
try:
    StreamHITS.RequireAlgs = RequireList
except:
    print "No accept algs indicated in RequireList"
try:
    StreamHITS.VetoAlgs = VetoList
except:
    print "No accept algs indicated in VetoList"

# Perfmon
from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
pmon_properties.PerfMonFlags.doMonitoring = True
pmon_properties.PerfMonFlags.doSemiDetailedMonitoring = True
Example #10
0
# Unfiltered stream
StreamAll = AthenaPoolOutputStream("StreamAll",
                                   "AthenaPoolMultiTest_StreamAll.root",
                                   False,
                                   noTag=False)
StreamAll.CheckNumberOfWrites = False
StreamAll.WritingTool.AttributeListKey = "SimpleTag"
StreamAll.WritingTool.SaveDecisions = True

# Configure them using filter methods and itemlist
# Must make sure that no OutStream's have been declared
#theApp.OutStream    = [];

# bit 2
Stream2.TakeItemsFromInput = True
Stream2.AcceptAlgs = ["Splitter2"]
Stream2.VetoAlgs = ["Splitter1"]
# bit 1
Stream1.TakeItemsFromInput = True
Stream1.AcceptAlgs = ["Splitter1"]
# bit 3
Stream3.TakeItemsFromInput = True
Stream3.AcceptAlgs = ["Splitter3"]
Stream3.VetoAlgs = ["Splitter2"]
# Unfiltered
StreamAll.TakeItemsFromInput = True

for stream in [Stream1, Stream2, Stream3]:
    stream.WriteOnExecute = False
    stream.MetadataItemList = []
Example #11
0
    raise RuntimeError("No outputEVNT_TR_MRGFile provided.")
Out = runArgs.outputEVNT_TR_MRGFile
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
try:
    StreamEVGEN = AthenaPoolOutputStream("StreamEVGEN", Out, True)
except:
    StreamEVGEN = AthenaPoolOutputStream("StreamEVGEN",
                                         "DidNotSetOutputName.root", True)
StreamEVGEN.TakeItemsFromInput = True
StreamEVGEN.ForceRead = True  #force read of output data objs
# The next line is an example on how to exclude clid's if they are causing a  problem
#StreamEVGEN.ExcludeList = ['6421#*']

# Look for lists of filter algorithms
try:
    StreamEVGEN.AcceptAlgs = AcceptList
except:
    print "No accept algs indicated in AcceptList"
try:
    StreamEVGEN.RequireAlgs = RequireList
except:
    print "No accept algs indicated in RequireList"
try:
    StreamEVGEN.VetoAlgs = VetoList
except:
    print "No accept algs indicated in VetoList"

# Perfmon
from PerfMonComps.PerfMonFlags import jobproperties as pmon_properties
pmon_properties.PerfMonFlags.doMonitoring = True
pmon_properties.PerfMonFlags.doSemiDetailedMonitoring = True
Example #12
0
StreamDPD.ItemList += ['MissingET#MET_RefFinal']
StreamDPD.ItemList += ['MissingET#MET_LocHadObj']
StreamDPD.ItemList += ['CaloClusterContainer#CaloCalTopoCluster']
StreamDPD.ItemList += ['Analysis::MuonContainer#StacoMuonCollection']
StreamDPD.ItemList += ['JetCollection#Kt4LCTopoJets']
StreamDPD.ItemList += ['JetKeyDescriptor#JetKeyMap']
StreamDPD.ItemList += ['JetCollection#Kt4TruthJets']
StreamDPD.ItemList += ['Rec::TrackParticleContainer#TrackParticleCandidate']
StreamDPD.ItemList += ['Rec::TrackParticleContainer#StacoTrackParticles']
StreamDPD.ItemList += ['TruthParticleContainer#SpclMC']
StreamDPD.ItemList += ['McEventCollection#GEN_AOD']

StreamDPD.OutputFile = "SkimmedThin.AOD.pool.root"
#StreamDPD.OutputFile = outFileName
StreamDPD.ForceRead=TRUE;  #force read of output data objs
StreamDPD.AcceptAlgs=["ttbarFilter"]


ChronoStatSvc = Service( "ChronoStatSvc" )
ChronoStatSvc.ChronoDestinationCout = True

ChronoStatSvc.PrintUserTime     = True
ChronoStatSvc.PrintSystemTime   = True
ChronoStatSvc.PrintEllapsedTime = True
AthenaPoolCnvSvc = Service( "AthenaPoolCnvSvc" )
AthenaPoolCnvSvc.UseDetailChronoStat = True

MessageSvc = Service("MessageSvc")
#MessageSvc.OutputLevel = DEBUG
#MessageSvc.OutputLevel = ERROR
Example #13
0
except:
    print "Reading from file"

from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
try:
    Stream1 = AthenaPoolOutputStream("Stream1", Out, True)
except:
    Stream1 = AthenaPoolOutputStream("Stream1", "DidNotSetOutputName.root",
                                     True)
Stream1.TakeItemsFromInput = TRUE
# The next line is an example on how to exclude clid's if they are causing a  problem
#Stream1.ExcludeList = ['6421#*']

# Look for lists of filter algorithms
try:
    Stream1.AcceptAlgs = AcceptList
except:
    print "No accept algs indicated in AcceptList"
try:
    Stream1.RequireAlgs = RequireList
except:
    print "No accept algs indicated in RequireList"
try:
    Stream1.VetoAlgs = VetoList
except:
    print "No accept algs indicated in VetoList"

from IOVDbMetaDataTools.IOVDbMetaDataToolsConf import IOVDbMetaDataTool
svcMgr.MetaDataSvc.MetaDataTools += ["IOVDbMetaDataTool"]

# EventCheck configuration ------------------------ END
StreamDPD = AthenaPoolOutputStream("StreamDPD")

## configure the thinning service
from AthenaServices.Configurables import ThinningSvc

svcMgr += ThinningSvc(Streams=['StreamDPD'])

######################Write Item List##########################################
StreamDPD.ItemList = ['EventInfo#*', 'TrackRecordCollection#*']
StreamDPD.ItemList += ['ElectronContainer#ElectronAODCollection']
StreamDPD.ItemList += ['egDetailContainer#egDetailAOD']
StreamDPD.ItemList += ['Analysis::MuonContainer#StacoMuonCollection']
StreamDPD.ItemList += ['JetKeyDescriptor#JetKeyMap']
StreamDPD.ItemList += ['JetCollection#Cone4H1TowerJets']
StreamDPD.ItemList += ['JetCollection#Cone4TruthJets']
StreamDPD.ItemList += ['Rec::TrackParticleContainer#TrackParticleCandidate']
StreamDPD.ItemList += ['Rec::TrackParticleContainer#StacoTrackParticles']
StreamDPD.ItemList += ['VxContainer#*']

StreamDPD.ForceRead = TRUE
#force read of output data objs

#electron Filter
StreamDPD.AcceptAlgs = ["ElectronFilter"]

#=============================================================
#
# End of job options file
#
###############################################################