ATLAS Offline Software
Loading...
Searching...
No Matches
LArRampCompleteCnv.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 "LArRampCompleteCnv.h"
13
15
18{
19 MsgStream log(msgSvc(), "LArRampCompleteCnv" );
20 //log << MSG::DEBUG << "LArRampComplete write" << endmsg;
21 LArRampPersType* persObj = TPconverter.createPersistentConst( transObj, log );
22 //log << MSG::DEBUG << "Success" << endmsg;
23 return persObj;
24}
25
28{
29 static const pool::Guid p1_guid("BB629283-BDF5-4FA8-93F4-5D8C2F201364");
30 static const pool::Guid p0_guid("4019776D-D528-4401-9CBD-7956C4B00607");
31 if( compareClassGuid(p1_guid) ) {
32 // using unique_ptr ensures deletion of the persistent object
33 std::unique_ptr< LArRampSubset_p1 > col_vect( poolReadObject< LArRampSubset_p1 >() );
34 MsgStream log(msgSvc(), "LArRampCompleteCnv" );
35 //log << MSG::INFO << "Reading LArRampSubset_p1" << endmsg;
36 return TPconverter.createTransientConst( col_vect.get(), log );
37 }
38 else if( compareClassGuid(p0_guid) ) {
39 // subset from before TP separation
40
41 MsgStream log(msgSvc(), "LArRampCompleteCnv" );
42 log << MSG::DEBUG << "Reading LArRampSubset (original)" << endmsg;
43
44 std::unique_ptr< LArConditionsSubset<LArRampP> > subset ( poolReadObject< LArConditionsSubset<LArRampP> >() );
45 // Here we must convert from LArRampP to LArRampP1
46
47 log << MSG::DEBUG << "subset ptr " << subset.get() << endmsg;
48
49 return (createTransient(subset.get()));
50
51 }
52 throw std::runtime_error("Unsupported persistent version of LArRampCompleteCnv");
53}
54
57{
58
59 MsgStream log(msgSvc(), "LArRampCompleteCnv" );
60 log << MSG::DEBUG << "LArRampCompleteCnv::createTransient orig " << orig << endmsg;
61
63
64 // Copy LArRampP subset to LArRampP1
65 LArRampCopy copier;
66 copier.copyOldtoNew(orig, result);
67
68 return (result);
69}
70
71// Copy LArRampP subset to LArRampP1
72void
75{
76 newRamp->assign (*oldRamp,
77 [] (const LArRampP& from,
78 LArRampP1& to)
79 {
80 to.m_vRamp = from.m_vRamp;
81 });
82}
83
#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
LArConditionsSubset< LArRampP1 > LArRampTransType
template class for use for I/O of conditions data
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
virtual LArRampTransType * createTransient()
method to be implemented by the developer.
virtual LArRampPersType * createPersistent(LArRampTransType *transObj)
method to be implemented by the developer.
void copyOldtoNew(const LArConditionsSubset< LArRampP > *oldRamp, LArConditionsSubset< LArRampP1 > *newRamp)
Persistent data for LArRamp Copied from LAr.
Definition LArRampP1.h:24
Persistent data for LArRamp Copied from LAr.
Definition LArRampP.h:24
std::vector< float > m_vRamp
Definition LArRampP.h:29
persistent class container of LArConditionsSubset for LArRamp data.