49 return StatusCode::FAILURE;
53 return StatusCode::FAILURE;
57 return StatusCode::SUCCESS;
68 return StatusCode::SUCCESS;
76 const EventContext& ctx = Gaudi::Hive::currentContext();
83 return StatusCode::FAILURE;
91 std::vector<const TrackStateOnSurface*> material;
92 std::vector<const TrackStateOnSurface*> matPrec;
94 for (
unsigned int it = 0; it <
m_numScan+1; it++) {
106 material.clear(); matPrec.clear();
129 const std::vector<const Trk::TrackStateOnSurface*>* mmsentry =
m_extrapolator->extrapolateM(ctx,
136 for (
const auto& entry : *mmsentry) {
139 << entry->trackParameters()->position() <<
":"
140 << entry->trackParameters()->momentum().mag() - currPar->
momentum().mag());
144 currPar = (mmsentry->back()) ? mmsentry->back()->trackParameters() : msEntry;
146 const std::vector<const Trk::TrackStateOnSurface*>* peri =
m_extrapolator->extrapolateM(ctx,
156 ATH_MSG_ERROR (
"Perigee pointer is null in CETmaterial.cxx");
158 return StatusCode::FAILURE;
160 for (
const auto& entry : *peri) {
161 if (entry && entry->trackParameters()) {
163 << entry->trackParameters()->position() <<
":"
164 << entry->trackParameters()->momentum().mag() - msEntry->
momentum().mag());
168 if (peri->back() && peri->back()->trackParameters()) {
170 << initialPerigee.parameters()[0] <<
","
171 << initialPerigee.parameters()[1] <<
","
172 << initialPerigee.parameters()[2] <<
","
173 << initialPerigee.parameters()[3] <<
","
174 << initialPerigee.
momentum().mag() );
176 << peri->back()->trackParameters()->parameters()[0] <<
","
177 << peri->back()->trackParameters()->parameters()[1] <<
","
178 << peri->back()->trackParameters()->parameters()[2] <<
","
179 << peri->back()->trackParameters()->parameters()[3] <<
","
180 << peri->back()->trackParameters()->momentum().mag() );
182 ATH_MSG_ERROR(
"extrapolation to perigee failed for input parameters: " << msEntry->parameters() );
187 ATH_MSG_ERROR(
"extrapolation to MSentry failed for input parameters: " << currPar->parameters() );
213 const std::vector<const Trk::TrackStateOnSurface*>* nextPrec =
m_extraprec->extrapolateM(
222 for (
const auto *i : *nextPrec) {
231 if (!lay || !nextPrec || nextPrec->empty() || !nextPrec->back() )
break;
232 precPar = nextPrec->back()->trackParameters();
234 if (!material.empty())
for (
auto & i : material) {
235 if (i->materialEffectsOnTrack()) mat += i->materialEffectsOnTrack()->thicknessInX0();
238 currPar->parameters()[1]-precPar->parameters()[1]);
248 if (!material.empty())
for (
auto & i : material) {
249 if (i->materialEffectsOnTrack()) matc += i->materialEffectsOnTrack()->thicknessInX0();
261 if (!material.empty())
for (
auto & i : material) {
262 if (i->materialEffectsOnTrack()) {
263 mat += i->materialEffectsOnTrack()->thicknessInX0();
269 const std::vector<const Trk::TrackStateOnSurface*>* destParameters =
m_extrapolator->extrapolateM(
279 if (destParameters)
for (
const auto *destParameter : *destParameters) {
290 std::vector<const Trk::DetachedTrackingVolume*> detVols =
m_extrapolator->trackingGeometry()->lowestDetachedTrackingVolumes(trPar->
position());
295 if (destParameters) {
303 if (!destParameters || destParameters->empty() ) {
304 ATH_MSG_ERROR(
"extrapolation to outer boundary failed for input parameters: " << initialPerigee.parameters() );
305 }
else if (destParameters->back()->trackParameters()) {
309 const std::vector<const Trk::TrackStateOnSurface*>* peri =
m_extrapolator->extrapolateM(
310 ctx, *(destParameters->back()->trackParameters()),
318 for (
unsigned int i=0; i< peri->size(); i++)
320 ATH_MSG_INFO(
"extrapolation to perigee:input: " << initialPerigee.parameters() );
321 ATH_MSG_INFO(
"extrapolation to perigee:output: " << peri->back()->trackParameters()->parameters() );
323 ATH_MSG_ERROR(
"extrapolation to perigee failed for input parameters: " << destParameters->back()->trackParameters()->parameters() );
329 delete destParameters;
335 return StatusCode::SUCCESS;
342 std::ofstream myfilemat;
344 myfilemat<<
theta<<
" "<<
phi<<
" "<<mat<<
" "<<dtheta<<
" "<<dphi<<std::endl;
350 std::ofstream myfilemat;
352 myfilemat <<
theta <<
" " <<
phi <<
" " <<
r <<
" " <<
z <<
" " << mat <<
" " << name << std::endl;
357 if (name.empty()) {};
358 std::ofstream myfilemat;
371 *
m_err = mdest->covariance()->inverse().eval();
386 myfilemat <<
m_th <<
" " <<
m_ph <<
" " << 0 <<
" " <<
m_id << std::endl;
400 *
m_err = mdest->covariance()->inverse().eval();
416 *
m_err = mdest->covariance()->inverse().eval();
423 std::ofstream myfilemat;
425 myfilemat <<
theta <<
" " <<
phi <<
" " << currPar->
position().perp() <<
" " << currPar->
position().z() <<
" " << name.substr(0,2)
426 <<
" " << mat <<
" " << matApp <<
" " << dx <<
" " << dy << std::endl;
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
void printMat(double th, double ph, double mat, double dtheta=0., double dphi=0.) const
BooleanProperty m_backward
StatusCode initialize()
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
StatusCode execute()
standard Athena-Algorithm method
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 override=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
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