46 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
54 return StatusCode::SUCCESS;
64 return StatusCode::SUCCESS;
77 return StatusCode::FAILURE;
85 std::vector<const TrackStateOnSurface*> material;
86 std::vector<const TrackStateOnSurface*> matPrec;
88 for (
unsigned int it = 0; it <
m_numScan + 1; it++) {
91 phi += 1 * Gaudi::Units::deg;
120 const std::vector<const Trk::TrackStateOnSurface*>* mmsentry =
m_extrapolator->extrapolateM(ctx,
124 for (
const auto& entry : *mmsentry) {
127 << entry->trackParameters()->position() <<
":"
128 << entry->trackParameters()->momentum().mag() - currPar->
momentum().mag());
131 currPar = (mmsentry->back()) ? mmsentry->back()->trackParameters() : msEntry.release();
132 const std::vector<const Trk::TrackStateOnSurface*>* peri =
m_extrapolator->extrapolateM(ctx,
140 return StatusCode::FAILURE;
142 for (
const auto& entry : *peri) {
143 if (entry && entry->trackParameters()) {
145 << entry->trackParameters()->position() <<
":"
146 << entry->trackParameters()->momentum().mag() - msEntry->momentum().mag());
150 if (peri->back() && peri->back()->trackParameters()) {
152 << initialPerigee.parameters()[0] <<
","
153 << initialPerigee.parameters()[1] <<
","
154 << initialPerigee.parameters()[2] <<
","
155 << initialPerigee.parameters()[3] <<
","
156 << initialPerigee.
momentum().mag());
158 << peri->back()->trackParameters()->parameters()[0] <<
","
159 << peri->back()->trackParameters()->parameters()[1] <<
","
160 << peri->back()->trackParameters()->parameters()[2] <<
","
161 << peri->back()->trackParameters()->parameters()[3] <<
","
162 << peri->back()->trackParameters()->momentum().mag());
164 ATH_MSG_ERROR(
"extrapolation to perigee failed for input parameters: " << msEntry->parameters());
169 ATH_MSG_ERROR(
"extrapolation to MSentry failed for input parameters: " << currPar->parameters());
181 std::pair<std::unique_ptr<Trk::TrackParameters>,
const Trk::Layer*>
next =
190 const std::vector<const Trk::TrackStateOnSurface*>* nextPrec =
m_extraprec->extrapolateM(
197 for (
const auto* i : *nextPrec) {
206 if (!lay || !nextPrec || nextPrec->empty() || !nextPrec->back())
break;
207 precPar = nextPrec->back()->trackParameters();
209 if (!material.empty())
for (
auto& i : material) {
210 if (i->materialEffectsOnTrack()) mat += i->materialEffectsOnTrack()->thicknessInX0();
214 currPar->parameters()[0] - precPar->parameters()[0],
215 currPar->parameters()[1] - precPar->parameters()[1]);
225 if (!material.empty())
for (
auto& i : material) {
226 if (i->materialEffectsOnTrack()) matc += i->materialEffectsOnTrack()->thicknessInX0();
238 if (!material.empty())
for (
auto& i : material) {
239 if (i->materialEffectsOnTrack()) {
240 mat += i->materialEffectsOnTrack()->thicknessInX0();
246 const std::vector<const Trk::TrackStateOnSurface*>* destParameters =
m_extrapolator->extrapolateM(
252 if (destParameters)
for (
const auto* destParameter : *destParameters) {
258 std::vector<const Trk::DetachedTrackingVolume*> detVols =
260 if (!detVols.empty()){
273 if (!destParameters || destParameters->empty()) {
274 ATH_MSG_ERROR(
"extrapolation to outer boundary failed for input parameters: " << initialPerigee.parameters());
275 }
else if (destParameters->back()->trackParameters()) {
279 const std::vector<const Trk::TrackStateOnSurface*>* peri =
m_extrapolator->extrapolateM(
280 ctx, *(destParameters->back()->trackParameters()),
288 for (
unsigned int i = 0; i < peri->size(); i++){
291 ATH_MSG_INFO(
"extrapolation to perigee:input: " << initialPerigee.parameters());
292 ATH_MSG_INFO(
"extrapolation to perigee:output: " << peri->back()->trackParameters()->parameters());
295 "extrapolation to perigee failed for input parameters: " <<
296 destParameters->back()->trackParameters()->parameters());
303 delete destParameters;
304 destParameters =
nullptr;
310 return StatusCode::SUCCESS;
316 std::ofstream myfilemat;
318 myfilemat <<
theta <<
" " <<
phi <<
" " << mat <<
" " << dtheta <<
" " << dphi << std::endl;
322 const std::string& name)
const {
323 std::ofstream myfilemat;
325 myfilemat <<
theta <<
" " <<
phi <<
" " <<
r <<
" " <<
z <<
" " << mat <<
" " << name << std::endl;
331 std::ofstream myfilemat;
344 *
m_err = mdest->covariance()->inverse().eval();
359 myfilemat <<
m_th <<
" " <<
m_ph <<
" " << 0 <<
" " <<
m_id << std::endl;
375 *
m_err = mdest->covariance()->inverse().eval();
392 *
m_err = mdest->covariance()->inverse().eval();
398 const std::string& name,
double mat,
double matApp,
double dx,
double dy)
const {
399 std::ofstream myfilemat;
403 <<
" " << mat <<
" " << matApp <<
" " << dx <<
" " << dy << std::endl;
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
void printMat(double th, double ph, double mat, double dtheta=0., double dphi=0.) const
BooleanProperty m_backward
StatusCode initialize()
standard Athena-Algorithm method
StatusCode execute(const EventContext &ctx)
standard Athena-Algorithm method
BooleanProperty m_domsentry
CETmaterial(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
const Trk::TrackingGeometry * m_trackingGeometry
StatusCode finalize()
standard Athena-Algorithm method
IntegerProperty m_particleType
void printMatPrec(double theta, double phi, const Trk::TrackParameters *, const Trk::TrackParameters *, double mat, int id, const std::string &name)
const char * m_matCompFile
BooleanProperty m_doprecision
void printMatScan(double theta, double phi, double r, double z, double mat, const std::string &name) const
IChronoStatSvc_t m_chronoStatSvc
const char * m_matTotFile
BooleanProperty m_printActive
~CETmaterial()
Default Destructor.
BooleanProperty m_checkStepWise
ToolHandle< IExtrapolator > m_extraprec
UnsignedIntegerProperty m_numScan
const Trk::Surface * m_outerBoundary
const char * m_matScanFile
Trk::TrackParameters * m_next
BooleanProperty m_printMaterial
void printMatComp(double theta, double phi, const Trk::TrackParameters *currPar, const std::string &name, double mat, double matApp, double dx, double dy) const
DoubleProperty m_minTheta
DoubleProperty m_maxTheta
const Trk::TrackingVolume * m_msentry
ToolHandle< IExtrapolator > m_extrapolator
The Extrapolator(s) to be retrieved.
const char * m_matActiveFile
const std::string & name() const
returns the Name
Base Class for a Detector Layer in the Tracking realm.
int layerType() const
get the Layer coding
const DetachedTrackingVolume * enclosingDetachedTrackingVolume() const
get the confining DetachedTrackingVolume
base class to integrate material effects on Trk::Track in a flexible way.
double thicknessInX0() const
returns the actually traversed material .
const Amg::Vector3D & momentum() const
Access method for the momentum.
virtual ParametersBase< DIM, T > * clone() const override=0
clone method for polymorphic deep copy
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const =0
Access to the Surface associated to the Parameters.
virtual ParametersT< DIM, T, S > * clone() const override final
Virtual clone.
virtual const S & associatedSurface() const override final
Access to the Surface method.
Class describing the Line to which the Perigee refers to.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
@ z
global position (cartesian)
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.
ParametersBase< TrackParametersDim, Charged > TrackParameters