ATLAS Offline Software
Functions | Variables
test_magFieldCondAlg Namespace Reference

Functions

def createDB ()
 

Variables

list currents
 
string folder = '/EXT/DCS/MAGNETS/SENSORDATA'
 
string sqlite = 'magfield.db'
 
 flags = initConfigFlags()
 
 Files
 
 NumThreads
 
 MaxEvents
 
 GlobalTag
 
 SqliteInput
 
 SqliteFolders
 
 acc = MainEvgenServicesCfg(flags)
 
 EventsPerLB
 

Function Documentation

◆ createDB()

def test_magFieldCondAlg.createDB ( )
Create sqlite file with DCS currents

Definition at line 30 of file test_magFieldCondAlg.py.

30 def createDB():
31  """Create sqlite file with DCS currents"""
32  import os
33  os.environ['CLING_STANDARD_PCH'] = 'none' #See bug ROOT-10789
34  from PyCool import cool
35  from CoolConvUtilities import AtlCoolLib, AtlCoolTool
36 
37  # Cleanup previous file
38  if os.path.isfile(sqlite):
39  os.remove(sqlite)
40 
41  db = cool.DatabaseSvcFactory.databaseService().createDatabase(f'sqlite://;schema={sqlite};dbname=CONDBR2')
42  spec = cool.RecordSpecification()
43  spec.extend("value", cool.StorageType.Float)
44  spec.extend("quality_invalid", cool.StorageType.Bool)
45  f = AtlCoolLib.ensureFolder(db, folder, spec, AtlCoolLib.athenaDesc(True, 'CondAttrListCollection'))
46 
47  for v in currents:
48  sol = cool.Record(spec)
49  sol['value'] = v[1]
50  sol['quality_invalid'] = False
51  tor = cool.Record(spec)
52  tor['value'] = v[2]
53  tor['quality_invalid'] = False
54  f.storeObject(v[0], cool.ValidityKeyMax, sol, 1) # channel 1
55  f.storeObject(v[0], cool.ValidityKeyMax, tor, 3) # channel 3
56 
57  # print database content
58  act = AtlCoolTool.AtlCoolTool(db)
59  print (act.more(folder))
60 
61 
62 # Create sqlite file with DCS currents
63 createDB()
64 

Variable Documentation

◆ acc

test_magFieldCondAlg.acc = MainEvgenServicesCfg(flags)

Definition at line 78 of file test_magFieldCondAlg.py.

◆ currents

list test_magFieldCondAlg.currents
Initial value:
1 = [(0, 7730, 20400),
2  (5, 0, 0),
3  (10, 7730, 20400)]

Definition at line 10 of file test_magFieldCondAlg.py.

◆ EventsPerLB

test_magFieldCondAlg.EventsPerLB

Definition at line 79 of file test_magFieldCondAlg.py.

◆ Files

test_magFieldCondAlg.Files

Definition at line 70 of file test_magFieldCondAlg.py.

◆ flags

test_magFieldCondAlg.flags = initConfigFlags()

Definition at line 69 of file test_magFieldCondAlg.py.

◆ folder

string test_magFieldCondAlg.folder = '/EXT/DCS/MAGNETS/SENSORDATA'

Definition at line 27 of file test_magFieldCondAlg.py.

◆ GlobalTag

test_magFieldCondAlg.GlobalTag

Definition at line 73 of file test_magFieldCondAlg.py.

◆ MaxEvents

test_magFieldCondAlg.MaxEvents

Definition at line 72 of file test_magFieldCondAlg.py.

◆ NumThreads

test_magFieldCondAlg.NumThreads

Definition at line 71 of file test_magFieldCondAlg.py.

◆ sqlite

string test_magFieldCondAlg.sqlite = 'magfield.db'

Definition at line 28 of file test_magFieldCondAlg.py.

◆ SqliteFolders

test_magFieldCondAlg.SqliteFolders

Definition at line 75 of file test_magFieldCondAlg.py.

◆ SqliteInput

test_magFieldCondAlg.SqliteInput

Definition at line 74 of file test_magFieldCondAlg.py.

test_magFieldCondAlg.createDB
def createDB()
Definition: test_magFieldCondAlg.py:30
taskman.createDatabase
createDatabase
Definition: taskman.py:100