ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Attributes | Friends | List of all members
DataHeaderForm_p6 Class Reference

This class provides storage for the constant fields of the persistent DataHeader class. More...

#include <DataHeader_p6.h>

Collaboration diagram for DataHeaderForm_p6:

Classes

struct  DbRecord
 
struct  ObjRecord
 

Public Types

enum  DHVersions { DHverFormRef = 600 }
 
using sgkey_t = SG::sgkey_t
 

Public Member Functions

 DataHeaderForm_p6 ()
 
 DataHeaderForm_p6 (const DataHeaderForm_p6 &rhs)
 
DataHeaderForm_p6operator= (const DataHeaderForm_p6 &rhs)
 
 ~DataHeaderForm_p6 ()
 
unsigned int insertDb (const DbRecord &rec)
 
std::size_t sizeDb () const
 
Guid getDbGuid (unsigned int index) const
 
unsigned int getDbTech (unsigned int index) const
 
unsigned int insertObj (const ObjRecord &rec, const std::set< std::string > &alias=std::set< std::string >(), bool doAliasFiletering=true, const std::set< unsigned int > &symLinks=std::set< unsigned int >(), const std::vector< sgkey_t > &hashes=std::vector< sgkey_t >())
 
std::size_t sizeObj () const
 
std::string getObjContainer (unsigned int index) const
 
std::string getObjKey (unsigned int index) const
 
unsigned int getObjType (unsigned int index) const
 
Guid getObjClassId (unsigned int index) const
 
long long getObjOid1 (unsigned int index) const
 
std::set< std::string > getObjAlias (unsigned int index) const
 
std::set< unsigned int > getObjSymLinks (unsigned int index) const
 
std::vector< sgkey_tgetObjHashes (unsigned int index) const
 
std::string calculateMdx ()
 
bool isModified () const
 
void clearModified ()
 
void setToken (const std::string &tok)
 
const std::string & getToken () const
 
void resize (unsigned int size)
 
const std::string & getProcessTag () const
 
void setProcessTag (const std::string &tag)
 
unsigned version () const
 
void setVersion (const DHVersions ver)
 change version if writing backward compatible format More...
 

Private Attributes

std::vector< DbRecordm_dbRecords
 
std::vector< ObjRecordm_objRecords
 
std::vector< std::vector< std::string > > m_objAlias
 
std::vector< std::vector< unsigned int > > m_objSymLinks
 
std::vector< std::vector< sgkey_t > > m_objHashes
 
unsigned m_version { DHverFormRef }
 Subversion of DHForm_p6 for small changes of data encoding. More...
 
std::string m_processTag
 DataHeader SG Key. More...
 
bool m_modified { true }
 indicates that the last event was somehow different and a new DHForm needs to be written More...
 
std::string m_token
 Reference to self in the persistent storage. More...
 

Friends

class DataHeaderCnv_p6
 

Detailed Description

This class provides storage for the constant fields of the persistent DataHeader class.

Definition at line 27 of file DataHeader_p6.h.

Member Typedef Documentation

◆ sgkey_t

Definition at line 31 of file DataHeader_p6.h.

Member Enumeration Documentation

◆ DHVersions

Enumerator
DHverFormRef 

Definition at line 50 of file DataHeader_p6.h.

50 { DHverFormRef = 600 };

Constructor & Destructor Documentation

◆ DataHeaderForm_p6() [1/2]

DataHeaderForm_p6::DataHeaderForm_p6 ( )
inline

Definition at line 55 of file DataHeader_p6.h.

55 {}

◆ DataHeaderForm_p6() [2/2]

DataHeaderForm_p6::DataHeaderForm_p6 ( const DataHeaderForm_p6 rhs)

Definition at line 12 of file DataHeader_p6.cxx.

◆ ~DataHeaderForm_p6()

DataHeaderForm_p6::~DataHeaderForm_p6 ( )

Definition at line 36 of file DataHeader_p6.cxx.

37 { }

Member Function Documentation

◆ calculateMdx()

std::string DataHeaderForm_p6::calculateMdx ( )

◆ clearModified()

void DataHeaderForm_p6::clearModified ( )

Definition at line 139 of file DataHeader_p6.cxx.

139  {
140  m_modified = false;
141 }

◆ getDbGuid()

Guid DataHeaderForm_p6::getDbGuid ( unsigned int  index) const

Definition at line 57 of file DataHeader_p6.cxx.

57  {
58  return m_dbRecords[index].fid;
59 }

◆ getDbTech()

unsigned int DataHeaderForm_p6::getDbTech ( unsigned int  index) const

Definition at line 61 of file DataHeader_p6.cxx.

61  {
62  return m_dbRecords[index].tech;
63 }

◆ getObjAlias()

std::set< std::string > DataHeaderForm_p6::getObjAlias ( unsigned int  index) const

Definition at line 122 of file DataHeader_p6.cxx.

122  {
123  return(std::set<std::string>(m_objAlias[index].begin(), m_objAlias[index].end()));
124 }

◆ getObjClassId()

Guid DataHeaderForm_p6::getObjClassId ( unsigned int  index) const

