ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
eflowTrackClusterLink.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
/*
6
* eflowTrackClusterLink.h
7
*
8
* Created on: 30.09.2013
9
* Author: tlodd
10
*/
11
12
#ifndef EFLOWREC_EFLOWTRACKCLUSTERLINK_H
13
#define EFLOWREC_EFLOWTRACKCLUSTERLINK_H
14
15
#include <utility>
16
#include <unordered_map>
17
#include <vector>
18
#include <iostream>
19
#include <mutex>
20
21
#include "GaudiKernel/ToolHandle.h"
22
#include "GaudiKernel/EventContext.h"
23
24
#include "
CxxUtils/fpcompare.h
"
25
#include "
eflowRecTrack.h
"
26
27
class
eflowRecTrack
;
28
class
eflowRecCluster
;
29
36
class
eflowTrackClusterLink
{
37
public
:
38
eflowTrackClusterLink
(
eflowRecTrack
* track,
eflowRecCluster
* cluster) :
39
m_track
(track),
m_cluster
(cluster) { }
40
41
virtual
~eflowTrackClusterLink
() { }
42
43
static
eflowTrackClusterLink
*
getInstance
(
eflowRecTrack
* track,
44
eflowRecCluster
* cluster,
45
const
EventContext& ctx);
46
47
eflowRecCluster
*
getCluster
() {
return
m_cluster
; }
48
const
eflowRecCluster
*
getCluster
()
const
{
return
m_cluster
; }
49
eflowRecTrack
*
getTrack
() {
return
m_track
; }
50
const
eflowRecTrack
*
getTrack
()
const
{
return
m_track
; }
51
52
void
setClusterIntegral
(
const
std::vector<double>& clusterIntegral) {
53
m_clusterIntegral
= clusterIntegral;
54
}
55
const
std::vector<double>&
getClusterIntegral
()
const
{
return
m_clusterIntegral
; }
56
57
private
:
58
using
key_t
= std::pair<eflowRecTrack*, eflowRecCluster*>;
59
struct
Hasher
60
{
61
size_t
operator()
(
const
key_t
& k)
const
62
{
63
return
std::hash<eflowRecTrack*>()(k.first) ^
64
std::hash<eflowRecCluster*>()(k.second);
65
}
66
};
67
struct
Cache
68
{
69
std::mutex
m_mutex
;
70
std::unordered_map<key_t, std::unique_ptr<eflowTrackClusterLink>,
Hasher
>
m_map
;
71
EventContext::ContextEvt_t
m_evt
=
static_cast<
EventContext::ContextEvt_t
>
(-1);
72
};
73
74
eflowRecTrack
*
m_track
;
75
eflowRecCluster
*
m_cluster
;
76
77
std::vector<double>
m_clusterIntegral
;
78
};
79
80
#endif
/* EFLOWREC_EFLOWTRACKCLUSTERLINK_H */
eflowRecCluster
This class extends the information about a xAOD::CaloCluster.
Definition
eflowRecCluster.h:40
eflowRecTrack
This class extends the information about a xAOD::Track.
Definition
eflowRecTrack.h:49
eflowTrackClusterLink
Stores pointers to an eflowRecTrack and an eflowRecCluster.
Definition
eflowTrackClusterLink.h:36
eflowTrackClusterLink::key_t
std::pair< eflowRecTrack *, eflowRecCluster * > key_t
Definition
eflowTrackClusterLink.h:58
eflowTrackClusterLink::getInstance
static eflowTrackClusterLink * getInstance(eflowRecTrack *track, eflowRecCluster *cluster, const EventContext &ctx)
Definition
eflowTrackClusterLink.cxx:19
eflowTrackClusterLink::getTrack
eflowRecTrack * getTrack()
Definition
eflowTrackClusterLink.h:49
eflowTrackClusterLink::getCluster
eflowRecCluster * getCluster()
Definition
eflowTrackClusterLink.h:47
eflowTrackClusterLink::getClusterIntegral
const std::vector< double > & getClusterIntegral() const
Definition
eflowTrackClusterLink.h:55
eflowTrackClusterLink::m_cluster
eflowRecCluster * m_cluster
Definition
eflowTrackClusterLink.h:75
eflowTrackClusterLink::getCluster
const eflowRecCluster * getCluster() const
Definition
eflowTrackClusterLink.h:48
eflowTrackClusterLink::m_clusterIntegral
std::vector< double > m_clusterIntegral
Definition
eflowTrackClusterLink.h:77
eflowTrackClusterLink::m_track
eflowRecTrack * m_track
Definition
eflowTrackClusterLink.h:74
eflowTrackClusterLink::setClusterIntegral
void setClusterIntegral(const std::vector< double > &clusterIntegral)
Definition
eflowTrackClusterLink.h:52
eflowTrackClusterLink::getTrack
const eflowRecTrack * getTrack() const
Definition
eflowTrackClusterLink.h:50
eflowTrackClusterLink::eflowTrackClusterLink
eflowTrackClusterLink(eflowRecTrack *track, eflowRecCluster *cluster)
Definition
eflowTrackClusterLink.h:38
eflowTrackClusterLink::~eflowTrackClusterLink
virtual ~eflowTrackClusterLink()
Definition
eflowTrackClusterLink.h:41
eflowRecTrack.h
fpcompare.h
Workaround x86 precision issues for FP inequality comparisons.
eflowTrackClusterLink::Cache
Definition
eflowTrackClusterLink.h:68
eflowTrackClusterLink::Cache::m_map
std::unordered_map< key_t, std::unique_ptr< eflowTrackClusterLink >, Hasher > m_map
Definition
eflowTrackClusterLink.h:70
eflowTrackClusterLink::Cache::m_evt
EventContext::ContextEvt_t m_evt
Definition
eflowTrackClusterLink.h:71
eflowTrackClusterLink::Cache::m_mutex
std::mutex m_mutex
Definition
eflowTrackClusterLink.h:69
eflowTrackClusterLink::Hasher
Definition
eflowTrackClusterLink.h:60
eflowTrackClusterLink::Hasher::operator()
size_t operator()(const key_t &k) const
Definition
eflowTrackClusterLink.h:61
Generated on
for ATLAS Offline Software by
1.17.0