Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:24

0001 #ifndef TESTCDBINSERT_C
0002 #define TESTCDBINSERT_C
0003 
0004 #include <sphenixnpc/CDBUtils.h>
0005 
0006 #include <phool/recoConsts.h>
0007 
0008 R__LOAD_LIBRARY(libsphenixnpc.so)
0009 R__LOAD_LIBRARY(libphool.so)
0010 
0011 // if you get errors like
0012 // Error inserting payload test.root, msg: "DataBaseException: Global Tag is locked."
0013 // use CDBUtils to unlock your global tag (unlockGlobalTag("<global tag>")
0014 
0015 void TestCDBInsert()
0016 {
0017   recoConsts *rc = recoConsts::instance();
0018 // please choose a unique name, if it is your username it's easier to see who created it
0019   rc->set_StringFlag("CDB_GLOBALTAG","pinkenbu");
0020   CDBUtils *cdb = new CDBUtils(rc->get_StringFlag("CDB_GLOBALTAG"));
0021   cdb->createPayloadType("TestBeginValidity");
0022   cdb->insertPayload("TestBeginValidity","test.root",10);
0023   cdb->createPayloadType("TestBeginEndValidity");
0024   cdb->insertPayload("TestBeginEndValidity","test.root",10,20);
0025   return;
0026 }
0027 
0028 #endif