12 #include "CoralBase/Attribute.h"
15 #include "CoolKernel/IDatabase.h"
16 #include "CoolKernel/IFolder.h"
17 #include "CoolKernel/IObjectIterator.h"
18 #include "CoolKernel/IObject.h"
19 #include "CoolKernel/Record.h"
20 #include "CoolKernel/Exception.h"
21 #include "CoolKernel/IDatabaseSvc.h"
22 #include "CoolKernel/StorageType.h"
23 #include "CoolKernel/ConstRecordAdapter.h"
33 cool::IDatabaseSvc&
dbSvc = this->databaseService();
35 return dbSvc.openDatabase(dbStr.c_str(), readOnly);
37 catch (cool::DatabaseDoesNotExist&) {
38 std::cout <<
"Error! Database does not exist!" << std::endl;
51 catch (cool::FolderNotFound&) {
52 std::cout <<
"Error! Folder '" << folderStr <<
"' does not exist!" << std::endl;
77 setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU) {
94 cool::Int64 runS =
m_since >> 32;
95 cool::Int64 lumiS =
m_since - (runS << 32);
96 cool::Int64 runU =
m_until >> 32;
97 cool::Int64 lumiU =
m_until - (runU << 32);
98 std::cout <<
"Using IOVrange [(" << runS <<
"," << lumiS <<
"),(" << runU <<
"," << lumiU <<
")] " <<
"[" <<
104 CoolOpen(
const std::string& dbStr) {
111 std::cout <<
"Cleared!" << std::endl;
114 cool::RecordSpecification
118 cool::RecordSpecification
spec;
119 spec.extend(
"recEta", cool::StorageType::String4k);
120 spec.extend(
"detEta", cool::StorageType::String4k);
121 spec.extend(
"recPhi1", cool::StorageType::String4k);
122 spec.extend(
"recPhi2", cool::StorageType::String4k);
123 spec.extend(
"detPhi1", cool::StorageType::String4k);
124 spec.extend(
"detPhi2", cool::StorageType::String4k);
127 std::cout <<
"ERROR Source and destination folder specifications differ." << std::endl;
133 cool::RecordSpecification
137 cool::RecordSpecification
spec;
138 spec.extend(
"PanelRes", cool::StorageType::String255);
139 spec.extend(
"StripStatus", cool::StorageType::String4k);
142 std::cout <<
"ERROR Source and destination folder specifications differ." << std::endl;
151 const std::string& detEta,
152 const std::string& recPhi1,
153 const std::string& recPhi2,
154 const std::string& detPhi1,
155 const std::string& detPhi2,
156 const cool::RecordSpecification&
spec) {
161 payload[
"recEta"].data<cool::String4k>() = recEta;
162 payload[
"detEta"].data<cool::String4k>() = detEta;
163 payload[
"recPhi1"].data<cool::String4k>() = recPhi1;
165 payload[
"recPhi2"].data<cool::String4k>() = recPhi2;
166 payload[
"detPhi1"].data<cool::String4k>() = detPhi1;
167 payload[
"detPhi2"].data<cool::String4k>() = detPhi2;
178 const cool::RecordSpecification&
spec) {
183 payload[
"PanelRes"].data<cool::String255>() = PanelRes;
184 payload[
"StripStatus"].data<cool::String4k>() = StripStatus;
195 const cool::IObject& element =
objects->currentRef();
196 std::cout << element << std::endl;
199 catch (cool::Exception&
e) {
200 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
201 std::cout <<
" Inside create payload" << std::endl;
213 const cool::IObject& element =
objects->currentRef();
217 catch (cool::Exception&
e) {
218 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
225 dumpCode(
const std::string& channelName) {
242 const std::string& recEta,
243 const std::string& detEta,
244 const std::string& recPhi1,
245 const std::string& recPhi2,
246 const std::string& detPhi1,
247 const std::string& detPhi2,
253 cool::ValidityKey since_u = (
run << 32);
254 cool::ValidityKey until_u = (
run + 1) << 32;
255 m_coolFolder->storeObject(since_u, until_u, cool::Record(
259 catch (cool::Exception&
e) {
260 std::cout <<
" Inside create insert" << std::endl;
261 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
269 const std::string& PanelRes,
270 const std::string& StripStatus,
276 cool::ValidityKey since_u = (
run << 32) * 0;
277 cool::ValidityKey until_u = (
run + 1) << 32;
278 m_coolFolder->storeObject(since_u, until_u, cool::Record(
282 catch (cool::Exception&
e) {
283 std::cout <<
" Inside create insert" << std::endl;
284 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
292 const std::string& recEta,
293 const std::string& detEta,
294 const std::string& recPhi1,
295 const std::string& recPhi2,
296 const std::string& detPhi1,
297 const std::string& detPhi2) {
298 std::cout <<
"Trying to store payload [channel " << std::endl;
302 cool::ValidityKey since_u = (
run << 32);
303 cool::ValidityKey until_u = (
run + 1) << 32;
306 std::cout <<
"stored! without Tag" << std::endl;
308 catch (cool::Exception&
e) {
309 std::cout <<
" Inside create insert" << std::endl;
310 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;