ATLAS Offline Software
Loading...
Searching...
No Matches
LArRampMCCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
10
11#include "LArRampMCCnv.h"
13#include "LArRampCompleteCnv.h"
14
16
19{
20 MsgStream log(msgSvc(), "LArRampMCCnv" );
21 //log << MSG::DEBUG << "LArRampMC write" << endmsg;
22 LArRampPersType* persObj = TPconverter.createPersistentConst( transObj, log );
23 //log << MSG::DEBUG << "Success" << endmsg;
24 return persObj;
25}
26
29{
30 static const pool::Guid p1_guid("BB629283-BDF5-4FA8-93F4-5D8C2F201364");
31 static const pool::Guid p0_guid("4019776D-D528-4401-9CBD-7956C4B00607");
32 if( compareClassGuid(p1_guid) ) {
33 // using unique_ptr ensures deletion of the persistent object
34 std::unique_ptr< LArRampSubset_p1 > col_vect( poolReadObject< LArRampSubset_p1 >() );
35 MsgStream log(msgSvc(), "LArRampMCCnv" );
36 //log << MSG::INFO << "Reading LArRampSubset_p1" << endmsg;
37 return TPconverter.createTransientConst( col_vect.get(), log );
38 }
39 else if( compareClassGuid(p0_guid) ) {
40 // subset from before TP separation
41
42 MsgStream log(msgSvc(), "LArRampMCCnv" );
43 log << MSG::INFO << "Reading LArRampSubset (original)" << endmsg;
44
45 std::unique_ptr< LArConditionsSubset<LArRampP> > subset ( poolReadObject< LArConditionsSubset<LArRampP> >() );
46 // Here we must convert from LArRampP to LArRampP1
47
48 log << MSG::INFO << "subset ptr " << subset.get() << endmsg;
49
50 return (createTransient(subset.get()));
51
52 }
53 throw std::runtime_error("Unsupported persistent version of LArRampMCCnv");
54}
55
58{
59
60 MsgStream log(msgSvc(), "LArRampMCCnv" );
61 log << MSG::INFO << "LArRampMCCnv::createTransient orig " << orig << endmsg;
62
64
65 // Copy LArRampP subset to LArRampP1
66 LArRampCopy copier;
67 copier.copyOldtoNew(orig, result);
68
69 return (result);
70}
71
#define endmsg
static const LArAutoCorrSubsetCnv_p1 TPconverter
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current LArConditionsSubset< LArRampP1 >
AthenaPool converter LArRampComplete.
LArRampSubset_p1 LArRampPersType
AthenaPool converter LArRampMC.
LArConditionsSubset< LArRampP1 > LArRampTransType
template class for use for I/O of conditions data
void copyOldtoNew(const LArConditionsSubset< LArRampP > *oldRamp, LArConditionsSubset< LArRampP1 > *newRamp)
virtual LArRampPersType * createPersistent(LArRampTransType *transObj)
method to be implemented by the developer.
virtual LArRampTransType * createTransient()
method to be implemented by the developer.
persistent class container of LArConditionsSubset for LArRamp data.