if hasattr(runArgs,"skipEvents"):
    SkipEvents = runArgs.skipEvents
ServiceMgr.EventSelector.SkipEvents = SkipEvents

#--------------------------------------------------------------
# Setup Output
#--------------------------------------------------------------
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
Beispiel #2
0
# Setup Output
#--------------------------------------------------------------
if hasattr(runArgs, "outputRDO_MRGFile"):
  outputFile = runArgs.outputRDO_MRGFile
else:
  outputFile = "DidNotSetOutputName.root"

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:
Beispiel #3
0
                                False,
                                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"]
if hasattr(runArgs,"preExec"):
    recoLog.info("transform pre-exec")
    for cmd in runArgs.preExec:
        recoLog.info(cmd)
        exec(cmd)

## Pre-include
if hasattr(runArgs,"preInclude"): 
    for fragment in runArgs.preInclude:
        print "preInclude",fragment
        include(fragment)


## copy everything from the input file
## must force reading of all input objects
outStream.TakeItemsFromInput = True
outStream.ForceRead          = True
outStream.ItemList += [ "McEventCollection#*" ]


## Post-include
if hasattr(runArgs,"postInclude"): 
    for fragment in runArgs.postInclude:
        include(fragment)

## Post-exec
if hasattr(runArgs,"postExec"):
    recoLog.info("transform post-exec")
    for cmd in runArgs.postExec:
        recoLog.info(cmd)
        exec(cmd)
Beispiel #5
0
    SkipEvents = runArgs.skipEvents
ServiceMgr.EventSelector.SkipEvents = SkipEvents

#--------------------------------------------------------------
# Setup Output
#--------------------------------------------------------------
if not hasattr(runArgs, "outputHITS_MRGFile"):
    raise RuntimeError("No outputHITS_MRGFile provided.")
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:
Beispiel #6
0
## Configure POOL streaming to the output EVNT format file
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
from AthenaPoolCnvSvc.AthenaPoolCnvSvcConf import AthenaPoolCnvSvc
svcMgr.AthenaPoolCnvSvc.CommitInterval = 10  #< tweak for MC needs
if hasattr(runArgs, "outputEVNTFile"):
    poolFile = runArgs.outputEVNTFile
elif hasattr(runArgs, "outputEVNT_PreFile"):
    poolFile = runArgs.outputEVNT_PreFile
else:
    raise RuntimeError(
        "Output pool file, either EVNT or EVNT_Pre, is not known.")

StreamEVGEN = AthenaPoolOutputStream("StreamEVGEN", poolFile)
if hasattr(runArgs, "inputEVNT_PreFile"):
    svcMgr.EventSelector.InputCollections = runArgs.inputEVNT_PreFile
    StreamEVGEN.TakeItemsFromInput = True

StreamEVGEN.ForceRead = True
StreamEVGEN.ItemList += ["EventInfo#*", "McEventCollection#*"]
StreamEVGEN.RequireAlgs += ["EvgenFilterSeq"]
## Used for pile-up (remove dynamic variables except flavour labels)
if evgenConfig.saveJets:
    StreamEVGEN.ItemList += ["xAOD::JetContainer_v1#*"]
    StreamEVGEN.ItemList += [
        "xAOD::JetAuxContainer_v1#*.TruthLabelID.PartonTruthLabelID"
    ]

## Set the run numbers
dsid = os.path.basename(runArgs.jobConfig[0])
if not dsid.isdigit():
    dsid = "999999"
Beispiel #7
0
]
ServiceMgr.AthenaPoolCnvSvc.PrintInputAttrPerEvt += ["FILE_READ_CALLS = 'int'"]

ServiceMgr.AthenaPoolCnvSvc.InputPoolAttributes += ["ASYNC_PREFETCHING = '1'"]

ServiceMgr.AthenaPoolCnvSvc.UseDetailChronoStat = True
ServiceMgr.AthenaPoolCnvSvc.SkipFirstChronoCommit = True

