Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members
TagInfo Class Reference

This class contains the list of currently valid tags for detector description - GeoModel and IOV/Conditions. Tags are given as name/value pairs. More...

#include <TagInfo.h>

Collaboration diagram for TagInfo:

Public Types

typedefs:
typedef std::pair< std::string, std::string > NameTagPair
 
typedef std::vector< NameTagPairNameTagPairVec
 

Public Member Functions

structors
 TagInfo ()
 
virtual ~TagInfo ()
 
Tag information accessors
void findTag (const std::string &name, std::string &tag) const
 Find tag by its name - for current tags, returning in the reference argument. More...
 
std::string findTag (const std::string &name) const
 Find tag by name, return by value. More...
 
void getTags (NameTagPairVec &pairs) const
 Fill vector with all current tags. More...
 
const NameTagPairVecgetTags () const
 Return a vector with all current tags. More...
 
void findInputTag (const std::string &name, std::string &tag) const
 Find tag by its name - for input tags, return in the reference argument. More...
 
std::string findInputTag (const std::string &name) const
 Find tag by its name - for input tags, return by value. More...
 
void getInputTags (NameTagPairVec &pairs) const
 Fill reference vector with all current input tags. More...
 
const NameTagPairVecgetInputTags () const
 Return a vector with all current input tags. More...
 
const std::string & tagInfoTag () const
 The tag of the TagInfo object. More...
 
bool operator< (const TagInfo &rhs) const
 Less than comparision needed to create e.g. set<TagInfo> More...
 

Tag information set methods

NameTagPairVec m_tags
 
NameTagPairVec m_inputTags
 
std::string m_myTag
 
StatusCode addTag (const NameTagPair &pair, bool override=false)
 addTag for current tags - returns failure if tag name exists and override == false More...
 
StatusCode addInputTag (const NameTagPair &pair, bool override=false)
 addInputTag for input tags - returns failure if tag name exists and override == false More...
 
void setTagInfoTag (const std::string &tag)
 set the tag for the TagInfo object itself More...
 
void printTags (MsgStream &log) const
 Printout method: More...
 
std::string str () const
 String representation. More...
 

Detailed Description

This class contains the list of currently valid tags for detector description - GeoModel and IOV/Conditions. Tags are given as name/value pairs.

The set of tags corresponding to the input event are also made available separately.

Definition at line 41 of file TagInfo.h.

Member Typedef Documentation

◆ NameTagPair

typedef std::pair<std::string, std::string> TagInfo::NameTagPair

Definition at line 45 of file TagInfo.h.

◆ NameTagPairVec

typedef std::vector<NameTagPair> TagInfo::NameTagPairVec

Definition at line 46 of file TagInfo.h.

Constructor & Destructor Documentation

◆ TagInfo()

TagInfo::TagInfo ( )

Definition at line 87 of file TagInfo.cxx.

87 {}

◆ ~TagInfo()

TagInfo::~TagInfo ( )
virtual

Definition at line 89 of file TagInfo.cxx.

89 {}

Member Function Documentation

◆ addInputTag()

StatusCode TagInfo::addInputTag ( const NameTagPair pair,
bool  override = false 
)

addInputTag for input tags - returns failure if tag name exists and override == false

Return success if tag name not found, or override is set

Definition at line 181 of file TagInfo.cxx.

181  {
183  return addTagImpl(pair,m_inputTags,override)? (StatusCode::SUCCESS): (StatusCode::FAILURE);
184 }

◆ addTag()

StatusCode TagInfo::addTag ( const NameTagPair pair,
bool  override = false 
)

addTag for current tags - returns failure if tag name exists and override == false

Return success if tag name not found, or override is set

Definition at line 175 of file TagInfo.cxx.

175  {
177  return addTagImpl(pair,m_tags,override)? (StatusCode::SUCCESS): (StatusCode::FAILURE);
178 }

◆ findInputTag() [1/2]

std::string TagInfo::findInputTag ( const std::string &  name) const

Find tag by its name - for input tags, return by value.

Definition at line 111 of file TagInfo.cxx.

111  {
112  return findTagImpl(name, m_inputTags);;
113 }

◆ findInputTag() [2/2]

void TagInfo::findInputTag ( const std::string &  name,
std::string &  tag 
) const

Find tag by its name - for input tags, return in the reference argument.

Definition at line 106 of file TagInfo.cxx.

106  {
107  tag = findInputTag(name);
108 }

◆ findTag() [1/2]

std::string TagInfo::findTag ( const std::string &  name) const

Find tag by name, return by value.

Definition at line 100 of file TagInfo.cxx.

100  {
101  return findTagImpl(name, m_tags);
102 }

◆ findTag() [2/2]

void TagInfo::findTag ( const std::string &  name,
std::string &  tag 
) const

Find tag by its name - for current tags, returning in the reference argument.

Definition at line 95 of file TagInfo.cxx.

95  {
96  tag = findTag(name);
97 }

◆ getInputTags() [1/2]

const TagInfo::NameTagPairVec & TagInfo::getInputTags ( ) const

Return a vector with all current input tags.

Definition at line 132 of file TagInfo.cxx.

132  {
133  return m_inputTags;
134 }

◆ getInputTags() [2/2]

