ATLAS Offline Software
eflowTrackClusterLink.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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 EFLOWTRACKCLUSTERLINK_H_
13 #define 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 #include "GaudiKernel/ThreadLocalContext.h"
24 
25 #include "CxxUtils/fpcompare.h"
26 #include "eflowRec/eflowRecTrack.h"
27 
28 class eflowRecTrack;
29 class eflowRecCluster;
30 
38 public:
40  m_track(track), m_cluster(cluster) { }
41 
42  virtual ~eflowTrackClusterLink() { }
43 
45  eflowRecCluster* cluster,
46  const EventContext& ctx = Gaudi::Hive::currentContext());
47 
49  const eflowRecCluster* getCluster() const { return m_cluster; }
51  const eflowRecTrack* getTrack() const { return m_track; }
52 
53  void setClusterIntegral(const std::vector<double>& clusterIntegral) {
54  m_clusterIntegral = clusterIntegral;
55  }
56  const std::vector<double>& getClusterIntegral() const { return m_clusterIntegral; }
57 
58 private:
59  using key_t = std::pair<eflowRecTrack*, eflowRecCluster*>;
60  struct Hasher
61  {
62  size_t operator() (const key_t& k) const
63  {
64  return std::hash<eflowRecTrack*>()(k.first) ^
65  std::hash<eflowRecCluster*>()(k.second);
66  }
67  };
68  struct Cache
69  {
71  std::unordered_map<key_t, std::unique_ptr<eflowTrackClusterLink>, Hasher > m_map;
72  EventContext::ContextEvt_t m_evt = static_cast<EventContext::ContextEvt_t>(-1);
73  };
74 
77 
78  std::vector<double> m_clusterIntegral;
79 };
80 
81 #endif /* EFLOWTRACKCLUSTERLINK_H_ */
eflowRecCluster
This class extends the information about a xAOD::CaloCluster.
Definition: eflowRecCluster.h:40
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
eflowRecTrack
This class extends the information about a xAOD::Track.
Definition: eflowRecTrack.h:46
eflowRecTrack.h
fpcompare.h
Workaround x86 precision issues for FP inequality comparisons.
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
fitman.k
k
Definition: fitman.py:528