# Copy Output
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
StreamAOD = AthenaPoolOutputStream("StreamAOD", "AOD_copy.pool.root", True)
# Base the xAOD branch names just on the SG keys:
StreamAOD.WritingTool.SubLevelBranchName = "<key>"

StreamAOD.ForceRead = True
StreamAOD.TakeItemsFromInput = True
StreamAOD.ExcludeList += ["CaloCellContainer#*"]
StreamAOD.ExcludeList += ["TileCellContainer#*"]
StreamAOD.ExcludeList += ["CaloClusterCellLinkContainer#*"]

#--------------------------------------------------------------
# Performance Monitoring
#--------------------------------------------------------------
from PerfMonComps.PerfMonFlags import jobproperties as pmjp
pmjp.PerfMonFlags.doPostProcessing = True
pmjp.PerfMonFlags.doSemiDetailedMonitoringFullPrint = True
#pmjp.PerfMonFlags.doDetailedMonitoring = True

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
#--------------------------------------------------------------
Beispiel #8
0
    EventSelector.InputCollections = In
except:
    print "Usage: -c 'In=['file']'"
# Check collection type
try:
    EventSelector.CollectionType = CollType
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:
Beispiel #9
0
Stream3.CheckNumberOfWrites = False
# 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 = []
#topSequence.ttbarFilter.jetsName = 'Kt4LCTopoJets' # use new LC topo jets
#topSequence.ttbarFilter.maxDeltaRcx = 100.4       # effectively switch off
                                                   # cluster thinning

#print topSequence
#==============================================================
#
# End of job options file
#
###############################################################
#--------------------------------------------------------------
#---   Secondary Write portion  ----- Don't change it !!!
#--------------------------------------------------------------
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
StreamDPD = AthenaPoolOutputStream("StreamDPD")
StreamDPD.TakeItemsFromInput = True
#StreamDPD.ItemList += ['CaloClusterContainer#CaloCalTopoCluster']
#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.ExcludeList =['CaloClusterContainer#CaloCalTopoCluster']
StreamDPD.ExcludeList+=['TrigRoiDescriptor#HLTAutoKey*']
StreamDPD.ExcludeList+=['98849495#ConvertedMBoySegments']
StreamDPD.ExcludeList+=['107385089#*']
StreamDPD.ExcludeList+=['Rec::TrackParticleContainer#TrackParticleCandidate']
StreamDPD.OutputLevel = DEBUG
StreamDPD.OutputFile = "SkimmedThin.AOD.pool.root"
#StreamDPD.OutputFile = outFileName
 
svcMgr.EventSelector.InputCollections =  ["AthenaPoolMultiTest_StreamAll2.root"]

#--------------------------------------------------------------
# Private Application Configuration options
#--------------------------------------------------------------
# include stream transform
include( "AthenaPoolMultiTest/ExampleStreamConfig.py" )

from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
# Unfiltered stream
StreamAll = AthenaPoolOutputStream( "StreamAllP", "AthenaPoolMultiTest_Propagate.root", False, noTag=False, decisionFilter="Stream" )
StreamAll.CheckNumberOfWrites = False
StreamAll.WritingTool.AttributeListKey="SimpleTag"
StreamAll.WritingTool.SaveDecisions = False
StreamAll.TakeItemsFromInput = True

#EventInfoTagBuilder.FilterString = "Stream"
#EventInfoTagBuilder.PropagateInput=True

# Add the outputstreams to the execution sequence
#athOutSeq+=StreamAll

#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL)
#--------------------------------------------------------------
svcMgr.MessageSvc.OutputLevel = INFO
svcMgr.MessageSvc.debugLimit = 5000
import AthenaCommon.CfgMgr as CfgMgr
if not hasattr(svcMgr, 'DecisionSvc'): svcMgr += CfgMgr.DecisionSvc()
svcMgr.DecisionSvc.CalcStats = True
Beispiel #12
0
job += epos