Definition at line 118 of file DataHeader_p6.cxx.

118  {
119  return m_objRecords[index].guid;
120 }

◆ getObjContainer()

std::string DataHeaderForm_p6::getObjContainer ( unsigned int  index) const

Definition at line 106 of file DataHeader_p6.cxx.

106  {
107  return m_objRecords[index].cont;
108 }

◆ getObjHashes()

std::vector< DataHeaderForm_p6::sgkey_t > DataHeaderForm_p6::getObjHashes ( unsigned int  index) const

Definition at line 131 of file DataHeader_p6.cxx.

131  {
132  return(m_objHashes[index]);
133 }

◆ getObjKey()

std::string DataHeaderForm_p6::getObjKey ( unsigned int  index) const

Definition at line 110 of file DataHeader_p6.cxx.

110  {
111  return m_objRecords[index].key;
112 }

◆ getObjOid1()

long long DataHeaderForm_p6::getObjOid1 ( unsigned int  index) const
inline

Definition at line 74 of file DataHeader_p6.h.

74 { return m_objRecords[index].oid1; }

◆ getObjSymLinks()

std::set< unsigned int > DataHeaderForm_p6::getObjSymLinks ( unsigned int  index) const

Definition at line 126 of file DataHeader_p6.cxx.

126  {
127  return(std::set<unsigned int>(m_objSymLinks[index].begin(), m_objSymLinks[index].end()));
128 }

◆ getObjType()

unsigned int DataHeaderForm_p6::getObjType ( unsigned int  index) const

Definition at line 114 of file DataHeader_p6.cxx.

114  {
115  return m_objRecords[index].clid;
116 }

◆ getProcessTag()

const std::string& DataHeaderForm_p6::getProcessTag ( ) const
inline

Definition at line 84 of file DataHeader_p6.h.

84 { return m_processTag; }

◆ getToken()

const std::string & DataHeaderForm_p6::getToken ( ) const

Definition at line 148 of file DataHeader_p6.cxx.

148  {
149  return m_token;
150 }

◆ insertDb()

unsigned int DataHeaderForm_p6::insertDb ( const DbRecord rec)

Definition at line 40 of file DataHeader_p6.cxx.

40  {
41  unsigned int index = 0U;
42  for (std::vector<DbRecord>::const_iterator iter = m_dbRecords.begin(), last = m_dbRecords.end();
43  iter != last; ++iter, ++index) {
44  if (*iter == rec) break;
45  }
46  if (index == m_dbRecords.size()) {
47  m_dbRecords.push_back(rec);
48  m_modified = true;
49  }
50  return(index);
51 }

◆ insertObj()

unsigned int DataHeaderForm_p6::insertObj ( const ObjRecord rec,
const std::set< std::string > &  alias = std::set<std::string>(),
bool  doAliasFiletering = true,
const std::set< unsigned int > &  symLinks = std::set<unsigned int>(),
const std::vector< sgkey_t > &  hashes = std::vector<sgkey_t>() 
)

Definition at line 65 of file DataHeader_p6.cxx.

69 {
70  unsigned int index = 0U;
71  for (std::vector<ObjRecord>::const_iterator iter = m_objRecords.begin(), last = m_objRecords.end();
72  iter != last; ++iter, ++index) {
73  if (*iter == rec) break;
74  }
75  std::vector<std::string> alias( aliases.cbegin(), aliases.cend() );
76  std::vector<unsigned int> symlinks( symLinks.begin(), symLinks.end() );
77  if (index != m_objRecords.size()) {
78  // found matching object record, check if all the info is the same
79  if( m_objSymLinks[index] != symlinks ) {
80  m_objSymLinks[index] = std::move(symlinks);
81  m_modified = true;
82  }
83  if( m_objHashes[index] != hashes ) {
85  m_modified = true;
86  }
87  if( (!doAliasFiltering or m_modified) and m_objAlias[index] != alias ) {
88  m_objAlias[index] = std::move(alias);
89  m_modified = true;
90  }
91  return index;
92  }
93  // enter a new record
94  m_objRecords.push_back( rec );
95  m_objAlias.push_back( std::move(alias) );
96  m_objSymLinks.push_back( std::move(symlinks) );
97  m_objHashes.push_back( hashes );
98  m_modified = true;
99  return m_objRecords.size() - 1;
100 }

◆ isModified()

bool DataHeaderForm_p6::isModified ( ) const

Definition at line 135 of file DataHeader_p6.cxx.

135  {
136  return m_modified;
137 }

◆ operator=()

DataHeaderForm_p6 & DataHeaderForm_p6::operator= ( const DataHeaderForm_p6 rhs)

Definition at line 21 of file DataHeader_p6.cxx.

22 {
23  if (&rhs != this) {
26  m_objAlias = rhs.m_objAlias;
29  m_version = rhs.m_version;
30  m_modified = rhs.m_modified;
31  setToken(rhs.m_token);
32  }
33  return *this;
34 }

◆ resize()

void DataHeaderForm_p6::resize ( unsigned int  size)

Definition at line 152 of file DataHeader_p6.cxx.

