ATLAS Offline Software
Loading...
Searching...
No Matches
AssociatedMaterial.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6// AssociatedMaterial.cxx, (c) ATLAS Detector software
8
10
11#include "TrkGeometry/Layer.h"
13// Gaudi
14#include "GaudiKernel/MsgStream.h"
15// STD
16#include <iostream>
17
26
28 float steplength, float X0,
29 float L0, float A, float Z,
30 float rho, float cFactor,
31 const TrackingVolume* tvol,
32 const Layer* lay)
33 : m_materialPosition(hitpos),
34 m_correctionFactor(cFactor),
35 m_materialProperties(nullptr),
36 m_materialStep(new Trk::MaterialStep(hitpos.x(), hitpos.y(), hitpos.z(),
37 steplength, X0, L0, A, Z, rho)),
38 m_trackingVolume(tvol),
39 m_layer(lay),
40 m_cleanup(true) {}
41
43 const Amg::Vector3D& hitpos, float steplength, const Trk::Material& mat,
44 float cFactor, const TrackingVolume* tvol, const Layer* lay)
45 : m_materialPosition(hitpos),
46 m_correctionFactor(cFactor),
48 m_materialStep(nullptr),
49 m_trackingVolume(tvol),
50 m_layer(lay),
51 m_cleanup(true) {}
52
54 const Amg::Vector3D& hitpos, const Trk::MaterialProperties* mprop,
55 float cFactor, const Trk::TrackingVolume* tvol, const Trk::Layer* lay)
56 : m_materialPosition(hitpos),
57 m_correctionFactor(cFactor),
59 m_materialStep(nullptr),
60 m_trackingVolume(tvol),
61 m_layer(lay),
62 m_cleanup(false)
63
64{}
65
67 float cFactor,
68 const Trk::TrackingVolume* tvol,
69 const Trk::Layer* lay)
70 : m_materialPosition(Amg::Vector3D(ms->hitX(), ms->hitY(), ms->hitZ())),
71 m_correctionFactor(cFactor),
72 m_materialProperties(nullptr),
74 m_trackingVolume(tvol),
75 m_layer(lay),
76 m_cleanup(false) {}
77
79 const Trk::TrackingVolume* tvol,
80 const Trk::Layer* lay)
81 : m_materialPosition(hitpos),
83 m_materialProperties(nullptr),
84 m_materialStep(nullptr),
85 m_trackingVolume(tvol),
86 m_layer(lay),
87 m_cleanup(false) {}
88
101
103 Trk::AssociatedMaterial&& am) noexcept
104 : m_materialPosition(std::move(am.m_materialPosition)),
105 m_correctionFactor(am.m_correctionFactor),
106 m_materialProperties(am.m_materialProperties),
107 m_materialStep(am.m_materialStep),
108 m_trackingVolume(am.m_trackingVolume),
109 m_layer(am.m_layer),
110 m_cleanup(am.m_cleanup) {
111 am.m_materialProperties = nullptr;
112 am.m_materialStep = nullptr;
113 am.m_cleanup = false;
114}
115
137
139 Trk::AssociatedMaterial&& am) noexcept {
140 m_materialPosition = std::move(am.m_materialPosition);
141 m_correctionFactor = am.m_correctionFactor;
142 m_trackingVolume = am.m_trackingVolume;
143 m_layer = am.m_layer;
144 m_cleanup = am.m_cleanup;
145
146 if (m_materialProperties && m_materialProperties != am.m_materialProperties) {
148 }
149 m_materialProperties = am.m_materialProperties;
150 am.m_materialProperties = nullptr;
151
152 if (m_materialStep && m_materialStep != am.m_materialStep) {
153 delete m_materialStep;
154 }
155 m_materialStep = am.m_materialStep;
156 am.m_materialStep = nullptr;
157
158 am.m_cleanup = false;
159 return *this;
160}
161
168
169MsgStream& Trk::AssociatedMaterial::dump(MsgStream& sl) const {
170 sl << "----> AssociatedMaterial - recorded at (x/y/z) | r : ("
171 << m_materialPosition.x() << "/ ";
172 sl << m_materialPosition.y() << "/ ";
173 sl << m_materialPosition.z() << ")" << std::endl;
174 sl << " Material (t/x0/l0/A/Z/rho) : (" << steplength() << "/ ";
175 sl << x0() << "/ ";
176 sl << l0() << "/ ";
177 sl << A() << "/ ";
178 sl << Z() << "/ ";
179 sl << rho() << ")" << std::endl;
181 sl << " Associated to TrackingVolume : "
182 << m_trackingVolume->volumeName() << std::endl;
183 if (m_layer)
184 sl << " and Layer with Index : "
185 << m_layer->layerIndex().value() << std::endl;
186 return sl;
187}
188
189std::ostream& Trk::AssociatedMaterial::dump(std::ostream& sl) const {
190 sl << "----> AssociatedMaterial - recorded at (x/y/z) | r : ("
191 << m_materialPosition.x() << "/ ";
192 sl << m_materialPosition.y() << "/ ";
193 sl << m_materialPosition.z() << ")" << std::endl;
194 sl << " Material (t/x0/l0/A/Z/rho) : (" << steplength() << "/ ";
195 sl << x0() << "/ ";
196 sl << l0() << "/ ";
197 sl << A() << "/ ";
198 sl << Z() << "/ ";
199 sl << rho() << ")" << std::endl;
201 sl << " Associated to TrackingVolume : "
202 << m_trackingVolume->volumeName() << std::endl;
203 if (m_layer)
204 sl << " and Layer with Index : "
205 << m_layer->layerIndex().value() << std::endl;
206 return sl;
207}
208
209MsgStream& Trk::operator<<(MsgStream& sl,
210 const Trk::AssociatedMaterial& mstep) {
211 return mstep.dump(sl);
212}
213
214std::ostream& Trk::operator<<(std::ostream& sl,
215 const Trk::AssociatedMaterial& mstep) {
216 return mstep.dump(sl);
217}
218
Eigen::Matrix< double, 3, 1 > Vector3D
It is used in the Mapping process ( using MaterialSteps ), the validation and recostruction ( using M...
double x0() const
Access method : material X0/A/Z/rho.
const Trk::TrackingVolume * m_trackingVolume
double steplength() const
Access method : steplength.
AssociatedMaterial()
Default constructor.
AssociatedMaterial & operator=(const AssociatedMaterial &am)
Assignment operator.
MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
const Trk::MaterialStep * m_materialStep
const Trk::MaterialProperties * m_materialProperties
Base Class for a Detector Layer in the Tracking realm.
Definition Layer.h:72
Material with information about thickness of material.
MaterialProperties * clone() const
Pseudo-Constructor clone()
is needed for the recording of MaterialProperties from Geant4 and read them in with the mapping algor...
A common object to be contained by.
Definition Material.h:117
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
@ x
Definition ParamDefs.h:55
@ z
global position (cartesian)
Definition ParamDefs.h:57
@ y
Definition ParamDefs.h:56