genSeq.ExtSvc += ["AtRndmGenSvc"]

# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc = Service("MessageSvc")
MessageSvc.OutputLevel = 3

# Number of events to be processed (default is 10)
#theApp.EvtMax = 200
evgenConfig.minevents = 100

# ----------------------------------------------------------------------
# Printing service
# ----------------------------------------------------------------------
from TruthExamples.TruthExamplesConf import DumpMC
#job += DumpMC()

# ----------------------------------------------------------------------
# Ntuple service output
# ----------------------------------------------------------------------
import AthenaPoolCnvSvc.WriteAthenaPool
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream

stream1 = AthenaPoolOutputStream("StreamEVGEN")
stream1.WritingTool = "AthenaOutputStreamTool"
stream1.OutputFile = "epos_events.pool.root"
stream1.TakeItemsFromInput = True
stream1.ItemList += ['EventInfo#*', 'McEventCollection#*']
# ----------------------------------------------------------------------
Beispiel #13
0
#topSequence.ttbarFilter.jetsName = 'Kt4LCTopoJets' # use new LC topo jets
#topSequence.ttbarFilter.maxDeltaRcx = 100.4       # effectively switch off
# cluster thinning

#print topSequence
#==============================================================
#
# End of job options file
#
###############################################################
#--------------------------------------------------------------
#---   Secondary Write portion  ----- Don't change it !!!
#--------------------------------------------------------------
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
StreamDPD = AthenaPoolOutputStream("StreamDPD")
StreamDPD.TakeItemsFromInput = True
#StreamDPD.ItemList += ['CaloClusterContainer#CaloCalTopoCluster']
#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.ExcludeList = ['CaloClusterContainer#CaloCalTopoCluster']
StreamDPD.ExcludeList += ['TrigRoiDescriptor#HLTAutoKey*']
StreamDPD.ExcludeList += ['98849495#ConvertedMBoySegments']
StreamDPD.ExcludeList += ['107385089#*']
StreamDPD.ExcludeList += ['Rec::TrackParticleContainer#TrackParticleCandidate']
StreamDPD.OutputLevel = DEBUG
StreamDPD.OutputFile = "SkimmedThin.AOD.pool.root"
#StreamDPD.OutputFile = outFileName
if BTaggingFlags.doJetTagSlimNtuple:
  theApp.TopAlg = [ e for e in theApp.TopAlg if e not in ['JetTagNtupleBuilder/JTNtSlimBuilder'] ]
  theApp.TopAlg += ['JetTagNtupleBuilder/JTNtSlimBuilder']

# override DB: to have the worst case for pixel dead modules
if OverridePixMapOverlay != "":
  print '#BTAG# Overriding PixMapOverlay with ',OverridePixMapOverlay
  conddb.addOverride('/PIXEL/PixMapOverlay', OverridePixMapOverlay)

# --- output a new AOD file if requested (not fully validated ! strange behavior for re-tagged collections !)
if WriteNewAODFile:
  from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
  StreamAOD = AthenaPoolOutputStream( "StreamAOD", "newAOD.pool.root", True )
  StreamAOD.ForceRead = True 
  StreamAOD.ExtendProvenanceRecord = False 
  StreamAOD.TakeItemsFromInput=True
  taggedJetList = []
  for key in BTaggingFlags.Jets:
    if key in BTaggingFlags.RetagJets:
#      newJetColl = "JetCollection#"+key+"JetsAOD"
      newJetColl = "JetCollection#"+key+"JetsReTagged"
    else:
      newJetColl = "JetCollection#"+key+"Jets"
    print '#BTAG# jet collection: ',newJetColl
    taggedJetList +=  [ newJetColl ]
  StreamAOD.ItemList += taggedJetList
  print '#BTAG# writing out :',StreamAOD.ItemList

# --- Filter on GRL first:
## For data, use the Good Run / Lumi Block List
## use grlb algorithm for event selection.