ATLAS Offline Software
createRpcFolders.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 # *************************************************
4 # Python to create RPC SQLite Folder to be filled with RPC alibration results
5 # author Michele Bianco michele.bianco@le.infn.it, Gabriele Chiodini gabriele.chiodini@le.infn.it
6 # and Angelo Guida angelo.guida@le.infn.it
7 # 08/April/2009
8 # ************************************************
9 
11  import os
12  from PyCool import cool
13 
14  # get database service and open database
15  dbSvc = cool.DatabaseSvcFactory.databaseService()
16  # database accessed via physical name
17  dbstring = 'sqlite://;schema=RPCDQMFOFFLINE.db;dbname=RPC_DQA'
18  if os.access('RPCDQMFOFFLINE.db', os.R_OK):
19  try:
20  os.unlink('RPCDQMFOFFLINE.db')
21  except Exception as e:
22  print('Unable to remove existing db file, reason', e)
23  try:
24  db = dbSvc.createDatabase(dbstring)
25  except Exception as e:
26  print('Problem creating database', e)
27  return
28  print("Created database", dbstring)
29 
30  spec2 = cool.RecordSpecification()
31  spec2.extend("recEta", cool.StorageType.String4k)
32  spec2.extend("detEta", cool.StorageType.String4k)
33  spec2.extend("recPhi1", cool.StorageType.String4k)
34  spec2.extend("recPhi2", cool.StorageType.String4k)
35  spec2.extend("detPhi1", cool.StorageType.String4k)
36  spec2.extend("detPhi2", cool.StorageType.String4k)
37 
38  # folder meta-data - note for Athena this has a special meaning
39  desc = "<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
40  # create the folder - single version
41  # last argument is createParents - if true, automatically creates parent
42  # folders if needed
43  # note this will not work if the database already exists - delete mycool.db first
44  # Deprecated/dropped: myfolder=db.createFolder('/OFFLINE/OFFLINE_DQMF',spec2,desc,cool.FolderVersioning.MULTI_VERSION,True)
45  folderSpec = cool.FolderSpecification(
46  cool.FolderVersioning.MULTI_VERSION, spec2)
47  db.createFolder('/OFFLINE/OFFLINE_DQMF', folderSpec, desc, True)
48  db.closeDatabase()
49 
50 
52  import os
53  from PyCool import cool
54 
55  # get database service and open database
56  dbSvc = cool.DatabaseSvcFactory.databaseService()
57  # database accessed via physical name
58  dbstring = 'sqlite://;schema=RPCConditionDB.db;dbname=RPC_DQA'
59  if os.access('RPCConditionDB.db', os.R_OK):
60  try:
61  os.unlink('RPCConditionDB.db')
62  except Exception as e:
63  print('Unable to remove existing db file, reason', e)
64  try:
65  db = dbSvc.createDatabase(dbstring)
66  except Exception as e:
67  print('Problem creating database', e)
68  return
69  print("Created database", dbstring)
70 
71  spec2 = cool.RecordSpecification()
72  spec2.extend("PanelRes", cool.StorageType.String255)
73  spec2.extend("StripStatus", cool.StorageType.String4k)
74 
75  desc = "<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
76 
77  # create the folder - single version
78  # last argument is createParents - if true, automatically creates parent
79  # folders if needed
80  # note this will not work if the database already exists - delete mycool.db first
81  # Deprecated/dropped: myfolder=db.createFolder('/OFFLINE/FINAL',spec2,desc,cool.FolderVersioning.MULTI_VERSION,True)
82  folderSpec = cool.FolderSpecification(
83  cool.FolderVersioning.MULTI_VERSION, spec2)
84  db.createFolder('/OFFLINE/FINAL', folderSpec, desc, True)
85  db.closeDatabase()
python.createRpcFolders.createRPCConditionDB
def createRPCConditionDB()
Definition: createRpcFolders.py:51
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.createRpcFolders.createRPCDQMFDB
def createRPCDQMFDB()
Definition: createRpcFolders.py:10