ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TagMetaDto Class Reference

#include <CrestModel.h>

Collaboration diagram for TagMetaDto:

Public Member Functions

 TagMetaDto (std::string tagName, std::string description, const TagInfoDto &info)
 
 TagMetaDto ()
 
json to_json () const
 

Static Public Member Functions

static TagMetaDto from_json (const json &j)
 

Public Attributes

std::string tagName
 
std::string description
 
std::optional< std::string > insertionTime
 
TagInfoDto tagInfo
 

Detailed Description

Definition at line 237 of file CrestModel.h.

Constructor & Destructor Documentation

◆ TagMetaDto() [1/2]

TagMetaDto::TagMetaDto ( std::string  tagName,
std::string  description,
const TagInfoDto info 
)
inline

Definition at line 245 of file CrestModel.h.

245  :
247  }

◆ TagMetaDto() [2/2]

TagMetaDto::TagMetaDto ( )
inline

Definition at line 249 of file CrestModel.h.

249  : tagName(""), description(""), tagInfo(""){
250  }

Member Function Documentation

◆ from_json()

TagMetaDto TagMetaDto::from_json ( const json j)
static

Definition at line 401 of file CrestModel.cxx.

402 {
403  TagMetaDto tag;
404  tag.tagName = j.value("tagName", "");
405  json infoJs = j["tagInfo"];
406  if (infoJs.is_string())
407  {
408  std::istringstream ss(to_string(infoJs));
409  std::string st;
410  ss >> std::quoted(st);
411  infoJs = json::parse(st);
412  }
413  tag.tagInfo = TagInfoDto::from_json(infoJs);
414 
415  tag.description = j.value("description", "");
416  if (j.contains(std::string{"insertionTime"}))
417  tag.insertionTime = j.value("insertionTime", "");
418  return tag;
419 }

◆ to_json()

json TagMetaDto::to_json ( ) const

Definition at line 389 of file CrestModel.cxx.

390 {
391  json tagMeta = {};
392  tagMeta["tagName"] = tagName;
393  tagMeta["description"] = description;
394  tagMeta["chansize"] = tagInfo.getChannelSize();
395  tagMeta["colsize"] = tagInfo.getColumnSize();
396  tagMeta["tagInfo"] = tagInfo.to_json().dump();
397  if (insertionTime.has_value())
398  tagMeta["insertionTime"] = insertionTime.value();
399  return tagMeta;
400 }

Member Data Documentation

◆ description

std::string TagMetaDto::description

Definition at line 241 of file CrestModel.h.

◆ insertionTime

std::optional<std::string> TagMetaDto::insertionTime

Definition at line 242 of file CrestModel.h.

◆ tagInfo

TagInfoDto TagMetaDto::tagInfo

Definition at line 243 of file CrestModel.h.

◆ tagName

std::string TagMetaDto::tagName

Definition at line 240 of file CrestModel.h.


The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
TagInfoDto::getChannelSize
size_t getChannelSize() const
Definition: CrestModel.h:229
TagMetaDto::tagInfo
TagInfoDto tagInfo
Definition: CrestModel.h:243
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
json
nlohmann::json json
Definition: HistogramDef.cxx:9
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:1054
TagMetaDto
Definition: CrestModel.h:238
TagInfoDto::to_json
json to_json() const
Definition: CrestModel.cxx:366
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TagInfoDto::from_json
static TagInfoDto from_json(const json &j)
Definition: CrestModel.cxx:374
TagMetaDto::description
std::string description
Definition: CrestModel.h:241
TagMetaDto::tagName
std::string tagName
Definition: CrestModel.h:240
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
TagInfoDto::getColumnSize
size_t getColumnSize() const
Definition: CrestModel.h:230
TagMetaDto::insertionTime
std::optional< std::string > insertionTime
Definition: CrestModel.h:242