void TagInfo::getInputTags ( NameTagPairVec pairs) const

Fill reference vector with all current input tags.

Definition at line 127 of file TagInfo.cxx.

127  {
128  pairs = m_inputTags;
129 }

◆ getTags() [1/2]

const TagInfo::NameTagPairVec & TagInfo::getTags ( ) const

Return a vector with all current tags.

Definition at line 122 of file TagInfo.cxx.

122  {
123  return m_tags;
124 }

◆ getTags() [2/2]

void TagInfo::getTags ( NameTagPairVec pairs) const

Fill vector with all current tags.

Definition at line 117 of file TagInfo.cxx.

117  {
118  pairs = m_tags;
119 }

◆ operator<()

bool TagInfo::operator< ( const TagInfo rhs) const

Less than comparision needed to create e.g. set<TagInfo>

Definition at line 141 of file TagInfo.cxx.

142  {
143  if (this->tagInfoTag() != rhs.tagInfoTag()) {
144  return(this->tagInfoTag() < rhs.tagInfoTag());
145  }
146  if (this->m_tags.size() != rhs.m_tags.size()) {
147  return(this->m_tags.size() < rhs.m_tags.size());
148  }
149  for (NameTagPairVec::const_iterator i = this->m_tags.begin(), j = rhs.m_tags.begin();
150  i != this->m_tags.end(); ++i, ++j) {
151  if (i->first != j->first) {
152  return(i->first < j->first);
153  }
154  if (i->second != j->second) {
155  return(i->second < j->second);
156  }
157  }
158  if (this->m_inputTags.size() != rhs.m_inputTags.size()) {
159  return(this->m_inputTags.size() < rhs.m_inputTags.size());
160  }
161  for (NameTagPairVec::const_iterator i = this->m_inputTags.begin(), j = rhs.m_inputTags.begin();
162  i != this->m_inputTags.end(); ++i, ++j) {
163  if (i->first != j->first) {
164  return(i->first < j->first);
165  }
166  if (i->second != j->second) {
167  return(i->second < j->second);
168  }
169  }
170  return(false);
171 }

◆ printTags()

void TagInfo::printTags ( MsgStream &  log) const

Printout method:

Definition at line 192 of file TagInfo.cxx.

192  {
193  if (log.level() <= MSG::DEBUG) {
194  log << MSG::DEBUG << "TagInfo tag: " << m_myTag << endmsg;
195  log << MSG::DEBUG << "Current tags: " << endmsg;
196  for (const auto &thisPair : m_tags) {
197  log << MSG::DEBUG << formatTagPair(thisPair) << endmsg;
198  }
199  log << MSG::DEBUG << "Input tags: " << endmsg;
200  for (const auto &thisPair : m_inputTags) {
201  log << MSG::DEBUG << formatTagPair(thisPair) << endmsg;
202  }
203  }
204 }

◆ setTagInfoTag()

void TagInfo::setTagInfoTag ( const std::string &  tag)

set the tag for the TagInfo object itself

Definition at line 187 of file TagInfo.cxx.

187  {
188  m_myTag = tag;
189 }

◆ str()

std::string TagInfo::str ( ) const

String representation.

Definition at line 207 of file TagInfo.cxx.

207  {
208  std::string m{};
209  m+="TagInfo tag: " + m_myTag + "\n";
210  m+="Current tags: \n";
211  for (const auto &thisPair : m_tags) {
212  m+= formatTagPair(thisPair) + "\n";
213  }
214  m+= "Input tags: \n";
215  for (const auto &thisPair : m_inputTags) {
216  m += formatTagPair(thisPair) + "\n";
217  }
218  return m;
219 }

◆ tagInfoTag()

const std::string & TagInfo::tagInfoTag ( ) const

The tag of the TagInfo object.

Definition at line 137 of file TagInfo.cxx.

137  {
138  return(m_myTag);
139 }

Member Data Documentation

◆ m_inputTags

NameTagPairVec TagInfo::m_inputTags
private

Definition at line 115 of file TagInfo.h.

◆ m_myTag

std::string TagInfo::m_myTag
private

Definition at line 116 of file TagInfo.h.

◆ m_tags

NameTagPairVec TagInfo::m_tags
private

Definition at line 114 of file TagInfo.h.


The documentation for this class was generated from the following files:
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
TagInfo::findInputTag
void findInputTag(const std::string &name, std::string &tag) const
Find tag by its name - for input tags, return in the reference argument.
Definition: TagInfo.cxx:106
python.CreateTierZeroArgdict.pairs
pairs
Definition: CreateTierZeroArgdict.py:201
lumiFormat.i
int i
Definition: lumiFormat.py:85
TagInfo::tagInfoTag
const std::string & tagInfoTag() const
The tag of the TagInfo object.
Definition: TagInfo.cxx:137
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TagInfo::m_inputTags
NameTagPairVec m_inputTags
Definition: TagInfo.h:115
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TagInfo::findTag
void findTag(const std::string &name, std::string &tag) const
Find tag by its name - for current tags, returning in the reference argument.
Definition: TagInfo.cxx:95
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
TagInfo::m_myTag
std::string m_myTag
Definition: TagInfo.h:116
TagInfo::m_tags
NameTagPairVec m_tags
Definition: TagInfo.h:114