ATLAS Offline Software
Tracking
TrkEvent
TrkTruthData
TrkTruthData
TrackTruthKey.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Dear emacs, this is -*-c++-*-
6
#ifndef TRACKTRUTHKEY_H
7
#define TRACKTRUTHKEY_H
8
9
#include "
TrkTrack/TrackCollection.h
"
10
#include "AthLinks/ElementLink.h"
11
12
namespace
Trk
{
13
14
// This class identifies a track in TrackTruthCollection and
15
// DetailedTrackTruthCollection. It uses less memory than
16
// ElementLink<TrackCollection> because it does not carry a
17
// string-the TrackCollection key. Instead this is a wrapper around
18
// a single integer - the index of the track in a TrackCollection.
19
//
20
// andrei.gaponenko@cern.ch, 2007
21
22
class
TrackTruthKey
{
23
public
:
24
// Is it enough to use a 32 bit unsigned instead?
25
typedef
TrackCollection::size_type
size_type
;
26
27
size_type
index
()
const
{
return
m_index
; }
28
29
TrackTruthKey
(
size_type
i
) :
m_index
(
i
) {}
30
31
// For compatibility with the existing clients of ElementLink
32
// based TrackTruthCollection. This constuctor may be removed
33
// after the clients are migrated to use bare index instead of
34
// building ElementLink to do truth look up.
35
36
TrackTruthKey
(
const
ElementLink<TrackCollection>
&
el
) :
m_index
(
el
.
index
()) {}
37
38
// Reflex is clueless about handling types that do not have a default constructor
39
TrackTruthKey
() :
m_index
(-1U) {}
40
41
private
:
42
size_type
m_index
;
43
};
44
45
inline
bool
operator<
(
const
TrackTruthKey
&
a
,
const
TrackTruthKey
&
b
) {
46
return
a
.index() <
b
.index();
47
}
48
49
}
50
51
#endif
/*TRACKTRUTHKEY_H*/
Trk::TrackTruthKey::TrackTruthKey
TrackTruthKey()
Definition:
TrackTruthKey.h:39
Trk::operator<
bool operator<(const LayerIndex &one, const LayerIndex &two)
Overload of operator< | <= | > | >= for the usage in a map.
Definition:
LayerIndex.cxx:12
Trk::TrackTruthKey::size_type
TrackCollection::size_type size_type
Definition:
TrackTruthKey.h:25
Trk::TrackTruthKey
Definition:
TrackTruthKey.h:22
index
Definition:
index.py:1
Trk::TrackTruthKey::TrackTruthKey
TrackTruthKey(size_type i)
Definition:
TrackTruthKey.h:29
Trk::TrackTruthKey::m_index
size_type m_index
Definition:
TrackTruthKey.h:42
lumiFormat.i
int i
Definition:
lumiFormat.py:85
TrackCollection.h
plotIsoValidation.el
el
Definition:
plotIsoValidation.py:197
ElementLink< TrackCollection >
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition:
FakeTrackBuilder.h:9
Trk::TrackTruthKey::index
size_type index() const
Definition:
TrackTruthKey.h:27
Trk::TrackTruthKey::TrackTruthKey
TrackTruthKey(const ElementLink< TrackCollection > &el)
Definition:
TrackTruthKey.h:36
plotBeamSpotMon.b
b
Definition:
plotBeamSpotMon.py:77
a
TList * a
Definition:
liststreamerinfos.cxx:10
DataVector< Trk::Track >::size_type
BASE::size_type size_type
Definition:
DataVector.h:813
Generated on Thu Nov 7 2024 21:29:16 for ATLAS Offline Software by
1.8.18