ATLAS Offline Software
Loading...
Searching...
No Matches
StatusFlagCommentCOOL.cxx File Reference
#include "DataQualityUtils/StatusFlagCommentCOOL.h"
#include "CoralBase/Attribute.h"
#include "CoolKernel/IDatabase.h"
#include "CoolKernel/IFolder.h"
#include "CoolKernel/IObjectIterator.h"
#include "CoolKernel/IObject.h"
#include "CoolKernel/Record.h"
#include "CoolKernel/Exception.h"
#include "CoolKernel/IDatabaseSvc.h"
#include "CoolKernel/StorageType.h"

Go to the source code of this file.

Functions

 ClassImp (dqutils::StatusFlagCommentCOOL) namespace dqutils

Function Documentation

◆ ClassImp()

Definition at line 24 of file StatusFlagCommentCOOL.cxx.

26 {
27 StatusFlagCommentCOOL::
28 StatusFlagCommentCOOL(const std::string& dbStr, const std::string& folderStr, int runS, int lumiS, int runU,
29 int lumiU)
30 : StatusFlagCOOLBase(dbStr, folderStr, runS, lumiS, runU, lumiU) {
31 }
32
33 StatusFlagCommentCOOL::
34 StatusFlagCommentCOOL(int runS, int lumiS, int runU, int lumiU)
35 : StatusFlagCOOLBase(runS, lumiS, runU, lumiU) {
36 }
37
38 StatusFlagCommentCOOL::
39 StatusFlagCommentCOOL()
40 : StatusFlagCOOLBase() {
41 }
42
43 cool::RecordSpecification
44 StatusFlagCommentCOOL::
45 createSpec() {
46 //std::cout << "Preparing RecordSpecification" << std::endl;
47 cool::RecordSpecification spec;
48 spec.extend("Code", cool::StorageType::Int32);
49 spec.extend("deadFrac", cool::StorageType::Float);
50 spec.extend("Thrust", cool::StorageType::Float);
51 spec.extend("Comment", cool::StorageType::String255);
52 if (!(spec == m_coolFolder->payloadSpecification())) {
53 std::cout << "ERROR Source and destination folder specifications differ." << std::endl;
54 }
55 return spec;
56 }
57
58 coral::AttributeList
59 StatusFlagCommentCOOL::
60 createPayload(int colourCode, float dfrac, float thrust, std::string& comment,
61 const cool::RecordSpecification& spec) {
62 coral::AttributeList payload = cool::Record(spec).attributeList();
63 payload["Code"].data<cool::Int32>() = colourCode;
64 payload["deadFrac"].data<cool::Float>() = dfrac;
65 payload["Thrust"].data<cool::Float>() = thrust;
66 payload["Comment"].data<cool::String255>() = comment;
67 return payload;
68 }
69
70 void
71 StatusFlagCommentCOOL::
72 insert(cool::ChannelId channelId, int code, float dfrac, float thrust, std::string comment,
73 const std::string& tag_name) {
74 try {
75 cool::RecordSpecification spec = this->createSpec();
76 coral::AttributeList payload = this->createPayload(code, dfrac, thrust, comment, spec);
77 insert_helper(channelId, payload, tag_name);
78 }
79 catch (cool::Exception& e) {
80 std::cout << "Unknown exception caught!" << e.what() << std::endl;
81 }
82 }
83
84 void
85 StatusFlagCommentCOOL::
86 insert(const std::string& channelName, int code, float dfrac, float thrust, const std::string& comment,
87 const std::string& tag_name) {
88 try {
89 this->insert(this->getCoolFolder()->channelId(channelName), code, dfrac, thrust, comment, tag_name);
90 }
91 catch (cool::Exception& e) {
92 std::cout << "Unknown exception caught!" << e.what() << std::endl;
93 }
94 }
95} //namespace dqutils
AthenaAttributeList * createPayload(const std::vector< Entry > &data, const coral::AttributeListSpecification &spec)