ATLAS Offline Software
Loading...
Searching...
No Matches
HistoryContainer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
10#include <iostream>
11
12using std::cout;
13using std::endl;
14
15using namespace LArSamples;
16
17
23
25 : m_data(other.m_data)
26{
27 ClassCounts::incrementInstanceCount("HistoryContainer");
28 if (other.m_cellInfo) m_cellInfo = std::make_unique<CellInfo>(*other.m_cellInfo);
29}
30
31
33{
34 ClassCounts::decrementInstanceCount("HistoryContainer");
35 for (const DataContainer* data : m_data)
36 delete data;
37}
38
39
41{
42 double fp = sizeof(*this);
43 if (m_cellInfo) fp += m_cellInfo->footprint();
44
45 for (unsigned int i = 0; i < nDataContainers(); i++)
46 fp += dataContainer(i)->footprint();
47
48 return fp;
49}
50
51
53{
54 if (!m_cellInfo || !m_cellInfo->isValid()) return false;
55 if (nDataContainers() == 0) return false;
56
57 for (const DataContainer* data : m_data) {
58 if (!data->isValid()) return false;
59 }
60
61 return true;
62}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
virtual ~HistoryContainer()
Destructor.
HistoryContainer(CellInfo *cellInfo=0)
Constructor (takes ownership of LArCellInfo object)
std::vector< const DataContainer * > m_data
std::unique_ptr< CellInfo > m_cellInfo
const CellInfo * cellInfo() const
unsigned int nDataContainers() const
const DataContainer * dataContainer(unsigned int i) const