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 from __future__ import print_function
10 
12  import os
13  from PyCool import cool
14 
15  # get database service and open database
16  dbSvc = cool.DatabaseSvcFactory.databaseService()
17  # database accessed via physical name
18  dbstring = 'sqlite://;schema=RPCDQMFOFFLINE.db;dbname=RPC_DQA'
19  if os.access('RPCDQMFOFFLINE.db', os.R_OK):
20  try:
21  os.unlink('RPCDQMFOFFLINE.db')
22  except Exception as e:
23  print('Unable to remove existing db file, reason', e)
24  try:
25  db = dbSvc.createDatabase(dbstring)
26  except Exception as e:
27  print('Problem creating database', e)
28  return
29  print("Created database", dbstring)
30 
31  spec2 = cool.RecordSpecification()
32  spec2.extend("recEta", cool.StorageType.String4k)
33  spec2.extend("detEta", cool.StorageType.String4k)
34  spec2.extend("recPhi1", cool.StorageType.String4k)
35  spec2.extend("recPhi2", cool.StorageType.String4k)
36  spec2.extend("detPhi1", cool.StorageType.String4k)
37  spec2.extend("detPhi2", cool.StorageType.String4k)
38 
39  # folder meta-data - note for Athena this has a special meaning
40  desc = "<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
41  # create the folder - single version
42  # last argument is createParents - if true, automatically creates parent
43  # folders if needed
44  # note this will not work if the database already exists - delete mycool.db first
45  # Deprecated/dropped: myfolder=db.createFolder('/OFFLINE/OFFLINE_DQMF',spec2,desc,cool.FolderVersioning.MULTI_VERSION,True)
46  folderSpec = cool.FolderSpecification(
47  cool.FolderVersioning.MULTI_VERSION, spec2)
48  db.createFolder('/OFFLINE/OFFLINE_DQMF', folderSpec, desc, True)
49  db.closeDatabase()
50 
51 
53  import os
54  from PyCool import cool
55 
56  # get database service and open database
57  dbSvc = cool.DatabaseSvcFactory.databaseService()
58  # database accessed via physical name
59  dbstring = 'sqlite://;schema=RPCConditionDB.db;dbname=RPC_DQA'
60  if os.access('RPCConditionDB.db', os.R_OK):
61  try:
62  os.unlink('RPCConditionDB.db')
63  except Exception as e:
64  print('Unable to remove existing db file, reason', e)
65  try:
66  db = dbSvc.createDatabase(dbstring)
67  except Exception as e:
68  print('Problem creating database', e)
69  return
70  print("Created database", dbstring)
71 
72  spec2 = cool.RecordSpecification()
73  spec2.extend("PanelRes", cool.StorageType.String255)
74  spec2.extend("StripStatus", cool.StorageType.String4k)
75 
76  desc = "<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\"71\" clid=\"1238547719\" /></addrHeader><typeName>CondAttrListCollection</typeName>"
77 
78  # create the folder - single version
79  # last argument is createParents - if true, automatically creates parent
80  # folders if needed
81  # note this will not work if the database already exists - delete mycool.db first
82  # Deprecated/dropped: myfolder=db.createFolder('/OFFLINE/FINAL',spec2,desc,cool.FolderVersioning.MULTI_VERSION,True)
83  folderSpec = cool.FolderSpecification(
84  cool.FolderVersioning.MULTI_VERSION, spec2)
85  db.createFolder('/OFFLINE/FINAL', folderSpec, desc, True)
86  db.closeDatabase()
python.createRpcFolders.createRPCConditionDB
def createRPCConditionDB()
Definition: createRpcFolders.py:52
python.createRpcFolders.createRPCDQMFDB
def createRPCDQMFDB()
Definition: createRpcFolders.py:11
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70