13 Simple test application to read LHCb dst files
14 For reading other root files: change the data access
15 if '/Event/Rec/Header' is not present.
17 Requires: 'SetupProject LHCb'
19 Script inherited from T.Ruf
23 from __future__
import print_function
29 from Configurables
import ApplicationMgr, EventSelector, Gaudi__RootCnvSvc
32 from GaudiKernel
import *
34 input_file =
"castor://castorlhcb.cern.ch//castor/cern.ch/grid/lhcb/LHCb/Collision11/SEMILEPTONIC.DST/00012569/0000/00012569_00000004_1.semileptonic.dst?svcClass=lhcbdisk"
35 input_file =
"root://castorlhcb.cern.ch//castor/cern.ch/grid//lhcb/data/2010/BHADRON.DST/00008399/0000/00008399_00001052_1.bhadron.dst?svcClass=lhcbdisk"
41 from Configurables
import StoreExplorerAlg
52 input_file = sys.argv[1]
54 appConf = ApplicationMgr(OutputLevel=INFO)
55 appConf.HistogramPersistency =
"NONE"
56 appConf.ExtSvc.append(
"Gaudi::IODataManager/IODataManager")
57 appConf.ExtSvc.append(
"Gaudi::RootCnvSvc/RootCnvSvc")
60 EventDataSvc().RootCLID = 1
61 EventDataSvc().EnableFaultHandler =
True
62 root = Gaudi__RootCnvSvc(
"RootCnvSvc")
63 root.CacheBranches = []
64 root.VetoBranches = [
"*"]
68 root.CacheBranches = [
73 "_Event_Rec_Header.*" "_Event_Rec_Header_R.*",
80 EventPersistencySvc().CnvServices.append(root)
81 EventSelector().Input = [
"DATA='PFN:" + input_file +
"' SVC='Gaudi::RootEvtSelector'"]
82 EventSelector().PrintFreq = 1000
88 test = open(
"/proc/self/io")
93 statistic[temp[0]] = int(temp[1])
94 statistic[
"time"] = time.time()
101 print(
"%15s : %10.2F sec" % (s, (s1[s] - s0[s])))
103 print(
"%15s : %10.2F MB" % (s, (s1[s] - s0[s]) / 1.0e6))
109 sel = appMgr.evtsel()
110 evt = appMgr.evtsvc()
122 if not evt[
"/Event/Rec/Header"]:
123 print(
"Failed to access /Event/Rec/Header")
129 print(
"Read %d events" % N)