ATLAS Offline Software
Loading...
Searching...
No Matches
LArAutoCorrCompleteCnv.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
13
15
18{
19 MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
20 //log << MSG::DEBUG << "LArAutoCorrComplete write" << endmsg;
21 LArAutoCorrPersType* persObj = TPconverter.createPersistentConst( transObj, log );
22 //log << MSG::DEBUG << "Success" << endmsg;
23 return persObj;
24}
25
28{
29 static const pool::Guid p1_guid("FA16A69D-241E-40F3-B710-77A95937E394");
30 static const pool::Guid p0_guid("4E7E36E9-2121-4327-88C5-8A516D6D6D2A");
31 if( compareClassGuid(p1_guid) ) {
32 // using unique_ptr ensures deletion of the persistent object
33 std::unique_ptr< LArAutoCorrSubset_p1 > col_vect( poolReadObject< LArAutoCorrSubset_p1 >() );
34 MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
35 //log << MSG::INFO << "Reading LArAutoCorrSubset_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(), "LArAutoCorrCompleteCnv" );
42 log << MSG::DEBUG << "Reading LArAutoCorrSubset (original)" << endmsg;
43
44 std::unique_ptr< LArConditionsSubset<LArAutoCorrP> > subset ( poolReadObject< LArConditionsSubset<LArAutoCorrP> >() );
45 // Here we must convert from LArAutoCorrP to LArAutoCorrP1
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 LArAutoCorrCompleteCnv");
53}
54
57{
58
59 MsgStream log(msgSvc(), "LArAutoCorrCompleteCnv" );
60 log << MSG::DEBUG << "LArAutoCorrCompleteCnv::createTransient orig " << orig << endmsg;
61
63
64 // Copy LArAutoCorrP subset to LArAutoCorrP1
65 LArAutoCorrCopy copier;
66 copier.copyOldtoNew(orig, result);
67
68 return (result);
69}
70
71
72// Copy LArAutoCorrP subset to LArAutoCorrP1
73void
76{
77 newAutoCorr->assign (*oldAutoCorr,
78 [] (const LArAutoCorrP& from,
79 LArAutoCorrP1& to)
80 {
81 to.m_vAutoCorr.assign (from.m_vAutoCorr.begin(),
82 from.m_vAutoCorr.end());
83 });
84}
#define endmsg
static const LArAutoCorrSubsetCnv_p1 TPconverter
AthenaPool converter LArAutoCorrComplete.
LArConditionsSubset< LArAutoCorrP1 > LArAutoCorrTransType
LArAutoCorrSubset_p1 LArAutoCorrPersType
virtual LArAutoCorrPersType * createPersistent(LArAutoCorrTransType *transObj)
method to be implemented by the developer.
virtual LArAutoCorrTransType * createTransient()
method to be implemented by the developer.
void copyOldtoNew(const LArConditionsSubset< LArAutoCorrP > *oldAutoCorr, LArConditionsSubset< LArAutoCorrP1 > *newAutoCorr)
c-struct reproducing the structure of the persistent data
c-struct reproducing the structure of the persistent data
std::vector< double > m_vAutoCorr
persistent class container of LArConditionsSubset for LArAutoCorr data.
template class for use for I/O of conditions data
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.