ATLAS Offline Software
Loading...
Searching...
No Matches
LArAutoCorrMCCnv.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 "LArAutoCorrMCCnv.h"
14
16
19{
20 MsgStream log(msgSvc(), "LArAutoCorrMCCnv" );
21 //log << MSG::DEBUG << "LArAutoCorrMC write" << endmsg;
22 LArAutoCorrPersType* persObj = TPconverter.createPersistentConst( transObj, log );
23 //log << MSG::DEBUG << "Success" << endmsg;
24 return persObj;
25}
26
29{
30 static const pool::Guid p1_guid("FA16A69D-241E-40F3-B710-77A95937E394");
31 static const pool::Guid p0_guid("4E7E36E9-2121-4327-88C5-8A516D6D6D2A");
32 if( compareClassGuid(p1_guid) ) {
33 // using unique_ptr ensures deletion of the persistent object
34 std::unique_ptr< LArAutoCorrSubset_p1 > col_vect( poolReadObject< LArAutoCorrSubset_p1 >() );
35 MsgStream log(msgSvc(), "LArAutoCorrMCCnv" );
36 //log << MSG::INFO << "Reading LArAutoCorrSubset_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(), "LArAutoCorrMCCnv" );
43 log << MSG::INFO << "Reading LArAutoCorrSubset (original)" << endmsg;
44
45 std::unique_ptr< LArConditionsSubset<LArAutoCorrP> > subset ( poolReadObject< LArConditionsSubset<LArAutoCorrP> >() );
46 // Here we must convert from LArAutoCorrP to LArAutoCorrP1
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 LArAutoCorrMCCnv");
54}
55
58{
59
60 MsgStream log(msgSvc(), "LArAutoCorrMCCnv" );
61 log << MSG::INFO << "LArAutoCorrMCCnv::createTransient orig " << orig << endmsg;
62
64
65 // Copy LArAutoCorrP subset to LArAutoCorrP1
66 LArAutoCorrCopy copier;
67 copier.copyOldtoNew(orig, result);
68
69 return (result);
70}
71
72
#define endmsg
static const LArAutoCorrSubsetCnv_p1 TPconverter
AthenaPool converter LArAutoCorrComplete.
LArAutoCorrSubset_p1 LArAutoCorrPersType
AthenaPool converter LArAutoCorrMC.
LArConditionsSubset< LArAutoCorrP1 > LArAutoCorrTransType
void copyOldtoNew(const LArConditionsSubset< LArAutoCorrP > *oldAutoCorr, LArConditionsSubset< LArAutoCorrP1 > *newAutoCorr)
virtual LArAutoCorrTransType * createTransient()
method to be implemented by the developer.
virtual LArAutoCorrPersType * createPersistent(LArAutoCorrTransType *transObj)
method to be implemented by the developer.
persistent class container of LArConditionsSubset for LArAutoCorr data.
template class for use for I/O of conditions data