Esempio 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
# ad-hoc configuration of pileup event loop manager

theApp.EventLoop = "PileUpEventLoopMgr"

pileUpEventLoopMgr = PileUpEventLoopMgr()
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"
from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool

pileUpEventLoopMgr = PileUpEventLoopMgr()
pileUpEventLoopMgr.OutStreamType = "AthenaOutputStream"

# Set up data input
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"
Esempio n. 4
0
PileUpEventLoopMgr = Service("PileUpEventLoopMgr")

pupStream = "PileUpCollXingStream"
from PileUpComps.PileUpCompsConf import BkgStreamsCache
from Digitization import PileUpEventType
from EventSelectorAthenaPool.EventSelectorAthenaPoolConf import EventSelectorAthenaPool

from Digitization.DigitizationFlags import digitizationFlags
PileUpEventLoopMgr.OrigSelector = "EventSelector"
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(
from AtlasGeoModel import GeoModelInit

from AthenaCommon.AppMgr import ServiceMgr
from PileUpComps.PileUpCompsConf import PileUpEventLoopMgr

# ad-hoc configuration of pileup event loop manager
theApp.EventLoop = "PileUpEventLoopMgr"
pileUpEventLoopMgr = PileUpEventLoopMgr()
from Digitization.DigitizationFlags import jobproperties
pupStream = "PileUpCollXingStream"
jobproperties.Digitization.rndmSeedList.addSeed(pupStream, 123, 345)
pileUpEventLoopMgr.OrigSelector = "EventSelector"

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

from AthenaCommon.AppMgr import ToolSvc
from LArRecUtils.LArRecUtilsConf import LArAutoCorrTotalTool
try: