ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
CoolTagInfo Class Reference

#include <CoolTagInfo.h>

Collaboration diagram for CoolTagInfo:

Public Member Functions

 CoolTagInfo (const cool::IDatabasePtr &db, const std::string &folder, const std::string &destfolder, const std::string &sourcetag, const std::string &desttag, const std::string &taglabel="")
 
bool write (const cool::IDatabasePtr &db, const bool copylock) const
 

Private Attributes

std::string m_folder
 
std::string m_tag
 
std::string m_desc
 
cool::HvsTagLock::Status m_status
 

Detailed Description

Definition at line 16 of file CoolTagInfo.h.

Constructor & Destructor Documentation

◆ CoolTagInfo()

CoolTagInfo::CoolTagInfo ( const cool::IDatabasePtr &  db,
const std::string &  folder,
const std::string &  destfolder,
const std::string &  sourcetag,
const std::string &  desttag,
const std::string &  taglabel = "" 
)

Definition at line 13 of file CoolTagInfo.cxx.

17  : m_folder (destfolder),
18  m_tag (desttag)
19 {
20  if (db->existsFolder(folder)) {
21  cool::IFolderPtr fptr=db->getFolder(folder);
22  m_desc=fptr->tagDescription(sourcetag);
23  m_status=fptr->tagLockStatus(sourcetag);
24  } else if (db->existsFolderSet(folder)) {
25  cool::IFolderSetPtr fptr=db->getFolderSet(folder);
26  m_desc=fptr->tagDescription(sourcetag);
27  m_status=fptr->tagLockStatus(sourcetag);
28  } else {
29  m_desc="";
30  m_status=cool::HvsTagLock::UNLOCKED;
31  std::cout << "Could not access tag information for folder " << folder <<
32  " tag " << sourcetag << std::endl;
33  }
34  // override description with input label if set
35  if (!taglabel.empty()) m_desc=taglabel;
36 }

Member Function Documentation

◆ write()

bool CoolTagInfo::write ( const cool::IDatabasePtr &  db,
const bool  copylock 
) const

Definition at line 38 of file CoolTagInfo.cxx.

38  {
39  try {
40  if (db->existsFolder(m_folder)) {
41  cool::IFolderPtr fptr=db->getFolder(m_folder);
42  if (!m_desc.empty()) fptr->setTagDescription(m_tag,m_desc);
43  if (copylock) fptr->setTagLockStatus(m_tag,m_status);
44  } else if (db->existsFolderSet(m_folder)) {
45  cool::IFolderSetPtr fptr=db->getFolderSet(m_folder);
46  if (!m_desc.empty()) fptr->setTagDescription(m_tag,m_desc);
47  if (copylock) fptr->setTagLockStatus(m_tag,m_status);
48  } else {
49  std::cout << "Cannot access tag " << m_tag << " in folder " << m_folder
50  << " to write tag info" << std::endl;
51  return false;
52  }
53  }
54  catch (cool::Exception& e) {
55  std::cout << "Exception writing tag info for tag " << m_tag <<
56  " in folder " << m_folder << std::endl;
57  return false;
58  }
59  return true;
60 }

Member Data Documentation

◆ m_desc

std::string CoolTagInfo::m_desc
private

Definition at line 29 of file CoolTagInfo.h.

◆ m_folder

std::string CoolTagInfo::m_folder
private

Definition at line 27 of file CoolTagInfo.h.

◆ m_status

cool::HvsTagLock::Status CoolTagInfo::m_status
private

Definition at line 30 of file CoolTagInfo.h.

◆ m_tag

std::string CoolTagInfo::m_tag
private

Definition at line 28 of file CoolTagInfo.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CoolTagInfo::m_tag
std::string m_tag
Definition: CoolTagInfo.h:28
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
CoolTagInfo::m_desc
std::string m_desc
Definition: CoolTagInfo.h:29
CoolTagInfo::m_folder
std::string m_folder
Definition: CoolTagInfo.h:27
fptr
std::vector< TFile * > fptr
Definition: hcg.cxx:48
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
CoolTagInfo::m_status
cool::HvsTagLock::Status m_status
Definition: CoolTagInfo.h:30