ATLAS Offline Software
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 
8 #include "LArCafJobs/CellInfo.h"
10 #include <iostream>
11 
12 using std::cout;
13 using std::endl;
14 
15 using namespace LArSamples;
16 
17 
19  : m_cellInfo(cellInfo)
20 {
21  ClassCounts::incrementInstanceCount("HistoryContainer");
22 }
23 
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 }
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
m_data
std::vector< T > m_data
Definition: TrackTruthMatchingBaseAlg.cxx:660
LArSamples::HistoryContainer::dataContainer
const DataContainer * dataContainer(unsigned int i) const
Definition: HistoryContainer.h:41
LArSamples::HistoryContainer::m_cellInfo
std::unique_ptr< CellInfo > m_cellInfo
Definition: HistoryContainer.h:60
LArSamples
Definition: AbsShape.h:24
DataContainer.h
LArSamples::HistoryContainer::~HistoryContainer
virtual ~HistoryContainer()
Destructor.
Definition: HistoryContainer.cxx:32
lumiFormat.i
int i
Definition: lumiFormat.py:92
trigmenu_modify_prescale_json.fp
fp
Definition: trigmenu_modify_prescale_json.py:53
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:33
LArSamples::HistoryContainer::isValid
bool isValid() const
Definition: HistoryContainer.cxx:52
HistoryContainer.h
LArSamples::HistoryContainer::m_data
std::vector< const DataContainer * > m_data
Definition: HistoryContainer.h:59
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:32
LArSamples::HistoryContainer::footprint
double footprint() const
Definition: HistoryContainer.cxx:40
LArSamples::CellInfo
Definition: CellInfo.h:31
LArSamples::HistoryContainer::HistoryContainer
HistoryContainer(CellInfo *cellInfo=0)
Constructor (takes ownership of LArCellInfo object)
Definition: HistoryContainer.cxx:18
LArSamples::DataContainer
Definition: DataContainer.h:25
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArSamples::HistoryContainer
Definition: HistoryContainer.h:29
CellInfo.h
LArSamples::DataContainer::footprint
double footprint() const
Definition: DataContainer.h:88
LArSamples::HistoryContainer::nDataContainers
unsigned int nDataContainers() const
Definition: HistoryContainer.h:40
ClassCounts.h