ATLAS Offline Software
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 
15 std::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 
50 MsgStream&
51 Trk::operator<<(MsgStream& sl, const MaterialEffectsBase& meb)
52 {
53  return meb.dump(sl);
54 }
55 
57 std::ostream&
58 Trk::operator<<(std::ostream& sl, const MaterialEffectsBase& meb)
59 {
60  return meb.dump(sl);
61 }
62 
63 // Overload of << operator for MsgStream for debug output
64 MsgStream&
65 Trk::MaterialEffectsBase::dump(MsgStream& sl) const
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
84 std::ostream&
85 Trk::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 
Surface.h
Trk::MaterialEffectsBase::FittedMaterialEffects
@ FittedMaterialEffects
contains values obtained by fitting the scatterer or e-loss
Definition: MaterialEffectsBase.h:56
Trk::MaterialEffectsBase
base class to integrate material effects on Trk::Track in a flexible way.
Definition: MaterialEffectsBase.h:35
MaterialEffectsBase.h
Trk::MaterialEffectsBase::UsesMeasurement
@ UsesMeasurement
contains energy loss correction based on Calo measurement
Definition: MaterialEffectsBase.h:54
Trk::MaterialEffectsBase::dumpType
std::string dumpType() const
returns a string with the type of the object
Definition: MaterialEffectsBase.cxx:16
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Trk::MaterialEffectsBase::dump
virtual MsgStream & dump(MsgStream &sl) const
Interface method for output, can be overloaded by child classes.
Definition: MaterialEffectsBase.cxx:65
Trk::MaterialEffectsBase::ScatteringEffects
@ ScatteringEffects
contains material effects due to multiple scattering
Definition: MaterialEffectsBase.h:45
Trk::MaterialEffectsBase::type
bool type(const MaterialEffectsType &type) const
returns the flags (bits) which types of ME are present
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::MaterialEffectsBase::EnergyLossEffects
@ EnergyLossEffects
contains energy loss corrections
Definition: MaterialEffectsBase.h:48
Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes
@ NumberOfMaterialEffectsTypes
Definition: MaterialEffectsBase.h:59
Trk::MaterialEffectsBase::m_typeFlags
long m_typeFlags
Definition: MaterialEffectsBase.h:140
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::MaterialEffectsBase::BremPoint
@ BremPoint
contains q/p covariance noise term
Definition: MaterialEffectsBase.h:52
Trk::MaterialEffectsBase::MaterialThickness
@ MaterialThickness
contains only thickness, needs M.E.Updator to calculate effects
Definition: MaterialEffectsBase.h:50