ATLAS Offline Software
TrigInDetTrackTruthMapCnv.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 #include "TROOT.h"
9 #include <iostream>
10 
11 //constructor
14 }
15 
16 //destructor
18 
19 
20 //create persistent
22  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::createPersistent" );
23 
25 
26  return persObj;
27 }
28 
29 //create transient
31 
32  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::createTransient " );
33 
34  const static pool::Guid tlp1_guid("08892FEB-5706-4938-9226-F45C0AA662E7");
35  const static pool::Guid tlp2_guid("02074F47-F290-4A48-B503-4DCAB4181B3D");
36  const static pool::Guid tlp3_guid("81BFA8A7-89A8-4072-B6E2-7124300CA9EB");
37  const static pool::Guid tlp4_guid("018E514D-5EAD-702A-83E3-46AFCFD24B68");
38  const static pool::Guid p0_guid("41581666-F06D-44AE-93B9-D7E912A27AA1");
39 
40  TrigInDetTrackTruthMap *transObj = 0;
41 
42 
43  if( compareClassGuid(tlp4_guid) ) {
44 
45  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::reading tlp4 persistent object" );
46  poolReadObject< TrigInDetTrackTruthMap_tlp4 >( m_trigInDetTrackTruthMapCnv_tlp4 );
48 
49  }
50  else if( compareClassGuid(tlp3_guid) ) {
51 
52  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::reading tlp3 persistent object" );
53  poolReadObject< TrigInDetTrackTruthMap_tlp3 >( m_trigInDetTrackTruthMapCnv_tlp3 );
55 
56  }
57  else if( compareClassGuid(tlp2_guid) ) {
58 
59  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::reading tlp2 persistent object" );
60  poolReadObject< TrigInDetTrackTruthMap_tlp2 >( m_trigInDetTrackTruthMapCnv_tlp2 );
62 
63  }
64  else if( compareClassGuid(tlp1_guid) ) {
65  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::reading tlp1 persistent object" );
66  TrigInDetTrackTruthMapCnv_tlp1 tlp1_Converter;
67  poolReadObject< TrigInDetTrackTruthMap_tlp1 >(tlp1_Converter);
68  transObj = tlp1_Converter.createTransient( msg() );
69  }
70  else if( compareClassGuid(p0_guid) ) {
71 
72  ATH_MSG_DEBUG( "TrigInDetTrackTruthMapCnv::reading p0 persistent object" );
73  // old version from before TP separation, just return it
74  transObj = this->poolReadObject<TrigInDetTrackTruthMap>();
75  }
76  else {
77  throw std::runtime_error("Unsupported persistent version of TrigInDetTrackTruthMap");
78  }
79 
80  return transObj;
81 }
82 
83 
84 namespace {
85  // Helper to be able to call thread-unsafe code during initialize as we
86  // currently cannot mark Converter::initialize() as thread-unsafe.
87  StatusCode loadConverter ATLAS_NOT_THREAD_SAFE() {
88  gROOT->GetClass("TrigInDetTrackTruthMap_old");
91  return StatusCode::SUCCESS;
92  }
93 }
94 
96 {
97  [[maybe_unused]] static const bool did_rootcnv = []{
98  StatusCode sc ATLAS_THREAD_SAFE = loadConverter();
99  return sc.isSuccess();
100  }();
102 }
TrigInDetTrackTruthMapCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
Definition: TrigInDetTrackTruthMapCnv.cxx:95
TrigInDetTrackTruthMapCnv::m_trigInDetTrackTruthMapCnv_tlp4
TrigInDetTrackTruthMapCnv_tlp4 m_trigInDetTrackTruthMapCnv_tlp4
Definition: TrigInDetTrackTruthMapCnv.h:59
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
TrigInDetTrackTruthMap_old_cnv.h
TrigInDetTrackTruthMapCnv::createPersistent
virtual TrigInDetTrackTruthMap_PERS * createPersistent(TrigInDetTrackTruthMap *transObj)
Definition: TrigInDetTrackTruthMapCnv.cxx:21
TrigInDetTrackTruthMapCnv.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthMessaging::ATLAS_THREAD_SAFE
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
Definition: AthMessaging.h:141
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TrigInDetTrackTruthMapCnv::~TrigInDetTrackTruthMapCnv
~TrigInDetTrackTruthMapCnv()
Definition: TrigInDetTrackTruthMapCnv.cxx:17
TrigInDetTrackTruthMapCnv_tlp1
Definition: TrigInDetTrackTruthMapCnv_tlp1.h:31
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
TrigInDetTrackTruthMapCnv::m_trigInDetTrackTruthMapCnv_tlp3
TrigInDetTrackTruthMapCnv_tlp3 m_trigInDetTrackTruthMapCnv_tlp3
Definition: TrigInDetTrackTruthMapCnv.h:58
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigInDetTrackTruthMapCnv::m_trigInDetTrackTruthMapCnv_tlp2
TrigInDetTrackTruthMapCnv_tlp2 m_trigInDetTrackTruthMapCnv_tlp2
Definition: TrigInDetTrackTruthMapCnv.h:57
TrigInDetTrackTruthMap
Definition: TrigInDetTrackTruthMap.h:38
TrigInDetTrackTruthMapCnv::TrigInDetTrackTruthMapCnv
TrigInDetTrackTruthMapCnv(ISvcLocator *svcloc)
Definition: TrigInDetTrackTruthMapCnv.cxx:12
TrigInDetTrackTruthMap_old_cnv
Definition: TrigInDetTrackTruthMap_old_cnv.h:20
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
TConverterRegistry::AddConverter
void AddConverter(TVirtualConverter *conv)
Add a new converter to the registry.
Definition: TConverterRegistry.cxx:36
TConverterRegistry.h
Registry for Root converters.
TConverterRegistry::Instance
static TConverterRegistry * Instance()
Return a pointer to the global registry instance.
Definition: TConverterRegistry.cxx:143
TopLevelTPConverter::createPersistent
virtual TL_PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of transObj.
Definition: TopLevelTPConverter.h:110
TrigInDetTrackTruthMap_tlp2
Definition: TrigInDetTrackTruthMap_tlp2.h:27
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
T_AthenaPoolCustCnv::initialize
virtual StatusCode initialize()
Gaudi Service Interface method implementations:
TrigInDetTrackTruthMapCnv::createTransient
virtual TrigInDetTrackTruthMap * createTransient()
Definition: TrigInDetTrackTruthMapCnv.cxx:30