ATLAS Offline Software
Loading...
Searching...
No Matches
TagInfo Class Reference

This class contains the list of currently valid tags for detector description - GeoModel and IOV/Conditions. 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 ()
 TagInfo (const TagInfo &)=default
 TagInfo (TagInfo &&)=default
TagInfooperator= (const TagInfo &)=default
TagInfooperator= (TagInfo &&)=default
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.
std::string findTag (const std::string &name) const
 Find tag by name, return by value.
void getTags (NameTagPairVec &pairs) const
 Fill vector with all current tags.
const NameTagPairVecgetTags () const
 Return a vector with all current tags.
void findInputTag (const std::string &name, std::string &tag) const
 Find tag by its name - for input tags, return in the reference argument.
std::string findInputTag (const std::string &name) const
 Find tag by its name - for input tags, return by value.
void getInputTags (NameTagPairVec &pairs) const
 Fill reference vector with all current input tags.
const NameTagPairVecgetInputTags () const
 Return a vector with all current input tags.
const std::string & tagInfoTag () const
 The tag of the TagInfo object.
bool operator< (const TagInfo &rhs) const
 Less than comparision needed to create e.g. set<TagInfo>

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
StatusCode addInputTag (const NameTagPair &pair, bool override=false)
 addInputTag for input tags - returns failure if tag name exists and override == false
void setTagInfoTag (const std::string &tag)
 set the tag for the TagInfo object itself
void printTags (MsgStream &log) const
 Printout method:
std::string str () const
 String representation.

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() [1/3]

TagInfo::TagInfo ( )

Definition at line 87 of file TagInfo.cxx.

87{}

◆ ~TagInfo()

TagInfo::~TagInfo ( )
virtual

Definition at line 89 of file TagInfo.cxx.

89{}

◆ TagInfo() [2/3]

TagInfo::TagInfo ( const TagInfo & )
default

◆ TagInfo() [3/3]

TagInfo::TagInfo ( TagInfo && )
default

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}
NameTagPairVec m_inputTags
Definition TagInfo.h:120
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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}
NameTagPairVec m_tags
Definition TagInfo.h:119

◆ 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}
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

◆ 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}
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

◆ 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.

◆ 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}
const std::string & tagInfoTag() const
The tag of the TagInfo object.
Definition TagInfo.cxx:137

◆ operator=() [1/2]

TagInfo & TagInfo::operator= ( const TagInfo & )
default

◆ operator=() [2/2]

TagInfo & TagInfo::operator= ( TagInfo && )
default

◆ 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}
#define endmsg
std::string m_myTag
Definition TagInfo.h:121

◆ 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 120 of file TagInfo.h.

◆ m_myTag

std::string TagInfo::m_myTag
private

Definition at line 121 of file TagInfo.h.

◆ m_tags

NameTagPairVec TagInfo::m_tags
private

Definition at line 119 of file TagInfo.h.


The documentation for this class was generated from the following files: