All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
gaudi_971.py
Go to the documentation of this file.
1 # Options of the test job
2 from Gaudi.Configuration import *
3 
4 # modify the ROOTIO.xml file catalog to add a dummy replica
5 from xml.etree import ElementTree as ET
6 data = ET.parse('ROOTIO.xml')
7 for file_el in data.getroot().iterfind('File'):
8  for pfn in file_el.iterfind('physical/pfn'):
9  if pfn.attrib['name'] == 'ROOTIO.dst':
10  physical = file_el.find('physical')
11  dummy = physical.makeelement('pfn', {'name': 'dummy.dst',
12  'filetype': 'ROOT'})
13  physical.insert(0, dummy)
14  logical = file_el.find('logical')
15  if logical is None:
16  logical = file_el.makeelement('logical')
17  file_el.append(logical)
18  lfn = logical.makeelement('lfn', {'name': 'input.dst'})
19  logical.append(lfn)
20  break
21 
22 import codecs
23 with codecs.open('GAUDI-971x.xml', 'w', encoding='utf-8') as catalog:
24  catalog.write('<?xml version="1.0" encoding="utf-8" standalone="no" ?>\n')
25  catalog.write('<!DOCTYPE POOLFILECATALOG SYSTEM "InMemory">\n')
26  data.write(catalog, encoding='utf-8', xml_declaration=False)
27 
28 print '#' * 80
29 print open('GAUDI-971.xml').read()
30 print '#' * 80
31 
32 FileCatalog(Catalogs = [ "xmlcatalog_file:GAUDI-971.xml" ])
33 
34 esel = EventSelector()
35 esel.Input = ["DATAFILE='LFN:input.dst' SVC='Gaudi::RootEvtSelector' OPT='READ'"]
36 
Definition of class EventSelector.
Definition: EventSelector.h:53