ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsTrackReconstruction
src
detail
MeasurementIndex.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ACTSTRACKRECONSTRUCTION_MEASUREMENTINDEX_H
6
#define ACTSTRACKRECONSTRUCTION_MEASUREMENTINDEX_H
7
8
#include "
xAODMeasurementBase/UncalibratedMeasurementContainer.h
"
9
10
#include <utility>
11
#include <vector>
12
13
namespace
ActsTrk::detail
{
14
15
// Helper class to keep track of measurement indices, used for shared hits and debug printing
16
class
MeasurementIndex
{
17
public
:
18
inline
MeasurementIndex
(std::size_t nMeasurementContainerMax = 0ul);
// nMeasurementContainerMax is only a hint
19
MeasurementIndex
(
const
MeasurementIndex
&) =
default
;
20
MeasurementIndex
&
operator=
(
const
MeasurementIndex
&) =
default
;
21
MeasurementIndex
(
MeasurementIndex
&&) noexcept = default;
22
MeasurementIndex
&operator=(
MeasurementIndex
&&) noexcept = default;
23
~
MeasurementIndex
() = default;
24
25
// addMeasurement(s)/newMeasurementIndex can include previously added hits, as long as they are in the same owning container.
26
inline
bool
addMeasurement
(
const
xAOD
::UncalibratedMeasurement &
hit
);
27
inline
void
addMeasurements
(
const
xAOD
::UncalibratedMeasurementContainer &clusterContainer);
28
inline
std
::
size_t
nMeasurements
()
const
;
29
30
inline
std
::
size_t
index
(
const
xAOD
::UncalibratedMeasurement &
hit
)
const
;
31
inline
std
::
pair
<
std
::
size_t
,
bool
>
newMeasurementIndex
(
const
xAOD
::UncalibratedMeasurement &
hit
);
32
inline
std
::
size_t
size
()
const
;
33
34
private
:
35
using
ContainerPtr
=
const
SG
::AuxVectorData *;
36
std
::
vector
<
std
::
pair
<
ContainerPtr
,
std
::
size_t
>>
m_measurementContainerOffsets
;
37
std
::
size_t
m_size
{};
38
std::size_t
m_nMeasurements
{};
39
// MeasurementIndex is only ever used as a local stack variable, so doesn't need to be thread safe.
40
// Is there a way to confirm this but still disable "non-thread-safe" warnings?
41
// We could make index() non-const, but it is only needed for these cached values.
42
mutable
ContainerPtr
m_lastContainer
ATLAS_THREAD_SAFE
{
nullptr
};
43
mutable
std::size_t m_lastContainerOffset
ATLAS_THREAD_SAFE
{};
44
mutable
std::size_t m_lastContainerSize
ATLAS_THREAD_SAFE
{};
45
};
46
47
}
// namespace ActsTrk::detail
48
49
#include "
src/detail/MeasurementIndex.icc
"
50
51
#endif
hit
bool hit(const Container &ids, int pdgId)
Definition
JetIRCSafeLabelTool.cxx:64
MeasurementIndex.icc
UncalibratedMeasurementContainer.h
ActsTrk::detail::MeasurementIndex::addMeasurement
bool addMeasurement(const xAOD::UncalibratedMeasurement &hit)
ActsTrk::detail::MeasurementIndex::ATLAS_THREAD_SAFE
ContainerPtr m_lastContainer ATLAS_THREAD_SAFE
Definition
MeasurementIndex.h:42
ActsTrk::detail::MeasurementIndex::size
std::size_t size() const
ActsTrk::detail::MeasurementIndex::MeasurementIndex
MeasurementIndex(std::size_t nMeasurementContainerMax=0ul)
ActsTrk::detail::MeasurementIndex::MeasurementIndex
MeasurementIndex(MeasurementIndex &&) noexcept=default
ActsTrk::detail::MeasurementIndex::newMeasurementIndex
std::pair< std::size_t, bool > newMeasurementIndex(const xAOD::UncalibratedMeasurement &hit)
ActsTrk::detail::MeasurementIndex::m_size
std::size_t m_size
Definition
MeasurementIndex.h:37
ActsTrk::detail::MeasurementIndex::ContainerPtr
const SG::AuxVectorData * ContainerPtr
Definition
MeasurementIndex.h:35
ActsTrk::detail::MeasurementIndex::m_measurementContainerOffsets
std::vector< std::pair< ContainerPtr, std::size_t > > m_measurementContainerOffsets
Definition
MeasurementIndex.h:36
ActsTrk::detail::MeasurementIndex::nMeasurements
std::size_t nMeasurements() const
ActsTrk::detail::MeasurementIndex::operator=
MeasurementIndex & operator=(const MeasurementIndex &)=default
ActsTrk::detail::MeasurementIndex::MeasurementIndex
MeasurementIndex(const MeasurementIndex &)=default
ActsTrk::detail::MeasurementIndex::m_nMeasurements
std::size_t m_nMeasurements
Definition
MeasurementIndex.h:38
ActsTrk::detail::MeasurementIndex::addMeasurements
void addMeasurements(const xAOD::UncalibratedMeasurementContainer &clusterContainer)
pair
STL class.
vector
Definition
MultiHisto.h:13
const
ActsTrk::detail
Hash functions to pack the source link into unordered_maps / unordered_sets.
Definition
MeasurementCalibratorBase.h:31
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
index
Definition
index.py:1
std
STL namespace.
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0