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

#include <FPGATrackSimGNNGraphHitSelectorTool.h>

Inheritance diagram for FPGATrackSimGNNGraphHitSelectorTool:
Collaboration diagram for FPGATrackSimGNNGraphHitSelectorTool:

Public Member Functions

 FPGATrackSimGNNGraphHitSelectorTool (const std::string &, const std::string &, const IInterface *)
virtual StatusCode selectHits (const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits, std::vector< std::shared_ptr< FPGATrackSimGNNHit > > &graph_hits)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

float getEta (const std::shared_ptr< const FPGATrackSimHit > &hit)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 22 of file FPGATrackSimGNNGraphHitSelectorTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimGNNGraphHitSelectorTool()

FPGATrackSimGNNGraphHitSelectorTool::FPGATrackSimGNNGraphHitSelectorTool ( const std::string & algname,
const std::string & name,
const IInterface * ifc )

Definition at line 11 of file FPGATrackSimGNNGraphHitSelectorTool.cxx.

12 : AthAlgTool(algname, name, ifc) {}
AthAlgTool()
Default constructor:

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getEta()

float FPGATrackSimGNNGraphHitSelectorTool::getEta ( const std::shared_ptr< const FPGATrackSimHit > & hit)
private

Definition at line 83 of file FPGATrackSimGNNGraphHitSelectorTool.cxx.

84{
85 float r3 = std::sqrt(hit->getR()*hit->getR() + hit->getZ()*hit->getZ());
86 float theta = 0.5 * TMath::ACos(hit->getZ() / r3);
87 float eta = -1.0 * TMath::Log(TMath::Tan(theta));
88 return eta;
89}
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
float getZ() const
float getR() const

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ selectHits()

StatusCode FPGATrackSimGNNGraphHitSelectorTool::selectHits ( const std::vector< std::shared_ptr< const FPGATrackSimHit > > & hits,
std::vector< std::shared_ptr< FPGATrackSimGNNHit > > & graph_hits )
virtual

Definition at line 17 of file FPGATrackSimGNNGraphHitSelectorTool.cxx.

18{
19 // Not all FPGATrackSimHits will be passed to our GNN Pipeline
20 // So we need to select the hits that we want
21 // For pixel, this is all the same
22 // For strip, we only want to keep one spacepoint for the two clusters. However, we also need to keep the position of both clusters (necessary input for the GNN)
23
24 for (unsigned long int i = 0; i < hits.size(); i++) {
25 // For pixel, the hit = SP = cluster_1 = cluster_2
26 if(hits[i]->isPixel() && to_string(hits[i]->getHitType()) == "clustered") {
27 std::shared_ptr<FPGATrackSimGNNHit> graph_hit = std::make_shared<FPGATrackSimGNNHit>();
28 graph_hit->setHitID(i);
29 graph_hit->setIdentifier(hits[i]->getIdentifier());
30 graph_hit->setX(hits[i]->getX());
31 graph_hit->setY(hits[i]->getY());
32 graph_hit->setZ(hits[i]->getZ());
33 graph_hit->setR(hits[i]->getR());
34 graph_hit->setPhi(hits[i]->getGPhi());
35 graph_hit->setEta(getEta(hits[i]));
36 graph_hit->setCluster1X(hits[i]->getX());
37 graph_hit->setCluster1Y(hits[i]->getY());
38 graph_hit->setCluster1Z(hits[i]->getZ());
39 graph_hit->setCluster1R(hits[i]->getR());
40 graph_hit->setCluster1Phi(hits[i]->getGPhi());
41 graph_hit->setCluster1Eta(graph_hit->getEta());
42 graph_hit->setCluster2X(hits[i]->getX());
43 graph_hit->setCluster2Y(hits[i]->getY());
44 graph_hit->setCluster2Z(hits[i]->getZ());
45 graph_hit->setCluster2R(hits[i]->getR());
46 graph_hit->setCluster2Phi(hits[i]->getGPhi());
47 graph_hit->setCluster2Eta(graph_hit->getEta());
48 graph_hits.emplace_back(graph_hit);
49 }
50 // For strip, two clusters -> one spacepoint -> duplicate SP record in the hit
51 // This means we are ignoring single clusters in the strip that are labeled as hits (need to discuss if this is bad or not)
52 else if(i+1 < hits.size() && hits[i]->isStrip() && hits[i+1]->isStrip() && to_string(hits[i]->getHitType()) == "spacepoint" && to_string(hits[i+1]->getHitType()) == "spacepoint" && hits[i]->getX() == hits[i+1]->getX()) {
53 std::shared_ptr<FPGATrackSimGNNHit> graph_hit = std::make_shared<FPGATrackSimGNNHit>();
54 std::shared_ptr<const FPGATrackSimHit> cluster1_hit = std::make_shared<FPGATrackSimHit>(hits[i]->getOriginalHit());
55 std::shared_ptr<const FPGATrackSimHit> cluster2_hit = std::make_shared<FPGATrackSimHit>(hits[i+1]->getOriginalHit());
56 graph_hit->setHitID(i);
57 graph_hit->setIdentifier(hits[i]->getIdentifier());
58 graph_hit->setX(hits[i]->getX());
59 graph_hit->setY(hits[i]->getY());
60 graph_hit->setZ(hits[i]->getZ());
61 graph_hit->setR(hits[i]->getR());
62 graph_hit->setPhi(hits[i]->getGPhi());
63 graph_hit->setEta(getEta(hits[i]));
64 graph_hit->setCluster1X(cluster1_hit->getX());
65 graph_hit->setCluster1Y(cluster1_hit->getY());
66 graph_hit->setCluster1Z(cluster1_hit->getZ());
67 graph_hit->setCluster1R(cluster1_hit->getR());
68 graph_hit->setCluster1Phi(cluster1_hit->getGPhi());
69 graph_hit->setCluster1Eta(getEta(cluster1_hit));
70 graph_hit->setCluster2X(cluster2_hit->getX());
71 graph_hit->setCluster2Y(cluster2_hit->getY());
72 graph_hit->setCluster2Z(cluster2_hit->getZ());
73 graph_hit->setCluster2R(cluster2_hit->getR());
74 graph_hit->setCluster2Phi(cluster2_hit->getGPhi());
75 graph_hit->setCluster2Eta(getEta(cluster2_hit));
76 graph_hits.emplace_back(graph_hit);
77 }
78 }
79
80 return StatusCode::SUCCESS;
81}
static std::string to_string(const std::vector< T > &v)
float getEta(const std::shared_ptr< const FPGATrackSimHit > &hit)

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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