ATLAS Offline Software
Loading...
Searching...
No Matches
LArPedestalCompleteCnv.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
16
17
20{
21 MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
22 //log << MSG::DEBUG << "LArPedestalComplete write" << endmsg;
23 return TPconverter2.createPersistentConst( transObj, log );
24}
25
28{
29 static const pool::Guid p2_guid("8BD3FE69-A3C4-418C-ACB9-E362CE524353");
30 static const pool::Guid p1_guid("E365F747-264B-4A0C-B80A-570DBE099881");
31 static const pool::Guid p0_guid("E17191DD-4C0A-4B1A-AE49-7D587C6BE3EE");
32
33 if (compareClassGuid(p2_guid)) {
34 // using unique_ptr ensures deletion of the persistent object
35 std::unique_ptr< LArPedestalSubset_p2 > col_vect( poolReadObject< LArPedestalSubset_p2 >() );
36 MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
37 //log << MSG::INFO << "Reading LArPedestalSubset_p1" << endmsg;
38 return TPconverter2.createTransientConst( col_vect.get(), log );
39 }
40 else if( compareClassGuid(p1_guid) ) {
41 // using unique_ptr ensures deletion of the persistent object
42 std::unique_ptr< LArPedestalSubset_p1 > col_vect( poolReadObject< LArPedestalSubset_p1 >() );
43 MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
44 //log << MSG::INFO << "Reading LArPedestalSubset_p1" << endmsg;
45 return TPconverter1.createTransientConst( col_vect.get(), log );
46 }
47 else if( compareClassGuid(p0_guid) ) {
48 // subset from before TP separation
49
50 MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
51 log << MSG::DEBUG << "Reading LArPedestalSubset (original)" << endmsg;
52
53 std::unique_ptr< LArConditionsSubset<LArPedestalP> > subset ( poolReadObject< LArConditionsSubset<LArPedestalP> >() );
54 // Here we must convert from LArPedestalP to LArPedestalP1
55
56 log << MSG::DEBUG << "subset ptr " << subset.get() << endmsg;
57
58 return (createTransient(subset.get()));
59
60 }
61 throw std::runtime_error("Unsupported persistent version of LArPedestalCompleteCnv");
62}
63
66{
67
68 MsgStream log(msgSvc(), "LArPedestalCompleteCnv" );
69 log << MSG::DEBUG << "LArPedestalCompleteCnv::createTransient orig " << orig << endmsg;
70
72
73 // Copy LArPedestalP subset to LArPedestalP1
74 LArPedestalCopy copier;
75 copier.copyOldtoNew(orig, result);
76
77 return (result);
78}
79
80
81// Copy LArPedestalP subset to LArPedestalP1
82void
85{
86 newPedestal->assign (*oldPedestal,
87 [] (const LArPedestalP& from,
88 LArPedestalP1& to)
89 {
90 to.m_Pedestal = from.m_vPedestal.empty() ? 0 : from.m_vPedestal[0];
91 to.m_PedestalRMS = from.m_vPedestalRMS.empty() ? 0 : from.m_vPedestalRMS[0];
92 });
93}
94
95
#define endmsg
static const LArCaliWaveSubsetCnv_p2 TPconverter2
static const LArCaliWaveSubsetCnv_p1 TPconverter1
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current LArConditionsSubset< LArPedestalP1 >
AthenaPool converter LArPedestalComplete.
LArConditionsSubset< LArPedestalP1 > LArPedTransType
template class for use for I/O of conditions data
void assign(const LArConditionsSubset< U > &other, COPIER copier)
Copy from another subset object.
virtual LArPedPersType * createPersistent(LArPedTransType *transObj)
method to be implemented by the developer.
virtual LArPedTransType * createTransient()
method to be implemented by the developer.
void copyOldtoNew(const LArConditionsSubset< LArPedestalP > *oldPedestal, LArConditionsSubset< LArPedestalP1 > *newPedestal)
std::vector< float > m_vPedestalRMS
std::vector< float > m_vPedestal
persistent class container of LArConditionsSubset for LArPedestal data.