ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
10
13 MsgStream&) const
14{
17 if (! m_momentContainerCnv.setIterator(&pers->m_momentContainer,
18 pers->m_nClusters,
19 momentStoreIterator) ||
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
45 MsgStream& log) const
46{
47 pers->m_nClusters=trans->size();
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}
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
std::vector< ClusterMoment_p >::const_iterator const_iterator
virtual void transToPers(const CaloShowerContainer *trans, CaloShowerContainer_p2 *pers, MsgStream &) const override
CaloSamplingDataContainerCnv_p1 m_samplingContainerCnv
CaloClusterMomentContainerCnv_p1 m_momentContainerCnv
virtual void persToTrans(const CaloShowerContainer_p2 *pers, CaloShowerContainer *trans, MsgStream &) const override
CaloClusterMomentContainer_p1 m_momentContainer
CaloSamplingDataContainer_p1 m_samplingDataContainer
Container class for CaloShower.
Data class for cluster variables associated with a CaloCluster.
Definition CaloShower.h:12
const moment_store & getMomentStore() const
Access cluster moment store.
Definition CaloShower.h:71
const sampling_store & getSamplingStore() const
Retrieves the non-modifiable sampling data store.
Definition CaloShower.h:77
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
void clear()
Erase all the elements in the collection.