ATLAS Offline Software
Public Member Functions | Static Public Attributes | List of all members
ActsMaterialStepConverterTool Class Reference

#include <ActsMaterialStepConverterTool.h>

Inheritance diagram for ActsMaterialStepConverterTool:
Collaboration diagram for ActsMaterialStepConverterTool:

Public Member Functions

virtual StatusCode initialize () override
 
 ActsMaterialStepConverterTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual const Acts::RecordedMaterialTrack convertToMaterialTrack (const Trk::MaterialStepCollection &colStep) const override
 

Static Public Attributes

static constexpr double s_tolerance {0.1}
 

Detailed Description

Definition at line 17 of file ActsMaterialStepConverterTool.h.

Constructor & Destructor Documentation

◆ ActsMaterialStepConverterTool()

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

Definition at line 23 of file ActsMaterialStepConverterTool.cxx.

25  : base_class(type, name, parent)
26 {
27 }

Member Function Documentation

◆ convertToMaterialTrack()

const Acts::RecordedMaterialTrack ActsMaterialStepConverterTool::convertToMaterialTrack ( const Trk::MaterialStepCollection colStep) const
overridevirtual

Definition at line 39 of file ActsMaterialStepConverterTool.cxx.

40 {
42  std::vector<Acts::MaterialInteraction> nStep;
43  Acts::RecordedMaterial recorded;
44  double sum_X0 = 0;
45  double sum_L0 = 0;
46 
47  // check you are working with the correct dataset, otherwise write out a warning
48  // for mapping geantinos must be produced from (0, 0, 0), hence expecting z being very small!
49  double deltaZ = colStep.back()->hitZ() - colStep.front()->hitZ();
50  double deltaR = colStep.back()->hitR() - colStep.front()->hitR();
51  double vertexZ = colStep.front()->hitZ() - (deltaZ/deltaR)*colStep.front()->hitR();
52  if (std::abs(vertexZ)>s_tolerance)
53  ATH_MSG_WARNING("z-vertex position larger than expected for material mapping. Check the beamspot config used for production of material steps!");
54 
55  Acts::Vector3 v_pos{0, 0, 0};
56  Acts::Vector3 v_imp{colStep.back()->hitX(), colStep.back()->hitY(), colStep.back()->hitZ()};
57  v_imp = v_imp.normalized();
58 
59  for(auto const step: colStep) {
60  Acts::Vector3 pos{step->hitX(), step->hitY(), step->hitZ()};
61  Acts::MaterialSlab matProp(Acts::Material::fromMassDensity(step->x0(), step->l0(), step->A(), step->Z(), (step->rho() * Acts::UnitConstants::g) ),step->steplength());
62  Acts::MaterialInteraction interaction;
63  interaction.position = pos;
64  interaction.direction = Acts::Vector3(pos.x(), pos.y(), pos.z());
65  interaction.direction = interaction.direction.normalized();
66  interaction.materialSlab = matProp;
67  sum_X0 += step->steplengthInX0();
68  sum_L0 += step->steplengthInL0();
69  nStep.push_back(interaction);
70  }
71 
72  recorded.materialInX0 = sum_X0;
73  recorded.materialInL0 = sum_L0;
74  recorded.materialInteractions = nStep;
75 
76  mTrack = std::make_pair(std::make_pair(v_pos, v_imp), recorded);
77 
78  return mTrack;
79 
80 }

◆ initialize()

StatusCode ActsMaterialStepConverterTool::initialize ( )
overridevirtual

Definition at line 30 of file ActsMaterialStepConverterTool.cxx.

31 {
32  ATH_MSG_INFO(name() << " initializing");
33 
34  return StatusCode::SUCCESS;
35 }

Member Data Documentation

◆ s_tolerance

constexpr double ActsMaterialStepConverterTool::s_tolerance {0.1}
staticconstexpr

Definition at line 30 of file ActsMaterialStepConverterTool.h.


The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Acts::RecordedMaterialTrack
std::pair< std::pair< Acts::Vector3, Acts::Vector3 >, RecordedMaterial > RecordedMaterialTrack
Recorded material track.
Definition: ActsExtrapolationAlg.cxx:43
Base_Fragment.recorded
list recorded
if USE_PDG_VALUES = True, load PDG value of sin2thetaW and particle masses/widths from parameter dict...
Definition: GeneratorFilters/share/common/Base_Fragment.py:55
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
DataVector::front
const T * front() const
Access the first element in the collection as an rvalue.
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
ActsMaterialStepConverterTool::s_tolerance
static constexpr double s_tolerance
Definition: ActsMaterialStepConverterTool.h:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArCellBinning.step
step
Definition: LArCellBinning.py:158
makeComparison.deltaZ
int deltaZ
Definition: makeComparison.py:46
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36