ATLAS Offline Software
Loading...
Searching...
No Matches
MaterialEffectsBase.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// MaterialEffectsBase.cxx (c) ATLAS Detector software
8
10#include "GaudiKernel/MsgStream.h"
11#include "TrkSurfaces/Surface.h"
12#include <ostream>
13#include <string>
14
15std::string
17{
18 std::string type;
19 for (int i = 0; i < NumberOfMaterialEffectsTypes; ++i) {
20 if ((1 << i) & m_typeFlags) {
21 switch (i) {
23 type += "Scattering ";
24 break;
26 type += "EnergyLoss ";
27 break;
29 type += "UpdatorInput ";
30 break;
32 type += "BremPoint ";
33 break;
35 type += "UsesMeasurement ";
36 break;
38 type += "FittedMaterialEffects ";
39 break;
40 default:
41 type += "Unknown ";
42 break;
43 }
44 }
45 }
46 return type;
47}
48
50MsgStream&
51Trk::operator<<(MsgStream& sl, const MaterialEffectsBase& meb)
52{
53 return meb.dump(sl);
54}
55
57std::ostream&
58Trk::operator<<(std::ostream& sl, const MaterialEffectsBase& meb)
59{
60 return meb.dump(sl);
61}
62
63// Overload of << operator for MsgStream for debug output
64MsgStream&
66{
67 std::string name("MaterialEffects ");
68 sl << name << "type : " << dumpType() << endmsg;
69 sl << name << "thickness/X0: " << thicknessInX0() << endmsg;
70 sl << name << "Surface : ";
71 if (m_associatedSurface == nullptr) {
72 sl << "NULL";
73 } else {
74 if (m_associatedSurface->associatedDetectorElement() != nullptr) {
75 sl << "from detector Element";
76 } else {
77 sl << associatedSurface() << endmsg;
78 }
79 }
80 sl << endmsg;
81 return sl;
82}
83// Overload of << operator for std::ostream for debug output
84std::ostream&
85Trk::MaterialEffectsBase::dump(std::ostream& sl) const
86{
87 sl << "MaterialEffects type : " << dumpType() << std::endl;
88 sl << "MaterialEffects thickness/X0: " << thicknessInX0() << std::endl;
89 sl << "MaterialEffects Surface : ";
90 if (m_associatedSurface == nullptr) {
91 sl << "NULL";
92 } else {
93 if (m_associatedSurface->associatedDetectorElement() != nullptr) {
94 sl << "from detector Element";
95 } else {
96 sl << associatedSurface() << std::endl;
97 }
98 }
99 sl << std::endl;
100 return sl;
101}
102
#define endmsg
base class to integrate material effects on Trk::Track in a flexible way.
@ BremPoint
contains q/p covariance noise term
@ ScatteringEffects
contains material effects due to multiple scattering
@ UsesMeasurement
contains energy loss correction based on Calo measurement
@ FittedMaterialEffects
contains values obtained by fitting the scatterer or e-loss
@ EnergyLossEffects
contains energy loss corrections
@ MaterialThickness
contains only thickness, needs M.E.Updator to calculate effects
virtual MsgStream & dump(MsgStream &sl) const
Interface method for output, can be overloaded by child classes.
const Surface & associatedSurface() const
returns the surface to which these m.eff. are associated.
double thicknessInX0() const
returns the actually traversed material .
std::string dumpType() const
returns a string with the type of the object
bool type(const MaterialEffectsType &type) const
returns the flags (bits) which types of ME are present
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output