Skip to content
Snippets Groups Projects
Commit d9003323 authored by Stewart Martin-Haugh's avatar Stewart Martin-Haugh Committed by Frank Winklmeier
Browse files

py3 fixes for EventInfo

parent ac357f41
No related branches found
No related tags found
No related merge requests found
......@@ -60,13 +60,3 @@ atlas_add_test( TagInfo_test
)
set_target_properties( EventInfo_TagInfo_test PROPERTIES ENABLE_EXPORTS True )
# Install files from the package:
atlas_install_python_modules( python/*.py )
atlas_install_joboptions( share/*.py )
atlas_add_test( flake8
SCRIPT flake8 --select=ATL,F,E7,E9,W6 ${CMAKE_CURRENT_SOURCE_DIR}/python
POST_EXEC_SCRIPT nopost.sh )
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from __future__ import print_function
#
# Params for EventInfo classes
#
# Set values for EventType bits
# To use one accesses each bit value as:
#
# EventInfoParams.EventType.is_simulation_bit()
# EventInfoParams.EventType.is_testbeam_bit()
# EventInfoParams.EventType.is_calibration_bit()
#
# for example:
# bit = EventInfoParams.EventType.is_calibration_bit()
#
class EventInfoParams:
# EventType
class EventType:
is_simulation = 0
is_testbeam = 1
is_calibration = 2
def Print (cls):
for attr in dir(cls)[:]:
print (attr)
def is_simulation_bit (self):
return self.is_simulation
def is_testbeam_bit (self):
return self.is_testbeam
def is_calibration_bit (self):
return self.is_calibration
# Define class methods to allow use of
# EventInfoParams.EventType.is_simulation_bit()
is_simulation_bit = classmethod(is_simulation_bit)
is_testbeam_bit = classmethod(is_testbeam_bit)
is_calibration_bit = classmethod(is_calibration_bit)
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# File: EventInfo/python/__init__.py
# Author: RD Schaffer (R.D.Schaffer@cern.ch)
__version__ = '0.2.9'
__author__ = 'RD Schaffer (R.D.Schaffer@cern.ch)'
__all__ = [ 'EventInfoParams' ]
#
# Access parameters for EventInfo classes
#
# See EventInfoParams.py for details
#
include.block ( "EventInfo/EventInfo_joboptions.py" )
from EventInfo.EventInfoParams import EventInfoParams
# test values:
#print EventInfoParams.EventType.is_simulation_bit()
#print EventInfoParams.EventType.is_testbeam_bit()
#print EventInfoParams.EventType.is_calibration_bit()
#--------------------------------------------------------------
# job options fragment to bootstrap metadata
#--------------------------------------------------------------
#include ( "EventInfo/EventInfoDict_joboptions.py" )
include ( "EventInfo/EventInfo_joboptions.py" )
include ( "LumiBlockAthenaPool/LumiBlockAthenaPool_joboptions.py")
#To run the luminosity block from event info 'bootstrap' algo
theApp.Dlls += [ "LumiBlockComps" ]
theApp.TopAlg += [ "CreateLumiBlockCollectionFromFile" ]
CreateLumiBlockCollectionFromFile = Algorithm( "CreateLumiBlockCollectionFromFile");
# Basic setup for Athena job
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon.AppMgr import ToolSvc
import AthenaPoolCnvSvc.ReadAthenaPool
from AthenaCommon.AlgSequence import AlgSequence
# the POOL converters
include( "ParticleBuilderOptions/ESD_PoolCnv_jobOptions.py" )
include( "ParticleBuilderOptions/AOD_PoolCnv_jobOptions.py")
include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py")
include( "EventAthenaPool/EventAthenaPool_joboptions.py" )
# the Top Algorithm Sequence
topSequence = AlgSequence()
###
# Modify the following to run over exactly the AOD files being used in your analysis
###
ServiceMgr.EventSelector.InputCollections = ["/afs/atlass01.physik.uni-bonn.de/data/share/top/topmix/AOD/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00139.pool.root"]
# Number of Events to process
if not "EvtMax" in dir(): EvtMax=-1
theApp.EvtMax = EvtMax
# Number of Events to skip
if not "SkipEvents" in dir(): SkipEvents=0
ServiceMgr.EventSelector.SkipEvents = SkipEvents
from LumiBlockComps.LumiBlockCompsConf import CreateAANTFromLumiBlockCollection
CreateAANTFromLB = CreateAANTFromLumiBlockCollection("CreateAANTFromLB")
topSequence += CreateAANTFromLB
###################### Output Ntuple files
# User CBNTMaker Tool to create TTree
from GaudiSvc.GaudiSvcConf import THistSvc
from AnalysisTools.AnalysisToolsConf import AANTupleStream
# create instance of THistSvc
ServiceMgr += THistSvc()
# ntuples: AANT (Athena Aware NTuples)
ntupleFile = "testlumi.root"
ServiceMgr.THistSvc.Output += [ "AANT DATAFILE='%s' OPT='RECREATE'" % ntupleFile ]
# also add default CollectionTree
AANTupleStream = AANTupleStream()
AANTupleStream.ExtraRefNames = [ "StreamESD","StreamRDO" ]
AANTupleStream.OutputName = ntupleFile
AANTupleStream.WriteInputDataHeader = True
AANTupleStream.OutputLevel = WARNING
topSequence += AANTupleStream
# Root Ntuple output file and name
theApp.Dlls += [ "RootHistCnv" ]
theApp.HistogramPersistency = "ROOT"
# Dump list of containers on StoreGate to output log
StoreGateSvc = Service( "StoreGateSvc" )
StoreGateSvc.Dump = FALSE
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc.OutputLevel = INFO
# Print the job schedule/sequence on output
print topSequence
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment