ATLAS Offline Software
Loading...
Searching...
No Matches
eflowTrackClusterLink Class Reference

Stores pointers to an eflowRecTrack and an eflowRecCluster. More...

#include <eflowTrackClusterLink.h>

Collaboration diagram for eflowTrackClusterLink:

Classes

struct  Cache
struct  Hasher

Public Member Functions

 eflowTrackClusterLink (eflowRecTrack *track, eflowRecCluster *cluster)
virtual ~eflowTrackClusterLink ()
eflowRecClustergetCluster ()
const eflowRecClustergetCluster () const
eflowRecTrackgetTrack ()
const eflowRecTrackgetTrack () const
void setClusterIntegral (const std::vector< double > &clusterIntegral)
const std::vector< double > & getClusterIntegral () const

Static Public Member Functions

static eflowTrackClusterLinkgetInstance (eflowRecTrack *track, eflowRecCluster *cluster, const EventContext &ctx=Gaudi::Hive::currentContext())

Private Types

using key_t = std::pair<eflowRecTrack*, eflowRecCluster*>

Private Attributes

eflowRecTrackm_track
eflowRecClusterm_cluster
std::vector< double > m_clusterIntegral

Detailed Description

Stores pointers to an eflowRecTrack and an eflowRecCluster.

These pointers kept in a cache internal to the getInstance function. We also store a vector of energy density, around the track impact point in each calorimeter layer, corresponding to the layers in the calorimeter.

Definition at line 37 of file eflowTrackClusterLink.h.

Member Typedef Documentation

◆ key_t

Definition at line 59 of file eflowTrackClusterLink.h.

Constructor & Destructor Documentation

◆ eflowTrackClusterLink()

eflowTrackClusterLink::eflowTrackClusterLink ( eflowRecTrack * track,
eflowRecCluster * cluster )
inline

Definition at line 39 of file eflowTrackClusterLink.h.

39 :
40 m_track(track), m_cluster(cluster) { }

◆ ~eflowTrackClusterLink()

virtual eflowTrackClusterLink::~eflowTrackClusterLink ( )
inlinevirtual

Definition at line 42 of file eflowTrackClusterLink.h.

42{ }

Member Function Documentation

◆ getCluster() [1/2]

eflowRecCluster * eflowTrackClusterLink::getCluster ( )
inline

Definition at line 48 of file eflowTrackClusterLink.h.

48{ return m_cluster; }

◆ getCluster() [2/2]

const eflowRecCluster * eflowTrackClusterLink::getCluster ( ) const
inline

Definition at line 49 of file eflowTrackClusterLink.h.

49{ return m_cluster; }

◆ getClusterIntegral()

const std::vector< double > & eflowTrackClusterLink::getClusterIntegral ( ) const
inline

Definition at line 56 of file eflowTrackClusterLink.h.

56{ return m_clusterIntegral; }

◆ getInstance()

eflowTrackClusterLink * eflowTrackClusterLink::getInstance ( eflowRecTrack * track,
eflowRecCluster * cluster,
const EventContext & ctx = Gaudi::Hive::currentContext() )
static

Definition at line 19 of file eflowTrackClusterLink.cxx.

22{
23 static SG::SlotSpecificObj<Cache> slots ATLAS_THREAD_SAFE;
24 Cache& c = *slots.get (ctx);
25 std::lock_guard lock (c.m_mutex);
26 if (c.m_evt != ctx.evt()) {
27 c.m_map.clear();
28 c.m_evt = ctx.evt();
29 }
30
31 key_t key (track, cluster);
32 auto it = c.m_map.try_emplace (key, std::unique_ptr<eflowTrackClusterLink>()).first;
33 if (!it->second) {
34 it->second = std::make_unique<eflowTrackClusterLink>(track,cluster);
35 }
36 return it->second.get();
37}
#define ATLAS_THREAD_SAFE

◆ getTrack() [1/2]

eflowRecTrack * eflowTrackClusterLink::getTrack ( )
inline

Definition at line 50 of file eflowTrackClusterLink.h.

50{ return m_track; }

◆ getTrack() [2/2]

const eflowRecTrack * eflowTrackClusterLink::getTrack ( ) const
inline

Definition at line 51 of file eflowTrackClusterLink.h.

51{ return m_track; }

◆ setClusterIntegral()

void eflowTrackClusterLink::setClusterIntegral ( const std::vector< double > & clusterIntegral)
inline

Definition at line 53 of file eflowTrackClusterLink.h.

53 {
54 m_clusterIntegral = clusterIntegral;
55 }

Member Data Documentation

◆ m_cluster

eflowRecCluster* eflowTrackClusterLink::m_cluster
private

Definition at line 76 of file eflowTrackClusterLink.h.

◆ m_clusterIntegral

std::vector<double> eflowTrackClusterLink::m_clusterIntegral
private

Definition at line 78 of file eflowTrackClusterLink.h.

◆ m_track

eflowRecTrack* eflowTrackClusterLink::m_track
private

Definition at line 75 of file eflowTrackClusterLink.h.


The documentation for this class was generated from the following files: