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

#include <TrigDkfTrackMakerTool.h>

Inheritance diagram for TrigDkfTrackMakerTool:
Collaboration diagram for TrigDkfTrackMakerTool:

Public Member Functions

 TrigDkfTrackMakerTool (const std::string &, const std::string &, const IInterface *)
StatusCode initialize ()
bool createDkfTrack (const Trk::Track &track, std::vector< Trk::TrkBaseNode * > &vpTrkNodes, double DChi2) const
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

Static Public Member Functions

static const InterfaceID & interfaceID ()
 other standard AlgTool methods

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

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const AtlasDetectorIDm_idHelper
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 TrigDkfTrackMakerTool.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

◆ TrigDkfTrackMakerTool()

TrigDkfTrackMakerTool::TrigDkfTrackMakerTool ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 41 of file TrigDkfTrackMakerTool.cxx.

43 : AthAlgTool(t,n,p)
44{
45 declareInterface< ITrigDkfTrackMakerTool >( this );
46 m_idHelper=nullptr;
47}
AthAlgTool()
Default constructor:
const AtlasDetectorID * m_idHelper

Member Function Documentation

◆ createDkfTrack()

bool TrigDkfTrackMakerTool::createDkfTrack ( const Trk::Track & track,
std::vector< Trk::TrkBaseNode * > & vpTrkNodes,
double DChi2 ) const
virtual

Implements ITrigDkfTrackMakerTool.

Definition at line 55 of file TrigDkfTrackMakerTool.cxx.

57 {
58
59 if(track.measurementsOnTrack()->size()==0)
60 {
61 ATH_MSG_ERROR("Cannot create a DKF track -- Trk::Track has no hits");
62 return false;
63 }
64 vpTrkNodes.clear();
65 vpTrkNodes.reserve(track.measurementsOnTrack()->size());
66 for (auto tMOT = track.measurementsOnTrack()->begin(); tMOT != track.measurementsOnTrack()->end(); ++tMOT) {
67 const Trk::Surface& rSurf=(*tMOT)->associatedSurface();
68 constexpr double radLength=0.022;
69 double C[3],N[3],M[3][3];
71 N[0]=rSurf.normal().x();
72 N[1]=rSurf.normal().y();
73 N[2]=rSurf.normal().z();
74 C[0]=rSurf.center().x();
75 C[1]=rSurf.center().y();
76 C[2]=rSurf.center().z();
77 mx=rSurf.transform().rotation().block(0,0,3,1);
78 my=rSurf.transform().rotation().block(0,1,3,1);
79 mz=rSurf.transform().rotation().block(0,2,3,1);
80 for(int i=0;i<3;i++) {
81 M[i][0]=mx[i];M[i][1]=my[i];M[i][2]=mz[i];
82 }
83 Trk::TrkPlanarSurface* pS = new Trk::TrkPlanarSurface(C,N,M,radLength, &(rSurf));
84
85 const InDet::SiClusterOnTrack* siCLOT = dynamic_cast<const InDet::SiClusterOnTrack*>(*tMOT);
86 if (siCLOT==nullptr) {
87 ATH_MSG_VERBOSE("siCLOT is null");
88 continue;
89 }
90 const InDet::SiCluster* siCL = dynamic_cast<const InDet::SiCluster*>(siCLOT->prepRawData());
91 if (siCL==nullptr) {
92 ATH_MSG_VERBOSE("siCL is null");
93 continue;
94 }
95 Identifier id = (*tMOT)->associatedSurface().associatedDetectorElement()->identify();
96 ATH_MSG_DEBUG("Identifier: " << m_idHelper->print_to_string(id));
97 if(m_idHelper->is_sct(id)) {
98 const InDetDD::SiDetectorElement* sctElement = dynamic_cast<const InDetDD::SiDetectorElement*>
99 ((*tMOT)->associatedSurface().associatedDetectorElement());
100 if (sctElement) {
101 if(sctElement->design().shape()==InDetDD::Trapezoid) //SCT Endcap
102 {
103 ATH_MSG_DEBUG("SCT endcap node");
104 const Trk::SurfaceBounds& rBounds=rSurf.bounds();
105 const Trk::TrapezoidBounds& ecBounds= dynamic_cast<const Trk::TrapezoidBounds&>(rBounds);
106 double R=(ecBounds.maxHalflengthX()+ecBounds.minHalflengthX())*
107 ecBounds.halflengthY()/(ecBounds.maxHalflengthX()-ecBounds.minHalflengthX());
108 vpTrkNodes.push_back(new Trk::TrkEndCapClusterNode(pS,DChi2,siCL,R));
109 }
110 else if(sctElement->design().shape()==InDetDD::Box) {//SCT Barrel
111 ATH_MSG_DEBUG("SCT barrel node");
112 vpTrkNodes.push_back(new Trk::TrkClusterNode(pS,DChi2,siCL));
113 }
114 else if(sctElement->design().shape()==InDetDD::Annulus) { //Strip Endcap
115 ATH_MSG_DEBUG("Strip endcap node");
116 const Trk::SurfaceBounds& rBounds=rSurf.bounds();
117 const Trk::AnnulusBounds& ecBounds= dynamic_cast<const Trk::AnnulusBounds&>(rBounds);
118 double R=ecBounds.waferCentreR();
119 vpTrkNodes.push_back(new Trk::TrkEndCapClusterNode(pS,DChi2,siCL,R));
120 }
121 }
122 else {
123 ATH_MSG_WARNING("Identifier is SCT but does not match endcap or barrel shape");
124 }
125 }
126 else if (m_idHelper->is_pixel(id)) {//Pixel
127 ATH_MSG_DEBUG("Pixel node");
128 vpTrkNodes.push_back(new Trk::TrkPixelNode(pS,DChi2,siCL));
129 }
130 else {
131 ATH_MSG_WARNING("Identifier is neither SCT nor pixel");
132 }
133 }
134 ATH_MSG_DEBUG(vpTrkNodes.size()<<" filtering nodes created");
135
136 return true;
137}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
virtual DetectorShape shape() const
Shape of element.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
double waferCentreR() const
This method returns the R-parameter from design of sensors, which is the radius that the original cen...
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
virtual const Amg::Vector3D & normal() const
Returns the normal vector of the Surface (i.e.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
const Amg::Vector3D & center() const
Returns the center position of the Surface.
double halflengthY() const
This method returns the halflength in Y (second coordinate of local surface frame)
double minHalflengthX() const
This method returns the minimal halflength in X (first coordinate of local surface frame)
double maxHalflengthX() const
This method returns the maximal halflength in X (first coordinate of local surface frame)
struct color C
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)

◆ 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

◆ initialize()

StatusCode TrigDkfTrackMakerTool::initialize ( )

Definition at line 49 of file TrigDkfTrackMakerTool.cxx.

50{
51 ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
52 return StatusCode::SUCCESS;
53}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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.

◆ interfaceID()

const InterfaceID & ITrigDkfTrackMakerTool::interfaceID ( )
inlinestaticinherited

other standard AlgTool methods

Definition at line 35 of file ITrigDkfTrackMakerTool.h.

static const InterfaceID IID_ITrigDkfTrackMakerTool("ITrigDkfTrackMakerTool", 1, 0)

◆ 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 }

◆ 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_idHelper

const AtlasDetectorID* TrigDkfTrackMakerTool::m_idHelper
private

Definition at line 35 of file TrigDkfTrackMakerTool.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: