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

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2007-01-23 - ChristianSchmitt
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

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