ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileSimEvent
TileSimEvent
TileHitVectorCellBuilder.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef TILESIMEVENT_TILEHITVECTORCELLBUILDER_H
6
#define TILESIMEVENT_TILEHITVECTORCELLBUILDER_H
7
8
#include "Identifier/Identifier.h"
9
#include "
TileSimEvent/TileHitVector.h
"
10
11
#include <array>
12
#include <cstddef>
13
#include <memory>
14
#include <string>
15
24
template
<std::
size_t
NCells>
25
class
TileHitVectorCellBuilder
:
public
TileHitVector
26
{
27
public
:
28
explicit
TileHitVectorCellBuilder
(
const
std::string& collectionName)
29
:
TileHitVector
(collectionName)
30
{}
31
32
bool
HasHit
(std::size_t
index
)
const
{
return
m_hits
[
index
] !=
nullptr
; }
33
34
void
AddHit
(std::size_t
index
,
Identifier
id
,
double
energy,
double
time = 0.0,
double
deltaT = 0.0)
35
{
36
if
(
m_hits
[
index
]) {
37
m_hits
[
index
]->add(energy, time, deltaT);
38
}
else
{
39
m_hits
[
index
] = std::make_unique<TileSimHit>(
id
, energy, time, deltaT);
40
}
41
}
42
43
void
Finalize
()
44
{
45
for
(std::size_t
index
= 0;
index
< NCells; ++
index
) {
46
if
(
m_hits
[
index
]) {
47
Insert
(
TileHit
(
m_hits
[
index
].
get
()));
48
m_hits
[
index
].reset();
49
}
50
}
51
}
52
53
private
:
54
std::array<std::unique_ptr<TileSimHit>, NCells>
m_hits
{};
55
};
56
57
#endif
// TILESIMEVENT_TILEHITVECTORCELLBUILDER_H
TileHitVector.h
TileHitVector
AtlasHitsVector< TileHit > TileHitVector
Definition
TileHitVector.h:28
AtlasHitsVector< TileHit >::Insert
void Insert(const TileHit &h)
Definition
AtlasHitsVector.h:72
TileHitVectorCellBuilder::Finalize
void Finalize()
Definition
TileHitVectorCellBuilder.h:43
TileHitVectorCellBuilder::HasHit
bool HasHit(std::size_t index) const
Definition
TileHitVectorCellBuilder.h:32
TileHitVectorCellBuilder::AddHit
void AddHit(std::size_t index, Identifier id, double energy, double time=0.0, double deltaT=0.0)
Definition
TileHitVectorCellBuilder.h:34
TileHitVectorCellBuilder::TileHitVectorCellBuilder
TileHitVectorCellBuilder(const std::string &collectionName)
Definition
TileHitVectorCellBuilder.h:28
TileHitVectorCellBuilder::m_hits
std::array< std::unique_ptr< TileSimHit >, NCells > m_hits
Definition
TileHitVectorCellBuilder.h:54
TileHit
Definition
TileSimEvent/TileSimEvent/TileHit.h:30
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:132
Identifier
Definition
IdentifierFieldParser.cxx:14
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0