Ejemplo n.º 1
0
def initMultiInput():
    global inputObjectList, pileUpEventLoopMgr, ServiceMgr, SkipEvents

    i = 0
    for iObj in inputObjectList:
        if i == 0:  #The Primary stream in PileUp
            #Selector of the first one has to be this name?
            pileUpEventLoopMgr.OrigSelector = "EventSelector"
            ServiceMgr.EventSelector.InputCollections = iObj.inputCollections
            pileUpEventLoopMgr.firstXing = 0
            pileUpEventLoopMgr.lastXing = 0
            ServiceMgr.EventSelector.SkipEvents = SkipEvents
        else:
            pileUpEventLoopMgr.bkgCaches += [
                BkgStreamsCache(iObj.objectName + "_Cache")
            ]
            tmpCache = pileUpEventLoopMgr.bkgCaches[
                len(pileUpEventLoopMgr.bkgCaches) - 1]
            tmpCache.CollPerXing = 1
            tmpCache.CollDistribution = "Fixed"
            tmpCache.ReadDownscaleFactor = 1

            tmpEvtSel = EventSelectorAthenaPool(iObj.objectName +
                                                "_EventSelector")
            tmpEvtSel.InputCollections = iObj.inputCollections
            tmpEvtSel.KeepInputFilesOpen = True
            tmpEvtSel.SkipEvents = SkipEvents

            ServiceMgr += tmpEvtSel
            tmpCache.EventSelector = iObj.objectName + "_EventSelector"

        print iObj.objectName
        print iObj.inputCollections
        i = i + 1
Ejemplo n.º 2
0
def getGenericBackgroundEventSelector(name="GenericBackgroundEventSelector",
                                      **kwargs):
    kwargs.setdefault('KeepInputFilesOpen', True)
    kwargs.setdefault('ProcessMetadata', False)

    from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
    return EventSelectorAthenaPool(name, **kwargs)
from Digitization.DigitizationFlags import jobproperties
pupStream = "PileUpCollXingStream"
jobproperties.Digitization.rndmSeedList.addSeed( pupStream, 123, 345 )
#define inputs
pileUpEventLoopMgr.OrigSelector="EventSelector"

from PileUpComps.PileUpCompsConf import BkgStreamsCache
from Digitization import PileUpEventType
from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
minBiasCache = BkgStreamsCache("MinBiasCache")
minBiasCache.CollPerXing=Ncoll
minBiasCache.CollDistribution="Poisson"
minBiasCache.ReadDownscaleFactor=1  # read one new event every event
minBiasCache.RndmGenSvc=jobproperties.Digitization.rndmSvc()
minBiasCache.RndmStreamName=pupStream
minBiasEvtSel = EventSelectorAthenaPool("minBiasEventSelector")
minBiasEvtSel.InputCollections = minBiasInputCols
minBiasEvtSel.KeepInputFilesOpen = True
ServiceMgr += minBiasEvtSel
minBiasCache.EventSelector="minBiasEventSelector"
pileUpEventLoopMgr.bkgCaches += [ minBiasCache ]

#define output stream
pileUpEventLoopMgr.OutStreamType = "AthenaOutputStream"

#define time range to be studied. t0 at t=0, xing=0
pileUpEventLoopMgr.XingFrequency=25;
pileUpEventLoopMgr.firstXing=0
pileUpEventLoopMgr.lastXing=0

pileUpEventLoopMgr.OutputLevel=VERBOSE
pileUpEventLoopMgr.OrigSelector = "EventSelector"
ServiceMgr.EventSelector.InputCollections = [
    "/afs/cern.ch/user/a/andr/scratch0/ideal2_valid1.007211.singlepart_mu10.digit.RDO.v13003002/RDO.016155._00001.pool.root.1"
]
pileUpEventLoopMgr.firstXing = 0
pileUpEventLoopMgr.lastXing = 0
ServiceMgr.EventSelector.SkipEvents = 0

