ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterContainerCnv_p2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7
10
11
14 MsgStream &log) const
15{
16 // reset element link converters, and provide container name lookup table
17 ShowerLinkState showerLinkState (pers->m_linkNames);
18 CellLinkState cellLinkState (pers->m_linkNames);
19
20 // Use data pool for clusters to avoid calling constructor for each event
21 DataPool<CaloCluster> clusters;
22
23 trans->clear (SG::VIEW_ELEMENTS);
24 trans->reserve(pers->m_vec.size());
27 if ( ! m_momentContainerCnv.setIterator(&pers->m_momentContainer,
28 pers->m_vec.size(),
29 momentStoreIterator) ||
31 pers->m_vec.size(),
32 samplingState))
33 {
34 REPORT_MESSAGE_WITH_CONTEXT(MSG::WARNING, "CaloClusterContainerCnv_p2")
35 << "Not converting CaloClusterContainer.";
36 return;
37 }
38
41 for(;itp!=itp_e;++itp) {
42
43 // Get next ptr for next cluster
44 CaloCluster* transCluster = clusters.nextElementPtr();
45
46 //The var-type pattern is stored in CaloSamplingDataContainer_p1 (once for the entire cluster container)
47 //transCluster->m_dataStore.m_varTypePattern=pers->m_samplingDataContainer.m_varTypePattern;
48 //... not any more...
49
50 //Convert Cluster-quantities
51 persToTrans(&(*itp),transCluster,
52 showerLinkState,
53 cellLinkState,
54 log);
55 //Convert sampling data store
56 m_samplingDataContainerCnv.persToTrans(&(pers->m_samplingDataContainer),&(transCluster->m_dataStore),
57 samplingState);
58 //Convert moment store
59 m_momentContainerCnv.persToTrans(&(pers->m_momentContainer),&(transCluster->m_momentStore),
60 momentStoreIterator);
61 trans->push_back(transCluster);
62 }
63 //Convert TowerSegment
64 CaloTowerSeg seg;
65 m_caloTowerSegCnv.persToTrans(&(pers->m_towerSeg),&seg);
66 trans->setTowerSeg (seg);
67}
68
69
72 MsgStream &log) const
73{
74 // reset element link converters, and provide container name lookup table
75 ShowerLinkState showerLinkState (pers->m_linkNames);
76 CellLinkState cellLinkState (pers->m_linkNames);
77
78 pers->m_vec.resize(trans->size());
82 if (it!=it_e) {
83 //The var-type pattern is stored in CaloSamplingDataContainer_p1 (once for the entire container)
84 //pers->m_samplingDataContainer.m_varTypePattern=(*it)->m_dataStore.m_varTypePattern;
85 //... not any more...
86
87 //The number of moments is also the same for the entire container
88 pers->m_momentContainer.m_nMoments=(*it)->m_momentStore.size();
89 }
90 for(;it!=it_e;++it,++itp) {
91 transToPers(*it,&(*itp),
92 showerLinkState,
93 cellLinkState,
94 log);
95 m_samplingDataContainerCnv.transToPers(&((*it)->m_dataStore),&(pers->m_samplingDataContainer),log);
96 m_momentContainerCnv.transToPers(&((*it)->m_momentStore),&(pers->m_momentContainer));
97 }
98 m_caloTowerSegCnv.transToPers(&trans->getTowerSeg(),&(pers->m_towerSeg));
99}
100
101
102
104 CaloCluster* trans,
105 ShowerLinkState& showerLinkState,
106 CellLinkState& cellLinkState,
107 MsgStream& log) const
108{
110 trans->setBasicEnergy (pers->m_basicSignal);
111 trans->setTime (pers->m_time);
113 trans->m_barrel=pers->m_barrel;
114 trans->m_endcap=pers->m_endcap;
115 trans->m_eta0=pers->m_eta0;
116 trans->m_phi0=pers->m_phi0;
118 trans->setClusterSize (pers->m_clusterSize);
119
120 //trans->m_barrel=pers->m_samplingPattern & 0x1ff00f; //That's the OR of all barrel-bits
121 //trans->m_endcap=pers->m_samplingPattern & 0xe00ff0; //That's the OR of all endcap-bits
122
123 //Convert base class and element links
124 m_P4EEtaPhiMCnv.persToTrans(&pers->m_P4EEtaPhiM,static_cast<P4EEtaPhiM*>(trans),log);
125 m_showerElementLinkCnv.persToTrans(showerLinkState, pers->m_dataLink, trans->m_dataLink,log);
126 m_cellElementLinkCnv.persToTrans(cellLinkState, pers->m_cellLink, trans->m_cellLink,log);
128
129}
130
131
132
133
136 ShowerLinkState& showerLinkState,
137 CellLinkState& cellLinkState,
138 MsgStream& log) const
139{
140 pers->m_basicSignal=trans->getBasicEnergy();
141 pers->m_time=trans->getTime();
143 pers->m_barrel=trans->m_barrel;
144 pers->m_endcap=trans->m_endcap;
145 pers->m_eta0=trans->eta0();
146 pers->m_phi0=trans->phi0();
148 pers->m_clusterSize=trans->getClusterSize();
149
150 //Convert base class and element links
151 P4EEtaPhiM tmp = *trans;
152 m_P4EEtaPhiMCnv.transToPers(&tmp,&pers->m_P4EEtaPhiM,log);
153 m_showerElementLinkCnv.transToPers(showerLinkState, trans->m_dataLink, pers->m_dataLink,log);
154 m_cellElementLinkCnv.transToPers(cellLinkState, trans->m_cellLink, pers->m_cellLink,log);
155}
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.
virtual void setAthenaBarCode(AthenaBarCode_t id)
ElementLinkCnv_p2< ElementLink< CaloCellLinkContainer > >::State CellLinkState
ElementLinkCnv_p2< ElementLink< CaloCellLinkContainer > > m_cellElementLinkCnv
ElementLinkCnv_p2< ElementLink< CaloShowerContainer > >::State ShowerLinkState
virtual void transToPers(const CaloClusterContainer *trans, CaloClusterContainer_p2 *pers, MsgStream &log) const override
CaloSamplingDataContainerCnv_p1 m_samplingDataContainerCnv
virtual void persToTrans(const CaloClusterContainer_p2 *pers, CaloClusterContainer *trans, MsgStream &log) const override
ElementLinkCnv_p2< ElementLink< CaloShowerContainer > > m_showerElementLinkCnv
CaloClusterMomentContainerCnv_p1 m_momentContainerCnv
contType::const_iterator const_iterator
ElementLinkContNames_p2 m_linkNames
CaloSamplingDataContainer_p1 m_samplingDataContainer
CaloClusterMomentContainer_p1 m_momentContainer
virtual const CaloTowerSeg & getTowerSeg() const
Retrieve tower segmentation.
virtual void setTowerSeg(const CaloTowerSeg &towerSeg)
Set tower segmentation into CaloClusterContainer.
std::vector< ClusterMoment_p >::const_iterator const_iterator
cell_link_type m_cellLink
Local pointer to cell store.
Principal data class for CaloCell clusters.
double eta0() const
Returns raw of cluster seed.
CaloClusterMomentStore m_momentStore
cluster moments
virtual double getBasicEnergy() const
Access basic energy scale signal.
unsigned int m_samplingPattern
Sampling pattern.
double getTime() const
Access cluster time.
bool m_endcap
Flag is true if at least one cell in EMB.
bool setDefaultSignalState(signalstate_t s)
Sets default signal state.
void setClusterSize(unsigned int theClusterSize)
Set cluster size.
void setTime(double theTime)
Set cluster time.
unsigned int getClusterSize() const
Get cluster size.
CaloSamplingData m_dataStore
{\ brief Cached Stores
virtual void setBasicEnergy(double theEnergy)
Set basic energy scale signal.
double phi0() const
Returns raw of cluster seed.
bool m_barrel
Flag is true if at least one cell in EMB.
CaloRecoStatus m_status
Calorimeter reconstruction status.
reconstruction status indicator
virtual const store_type & getStatusWord() const
retrieve the entire status word
Data object stores CaloTower segmentation.
a typed memory pool that saves time spent allocation small object.
Definition DataPool.h:63
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.
static const AthenaBarCode_t UNDEFINEDBARCODE
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts