ATLAS Offline Software
InDetTrackCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GaudiKernel/MsgStream.h"
6 
7 #include "InDetTrackCnv.h"
9 
10 #include <iostream>
11 #include <stdexcept>
12 
13 InDetTrackCnv::InDetTrackCnv(ISvcLocator* svcloc):
14  InDetTrackCnvBase(svcloc)
15 {
16 }
17 
18 
20 {
21  if( !InDetTrackCnvBase::initialize().isSuccess() )
22  return StatusCode::FAILURE;
23 
24 
25  // std::cout << " ------->>---- In InDetTrackCnv::initialize()" << std::endl;
26 
27  return StatusCode::SUCCESS;
28 }
29 
30 
31 // this method just reads the persistent object - no TP conversion here
32 void
33 InDetTrackCnv::readObjectFromPool( const std::string& token )
34 {
35  static const pool::Guid p2_guid( "4E3778E2-1497-4F10-8746-AA02319FAC83" );
36  static const pool::Guid p1_guid( "8380F7AC-4A8F-4382-95A5-1234E43D3B08" );
37 
38  // set the POOL token which will be used for reading from POOL
39  setToken( token );
40 
41  // select the object type based on its GUID
42  if( compareClassGuid( p2_guid ) ) {
43  // read the object using the main TP converter
44  poolReadObject< InDetTrack_PERS >( m_TPConverter2 );
45  }else if( compareClassGuid( p1_guid ) ) {
46  poolReadObject< InDet::Track_tlp1 >( m_TPConverter1 );
47  }
48  else
49  throw std::runtime_error( "Unsupported version of InDetTrack_PERS (unknown GUID)" );
50 }
51 
52 
InDetTrackCnv::m_TPConverter2
InDetTrackCnv_tlp2 m_TPConverter2
Definition: InDetTrackCnv.h:46
initialize
void initialize()
Definition: run_EoverP.cxx:894
InDetTrackCnv.h
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
T_AthenaPoolExtendingCnv::setToken
virtual void setToken(const std::string &token)
Set the token (in std::string representation) and classID for the object that will be read next.
TrackCollection.h
InDetTrackCnv::m_TPConverter1
InDetTrackCnv_tlp1 m_TPConverter1
Definition: InDetTrackCnv.h:45
InDetTrackCnv::readObjectFromPool
virtual void readObjectFromPool(const std::string &)
Read the persistent object from POOL.
Definition: InDetTrackCnv.cxx:33
InDetTrackCnv::initialize
virtual StatusCode initialize()
Definition: InDetTrackCnv.cxx:19
InDetTrackCnv::InDetTrackCnv
InDetTrackCnv(ISvcLocator *svcloc)
Definition: InDetTrackCnv.cxx:13
T_AthenaPoolExtendingCnv
This templated class extends T_AthenaPoolCustomCnv to provide additional/chaged functionality for Ath...
Definition: T_AthenaPoolCustomCnv.h:24