Athena Tips & Tricks

Reading in all files using simple pattern matching

To read in all files using a simple pattern matching use the following two lines:

import glob
EventSelector.InputCollections = glob.glob("/path/to/directory/InDetESD*.root")

Reading in all files on castor in a given directory

Reading in all files in a given castor directory is also not too difficult:

castordir = "/castor/"
collection = []
filelist = os.popen("rfdir "+castordir).readlines()
for i in filelist:
EventSelector.InputCollections = collection

-- ChristianSchmitt - 23 Jan 2007

This topic: Sandbox > TWikiUsers > ChristianSchmitt > ChristianSchmittSandbox
Topic revision: r2 - 2007-01-23 - ChristianSchmitt
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback