35 StringProperty containerPrefixProp(
"PoolContainerPrefix",
"CollectionTree");
36 StringProperty containerNameHintProp(
"TopLevelContainerName",
"");
37 StringProperty branchNameHintProp(
"SubLevelBranchName",
"<type>/<key>");
38 if (propertyServer !=
nullptr) {
39 propertyServer->getProperty(&containerPrefixProp).ignore();
40 propertyServer->getProperty(&containerNameHintProp).ignore();
41 propertyServer->getProperty(&branchNameHintProp).ignore();
46 return(StatusCode::SUCCESS);
58 return(POOL_StorageType);
64 bool ownTokAddr =
false;
65 if (tokAddr ==
nullptr || tokAddr->
getToken() ==
nullptr) {
69 GenericAddress* genAddr =
dynamic_cast<GenericAddress*
>(pAddr);
71 ATH_MSG_ERROR(
"Dynamic cast failed in AthenaPoolConverter::createObj");
74 return StatusCode::FAILURE;
80 ::sprintf(
text,
"[CTXT=%08X]",
static_cast<int>(*(pAddr->ipar())));
88 std::string
key = pAddr->par()[1];
97 if (pObj ==
nullptr) {
101 delete tokAddr; tokAddr =
nullptr;
104 if (pObj ==
nullptr) {
105 return(StatusCode::FAILURE);
107 return(StatusCode::SUCCESS);
112 if (
proxy ==
nullptr) {
113 ATH_MSG_ERROR(
"AthenaPoolConverter CreateRep failed to cast DataProxy, key = " << pObj->name());
114 return(StatusCode::FAILURE);
120 return(StatusCode::FAILURE);
124 return(StatusCode::FAILURE);
127 if (pAddr ==
nullptr) {
131 GenericAddress* gAddr =
dynamic_cast<GenericAddress*
>(pAddr);
132 if (gAddr !=
nullptr) {
136 return(StatusCode::SUCCESS);
144 return(StatusCode::FAILURE);
148 return(StatusCode::FAILURE);
150 return(StatusCode::SUCCESS);
154 return(POOL_StorageType);
159 ::
Converter(POOL_StorageType, myCLID, pSvcLocator),
161 name ?
name :
"AthenaPoolConverter"),
162 m_detStore(
"DetectorStore",
name ?
name :
"AthenaPoolConverter"),
163 m_athenaPoolCnvSvc(
"AthenaPoolCnvSvc",
name ?
name :
"AthenaPoolConverter"),
167 m_containerPrefix(
""),
168 m_containerNameHint(
""),
169 m_branchNameHint(
""),
170 m_dataObject(nullptr),
171 m_i_poolToken(nullptr) {
177 std::string::size_type pos1 =
output.find(
'[');
178 std::string outputConnectionSpec =
output.substr(0, pos1);
186 std::string containerName;
189 std::size_t colonPos = containerPrefix.find(
':');
190 if (colonPos != std::string::npos) {
191 dhContainerPrefix = containerPrefix.substr(0, colonPos + 1) + dhContainerPrefix;
197 std::string containerFriendPostfix;
198 while (pos1 != std::string::npos) {
199 const std::string::size_type pos2 =
output.find(
'=', pos1);
200 const std::string thisKey =
output.substr(pos1 + 1, pos2 - pos1 - 1);
201 const std::string::size_type pos3 =
output.find(
']', pos2);
202 const std::string
value =
output.substr(pos2 + 1, pos3 - pos2 - 1);
203 if (thisKey ==
"OutputCollection") {
204 dhContainerPrefix =
value;
205 }
else if (thisKey ==
"PoolContainerPrefix") {
206 containerPrefix =
value;
207 }
else if (thisKey ==
"TopLevelContainerName") {
208 containerNameHint =
value;
209 }
else if (thisKey ==
"SubLevelBranchName") {
210 branchNameHint =
value;
211 }
else if (thisKey ==
"PoolContainerFriendPostfix") {
212 containerFriendPostfix =
value;
214 pos1 =
output.find(
'[', pos3);
218 if( tname.compare(0, 10,
"DataHeader") == 0 ) {
219 if( tname.compare(10, 4,
"Form") == 0 ) {
220 containerName = dhContainerPrefix +
"Form" +
"(" + tname +
")";
222 if (
key[
key.size() - 1] ==
'/') {
223 containerName = dhContainerPrefix +
"(" +
key + tname +
")";
225 containerName = dhContainerPrefix +
"(" + tname +
")";
230 else if (tname.compare(0, 13,
"AttributeList") == 0) {
232 if( pool::ROOTRNTUPLE_StorageType.exactMatch(tech) ) {
237 tech = pool::ROOTTREE_StorageType.
type();
243 const std::string typeTok =
"<type>", keyTok =
"<key>";
244 containerName = containerPrefix + containerFriendPostfix + containerNameHint;
245 if (!branchNameHint.empty()) {
246 containerName +=
"(" + branchNameHint +
")";
248 const std::size_t pos1 = containerName.find(typeTok);
249 if (pos1 != std::string::npos) {
250 containerName.replace(pos1, typeTok.size(), tname);
252 const std::size_t pos2 = containerName.find(keyTok);
253 if (pos2 != std::string::npos) {
255 containerName.replace(pos2, keyTok.size(), tname);
257 containerName.replace(pos2, keyTok.size(),
key);
276 ATH_MSG_DEBUG(
"AthenaPoolConverter cleanUp called for base class.");
277 return(StatusCode::SUCCESS);