3 Simple test application to read LHCb dst files 4 For reading other root files: change the data access 5 if '/Event/Rec/Header' is not present. 7 Requires: 'SetupProject LHCb' 9 Script inherited from T.Ruf 16 from Configurables
import ApplicationMgr, EventSelector, Gaudi__RootCnvSvc
18 from GaudiKernel
import *
20 input_file =
'castor://castorlhcb.cern.ch//castor/cern.ch/grid/lhcb/LHCb/Collision11/SEMILEPTONIC.DST/00012569/0000/00012569_00000004_1.semileptonic.dst?svcClass=lhcbdisk' 21 input_file =
'root://castorlhcb.cern.ch//castor/cern.ch/grid//lhcb/data/2010/BHADRON.DST/00008399/0000/00008399_00001052_1.bhadron.dst?svcClass=lhcbdisk' 27 from Configurables
import StoreExplorerAlg
37 input_file = sys.argv[1]
39 appConf = ApplicationMgr(OutputLevel=INFO)
40 appConf.HistogramPersistency =
"NONE" 41 appConf.ExtSvc.append(
'Gaudi::IODataManager/IODataManager')
42 appConf.ExtSvc.append(
'Gaudi::RootCnvSvc/RootCnvSvc')
45 EventDataSvc().RootCLID = 1
46 EventDataSvc().EnableFaultHandler =
True 47 root = Gaudi__RootCnvSvc(
'RootCnvSvc')
48 root.CacheBranches = []
49 root.VetoBranches = [
'*']
53 root.CacheBranches = [
59 '_Event_Rec_Header_R.*' 66 EventPersistencySvc().CnvServices.append(root)
67 EventSelector().Input = [
"DATA='PFN:" + input_file +
68 "' SVC='Gaudi::RootEvtSelector'"]
69 EventSelector().PrintFreq = 1000
75 test = open(
'/proc/self/io')
80 statistic[temp[0]] = int(temp[1])
81 statistic[
'time'] = time.time()
88 print '%15s : %10.2F sec' % (s, (s1[s] - s0[s]))
90 print '%15s : %10.2F MB' % (s, (s1[s] - s0[s]) / 1.E6)
108 if not evt[
'/Event/Rec/Header']:
109 print 'Failed to access /Event/Rec/Header' 115 print 'Read %d events' % N
def storeExplorer(load=1, freq=0.0001, name='StoreExplorerAlg')
Small algorith, which traverses the data store and prints generic information about all leaves...