ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloCnv
CaloTPCnv
src
CaloShowerContainerCnv_p2.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
CaloTPCnv/CaloShowerContainerCnv_p2.h
"
6
7
#include "
CaloTPCnv/CaloShowerContainer_p2.h
"
8
#include "
CaloEvent/CaloShowerContainer.h
"
9
#include "
AthenaKernel/errorcheck.h
"
10
11
void
CaloShowerContainerCnv_p2::persToTrans
(
const
CaloShowerContainer_p2
* pers,
12
CaloShowerContainer
* trans,
13
MsgStream&)
const
14
{
15
CaloClusterMomentContainer_p1::const_iterator
momentStoreIterator;
16
CaloSamplingDataContainerCnv_p1::State
samplingState;
17
if
(!
m_momentContainerCnv
.setIterator(&pers->
m_momentContainer
,
18
pers->
m_nClusters
,
19
momentStoreIterator) ||
20
!
m_samplingContainerCnv
.setState(&pers->
m_samplingDataContainer
,
21
pers->
m_nClusters
,
22
samplingState))
23
{
24
REPORT_MESSAGE_WITH_CONTEXT
(MSG::WARNING,
"CaloShowerContainerCnv_p2"
)
25
<<
"Not converting CaloShowerContainer."
;
26
return
;
27
}
28
29
trans->
clear
();
30
trans->
reserve
(pers->
m_nClusters
);
31
for
(
unsigned
i=0;i<pers->
m_nClusters
;++i) {
32
CaloShower
* shower=
new
CaloShower
();
33
//trans->at(i)=shower;
34
m_momentContainerCnv
.persToTrans(&(pers->
m_momentContainer
),&(shower->
getMomentStore
()),
35
momentStoreIterator);
36
m_samplingContainerCnv
.persToTrans(&(pers->
m_samplingDataContainer
),&(shower->
getSamplingStore
()),
37
samplingState);
38
trans->
push_back
(shower);
39
}
40
}
41
42
43
void
CaloShowerContainerCnv_p2::transToPers
(
const
CaloShowerContainer
* trans,
44
CaloShowerContainer_p2
* pers,
45
MsgStream& log)
const
46
{
47
pers->
m_nClusters
=trans->
size
();
48
CaloShowerContainer::const_iterator
it=trans->
begin
();
49
CaloShowerContainer::const_iterator
it_e=trans->
end
();
50
if
(it!=it_e) {
51
//The var-type pattern and the sampling pattern are stored in CaloSamplingDataContainer_p1
52
//(once for the entire container)
53
//pers->m_samplingDataContainer.m_varTypePattern=(*it)->m_samplingStore.m_varTypePattern;
54
//pers->m_samplingDataContainer.m_samplingPattern=(*it)->m_samplingStore.m_samplingPattern; *** TO BE SOLVED !!!!!
55
pers->
m_momentContainer
.
m_nMoments
=(*it)->getMomentStore().size();
56
57
}
58
for
(;it!=it_e;++it) {
59
m_momentContainerCnv
.transToPers(&((*it)->getMomentStore()),&(pers->
m_momentContainer
));
60
m_samplingContainerCnv
.transToPers(&((*it)->getSamplingStore()),&(pers->
m_samplingDataContainer
),log);
61
}
62
}
CaloShowerContainerCnv_p2.h
CaloShowerContainer.h
CaloShowerContainer_p2.h
errorcheck.h
Helpers for checking error return status codes and reporting errors.
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:345
CaloClusterMomentContainer_p1::m_nMoments
unsigned short m_nMoments
Definition
CaloClusterMomentContainer_p1.h:19
CaloClusterMomentContainer_p1::const_iterator
std::vector< ClusterMoment_p >::const_iterator const_iterator
Definition
CaloClusterMomentContainer_p1.h:20
CaloShowerContainerCnv_p2::transToPers
virtual void transToPers(const CaloShowerContainer *trans, CaloShowerContainer_p2 *pers, MsgStream &) const override
Definition
CaloShowerContainerCnv_p2.cxx:43
CaloShowerContainerCnv_p2::m_samplingContainerCnv
CaloSamplingDataContainerCnv_p1 m_samplingContainerCnv
Definition
CaloShowerContainerCnv_p2.h:40
CaloShowerContainerCnv_p2::m_momentContainerCnv
CaloClusterMomentContainerCnv_p1 m_momentContainerCnv
Definition
CaloShowerContainerCnv_p2.h:39
CaloShowerContainerCnv_p2::persToTrans
virtual void persToTrans(const CaloShowerContainer_p2 *pers, CaloShowerContainer *trans, MsgStream &) const override
Definition
CaloShowerContainerCnv_p2.cxx:11
CaloShowerContainer_p2
Definition
CaloShowerContainer_p2.h:14
CaloShowerContainer_p2::m_momentContainer
CaloClusterMomentContainer_p1 m_momentContainer
Definition
CaloShowerContainer_p2.h:17
CaloShowerContainer_p2::m_samplingDataContainer
CaloSamplingDataContainer_p1 m_samplingDataContainer
Definition
CaloShowerContainer_p2.h:18
CaloShowerContainer_p2::m_nClusters
unsigned int m_nClusters
Definition
CaloShowerContainer_p2.h:19
CaloShowerContainer
Container class for CaloShower.
Definition
CaloShowerContainer.h:15
CaloShower
Data class for cluster variables associated with a CaloCluster.
Definition
CaloShower.h:12
CaloShower::getMomentStore
const moment_store & getMomentStore() const
Access cluster moment store.
Definition
CaloShower.h:71
CaloShower::getSamplingStore
const sampling_store & getSamplingStore() const
Retrieves the non-modifiable sampling data store.
Definition
CaloShower.h:77
DataVector< CaloShower >::const_iterator
DataModel_detail::const_iterator< DataVector > const_iterator
Definition
DataVector.h:838
DataVector::reserve
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::clear
void clear()
Erase all the elements in the collection.
CaloSamplingDataContainerCnv_p1::State
Definition
CaloSamplingDataContainerCnv_p1.h:18
Generated on
for ATLAS Offline Software by
1.17.0