ATLAS Offline Software
query_example.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
2 
3 import ROOT
4 
5 colsvc = ROOT.pool.CollectionService()
6 read_only_flag = True
7 col=colsvc.handle('SimplePoolCollection1', 'RootCollection', '', read_only_flag)
8 
9 des = col.description()
10 for c in range(0, des.numberOfAttributeColumns()):
11  print "Attribute: ", des.attributeColumn(c, 0).name(), " type:", des.attributeColumn(c, 0).type()
12 for c in range(0, des.numberOfTokenColumns()):
13  print "Reference: ", des.tokenColumn(c, 0).name()
14 
15 query = col.newQuery()
16 
17 #query.selectAll();
18 #query.addToOutputList( des.attributeColumn(0, 0).name() )
19 #query.addToOutputList( des.attributeColumn(1, 0).name() )
20 
21 cursor = query.execute()
22 
23 while( cursor.next() ):
24  row = cursor.currentRow()
25  tlist = row.tokenList()
26  print tlist.size()
27  print tlist[0].key()
28 
29  # this crashes python ??? MN
30  #alist = row.attributeList()
31  #print alist[0].data()
32  #print "Attributes ", alist.size()
33 
34 col.close()
while
while((inf=(TStreamerInfo *) nextinfo()) !=0)
Definition: liststreamerinfos.cxx:13
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37