ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SimSourceLink.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SimSourceLink.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2016-2019 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include <stdexcept>
12
#include <string>
13
14
#include "
ACTFW/EventData/GeometryContainers.hpp
"
15
#include "
Acts/EventData/Measurement.hpp
"
16
#include "
ActsFatras/EventData/Hit.hpp
"
17
18
namespace
FW {
19
26
class
SimSourceLink
{
27
public
:
28
SimSourceLink
(
const
Acts::Surface
&
surface
,
const
ActsFatras::Hit
&
truthHit
,
29
size_t
dim
,
Acts::BoundVector
values
,
Acts::BoundMatrix
cov)
30
:
m_values
(values),
31
m_cov
(cov),
32
m_dim
(dim),
33
m_geometryId
(truthHit.
geometryId
()),
34
m_surface
(&surface),
35
m_truthHit
(&truthHit) {}
37
SimSourceLink
() =
default
;
38
SimSourceLink
(
SimSourceLink
&&) =
default
;
39
SimSourceLink
(
const
SimSourceLink
&) =
default
;
40
SimSourceLink
&
operator=
(
SimSourceLink
&&) =
default
;
41
SimSourceLink
&
operator=
(
const
SimSourceLink
&) =
default
;
42
43
constexpr
Acts::GeometryID
geometryId
()
const
{
return
m_geometryId
; }
44
constexpr
const
Acts::Surface
&
referenceSurface
()
const
{
return
*
m_surface
; }
45
constexpr
const
ActsFatras::Hit
&
truthHit
()
const
{
return
*
m_truthHit
; }
46
47
Acts::FittableMeasurement<SimSourceLink>
operator*
()
const
{
48
if
(
m_dim
== 0) {
49
throw
std::runtime_error(
"Cannot create dim 0 measurement"
);
50
}
else
if
(
m_dim
== 1) {
51
return
Acts::Measurement<SimSourceLink, Acts::ParDef::eLOC_0>
{
52
m_surface
->
getSharedPtr
(), *
this
,
m_cov
.topLeftCorner<1, 1>(),
53
m_values
[0]};
54
}
else
if
(
m_dim
== 2) {
55
return
Acts::Measurement
<
SimSourceLink
,
Acts::ParDef::eLOC_0
,
56
Acts::ParDef::eLOC_1
>{
57
m_surface
->
getSharedPtr
(), *
this
,
m_cov
.topLeftCorner<2, 2>(),
58
m_values
[0],
m_values
[1]};
59
}
else
{
60
throw
std::runtime_error(
"Dim "
+
std::to_string
(
m_dim
) +
61
" currently not supported."
);
62
}
63
}
64
65
private
:
66
Acts::BoundVector
m_values
;
67
Acts::BoundMatrix
m_cov
;
68
size_t
m_dim
= 0
u
;
69
// store geo id copy to avoid indirection via truth hit
70
Acts::GeometryID
m_geometryId
;
71
// need to store pointers to make the object copyable
72
const
Acts::Surface
*
m_surface
;
73
const
ActsFatras::Hit
*
m_truthHit
;
74
75
friend
constexpr
bool
operator==
(
const
SimSourceLink
& lhs,
76
const
SimSourceLink
& rhs) {
77
return
lhs.
m_truthHit
== rhs.
m_truthHit
;
78
}
79
};
80
82
using
SimSourceLinkContainer
=
GeometryIdMultiset<SimSourceLink>
;
83
84
}
// end of namespace FW
acts
blob
master
Examples
Framework
include
ACTFW
EventData
SimSourceLink.hpp
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:23
using
1.8.2 with
ECCE GitHub integration