ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCafJobs
src
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
5
#include "
LArCafJobs/HistoryContainer.h
"
6
7
#include "
LArCafJobs/DataContainer.h
"
8
#include "
LArCafJobs/CellInfo.h
"
9
#include "
LArCafJobs/ClassCounts.h
"
10
#include <iostream>
11
12
using
std::cout;
13
using
std::endl;
14
15
using namespace
LArSamples
;
16
17
18
HistoryContainer::HistoryContainer
(
CellInfo
*
cellInfo
)
19
:
m_cellInfo
(
cellInfo
)
20
{
21
ClassCounts::incrementInstanceCount
(
"HistoryContainer"
);
22
}
23
24
HistoryContainer::HistoryContainer
(
const
HistoryContainer
& other)
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
32
HistoryContainer::~HistoryContainer
()
33
{
34
ClassCounts::decrementInstanceCount
(
"HistoryContainer"
);
35
for
(
const
DataContainer
* data :
m_data
)
36
delete
data;
37
}
38
39
40
double
HistoryContainer::footprint
()
const
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
52
bool
HistoryContainer::isValid
()
const
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
}
CellInfo.h
DataContainer.h
HistoryContainer.h
ClassCounts.h
LArSamples::CellInfo
Definition
CellInfo.h:31
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition
LArCafJobs/LArCafJobs/ClassCounts.h:32
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition
LArCafJobs/LArCafJobs/ClassCounts.h:33
LArSamples::DataContainer
Definition
DataContainer.h:25
LArSamples::DataContainer::footprint
double footprint() const
Definition
DataContainer.h:88
LArSamples::HistoryContainer::~HistoryContainer
virtual ~HistoryContainer()
Destructor.
Definition
HistoryContainer.cxx:32
LArSamples::HistoryContainer::HistoryContainer
HistoryContainer(CellInfo *cellInfo=0)
Constructor (takes ownership of LArCellInfo object).
Definition
HistoryContainer.cxx:18
LArSamples::HistoryContainer::m_data
std::vector< const DataContainer * > m_data
Definition
HistoryContainer.h:59
LArSamples::HistoryContainer::isValid
bool isValid() const
Definition
HistoryContainer.cxx:52
LArSamples::HistoryContainer::footprint
double footprint() const
Definition
HistoryContainer.cxx:40
LArSamples::HistoryContainer::m_cellInfo
std::unique_ptr< CellInfo > m_cellInfo
Definition
HistoryContainer.h:60
LArSamples::HistoryContainer::cellInfo
const CellInfo * cellInfo() const
Definition
HistoryContainer.h:43
LArSamples::HistoryContainer::nDataContainers
unsigned int nDataContainers() const
Definition
HistoryContainer.h:40
LArSamples::HistoryContainer::dataContainer
const DataContainer * dataContainer(unsigned int i) const
Definition
HistoryContainer.h:41
LArSamples
Definition
AbsShape.h:24
Generated on
for ATLAS Offline Software by
1.17.0