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

This class takes a given TrkTrack, extrapolates it to the Calo and returns the variables needed to compare with the cluster position. More...

#include <TBExtrapolTrackToCaloTool.h>

Inheritance diagram for TBExtrapolTrackToCaloTool:
Collaboration diagram for TBExtrapolTrackToCaloTool:

Public Member Functions

 TBExtrapolTrackToCaloTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TBExtrapolTrackToCaloTool ()
virtual StatusCode initialize () override
virtual StatusCode finalize () override
void CaloVariables (const Trk::TrackParameters *parm, double &etaCaloLocal, double &phiCaloLocal)
 now return the variables needed to compare with CaloClusters:
void CaloLocalPoint (const Trk::TrackParameters *parm, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
bool TrackSeenByCalo (const Trk::Track *trk, const CaloCell_ID::CaloSample sample, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
 The "do-it-all" method which combines the 3 steps.
bool TrackSeenByCalo (const Trk::TrackParameters *parm, const CaloCell_ID::CaloSample sample, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
bool TrackSeenByCalo (const Trk::Track *trk, const bool barrel, const CaloCell_ID::SUBCALO subcalo, const int sampling_or_module, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
bool TrackSeenByCalo (const Trk::TrackParameters *parm, const bool barrel, const CaloCell_ID::SUBCALO subcalo, const int sampling_or_module, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
bool TrackSeenByCalo (const Trk::Track *trk, const CaloCell_ID::CaloSample sample, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local, double &trketa_atcalo, double &trkphi_atcalo)
const Trk::TrackParametersextrapolate (const Trk::Track &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
const Trk::TrackParametersextrapolate (const Trk::TrackParticleBase &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
const Trk::TrackParametersextrapolate (const Trk::TrackParameters &, const CaloCell_ID::CaloSample, const double, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
const Trk::NeutralParametersextrapolate (const Trk::NeutralParameters &, const CaloCell_ID::CaloSample, const double, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
virtual const Trk::TrackParametersextrapolate (const xAOD::TrackParticle &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
virtual const Trk::NeutralParametersextrapolate (const xAOD::NeutralParticle &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum) const
 get Trk::NeutralParameters at the calorimeter sample from xAOD::NeutralParticle
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo (const Trk::TrackParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
virtual const DataVector< const Trk::NeutralParameters > * getParametersInCalo (const Trk::NeutralParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo (const Trk::TrackParticleBase &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo (const Trk::Track &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
virtual const DataVector< const Trk::TrackParameters > * getParametersInCalo (const xAOD::TrackParticle &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
ImpactInCalogetImpactInCalo (const Trk::Track &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
ImpactInCalogetImpactInCalo (const Trk::TrackParticleBase &, const Trk::ParticleHypothesis=Trk::undefined, const Trk::PropDirection=Trk::alongMomentum) const
virtual ImpactInCalogetImpactInCalo (const Trk::TrackParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
virtual ImpactInCalogetImpactInCalo (const Trk::NeutralParameters &, Trk::ParticleHypothesis, const Trk::PropDirection=Trk::alongMomentum) const
CaloDepthToolgetCaloDepth ()
 access to the private tool used to define the extrapolation depth, needed to play with delta-eta
const Trk::TrackParametersextrapolate (const Trk::TrackParameters *parm, const Trk::Surface *surf)
 to be used on AOD's or to extrapolate from perigee
const Trk::TrackParametersextrapolate (const Trk::Track *trk, const Trk::Surface *surf)
 will use the last measured hit, will not work on AOD's
virtual Amg::Vector3D getMomentumAtVertex (const xAOD::Vertex &vertex, bool) 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 ()

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

SG::ReadCondHandleKey< CaloDetDescrManagerm_caloMgrKey
const CaloCell_IDm_calo_id {nullptr}
ICaloCoordinateToolm_calo_tb_coord {nullptr}
CaloPhiRange m_range
ToolHandle< ICaloSurfaceBuilderm_calosurf
ToolHandle< Trk::IExtrapolatorm_extrapolator
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

This class takes a given TrkTrack, extrapolates it to the Calo and returns the variables needed to compare with the cluster position.

It heavily uses the Tracking PreconfiguredExtrapolator class.

The client is asked to select explicitely the CaloCell_ID::CaloSample where he wants to extrapolate. The 4 steps are combined :

  • first guess of eta : take it from last point measured for Trk::Track or the imput Trk::Parameters
  • CreateUserSurface(sample,offset,trketa)
  • extrapolate
  • compute calo variables ( neeed for H8, for Atlas correspond to the usual eta/phi )

The extrapolarion is performed WITH boundary checks.

INTERFACE :

Calorimeter : the enum CaloCell_ID::CaloSample is strongly recommended, the other one being here for backward compatibility.

Trk::Trk is recommended while running the full reconstruction or on ESD. If so, the extrapolation starts from the last measured point.

Trk::Parameter is mandatory while running on AOD's and can be used if you want to start the extrapolation from the perigee.

BEHIND THE SCEENE : the tools of the package CaloTrackingGeometry/CaloSurfaceBuilder are used to create the proper geometry elements ( Trk::Surface, Trk::Layer, Trk::Volume )

Definition at line 82 of file TBExtrapolTrackToCaloTool.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

◆ TBExtrapolTrackToCaloTool()

TBExtrapolTrackToCaloTool::TBExtrapolTrackToCaloTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 39 of file TBExtrapolTrackToCaloTool.cxx.

41 :
42 AthAlgTool(type, name, parent),
43 m_calosurf("CaloSurfaceBuilder"),
44 m_extrapolator("Trk::Extrapolator/AtlasExtrapolator")
45{
46
47 declareProperty ("CaloSurfaceBuilder",m_calosurf,"Extrapolation ToolHandle");
48 declareProperty ("Extrapolator",m_extrapolator,"CaloSurfaceBuilder ToolHandle");
49
50}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< Trk::IExtrapolator > m_extrapolator
ToolHandle< ICaloSurfaceBuilder > m_calosurf

◆ ~TBExtrapolTrackToCaloTool()

TBExtrapolTrackToCaloTool::~TBExtrapolTrackToCaloTool ( )
virtual

Definition at line 52 of file TBExtrapolTrackToCaloTool.cxx.

53{}

Member Function Documentation

◆ CaloLocalPoint()

void TBExtrapolTrackToCaloTool::CaloLocalPoint ( const Trk::TrackParameters * parm,
Amg::Vector3D * pt_ctb,
Amg::Vector3D * pt_local )

Definition at line 165 of file TBExtrapolTrackToCaloTool.cxx.

168{
169
170 if (!parm) {
171 ATH_MSG_WARNING ("CaloLocalPoint TrkParam called with null Trk::TrackParameters*" );
172 return;
173 }
174
175 if (!pt_local) {
176 ATH_MSG_WARNING ("CaloLocalPoint TrkParam called with null Amg::Vector3D* pt_local" );
177 return;
178 }
179
180 if (!pt_ctb) {
181 ATH_MSG_WARNING ("CaloLocalPoint TrkParam called with null Amg::Vector3D* pt_ctb" );
182 return;
183 }
184
185
186 *pt_ctb = parm->position();
187
188 ATH_MSG_DEBUG ("Impact point in ctb coord : x,y,z= "
189 << pt_ctb->x() << " "
190 << pt_ctb->y() << " " << pt_ctb->z() << " R="
191 << std::sqrt( pt_ctb->x()*pt_ctb->x() + pt_ctb->y()*pt_ctb->y()
192 + pt_ctb->z()*pt_ctb->z())
193 << " eta=" << pt_ctb->eta() << " phi=" << pt_ctb->phi() );
194
195 m_calo_tb_coord->ctb_to_local(*pt_ctb, *pt_local);
196
197 ATH_MSG_DEBUG ("Impact point in local coord : x,y,z= "
198 << pt_local->x() << " "
199 << pt_local->y() << " " << pt_local->z() << " R="
200 << std::sqrt( pt_local->x()*pt_local->x()
201 + pt_local->y()*pt_local->y()
202 + pt_local->z()*pt_local->z())
203 << " eta=" << pt_local->eta() << " phi=" << pt_local->phi());
204}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
const Amg::Vector3D & position() const
Access method for the position.

◆ CaloVariables()

void TBExtrapolTrackToCaloTool::CaloVariables ( const Trk::TrackParameters * parm,
double & etaCaloLocal,
double & phiCaloLocal )

now return the variables needed to compare with CaloClusters:

Definition at line 122 of file TBExtrapolTrackToCaloTool.cxx.

124{
125
126
127 Amg::Vector3D pt_ctb,pt_local;
128 etaCaloLocal = 0.;
129 phiCaloLocal = 0.;
130
131 if (!parm) {
132 ATH_MSG_WARNING ("CaloVariables called with null Trk::TrackParameters*" ) ;
133 return;
134 }
135
136 pt_ctb = parm->position();
137
138 m_calo_tb_coord->ctb_to_local(pt_ctb, pt_local);
139
140 if ( msgLvl(MSG::DEBUG) ){
141
142 ATH_MSG_DEBUG ("Impact point in ctb coord : x,y,z= "
143 << pt_ctb.x() << " "
144 << pt_ctb.y() << " " << pt_ctb.z() << " R="
145 << std::sqrt( pt_ctb.x()*pt_ctb.x() + pt_ctb.y()*pt_ctb.y()
146 + pt_ctb.z()*pt_ctb.z())
147 << " eta=" << pt_ctb.eta() << " phi=" << pt_ctb.phi() );
148
149
150
151 ATH_MSG_DEBUG ("Impact point in local coord : x,y,z= "
152 << pt_local.x() << " "
153 << pt_local.y() << " " << pt_local.z() << " R="
154 << std::sqrt( pt_local.x()*pt_local.x() + pt_local.y()*pt_local.y()
155 + pt_local.z()*pt_local.z())
156 << " eta=" << pt_local.eta() << " phi=" << pt_local.phi());
157 }
158
159 etaCaloLocal = pt_local.eta();
160 phiCaloLocal = pt_local.phi();
161
162}
bool msgLvl(const MSG::Level lvl) const
Eigen::Matrix< double, 3, 1 > Vector3D

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

◆ 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

◆ extrapolate() [1/8]

const Trk::NeutralParameters * TBExtrapolTrackToCaloTool::extrapolate ( const Trk::NeutralParameters & ,
const CaloCell_ID::CaloSample ,
const double ,
Trk::ParticleHypothesis ,
const Trk::PropDirection = Trk::alongMomentum ) const
inline

Definition at line 162 of file TBExtrapolTrackToCaloTool.h.

166 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ extrapolate() [2/8]

const Trk::TrackParameters * TBExtrapolTrackToCaloTool::extrapolate ( const Trk::Track & ,
const CaloCell_ID::CaloSample ,
const double ,
const Trk::PropDirection = Trk::alongMomentum,
const Trk::ParticleHypothesis = Trk::undefined ) const
inline

Definition at line 144 of file TBExtrapolTrackToCaloTool.h.

148 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ extrapolate() [3/8]

const Trk::TrackParameters * TBExtrapolTrackToCaloTool::extrapolate ( const Trk::Track * trk,
const Trk::Surface * surf )

will use the last measured hit, will not work on AOD's

Definition at line 460 of file TBExtrapolTrackToCaloTool.cxx.

462{
463
464 const Trk::TrackParameters* param=0;
465 if (!trk) {
466 ATH_MSG_WARNING ("extrapolate Trk called with null Trk::Track*");
467 return param;
468 }
469
470 if (!surf) {
471 ATH_MSG_WARNING ("extrapolate Trk called with null Trk::Surface*" );
472 return param;
473 }
474
475
476
477
478 ATH_MSG_DEBUG ("Trying to propagate to Surface ... " << (*surf) );
479
480 param = m_extrapolator->extrapolateTrack(
481 Gaudi::Hive::currentContext(),
482 *trk, *surf,
484 true, Trk::nonInteracting).release();
485
486 // the other way to do it:
487 //
488 // const TrackParameters* extrapolate(const Trk::Propagator& prop,
489 // const Trk::Track& trk,
490 // const Trk::Surface& sf,
491 // Trk::PropDirectiondir=anyDirection,Trk::BoundaryCheck bcheck = true)
492 // const;
493
494 if (param)
495 ATH_MSG_DEBUG ("Propagation successful " );
496 else
497 ATH_MSG_DEBUG ("Propagation failed ");
498
499 return param;
500}
@ alongMomentum
ParametersBase< TrackParametersDim, Charged > TrackParameters

◆ extrapolate() [4/8]

const Trk::TrackParameters * TBExtrapolTrackToCaloTool::extrapolate ( const Trk::TrackParameters & ,
const CaloCell_ID::CaloSample ,
const double ,
Trk::ParticleHypothesis ,
const Trk::PropDirection = Trk::alongMomentum ) const
inline

Definition at line 156 of file TBExtrapolTrackToCaloTool.h.

160 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ extrapolate() [5/8]

const Trk::TrackParameters * TBExtrapolTrackToCaloTool::extrapolate ( const Trk::TrackParameters * parm,
const Trk::Surface * surf )

to be used on AOD's or to extrapolate from perigee

Definition at line 421 of file TBExtrapolTrackToCaloTool.cxx.

423{
424
425
426 const Trk::TrackParameters* param=0;
427
428 if (!parm) {
429 ATH_MSG_WARNING ("extrapolate TrkParam called with null Trk::TrackParameters*" ) ;
430 return param;
431 }
432
433 if (!surf) {
434 ATH_MSG_WARNING ("extrapolate TrkParam called with null Trk::Surface*" << endmsg );
435 return param;
436 }
437
438
439
440
441 ATH_MSG_DEBUG ( "Trying to propagate TrackParameters to Surface ... "
442 << (*surf));
443
444 // for the moment use nonInteracting to avoid the navigation
445 param = m_extrapolator->extrapolate(
446 Gaudi::Hive::currentContext(),
447 *parm, *surf,
449 true, Trk::nonInteracting).release();
450
451 if (param)
452 ATH_MSG_DEBUG ("Propagation successful ");
453 else
454 ATH_MSG_DEBUG ("Propagation failed ");
455
456 return param;
457}
#define endmsg

◆ extrapolate() [6/8]

const Trk::TrackParameters * TBExtrapolTrackToCaloTool::extrapolate ( const Trk::TrackParticleBase & ,
const CaloCell_ID::CaloSample ,
const double ,
const Trk::PropDirection = Trk::alongMomentum,
const Trk::ParticleHypothesis = Trk::undefined ) const
inline

Definition at line 150 of file TBExtrapolTrackToCaloTool.h.

154 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ extrapolate() [7/8]

virtual const Trk::NeutralParameters * TBExtrapolTrackToCaloTool::extrapolate ( const xAOD::NeutralParticle & ,
const CaloCell_ID::CaloSample ,
const double ,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

get Trk::NeutralParameters at the calorimeter sample from xAOD::NeutralParticle

Definition at line 176 of file TBExtrapolTrackToCaloTool.h.

180 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ extrapolate() [8/8]

virtual const Trk::TrackParameters * TBExtrapolTrackToCaloTool::extrapolate ( const xAOD::TrackParticle & ,
const CaloCell_ID::CaloSample ,
const double ,
const Trk::PropDirection = Trk::alongMomentum,
const Trk::ParticleHypothesis = Trk::undefined ) const
inlinevirtual

Definition at line 168 of file TBExtrapolTrackToCaloTool.h.

173 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ finalize()

StatusCode TBExtrapolTrackToCaloTool::finalize ( )
overridevirtual

Definition at line 115 of file TBExtrapolTrackToCaloTool.cxx.

116{
117 StatusCode sc = StatusCode::SUCCESS;
118 return sc;
119}
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ getCaloDepth()

CaloDepthTool * TBExtrapolTrackToCaloTool::getCaloDepth ( )

access to the private tool used to define the extrapolation depth, needed to play with delta-eta

Definition at line 412 of file TBExtrapolTrackToCaloTool.cxx.

413{
414 if (m_calosurf==0) return nullptr;
415
416 // getCaloDepth from the surface builder
417 return m_calosurf->getCaloDepth();
418}

◆ getImpactInCalo() [1/4]

virtual ImpactInCalo * TBExtrapolTrackToCaloTool::getImpactInCalo ( const Trk::NeutralParameters & ,
Trk::ParticleHypothesis ,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 215 of file TBExtrapolTrackToCaloTool.h.

217 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getImpactInCalo() [2/4]

ImpactInCalo * TBExtrapolTrackToCaloTool::getImpactInCalo ( const Trk::Track & ,
const Trk::ParticleHypothesis = Trk::undefined,
const Trk::PropDirection = Trk::alongMomentum ) const
inline

Definition at line 203 of file TBExtrapolTrackToCaloTool.h.

205 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getImpactInCalo() [3/4]

virtual ImpactInCalo * TBExtrapolTrackToCaloTool::getImpactInCalo ( const Trk::TrackParameters & ,
Trk::ParticleHypothesis ,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 211 of file TBExtrapolTrackToCaloTool.h.

213 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getImpactInCalo() [4/4]

ImpactInCalo * TBExtrapolTrackToCaloTool::getImpactInCalo ( const Trk::TrackParticleBase & ,
const Trk::ParticleHypothesis = Trk::undefined,
const Trk::PropDirection = Trk::alongMomentum ) const
inline

Definition at line 207 of file TBExtrapolTrackToCaloTool.h.

209 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getMomentumAtVertex()

Amg::Vector3D TBExtrapolTrackToCaloTool::getMomentumAtVertex ( const xAOD::Vertex & vertex,
bool  ) const
virtual

Definition at line 503 of file TBExtrapolTrackToCaloTool.cxx.

504{
505 const EventContext& ctx = Gaudi::Hive::currentContext();
506 Amg::Vector3D momentum(0., 0., 0.);
507 if (vertex.vxTrackAtVertexAvailable())
508 {
509 // Use the parameters at the vertex
510 // (the tracks should be parallel but we will do the sum anyway)
511 for (const auto& trkAtVertex : vertex.vxTrackAtVertex())
512 {
513 const Trk::TrackParameters* paramAtVertex = trkAtVertex.perigeeAtVertex();
514 if (!paramAtVertex)
515 ATH_MSG_WARNING("VxTrackAtVertex does not have perigee at vertex");
516 else
517 momentum += paramAtVertex->momentum();
518 }
519 }
520 else if (vertex.nTrackParticles() == 1)
521 {
522 // Use the first measurement
523 const xAOD::TrackParticle *tp = vertex.trackParticle(0);
524 unsigned int index(0);
525 if (!tp || !tp->indexOfParameterAtPosition(index, xAOD::FirstMeasurement))
526 {
527 ATH_MSG_WARNING("No TrackParticle or no have first measurement");
528 }
529 else
530 momentum += tp->curvilinearParameters(index).momentum();
531 // OR last 3 values of trackParameters(index)
532 }
533 else
534 {
535 // Extrapolate track particles to vertex
536 // (the tracks should be parallel but we will do the sum anyway)
537 const Trk::PerigeeSurface *surface = new Trk::PerigeeSurface(vertex.position());
538 for (unsigned int i = 0; i < vertex.nTrackParticles(); ++i)
539 {
540 const xAOD::TrackParticle* tp = vertex.trackParticle( i );
541 if (!tp)
542 {
543 ATH_MSG_WARNING("NULL pointer to TrackParticle in vertex");
544 continue;
545 }
546 const Trk::TrackParameters* params = m_extrapolator->extrapolate(ctx,
547 tp->perigeeParameters(),
548 *surface,
549 Trk::alongMomentum).release();
550 if (!params)
551 ATH_MSG_DEBUG("Extrapolation to vertex (perigee) failed");
552 else
553 {
554 momentum += params->momentum();
555 delete params;
556 }
557 }
558 delete surface;
559 }
560
561 return momentum;
562}
const Amg::Vector3D & momentum() const
Access method for the momentum.
str index
Definition DeMoScan.py:362
TrackParticle_v1 TrackParticle
Reference the current persistent version:
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.

◆ getParametersInCalo() [1/5]

virtual const DataVector< const Trk::NeutralParameters > * TBExtrapolTrackToCaloTool::getParametersInCalo ( const Trk::NeutralParameters & ,
Trk::ParticleHypothesis ,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 186 of file TBExtrapolTrackToCaloTool.h.

188 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getParametersInCalo() [2/5]

virtual const DataVector< const Trk::TrackParameters > * TBExtrapolTrackToCaloTool::getParametersInCalo ( const Trk::Track & ,
const Trk::ParticleHypothesis = Trk::undefined,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 194 of file TBExtrapolTrackToCaloTool.h.

196 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getParametersInCalo() [3/5]

virtual const DataVector< const Trk::TrackParameters > * TBExtrapolTrackToCaloTool::getParametersInCalo ( const Trk::TrackParameters & ,
Trk::ParticleHypothesis ,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 182 of file TBExtrapolTrackToCaloTool.h.

184 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getParametersInCalo() [4/5]

virtual const DataVector< const Trk::TrackParameters > * TBExtrapolTrackToCaloTool::getParametersInCalo ( const Trk::TrackParticleBase & ,
const Trk::ParticleHypothesis = Trk::undefined,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 190 of file TBExtrapolTrackToCaloTool.h.

192 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ getParametersInCalo() [5/5]

virtual const DataVector< const Trk::TrackParameters > * TBExtrapolTrackToCaloTool::getParametersInCalo ( const xAOD::TrackParticle & ,
const Trk::ParticleHypothesis = Trk::undefined,
const Trk::PropDirection = Trk::alongMomentum ) const
inlinevirtual

Definition at line 198 of file TBExtrapolTrackToCaloTool.h.

200 {std::cout<<"Not Implemented !!!!"<<std::endl; return 0;}

◆ initialize()

StatusCode TBExtrapolTrackToCaloTool::initialize ( )
overridevirtual

Definition at line 56 of file TBExtrapolTrackToCaloTool.cxx.

57{
58
59 // at this point the joboption should have been read
60 ATH_CHECK(m_caloMgrKey.initialize());
61 ATH_CHECK(detStore()->retrieve(m_calo_id,"CaloCell_ID"));
62
63
64
65 ATH_MSG_DEBUG ( " getting started ");
66
67
68
69 // Get TrkExtrapolator from ToolService
70 StatusCode s=m_extrapolator.retrieve();
71
72 if (s.isFailure())
73 {
74 ATH_MSG_FATAL ( "Could not find Tool "
75 << m_extrapolator.name() << " with parent " << m_extrapolator.parentName() );
76 return s;
77 } else
78 {
79 ATH_MSG_INFO ( "Successfully retrieved tool " << m_extrapolator.typeAndName() << " with parent " << m_extrapolator.parentName() ) ;
80 }
81
82
83 IAlgTool* tool;
84 s = toolSvc()->retrieveTool("TBCaloCoordinate",tool);
85 if (s.isFailure())
86 {
87 ATH_MSG_FATAL ("Could not find Tool TBCaloCoordinate" );
88
89 return s;
90 }
91 m_calo_tb_coord = dynamic_cast<ICaloCoordinateTool*>(tool);
92
93
94
95 // Get the CaloSurface tool and sets the depthtool it should use:
96 s=m_calosurf.retrieve();
97
98 if (s.isFailure())
99 {
100 ATH_MSG_FATAL ("Could not find Tool CaloSurfaceBuilder"
101 << m_calosurf.typeAndName());
102 return s;
103 } else {
104 ATH_MSG_INFO ("Successfully retrieved Tool CaloSurfaceBuilder "
105 << m_calosurf.typeAndName());
106
107 }
108
109
110 StatusCode sc = StatusCode::SUCCESS;
111 return sc;
112}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
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 & TBExtrapolTrackToCaloTool::interfaceID ( )
inlinestatic

Definition at line 87 of file TBExtrapolTrackToCaloTool.h.

static const InterfaceID IID_TBExtrapolTrackToCaloTool("TBExtrapolTrackToCaloTool", 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.

◆ TrackSeenByCalo() [1/5]

bool TBExtrapolTrackToCaloTool::TrackSeenByCalo ( const Trk::Track * trk,
const bool barrel,
const CaloCell_ID::SUBCALO subcalo,
const int sampling_or_module,
const double offset,
Amg::Vector3D * pt_ctb,
Amg::Vector3D * pt_local )

Definition at line 312 of file TBExtrapolTrackToCaloTool.cxx.

319{
320
321
323 CaloDetDescrManager::build_sample ( subcalo, barrel ,sampling_or_module, sample);
324 return TrackSeenByCalo(trk,sample,offset,pt_ctb,pt_local);
325}
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
static void build_sample(CaloCell_ID::SUBCALO subCalo, bool barrel, int sampling_or_module, CaloCell_ID::CaloSample &sample)
translate between the 2 ways to label a sub-detector:
bool TrackSeenByCalo(const Trk::Track *trk, const CaloCell_ID::CaloSample sample, const double offset, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
The "do-it-all" method which combines the 3 steps.

◆ TrackSeenByCalo() [2/5]

bool TBExtrapolTrackToCaloTool::TrackSeenByCalo ( const Trk::Track * trk,
const CaloCell_ID::CaloSample sample,
const double offset,
Amg::Vector3D * pt_ctb,
Amg::Vector3D * pt_local )

The "do-it-all" method which combines the 3 steps.

Definition at line 207 of file TBExtrapolTrackToCaloTool.cxx.

212{
213
214 if (!trk) {
215 ATH_MSG_WARNING ("TrackSeenByCalo Trk called with null Trk::TrackParameters*" );
216 return false;
217 }
218
219 if (!pt_local) {
220 ATH_MSG_WARNING ("TrackSeenByCalo Trk called with null Amg::Vector3D* pt_local");
221
222 return false;
223 }
224
225 if (!pt_ctb) {
226 ATH_MSG_WARNING ("TrackSeenByCalo Trk called with null Amg::Vector3D* pt_ctb");
227
228 return false;
229 }
230
231
232 Trk::Surface* surf = 0;
233 bool success = false;
234 double trketa = 0.;
235 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{ m_caloMgrKey };
236 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
237 // Take eta of the last measured hit as best guess and create surface :
238 const DataVector<const Trk::TrackParameters>* paramvec =
239 trk->trackParameters();
240 if (paramvec) {
241 for (const Trk::TrackParameters* params : *paramvec)
242 trketa = params->eta();
243 surf = m_calosurf->CreateUserSurface(sample, offset, trketa, caloDDMgr);
244 }
245 if (!surf)
246 return success;
247
248 //std::cout << " here we go : " << std::endl;
249 const Trk::TrackParameters* param = extrapolate(trk,surf);
250
251
252
253 if(param) {
254 CaloLocalPoint (param,pt_ctb, pt_local);
255 success = true;
256 delete param;
257 }
258 delete surf;
259
260 return success;
261}
void CaloLocalPoint(const Trk::TrackParameters *parm, Amg::Vector3D *pt_ctb, Amg::Vector3D *pt_local)
const Trk::TrackParameters * extrapolate(const Trk::Track &, const CaloCell_ID::CaloSample, const double, const Trk::PropDirection=Trk::alongMomentum, const Trk::ParticleHypothesis=Trk::undefined) const
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.

◆ TrackSeenByCalo() [3/5]

bool TBExtrapolTrackToCaloTool::TrackSeenByCalo ( const Trk::Track * trk,
const CaloCell_ID::CaloSample sample,
const double offset,
Amg::Vector3D * pt_ctb,
Amg::Vector3D * pt_local,
double & trketa_atcalo,
double & trkphi_atcalo )

Definition at line 342 of file TBExtrapolTrackToCaloTool.cxx.

348{
349
350
351 if (!trk) {
352 ATH_MSG_WARNING ("TrackSeenByCalo Trk called with null Trk::TrackParameters*" );
353 return false;
354 }
355
356 if (!pt_local) {
357 ATH_MSG_WARNING ("TrackSeenByCalo Trk called with null Amg::Vector3D* pt_local" ) ;
358 return false;
359 }
360
361 if (!pt_ctb) {
362 ATH_MSG_WARNING ("TrackSeenByCalo Trk called with null Amg::Vector3D* pt_ctb" );
363 return false;
364 }
365
366 Trk::Surface* surf = 0;
367 bool success = false;
368 double trketa = 0.;
369
370 // Take eta of the last measured hit as best guess and create surface :
371 const DataVector<const Trk::TrackParameters>* paramvec =
372 trk->trackParameters();
373 if (paramvec) {
374 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{ m_caloMgrKey };
375 if ((*caloMgrHandle)->lar_geometry() == "H8") {
376 trketa = m_calo_tb_coord->beam_local_eta();
377 } else {
378 for (const Trk::TrackParameters* params : *paramvec)
379 trketa = params->eta();
380 }
381
382 surf = m_calosurf->CreateUserSurface(sample, offset, trketa, (*caloMgrHandle));
383 }
384 if (!surf)
385 return success;
386
387 const Trk::TrackParameters* param = extrapolate(trk,surf);
388
389
390
391 if(param) {
392 CaloLocalPoint (param,pt_ctb, pt_local);
393 trketa_atcalo = param->eta();
394 if ( sin(param->parameters()[Trk::phi]) > 0.)
395 trkphi_atcalo = std::acos(cos(param->parameters()[Trk::phi]));
396 else
397 trkphi_atcalo = -1. * std::acos(cos(param->parameters()[Trk::phi]));
398 trkphi_atcalo = m_range.fix(trkphi_atcalo);
399 success = true;
400 delete param;
401 }
402 else {
403 trketa_atcalo = 999999.;
404 trkphi_atcalo = 999999.;
405 }
406 delete surf;
407
408 return success;
409}
double eta() const
Access method for pseudorapidity - from momentum.
@ phi
Definition ParamDefs.h:75

◆ TrackSeenByCalo() [4/5]

bool TBExtrapolTrackToCaloTool::TrackSeenByCalo ( const Trk::TrackParameters * parm,
const bool barrel,
const CaloCell_ID::SUBCALO subcalo,
const int sampling_or_module,
const double offset,
Amg::Vector3D * pt_ctb,
Amg::Vector3D * pt_local )

Definition at line 328 of file TBExtrapolTrackToCaloTool.cxx.

335{
337 CaloDetDescrManager::build_sample ( subcalo, barrel ,sampling_or_module, sample);
338 return TrackSeenByCalo(parm,sample,offset,pt_ctb,pt_local);
339}

◆ TrackSeenByCalo() [5/5]

bool TBExtrapolTrackToCaloTool::TrackSeenByCalo ( const Trk::TrackParameters * parm,
const CaloCell_ID::CaloSample sample,
const double offset,
Amg::Vector3D * pt_ctb,
Amg::Vector3D * pt_local )

Definition at line 264 of file TBExtrapolTrackToCaloTool.cxx.

269{
270 bool success = false;
271
272
273 if (!parm) {
274 ATH_MSG_WARNING ("TrackSeenByCalo TrkParam called with null Trk::TrackParameters*" );
275 return false;
276 }
277
278 if (!pt_local) {
279
280 ATH_MSG_WARNING("TrackSeenByCalo TrkParam called with null Amg::Vector3D* pt_local" );
281 return false;
282 }
283
284 if (!pt_ctb) {
285 ATH_MSG_WARNING ("TrackSeenByCalo TrkParam called with null Amg::Vector3D* pt_ctb" );
286 return false;
287 }
288
289
290 // Take eta as best guess of track direction and create surface :
291 double trketa = parm->eta();
292 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{ m_caloMgrKey };
293 const CaloDetDescrManager* caloDDMgr = *caloMgrHandle;
294 Trk::Surface* surf = m_calosurf->CreateUserSurface (sample,offset,trketa,caloDDMgr);
295 if (!surf) return success;
296
297 const Trk::TrackParameters* resparam = extrapolate(parm,surf);
298
299
300
301 if(resparam) {
302 CaloLocalPoint (resparam,pt_ctb, pt_local);
303 success = true;
304 delete resparam;
305 }
306 delete surf;
307
308 return success;
309}

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

const CaloCell_ID* TBExtrapolTrackToCaloTool::m_calo_id {nullptr}
private

Definition at line 248 of file TBExtrapolTrackToCaloTool.h.

248{nullptr};

◆ m_calo_tb_coord

ICaloCoordinateTool* TBExtrapolTrackToCaloTool::m_calo_tb_coord {nullptr}
private

Definition at line 249 of file TBExtrapolTrackToCaloTool.h.

249{nullptr};

◆ m_caloMgrKey

SG::ReadCondHandleKey<CaloDetDescrManager> TBExtrapolTrackToCaloTool::m_caloMgrKey
private
Initial value:
{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }

Definition at line 243 of file TBExtrapolTrackToCaloTool.h.

243 { this
244 , "CaloDetDescrManager"
245 , "CaloDetDescrManager"
246 , "SG Key for CaloDetDescrManager in the Condition Store" };

◆ m_calosurf

ToolHandle<ICaloSurfaceBuilder> TBExtrapolTrackToCaloTool::m_calosurf
private

Definition at line 254 of file TBExtrapolTrackToCaloTool.h.

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

ToolHandle< Trk::IExtrapolator > TBExtrapolTrackToCaloTool::m_extrapolator
private

Definition at line 258 of file TBExtrapolTrackToCaloTool.h.

◆ m_range

CaloPhiRange TBExtrapolTrackToCaloTool::m_range
private

Definition at line 251 of file TBExtrapolTrackToCaloTool.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: