ATLAS Offline Software
Public Member Functions | List of all members
CaloSamplingDataCnv_p1 Class Reference

#include <CaloSamplingDataCnv_p1.h>

Collaboration diagram for CaloSamplingDataCnv_p1:

Public Member Functions

 CaloSamplingDataCnv_p1 ()
 
void persToTrans (const CaloSamplingData_p1 *, CaloSamplingData *) const
 
void transToPers (const CaloSamplingData *, CaloSamplingData_p1 *) const
 

Detailed Description

Definition at line 17 of file CaloSamplingDataCnv_p1.h.

Constructor & Destructor Documentation

◆ CaloSamplingDataCnv_p1()

CaloSamplingDataCnv_p1::CaloSamplingDataCnv_p1 ( )

Definition at line 13 of file CaloSamplingDataCnv_p1.cxx.

14 {
15 }

Member Function Documentation

◆ persToTrans()

void CaloSamplingDataCnv_p1::persToTrans ( const CaloSamplingData_p1 pers,
CaloSamplingData trans 
) const

Definition at line 18 of file CaloSamplingDataCnv_p1.cxx.

20 {
22  if (pers->m_dataStore.empty()) {
23  trans->m_dataStore.clear();
24  return;
25  }
26 
27  size_t nSamplings=trans->fastNsamp();
28  trans->m_dataStore.resize (trans->index (pers->m_dataStore.size(), 0));
29 
30  std::vector<std::vector<float> >::const_iterator it=pers->m_dataStore.begin();
31  std::vector<std::vector<float> >::const_iterator it_e=pers->m_dataStore.end();
33  for (;it!=it_e;++it) {
34  size_t nPersSamplings = it->size();
35  size_t nCopySamplings = std::min (nSamplings, nPersSamplings);
36  std::copy(it->begin(),it->begin()+nCopySamplings,pos);
37  if (nCopySamplings < nSamplings)
38  std::fill(pos+nCopySamplings, pos+nSamplings, 0);
39  pos += nSamplings;
40  }
41  assert (pos == trans->m_dataStore.end());
42 }

◆ transToPers()

void CaloSamplingDataCnv_p1::transToPers ( const CaloSamplingData trans,
CaloSamplingData_p1 pers 
) const

Definition at line 45 of file CaloSamplingDataCnv_p1.cxx.

47 {
49  if (trans->m_dataStore.empty()) {
50  pers->m_dataStore.clear();
51  return;
52  }
53  size_t nsamp = trans->fastNsamp();
54  pers->m_dataStore.resize(trans->m_dataStore.size() / nsamp);
55  CaloSamplingData::variable_store_type::const_iterator it=trans->m_dataStore.begin();
56  CaloSamplingData::variable_store_type::const_iterator it_e=trans->m_dataStore.end();
57  unsigned i=0;
58  for (; it<it_e; it += nsamp) {
59  pers->m_dataStore[i].assign (it, it+nsamp);
60  ++i;
61  }
62 }

The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CaloSamplingData::m_varTypePattern
unsigned int m_varTypePattern
Definition: CaloSamplingData.h:117
CaloSamplingData_p1::m_dataStore
std::vector< std::vector< float > > m_dataStore
Definition: CaloSamplingData_p1.h:14
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSamplingData::fastNsamp
size_t fastNsamp() const
Definition: CaloSamplingData.h:307
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
CaloSamplingData::m_dataStore
variable_store_type m_dataStore
Definition: CaloSamplingData.h:115
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CaloSamplingData_p1::m_varTypePattern
unsigned int m_varTypePattern
Definition: CaloSamplingData_p1.h:13
calibdata.copy
bool copy
Definition: calibdata.py:27
CaloSamplingData::index
size_t index(size_t theVariable, size_t theSampling) const
Definition: CaloSamplingData.h:301