# Set up MC input
pileUpEventLoopMgr.bkgCaches += [BkgStreamsCache("mcSignalEvent" + "_Cache")]
tmpCache = pileUpEventLoopMgr.bkgCaches[0]
tmpCache.CollPerXing = 1
tmpCache.CollDistribution = "Fixed"
tmpCache.ReadDownscaleFactor = 1

tmpEvtSel = EventSelectorAthenaPool("mcSignalEvent" + "_EventSelector")
tmpEvtSel.InputCollections = [
    "/afs/cern.ch/user/a/andr/scratch0/ideal2_valid1.007211.singlepart_mu10.digit.RDO.v13003002/RDO.016155._00002.pool.root.1"
]

tmpEvtSel.KeepInputFilesOpen = True
tmpEvtSel.SkipEvents = 1

ServiceMgr += tmpEvtSel
tmpCache.EventSelector = "mcSignalEvent" + "_EventSelector"

ServiceMgr += pileUpEventLoopMgr

#****************************************************************
from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
Ejemplo n.º 5
0
        "AthenaPoolAddressProviderSvc"
    ]
else:
    import AthenaPoolCnvSvc.ReadAthenaPool
    ServiceMgr.EventSelector.InputCollections = DataInputCollections

# Set up data input
pileUpEventLoopMgr.OrigSelector = "EventSelector"
pileUpEventLoopMgr.firstXing = 0
pileUpEventLoopMgr.lastXing = 0
pileUpEventLoopMgr.IsEventOverlayJob = True
pileUpEventLoopMgr.IsEventOverlayJobMC = not isRealData
ServiceMgr.EventSelector.SkipEvents = athenaCommonFlags.SkipEvents()

# Set up MC input
mcEvtSel = EventSelectorAthenaPool("mcSignal_EventSelector")
mcEvtSel.InputCollections = SignalInputCollections
mcEvtSel.KeepInputFilesOpen = True
mcEvtSel.SkipEvents = athenaCommonFlags.SkipEvents()

ServiceMgr += mcEvtSel
pileUpEventLoopMgr.SignalSelector = "mcSignal_EventSelector"

ServiceMgr += pileUpEventLoopMgr

if not hasattr(ServiceMgr, 'PileUpMergeSvc'):
    from PileUpTools.PileUpToolsConf import PileUpMergeSvc
    ServiceMgr += PileUpMergeSvc()
    del PileUpMergeSvc

# In overlaying unlike pileup we are NOT combining different MC events.
Ejemplo n.º 6
0
minBiasCache = BkgStreamsCache("MinBiasCache")
if hasattr(digitizationFlags, 'numberOfNDMinBias'):
    minBiasCache.CollPerXing = digitizationFlags.numberOfNDMinBias()
elif hasattr(digitizationFlags, 'numberOfLowPtMinBias'):
    minBiasCache.CollPerXing = digitizationFlags.numberOfLowPtMinBias()
else:
    raise AttributeError(
        "These job options require digitization jobproperties not present in this release! This job will crash."
    )
minBiasCache.RndmGenSvc = digitizationFlags.rndmSvc()
minBiasCache.RndmStreamName = pupStream
minBiasCache.PileUpEventType = PileUpEventType.MinimumBias
minBiasCache.ReadDownscaleFactor = 10  # read one new event every event

from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
minBiasEvtSel = EventSelectorAthenaPool("minBiasEventSelector")
if hasattr(digitizationFlags, 'NDMinBiasInputCols'):
    minBiasEvtSel.InputCollections = digitizationFlags.NDMinBiasInputCols()
elif hasattr(digitizationFlags, 'LowPtMinBiasInputCols'):
    minBiasEvtSel.InputCollections = digitizationFlags.LowPtMinBiasInputCols()
else:
    raise AttributeError(
        "These job options require digitization jobproperties not present in this release! This job will crash."
    )
