24#include "CLHEP/Units/SystemOfUnits.h"
25#include "CLHEP/Vector/Rotation.h"
26#include "CLHEP/Vector/ThreeVector.h"
40 const std::string& name,
41 const IInterface* parent) :
84 s = toolSvc()->retrieveTool(
"TBCaloCoordinate",tool);
104 ATH_MSG_INFO (
"Successfully retrieved Tool CaloSurfaceBuilder "
110 StatusCode
sc = StatusCode::SUCCESS;
117 StatusCode
sc = StatusCode::SUCCESS;
123 double& etaCaloLocal,
double& phiCaloLocal)
132 ATH_MSG_WARNING (
"CaloVariables called with null Trk::TrackParameters*" ) ;
140 if (
msgLvl(MSG::DEBUG) ){
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() );
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());
159 etaCaloLocal = pt_local.eta();
160 phiCaloLocal = pt_local.phi();
171 ATH_MSG_WARNING (
"CaloLocalPoint TrkParam called with null Trk::TrackParameters*" );
176 ATH_MSG_WARNING (
"CaloLocalPoint TrkParam called with null Amg::Vector3D* pt_local" );
181 ATH_MSG_WARNING (
"CaloLocalPoint TrkParam called with null Amg::Vector3D* pt_ctb" );
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() );
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());
215 ATH_MSG_WARNING (
"TrackSeenByCalo Trk called with null Trk::TrackParameters*" );
220 ATH_MSG_WARNING (
"TrackSeenByCalo Trk called with null Amg::Vector3D* pt_local");
226 ATH_MSG_WARNING (
"TrackSeenByCalo Trk called with null Amg::Vector3D* pt_ctb");
233 bool success =
false;
242 trketa = params->eta();
243 surf =
m_calosurf->CreateUserSurface(sample, offset, trketa, caloDDMgr);
270 bool success =
false;
274 ATH_MSG_WARNING (
"TrackSeenByCalo TrkParam called with null Trk::TrackParameters*" );
280 ATH_MSG_WARNING(
"TrackSeenByCalo TrkParam called with null Amg::Vector3D* pt_local" );
285 ATH_MSG_WARNING (
"TrackSeenByCalo TrkParam called with null Amg::Vector3D* pt_ctb" );
291 double trketa = parm->
eta();
295 if (!surf)
return success;
315 const int sampling_or_module,
331 const int sampling_or_module,
347 double& trketa_atcalo,
double& trkphi_atcalo)
352 ATH_MSG_WARNING (
"TrackSeenByCalo Trk called with null Trk::TrackParameters*" );
357 ATH_MSG_WARNING (
"TrackSeenByCalo Trk called with null Amg::Vector3D* pt_local" ) ;
362 ATH_MSG_WARNING (
"TrackSeenByCalo Trk called with null Amg::Vector3D* pt_ctb" );
367 bool success =
false;
375 if ((*caloMgrHandle)->lar_geometry() ==
"H8") {
379 trketa = params->eta();
382 surf =
m_calosurf->CreateUserSurface(sample, offset, trketa, (*caloMgrHandle));
393 trketa_atcalo = param->
eta();
394 if ( sin(param->parameters()[
Trk::phi]) > 0.)
395 trkphi_atcalo = std::acos(cos(param->parameters()[
Trk::phi]));
397 trkphi_atcalo = -1. * std::acos(cos(param->parameters()[
Trk::phi]));
398 trkphi_atcalo =
m_range.fix(trkphi_atcalo);
403 trketa_atcalo = 999999.;
404 trkphi_atcalo = 999999.;
429 ATH_MSG_WARNING (
"extrapolate TrkParam called with null Trk::TrackParameters*" ) ;
441 ATH_MSG_DEBUG (
"Trying to propagate TrackParameters to Surface ... "
446 Gaudi::Hive::currentContext(),
478 ATH_MSG_DEBUG (
"Trying to propagate to Surface ... " << (*surf) );
481 Gaudi::Hive::currentContext(),
505 const EventContext& ctx = Gaudi::Hive::currentContext();
507 if (vertex.vxTrackAtVertexAvailable())
511 for (
const auto& trkAtVertex : vertex.vxTrackAtVertex())
517 momentum += paramAtVertex->
momentum();
520 else if (vertex.nTrackParticles() == 1)
524 unsigned int index(0);
530 momentum += tp->curvilinearParameters(
index).momentum();
538 for (
unsigned int i = 0; i < vertex.nTrackParticles(); ++i)
547 tp->perigeeParameters(),
554 momentum += params->momentum();
571 const Trk::Surface* surface =
m_calosurf->CreateUserSurface (sample, 0. ,
momentum.eta());
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
CaloCell_Base_ID::SUBCALO SUBCALO
CaloSampling::CaloSample CaloSample
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:
This class provides the client interface for accessing the detector description information common to...
double eta() const
Access method for pseudorapidity - from momentum.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
Class describing the Line to which the Perigee refers to.
Abstract Base Class for tracking surfaces.
Intersection straightLineIntersection(const T &pars, bool forceDir=false, const Trk::BoundaryCheck &bchk=false) const
fst straight line intersection schema - templated for charged and neutral parameters
const DataVector< const TrackParameters > * trackParameters() const
Return a pointer to a vector of TrackParameters.
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersBase< TrackParametersDim, Charged > TrackParameters
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
@ FirstMeasurement
Parameter defined at the position of the 1st measurement.