Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
4a370671
Verified
Commit
4a370671
authored
Mar 26, 2019
by
Peter van Gemmeren
Committed by
Tadej Novak
Oct 28, 2020
Browse files
For Forward-Compatibility port reading of RootTreeIndexContainer
parent
7690df0c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Database/APR/RootStorageSvc/src/RootOODb.cpp
View file @
4a370671
...
...
@@ -15,6 +15,7 @@
#include "RootDomain.h"
#include "RootKeyContainer.h"
#include "RootTreeContainer.h"
#include "RootTreeIndexContainer.h"
#include "StorageSvc/DbInstanceCount.h"
using
namespace
pool
;
...
...
@@ -52,6 +53,9 @@ IDbContainer* RootOODb::createContainer(const DbType& typ) {
else
if
(
typ
.
match
(
ROOTTREE_StorageType
)
)
{
return
new
RootTreeContainer
(
this
);
}
else
if
(
typ
.
match
(
ROOTTREEINDEX_StorageType
)
)
{
return
new
RootTreeIndexContainer
(
this
);
}
else
if
(
typ
.
match
(
ROOT_StorageType
)
)
{
return
new
RootTreeContainer
(
this
);
}
...
...
Database/APR/RootStorageSvc/src/RootOODb.h
View file @
4a370671
...
...
@@ -62,6 +62,13 @@ namespace pool {
/// Create Root Container object
IDbContainer
*
createContainer
(
const
DbType
&
typ
);
};
class
RootOOKey
:
public
RootOODb
{
public:
/// Standard Constructor
RootOOKey
(
void
*
ctxt
)
:
RootOODb
(
ctxt
,
ROOTKEY_StorageType
)
{
}
/// Label of the specific class
static
const
char
*
catalogLabel
()
{
return
"ROOT_Key"
;
}
};
class
RootOOTree
:
public
RootOODb
{
public:
/// Standard Constructor
...
...
@@ -69,12 +76,12 @@ namespace pool {
/// Label of the specific class
static
const
char
*
catalogLabel
()
{
return
"ROOT_Tree"
;
}
};
class
RootOO
Key
:
public
RootOODb
{
class
RootOO
TreeIndex
:
public
RootOODb
{
public:
/// Standard Constructor
RootOO
Key
(
void
*
ctxt
)
:
RootOODb
(
ctxt
,
ROOT
KEY
_StorageType
)
{
}
RootOO
TreeIndex
(
void
*
ctxt
)
:
RootOODb
(
ctxt
,
ROOT
TREEINDEX
_StorageType
)
{
}
/// Label of the specific class
static
const
char
*
catalogLabel
()
{
return
"ROOT_
Key
"
;
}
static
const
char
*
catalogLabel
()
{
return
"ROOT_
TreeIndex
"
;
}
};
}
// end namespace pool
...
...
Database/APR/RootStorageSvc/src/RootTreeContainer.h
View file @
4a370671
...
...
@@ -104,6 +104,8 @@ namespace pool {
/// Definition of the branch container
typedef
std
::
vector
<
BranchDesc
>
Branches
;
protected:
/// Reference to the root tree object
TTree
*
m_tree
;
/// reference to exact type description
...
...
Database/APR/RootStorageSvc/src/RootTreeIndexContainer.cpp
0 → 100644
View file @
4a370671
/*
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
* */
// Local implementation files
#include "RootTreeIndexContainer.h"
#include "StorageSvc/Transaction.h"
#include "RootDataPtr.h"
#include "RootDatabase.h"
// Root include files
#include "TTree.h"
#include "TBranch.h"
using
namespace
pool
;
using
namespace
std
;
RootTreeIndexContainer
::
RootTreeIndexContainer
(
IOODatabase
*
idb
)
:
RootTreeContainer
(
idb
)
{
}
/// Standard destructor
RootTreeIndexContainer
::~
RootTreeIndexContainer
()
{
}
DbStatus
RootTreeIndexContainer
::
loadObject
(
DataCallBack
*
call
,
Token
::
OID_t
&
oid
,
DbAccessMode
mode
)
{
if
((
oid
.
second
>>
32
)
>
0
)
{
long
long
int
evt_id
=
m_tree
->
GetEntryNumberWithIndex
(
oid
.
second
);
if
(
evt_id
==
-
1
)
{
m_tree
->
BuildIndex
(
"index_ref"
);
evt_id
=
m_tree
->
GetEntryNumberWithIndex
(
oid
.
second
);
}
if
(
evt_id
>=
0
)
{
oid
.
second
=
evt_id
;
}
}
return
RootTreeContainer
::
loadObject
(
call
,
oid
,
mode
);
}
Database/APR/RootStorageSvc/src/RootTreeIndexContainer.h
0 → 100644
View file @
4a370671
/*
* Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
* */
#ifndef POOL_ROOTTREEINDEXCONTAINER_H
#define POOL_ROOTTREEINDEXCONTAINER_H 1
#include "RootTreeContainer.h"
// Forward declarations
class
TTree
;
class
TBranch
;
namespace
pool
{
/** @class RootTreeIndexContainer RootTreeIndexContainer.h src/RootTreeIndexContainer.h
*
* Description:
* Spezialization of RootTreeContainer, Read only port for R21!
* ROOT specific implementation of Database container.
* Since objects in root are stored in "trees with branches",
* this object corresponds to a tuple (Tree/Branch), where
* each object type (determined by the location of the transient
* object within the data store) is accessed by an index number
* stored inside its tree.
*
* @author N.Dulin, P.v.Gemmeren
* @date 8/1/2018
* @version 1.0
*/
class
RootTreeIndexContainer
:
public
RootTreeContainer
{
public:
/// Standard constructor
RootTreeIndexContainer
(
IOODatabase
*
idb
);
/// Standard destructor
virtual
~
RootTreeIndexContainer
();
/// Find object by object identifier and load it into memory
/** @param call [IN] Callback to load data
* @param oid [OUT] Object OID
* @param mode [IN] Object access mode
*
* @return Status code indicating success or failure.
*/
virtual
DbStatus
loadObject
(
DataCallBack
*
call
,
Token
::
OID_t
&
oid
,
DbAccessMode
mode
);
};
}
#endif //POOL_ROOTTREEINDEXCONTAINER_H
Database/APR/StorageSvc/StorageSvc/DbType.h
View file @
4a370671
...
...
@@ -100,6 +100,7 @@ namespace pool {
static
const
DbType
ROOT_StorageType
=
makeTechnology
(
2
,
0
);
static
const
DbType
ROOTKEY_StorageType
=
makeTechnology
(
2
,
1
);
static
const
DbType
ROOTTREE_StorageType
=
makeTechnology
(
2
,
2
);
static
const
DbType
ROOTTREEINDEX_StorageType
=
makeTechnology
(
2
,
3
);
static
const
DbType
OBJY_StorageType
=
makeTechnology
(
3
,
0
);
static
const
DbType
ACCESS_StorageType
=
makeTechnology
(
4
,
0
);
static
const
DbType
EXCEL_StorageType
=
makeTechnology
(
5
,
0
);
...
...
Database/APR/StorageSvc/src/DbType.cpp
View file @
4a370671
...
...
@@ -20,6 +20,8 @@ DbType DbType::getType(const std::string& name) {
return
ROOTKEY_StorageType
;
else
if
(
"ROOT_Tree"
==
name
)
return
ROOTTREE_StorageType
;
else
if
(
"ROOT_TreeIndex"
==
name
)
return
ROOTTREEINDEX_StorageType
;
else
if
(
"ROOT_All"
==
name
)
return
ROOT_StorageType
;
else
if
(
"POOL_RDBMS"
==
name
)
...
...
@@ -61,6 +63,8 @@ const std::string DbType::storageName() const {
return
"ROOT_Key"
;
else
if
(
match
(
ROOTTREE_StorageType
)
)
return
"ROOT_Tree"
;
else
if
(
match
(
ROOTTREEINDEX_StorageType
)
)
return
"ROOT_TreeIndex"
;
else
if
(
*
this
==
ROOT_StorageType
)
return
"ROOT_All"
;
else
if
(
match
(
POOL_RDBMS_HOMOGENEOUS_StorageType
)
)
...
...
Database/PersistentDataModel/src/DataHeader.cxx
View file @
4a370671
...
...
@@ -108,14 +108,7 @@ const Token* DataHeaderElement::getToken() const {
}
//_____________________________________________________________________________
long
DataHeaderElement
::
getStorageType
()
const
{
const
long
technology
=
m_token
->
technology
();
if
(
technology
==
POOL_StorageType
||
technology
==
POOL_ROOT_StorageType
||
technology
==
POOL_ROOTKEY_StorageType
||
technology
==
POOL_ROOTTREE_StorageType
)
{
return
(
POOL_StorageType
);
}
return
(
TEST_StorageType
);
return
(
POOL_StorageType
);
}
//_____________________________________________________________________________
const
std
::
vector
<
unsigned
int
>&
DataHeaderElement
::
getHashes
()
const
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment