ATLAS Offline Software
Loading...
Searching...
No Matches
LArOFCCompleteCnv.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 "LArOFCCompleteCnv.h"
13
15
18{
19 MsgStream log(msgSvc(), "LArOFCCompleteCnv" );
20 //log << MSG::DEBUG << "LArOFCComplete write" << endmsg;
21 LArOFCPersType* persObj = TPconverter.createPersistentConst( transObj, log );
22 //log << MSG::DEBUG << "Success" << endmsg;
23 return persObj;
24}
25
28 static const pool::Guid p1_guid("0A1DE2E2-90E4-4A24-BC6E-2092EDC9FDF6");
29 static const pool::Guid p0_guid("3E5389EF-D163-4099-91D9-D3F0EE06C1CD");
30
31 if( compareClassGuid(p1_guid) ) {
32 // using unique_ptr ensures deletion of the persistent object
33 std::unique_ptr< LArOFCSubset_p1 > col_vect( poolReadObject< LArOFCSubset_p1 >() );
34 MsgStream log(msgSvc(), "LArOFCCompleteCnv" );
35 //log << MSG::INFO << "Reading LArOFCSubset_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(), "LArOFCCompleteCnv" );
42 log << MSG::DEBUG << "Reading LArOFCSubset (original)" << endmsg;
43
44 std::unique_ptr< LArConditionsSubset<LArOFCP> > subset ( poolReadObject< LArConditionsSubset<LArOFCP> >() );
45 // Here we must convert from LArOFCP to LArOFCP1
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 LArOFCCompleteCnv");
53}
54
57{
58
59 MsgStream log(msgSvc(), "LArOFCCompleteCnv" );
60 log << MSG::DEBUG << "LArOFCCompleteCnv::createTransient orig " << orig << endmsg;
61
63
64 // Copy LArOFCP subset to LArOFCP1
65 LArOFCCopy copier;
66 copier.copyOldtoNew(orig, result);
67
68 return (result);
69}
70
71// Copy LArOFCP subset to LArOFCP1
72void
75{
76 newOFC->assign (*oldOFC,
77 [] (const LArOFCP& from,
78 LArOFCP1& to)
79 {
80 to = LArOFCP1 (from.m_timeOffset,
81 25./24,
82 from.m_vOFC_a,
83 from.m_vOFC_b);
84 });
85}
#define endmsg
static const LArAutoCorrSubsetCnv_p1 TPconverter
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current LArConditionsSubset< LArOFCP1 >
AthenaPool converter LArOfcComplete.
LArOFCSubset_p1 LArOFCPersType
LArConditionsSubset< LArOFCP1 > LArOFCTransType
template class for use for I/O of conditions data
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
virtual LArOFCTransType * createTransient()
method to be implemented by the developer.
virtual LArOFCPersType * createPersistent(LArOFCTransType *transObj)
method to be implemented by the developer.
void copyOldtoNew(const LArConditionsSubset< LArOFCP > *oldOFC, LArConditionsSubset< LArOFCP1 > *newOFC)
c-struct reproducing the structure of the persistent data
Definition LArOFCP1.h:22
c-struct reproducing the structure of the persistent data
Definition LArOFCP.h:15
std::vector< std::vector< float > > m_vOFC_a
Definition LArOFCP.h:22
std::vector< std::vector< float > > m_vOFC_b
Definition LArOFCP.h:23
float m_timeOffset
Definition LArOFCP.h:21
persistent class container of LArConditionsSubset for LArOFC data.