minBiasEvtSel.KeepInputFilesOpen = kfOpen
minBiasEvtSel.ProcessMetadata = False
ServiceMgr += minBiasEvtSel
minBiasCache.EventSelector = 'minBiasEventSelector'
PileUpEventLoopMgr.bkgCaches += [minBiasCache]

MergeMcEventCollection = Algorithm("MergeMcEventCollection")
Ejemplo n.º 7
0
#--------------------------------------------------------------
# Converters to enable input.
#--------------------------------------------------------------

# the POOL converters
#include("MuonEventAthenaPool/MuonEventAthenaPool_joboptions.py" )

#--------------------------------------------------------------
# Define the input data stream.
#--------------------------------------------------------------

# Event selector
if inputStreamType == "HITS" or inputStreamType == "RDO":
    include("AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py")
    from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
    cscEventSelector = EventSelectorAthenaPool("EventSelector")
elif inputStreamType == "RAW":
    include("ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py")
    include("MuonByteStream/ReadCscRDO_jobOptions.py")
    svcMgr = theApp.serviceMgr()
    from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamEventStorageInputSvc
    svcMgr += ByteStreamEventStorageInputSvc("ByteStreamInputSvc")
    cscEventSelector = svcMgr.EventSelector
    from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamCnvSvc
    svcMgr += ByteStreamCnvSvc()
    ByteStreamCnvSvc = svcMgr.ByteStreamCnvSvc

if inputStreamType == "HITS":
    cscEventSelector.InputCollections = [
        "/afs/usatlas.bnl.gov/users/dladams/data/calib0.005145.PythiaZmumu.simul.HITS.v12003101_tid003432._00001.pool.root.1"
    ]
Ejemplo n.º 8
0
from AthenaCommon.AppMgr import theApp
theApp.EvtMax = EvtMax

from AthenaCommon.AppMgr import ServiceMgr
ServiceMgr.EventSelector.RunNumber = RunNumber
ServiceMgr.EventSelector.FirstEvent = FirstEvent

import AthenaPoolCnvSvc.AthenaPool

from PartPropSvc.PartPropSvcConf import *

#================================================================
# Add an extra EventSelector to read in real data events

from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
InputDataEventSelector = EventSelectorAthenaPool("InputDataEventSelector")
InputDataEventSelector.InputCollections = InputCollections
InputDataEventSelector.SkipEvents = 0

ServiceMgr += InputDataEventSelector

#----------------------------------------------------------------=
# And a separate event store for the custom selector
from StoreGate.StoreGateConf import StoreGateSvc
sg2 = StoreGateSvc("InputData_Event_SG")
#sg2.Dump = True
#sg2.OutputLevel = VERBOSE

#================================================================
# Output
Ejemplo n.º 9
0
## @file EventSelectorAthenaPool_jobOptions.py
## @brief EventSelector job options file to illustrate available EventSelector properties.
## @author Peter van Gemmeren <*****@*****.**>
###############################################################
#
# EventSelectorAthenaPool job options file
# Principally for documentation, to illustrate available EventSelectorAthenaPool properties
#
#==============================================================
# The next lines tell Athena to load the EventSelectorAthenaPool, and also where to find it.

## get a handle on the ServiceManager
from AthenaCommon.AppMgr import ServiceMgr as svcMgr

from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool
svcMgr += EventSelectorAthenaPool("EventSelector")

EventSelector = svcMgr.EventSelector
#
# Switch on firing of FileIncidents which will trigger processing of metadata.
EventSelector.ProcessMetadata = TRUE
# Type of the collection.
EventSelector.CollectionType = "ImplicitROOT"
# Prefix of the collection TTree
EventSelector.CollectionTree = "POOLContainer_"
# Connection string.
EventSelector.Connection = "<connectionString>"
# Attribute name.
EventSelector.RefName = "<attributeName>"
# AttributeListKey name
EventSelector.AttributeListKey = "Input"