ATLAS Offline Software
eflowTrackClusterLink.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
23 #include "CxxUtils/fpcompare.h"
24 #include "eflowRec/eflowRecTrack.h"
25 
26 class eflowRecTrack;
27 class eflowRecCluster;
28 
36 public:
38  m_track(track), m_cluster(cluster) { }
39 
40  virtual ~eflowTrackClusterLink() { }
41 
43  eflowRecCluster* cluster,
44  const EventContext& ctx = Gaudi::Hive::currentContext());
45 
47  const eflowRecCluster* getCluster() const { return m_cluster; }
49  const eflowRecTrack* getTrack() const { return m_track; }
50 
51  void setClusterIntegral(const std::vector<double>& clusterIntegral) {
52  m_clusterIntegral = clusterIntegral;
53  }
54  const std::vector<double>& getClusterIntegral() const { return m_clusterIntegral; }
55 
56 private:
57  using key_t = std::pair<eflowRecTrack*, eflowRecCluster*>;
58  struct Hasher
59  {
60  size_t operator() (const key_t& k) const
61  {
62  return std::hash<eflowRecTrack*>()(k.first) ^
63  std::hash<eflowRecCluster*>()(k.second);
64  }
65  };
66  struct Cache
67  {
69  std::unordered_map<key_t, std::unique_ptr<eflowTrackClusterLink>, Hasher > m_map;
70  EventContext::ContextEvt_t m_evt = static_cast<EventContext::ContextEvt_t>(-1);
71  };
72 
75 
76  std::vector<double> m_clusterIntegral;
77 };
78 
79 #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:45
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