ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_ClusterContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "MsgUtil.h"
8
11
12#include <iostream>
13#include <memory>
14
16 : SCT_ClusterContainerCnvBase(svcloc, "SCT_ClusterContainerCnv"),
18 {}
19
20
22 ATH_MSG_INFO("SCT_ClusterContainerCnv::initialize()");
23
25
26 // Get the SCT helper from the detector store
27 const SCT_ID* idhelper(nullptr);
28 ATH_CHECK( detStore()->retrieve(idhelper, "SCT_ID") );
29
30 ATH_CHECK( m_converter_p0.initialize(msg()) );
31
32 ATH_MSG_DEBUG("Converter initialized");
33
34 return StatusCode::SUCCESS;
35}
36
37
38InDet::SCT_ClusterContainer* SCT_ClusterContainerCnv::createTransient() {
39 // MsgStream log(msgSvc(), "SCT_ClusterContainerCnv" );
40 static const pool::Guid p0_guid("A180F372-0D52-49C3-8AA0-0939CB0B8179"); // before t/p split
41 static const pool::Guid p1_guid("657F6546-F5CD-4166-9567-16AD9C96D286"); // with SCT_Cluster_tlp1
42 static const pool::Guid p2_guid("ECE7D831-0F31-4E6F-A6BE-2ADDE90083BA"); // with SCT_Cluster_p2
43 static const pool::Guid p3_guid("623F5836-369F-4A94-9DD4-DAD728E93C13"); // with SCT_Cluster_p3
44
45 //ATH_MSG_DEBUG("createTransient(): main converter");
46 InDet::SCT_ClusterContainer* p_collection(nullptr);
47 if ( compareClassGuid(p3_guid) ) {
48 //ATH_MSG_DEBUG("createTransient(): T/P version 3 detected");
49 std::unique_ptr< SCT_ClusterContainer_PERS > p_coll( poolReadObject< SCT_ClusterContainer_PERS >() );
50 p_collection = m_TPConverter_p3.createTransient( p_coll.get(), msg() );
51
52 } else if ( compareClassGuid(p1_guid) ) {
53 //ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
54 std::unique_ptr< InDet::SCT_ClusterContainer_tlp1 > p_coll( poolReadObject< InDet::SCT_ClusterContainer_tlp1 >() );
55 p_collection = m_TPConverter.createTransient( p_coll.get(), msg() );
56
57 } else if ( compareClassGuid(p2_guid) ) {
58 //ATH_MSG_DEBUG("createTransient(): T/P version 2 detected");
59 std::unique_ptr< InDet::SCT_ClusterContainer_p2 > p_coll( poolReadObject< InDet::SCT_ClusterContainer_p2 >() );
60 p_collection = m_TPConverter_p2.createTransient( p_coll.get(), msg() );
61
62 } else if ( compareClassGuid(p0_guid) ) {
63 //ATH_MSG_DEBUG("createTransient(): Old input file");
64 std::unique_ptr< SCT_ClusterContainer_p0 > col_vect( poolReadObject< SCT_ClusterContainer_p0 >() );
65 p_collection = m_converter_p0.createTransient( col_vect.get(), msg() );
66
67 } else {
68 throw std::runtime_error("Unsupported persistent version of SCT_ClusterContainer");
69
70 }
71 return p_collection;
72}
73
74
76 SCT_ClusterContainer_PERS* sctdc_p= m_TPConverter_p3.createPersistent( transCont, msg() );
77 return sctdc_p;
78}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
T_AthenaPoolCustomCnv< InDet::SCT_ClusterContainer, SCT_ClusterContainer_PERS > SCT_ClusterContainerCnvBase
InDet::SCT_ClusterContainer_p3 SCT_ClusterContainer_PERS
This is an Identifier helper class for the SCT subdetector.
virtual SCT_ClusterContainer_PERS * createPersistent(InDet::SCT_ClusterContainer *transCont) override
SCT_ClusterContainerCnv_tlp1 m_TPConverter
SCT_ClusterContainerCnv_p2 m_TPConverter_p2
virtual InDet::SCT_ClusterContainer * createTransient() override
SCT_ClusterContainerCnv_p3 m_TPConverter_p3
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
SCT_ClusterContainerCnv_p0 m_converter_p0
SCT_ClusterContainerCnv(ISvcLocator *svcloc)
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68