ATLAS Offline Software
Loading...
Searching...
No Matches
PixelClusterContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9#include <memory>
10
11#include <iostream>
12
14 : PixelClusterContainerCnvBase(svcloc, "PixelClusterContainerCnv"),
16 {}
17
18
20 ATH_MSG_INFO("PixelClusterContainerCnv::initialize()");
21
23
24 // Get the pixel helper from the detector store
25 const PixelID* idhelper(nullptr);
26 ATH_CHECK( detStore()->retrieve(idhelper, "PixelID") );
27
28 ATH_CHECK( m_converter_p0.initialize(msg()) );
29
30 ATH_MSG_DEBUG("Converter initialized");
31
32 return StatusCode::SUCCESS;
33}
34
35
36InDet::PixelClusterContainer* PixelClusterContainerCnv::createTransient() {
37 static const pool::Guid p0_guid("37B00A31-EA80-45DF-9A3F-2721EC0F0DA6"); // before t/p split
38 static const pool::Guid p1_guid("9DB54746-8C4E-4A56-8B4C-0E5D42905218"); // with PixelCluster_tlp1
39 static const pool::Guid p2_guid("DE48E26B-9E03-4EAD-86B9-351AD88D060E"); // with pixelCluster_p2
40 static const pool::Guid p3_guid("7BF0F163-B227-434C-86A6-16130E005E6C"); // with pixelCluster_p3
41 ATH_MSG_DEBUG("createTransient(): main converter");
42 InDet::PixelClusterContainer* p_collection(nullptr);
43 if( compareClassGuid(p3_guid) ) {
44 ATH_MSG_DEBUG("createTransient(): T/P version 3 detected");
45 std::unique_ptr< InDet::PixelClusterContainer_p3 > p_coll( poolReadObject< InDet::PixelClusterContainer_p3 >() );
46 p_collection = m_converter_p3.createTransient( p_coll.get(), msg() );
47 } else if( compareClassGuid(p2_guid) ) {
48 ATH_MSG_DEBUG("createTransient(): T/P version 2 detected");
49 std::unique_ptr< InDet::PixelClusterContainer_p2 > p_coll( poolReadObject< InDet::PixelClusterContainer_p2 >() );
50 p_collection = m_converter_p2.createTransient( p_coll.get(), msg() );
51 } else if( compareClassGuid(p1_guid) ) {
52 ATH_MSG_DEBUG("createTransient(): T/P version 1 detected");
53 std::unique_ptr< InDet::PixelClusterContainer_tlp1 > p_coll( poolReadObject< InDet::PixelClusterContainer_tlp1 >() );
54 p_collection = m_TPConverter.createTransient( p_coll.get(), msg() );
55 }
56 //----------------------------------------------------------------
57 else if( compareClassGuid(p0_guid) ) {
58 ATH_MSG_DEBUG("createTransient(): Old input file");
59
60 std::unique_ptr< PixelClusterContainer_p0 > col_vect( poolReadObject< PixelClusterContainer_p0 >() );
61 p_collection = m_converter_p0.createTransient( col_vect.get(), msg() );
62 }
63 else {
64 throw std::runtime_error("Unsupported persistent version of PixelClusterContainer");
65
66 }
67 return p_collection;
68}
69
70
72 PixelClusterContainer_PERS *pixdc_p= m_converter_p3.createPersistent( transCont, msg() );
73 return pixdc_p;
74}
75
76
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
T_AthenaPoolCustomCnv< InDet::PixelClusterContainer, PixelClusterContainer_PERS > PixelClusterContainerCnvBase
InDet::PixelClusterContainer_p3 PixelClusterContainer_PERS
This is an Identifier helper class for the Pixel subdetector.
virtual PixelClusterContainer_PERS * createPersistent(InDet::PixelClusterContainer *transCont) override
PixelClusterContainerCnv_p2 m_converter_p2
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
PixelClusterContainerCnv_p3 m_converter_p3
PixelClusterContainerCnv_p0 m_converter_p0
PixelClusterContainerCnv_tlp1 m_TPConverter
PixelClusterContainerCnv(ISvcLocator *svcloc)
virtual InDet::PixelClusterContainer * createTransient() override
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67