13 #include "CoralBase/Attribute.h"
16 #include "CoolKernel/IDatabase.h"
17 #include "CoolKernel/IFolder.h"
18 #include "CoolKernel/IObjectIterator.h"
19 #include "CoolKernel/IObject.h"
20 #include "CoolKernel/Record.h"
21 #include "CoolKernel/Exception.h"
22 #include "CoolKernel/IDatabaseSvc.h"
23 #include "CoolKernel/StorageType.h"
24 #include "CoolKernel/ConstRecordAdapter.h"
33 std::cout <<
"Opening database '" << dbStr <<
"'...";
34 cool::IDatabaseSvc&
dbSvc = this->databaseService();
35 std::cout <<
"done." << std::endl;
36 return dbSvc.openDatabase(dbStr.c_str(), readOnly);
38 catch (cool::DatabaseDoesNotExist&) {
39 std::cout <<
"Error! Database does not exist!" << std::endl;
52 catch (cool::FolderNotFound&) {
53 std::cout <<
"Error! Folder '" << folderStr <<
"' does not exist!" << std::endl;
78 setIOV(cool::Int64 runS, cool::Int64 lumiS, cool::Int64 runU, cool::Int64 lumiU) {
95 cool::Int64 runS =
m_since >> 32;
96 cool::Int64 lumiS =
m_since - (runS << 32);
97 cool::Int64 runU =
m_until >> 32;
98 cool::Int64 lumiU =
m_until - (runU << 32);
99 std::cout <<
"Using IOVrange [(" << runS <<
"," << lumiS <<
"),(" << runU <<
"," << lumiU <<
")] " <<
"[" <<
105 CoolOpen(
const std::string& dbStr) {
112 std::cout <<
"Cleared!" << std::endl;
115 cool::RecordSpecification
119 cool::RecordSpecification
spec;
120 spec.extend(
"Chamber_Name", cool::StorageType::String255);
121 spec.extend(
"Dead_multilayer", cool::StorageType::String255);
122 spec.extend(
"Dead_tube", cool::StorageType::String4k);
126 std::cout <<
"ERROR Source and destination folder specifications differ." << std::endl;
135 const std::string& DeadMultilayer,
136 const std::string& DeadTube,
137 const cool::RecordSpecification&
spec) {
142 payload[
"Chamber_Name"].data<cool::String255>() = ChamberName;
143 payload[
"Dead_multilayer"].data<cool::String255>() = DeadMultilayer;
144 payload[
"Dead_tube"].data<cool::String4k>() = DeadTube;
151 cool::RecordSpecification
155 cool::RecordSpecification
spec;
156 spec.extend(
"Chamber_Name", cool::StorageType::String255);
157 spec.extend(
"Noisy_multilayer", cool::StorageType::String255);
158 spec.extend(
"Noisy_tube", cool::StorageType::String4k);
162 std::cout <<
"ERROR Source and destination folder specifications differ." << std::endl;
171 const std::string& NoisyMultilayer,
172 const std::string& NoisyTube,
173 const cool::RecordSpecification&
spec) {
178 payload[
"Chamber_Name"].data<cool::String255>() = ChamberName;
179 payload[
"Noisy_multilayer"].data<cool::String255>() = NoisyMultilayer;
180 payload[
"Noisy_tube"].data<cool::String4k>() = NoisyTube;
194 const cool::IObject& element =
objects->currentRef();
195 std::cout << element << std::endl;
198 catch (cool::Exception&
e) {
199 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
200 std::cout <<
" dentro create payload" << std::endl;
212 const cool::IObject& element =
objects->currentRef();
216 catch (cool::Exception&
e) {
217 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
224 dumpCode(
const std::string& channelName) {
239 const std::string& ChamberName,
240 const std::string& DeadMultilayer,
241 const std::string& DeadTube,
246 cool::ValidityKey since_u = (
run << 32);
247 cool::ValidityKey until_u = (
run + 1) << 32;
248 m_coolFolder->storeObject(since_u, until_u, cool::Record(
250 std::cout <<
"stored! With Tag =" <<
cool_tag << std::endl;
252 catch (cool::Exception&
e) {
253 std::cout <<
" dentro create insert" << std::endl;
254 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
262 const std::string& ChamberName,
263 const std::string& DeadMultilayer,
264 const std::string& DeadTube) {
265 std::cout <<
"Trying to store payload [channel " << std::endl;
269 cool::ValidityKey since_u = (
run << 32);
270 cool::ValidityKey until_u = (
run + 1) << 32;
273 std::cout <<
"stored! without Tag" << std::endl;
275 catch (cool::Exception&
e) {
276 std::cout <<
" dentro create insert" << std::endl;
277 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
289 const std::string& ChamberName,
290 const std::string& NoisyMultilayer,
291 const std::string& NoisyTube,
296 cool::ValidityKey since_u = (
run << 32);
297 cool::ValidityKey until_u = (
run + 1) << 32;
298 m_coolFolder->storeObject(since_u, until_u, cool::Record(
300 std::cout <<
"stored! With Tag =" <<
cool_tag << std::endl;
302 catch (cool::Exception&
e) {
303 std::cout <<
" dentro create insert" << std::endl;
304 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;
312 const std::string& ChamberName,
313 const std::string& NoisyMultilayer,
314 const std::string& NoisyTube) {
315 std::cout <<
"Trying to store payload [channel " << std::endl;
319 cool::ValidityKey since_u = (
run << 32);
320 cool::ValidityKey until_u = (
run + 1) << 32;
323 std::cout <<
"stored! without Tag" << std::endl;
325 catch (cool::Exception&
e) {
326 std::cout <<
" dentro create insert" << std::endl;
327 std::cout <<
"Unknown exception caught!" <<
e.what() << std::endl;