Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:24:01

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