152  {
153  m_objRecords.reserve( size );
154  m_objAlias.reserve( size );
155  m_objSymLinks.reserve( size );
156  m_objHashes.reserve( size );
157 }

◆ setProcessTag()

void DataHeaderForm_p6::setProcessTag ( const std::string &  tag)
inline

Definition at line 85 of file DataHeader_p6.h.

85 { m_processTag = tag; }

◆ setToken()

void DataHeaderForm_p6::setToken ( const std::string &  tok)

Definition at line 143 of file DataHeader_p6.cxx.

144 {
145  m_token = tok;
146 }

◆ setVersion()

void DataHeaderForm_p6::setVersion ( const DHVersions  ver)
inline

change version if writing backward compatible format

Definition at line 88 of file DataHeader_p6.h.

88 { m_version = ver; }

◆ sizeDb()

std::size_t DataHeaderForm_p6::sizeDb ( ) const

Definition at line 53 of file DataHeader_p6.cxx.

53  {
54  return(m_dbRecords.size());
55 }

◆ sizeObj()

std::size_t DataHeaderForm_p6::sizeObj ( ) const

Definition at line 102 of file DataHeader_p6.cxx.

102  {
103  return(m_objRecords.size());
104 }

◆ version()

unsigned DataHeaderForm_p6::version ( ) const
inline

Definition at line 86 of file DataHeader_p6.h.

86 { return m_version; }

Friends And Related Function Documentation

◆ DataHeaderCnv_p6

friend class DataHeaderCnv_p6
friend

Definition at line 28 of file DataHeader_p6.h.

Member Data Documentation

◆ m_dbRecords

std::vector<DbRecord> DataHeaderForm_p6::m_dbRecords
private

Definition at line 91 of file DataHeader_p6.h.

◆ m_modified

bool DataHeaderForm_p6::m_modified { true }
private

indicates that the last event was somehow different and a new DHForm needs to be written

Definition at line 104 of file DataHeader_p6.h.

◆ m_objAlias

std::vector<std::vector<std::string> > DataHeaderForm_p6::m_objAlias
private

Definition at line 93 of file DataHeader_p6.h.

◆ m_objHashes

std::vector<std::vector<sgkey_t> > DataHeaderForm_p6::m_objHashes
private

Definition at line 95 of file DataHeader_p6.h.

◆ m_objRecords

std::vector<ObjRecord> DataHeaderForm_p6::m_objRecords
private

Definition at line 92 of file DataHeader_p6.h.

◆ m_objSymLinks

std::vector<std::vector<unsigned int> > DataHeaderForm_p6::m_objSymLinks
private

Definition at line 94 of file DataHeader_p6.h.

◆ m_processTag

std::string DataHeaderForm_p6::m_processTag
private

DataHeader SG Key.

Definition at line 100 of file DataHeader_p6.h.

◆ m_token

std::string DataHeaderForm_p6::m_token
private

Reference to self in the persistent storage.

Definition at line 106 of file DataHeader_p6.h.

◆ m_version

unsigned DataHeaderForm_p6::m_version { DHverFormRef }
private

Subversion of DHForm_p6 for small changes of data encoding.

Definition at line 98 of file DataHeader_p6.h.


The documentation for this class was generated from the following files:
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
DataHeaderForm_p6::m_objHashes
std::vector< std::vector< sgkey_t > > m_objHashes
Definition: DataHeader_p6.h:95
index
Definition: index.py:1
DataHeaderForm_p6::m_processTag
std::string m_processTag
DataHeader SG Key.
Definition: DataHeader_p6.h:100
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
DataHeaderForm_p6::m_dbRecords
std::vector< DbRecord > m_dbRecords
Definition: DataHeader_p6.h:91
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
DataHeaderForm_p6::DHverFormRef
@ DHverFormRef
Definition: DataHeader_p6.h:50
DataHeaderForm_p6::m_token
std::string m_token
Reference to self in the persistent storage.
Definition: DataHeader_p6.h:106
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Pythia8_A14_NNPDF23LO_Var1Down_Common.ver
ver
Definition: Pythia8_A14_NNPDF23LO_Var1Down_Common.py:26
DataHeaderForm_p6::m_objRecords
std::vector< ObjRecord > m_objRecords
Definition: DataHeader_p6.h:92
COOLRates.alias
alias
Definition: COOLRates.py:1172
DataHeaderForm_p6::m_objAlias
std::vector< std::vector< std::string > > m_objAlias
Definition: DataHeader_p6.h:93
DataHeaderForm_p6::setToken
void setToken(const std::string &tok)
Definition: DataHeader_p6.cxx:143
DeMoScan.index
string index
Definition: DeMoScan.py:364
DataHeaderForm_p6::m_modified
bool m_modified
indicates that the last event was somehow different and a new DHForm needs to be written
Definition: DataHeader_p6.h:104
DataHeaderForm_p6::m_objSymLinks
std::vector< std::vector< unsigned int > > m_objSymLinks
Definition: DataHeader_p6.h:94
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
DataHeaderForm_p6::m_version
unsigned m_version
Subversion of DHForm_p6 for small changes of data encoding.
Definition: DataHeader_p6.h:98