ATLAS Offline Software
Loading...
Searching...
No Matches
dmtest_condwriter.createTestDB Class Reference
Inheritance diagram for dmtest_condwriter.createTestDB:
Collaboration diagram for dmtest_condwriter.createTestDB:

Public Member Functions

 setup (self, args)
 usage (self)
 execute (self)

Public Attributes

str tag = str(args[0])
 xint = int(args[1])
int folder = args[2] if len(args)>2 else '/DMTest/TestAttrList'
 since
 until

Detailed Description

Definition at line 25 of file dmtest_condwriter.py.

Member Function Documentation

◆ execute()

dmtest_condwriter.createTestDB.execute ( self)

Definition at line 39 of file dmtest_condwriter.py.

39 def execute(self):
40
41 # do update - setup folder specification and create if needed
42 spec = cool.RecordSpecification()
43 spec.extend("xint", cool.StorageType.Int32)
44 print (">== Store object in folder", self.folder)
45 cfolder = AtlCoolLib.ensureFolder(self.db, self.folder, spec,
46 AtlCoolLib.athenaDesc(self.runLumi, 'AthenaAttributeList'),
47 cool.FolderVersioning.MULTI_VERSION)
48 if (cfolder is None): sys.exit(1)
49 # now write data
50 payload = cool.Record(spec)
51 payload['xint'] = self.xint
52 print ('>== Store object with IOV [',self.since,',',self.until,'] and tag',self.tag,'xint',self.xint)
53 try:
54 if (self.tag=="HEAD"):
55 cfolder.storeObject(self.since,self.until,payload,0)
56 else:
57 cfolder.storeObject(self.since,self.until,payload,0,self.tag)
58 print (">== Storing COOL object succeeded. Current content:")
59 except Exception:
60 import traceback
61 traceback.print_exc()
62 print ('>== Storing COOL object FAILED')
63 sys.exit(1)
64
65 # print full content
66 act = AtlCoolTool.AtlCoolTool(self.db)
67 print (act.more(self.folder))
68
69

◆ setup()

dmtest_condwriter.createTestDB.setup ( self,
args )

Definition at line 27 of file dmtest_condwriter.py.

27 def setup(self,args):
28 # set values of non-optional parameters
29 self.tag=str(args[0])
30 self.xint=int(args[1])
31 self.folder=args[2] if len(args)>2 else '/DMTest/TestAttrList'
32
bool setup(asg::AnaToolHandle< Interface > &tool, const std::string &type, const std::vector< std::string > &config, const std::string &progressFile="")
mostly useful for athena, which will otherwise re-use the previous tool

◆ usage()

dmtest_condwriter.createTestDB.usage ( self)
Define the additional syntax for options 

Definition at line 33 of file dmtest_condwriter.py.

33 def usage(self):
34 """ Define the additional syntax for options """
35 self._usage1()
36 print ('TAG xint [Folder]')
37 self._usage2()
38
StatusCode usage()

Member Data Documentation

◆ folder

dmtest_condwriter.createTestDB.folder = args[2] if len(args)>2 else '/DMTest/TestAttrList'

Definition at line 31 of file dmtest_condwriter.py.

◆ since

dmtest_condwriter.createTestDB.since

Definition at line 52 of file dmtest_condwriter.py.

◆ tag

dmtest_condwriter.createTestDB.tag = str(args[0])

Definition at line 29 of file dmtest_condwriter.py.

◆ until

dmtest_condwriter.createTestDB.until

Definition at line 52 of file dmtest_condwriter.py.

◆ xint

dmtest_condwriter.createTestDB.xint = int(args[1])

Definition at line 30 of file dmtest_condwriter.py.


The documentation for this class was generated from the following file: