ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
Trk::MaterialEffectsBase Class Referenceabstract

base class to integrate material effects on Trk::Track in a flexible way. More...

#include <MaterialEffectsBase.h>

Inheritance diagram for Trk::MaterialEffectsBase:
Collaboration diagram for Trk::MaterialEffectsBase:

Public Types

enum  MaterialEffectsDerivedType { ESTIMATED_BREM_ON_TRACK = 0, MATERIAL_EFFECTS_ON_TRACK, NTYPES }
 
enum  MaterialEffectsType {
  ScatteringEffects = 0, EnergyLossEffects = 1, MaterialThickness = 2, BremPoint = 3,
  UsesMeasurement = 4, FittedMaterialEffects = 5, Unknown = 6, NumberOfMaterialEffectsTypes = 7
}
 

Public Member Functions

 MaterialEffectsBase ()
 default constructor for POOL More...
 
 MaterialEffectsBase (double thicknessInX0, const Surface &assocSurf, const std::bitset< MaterialEffectsBase::NumberOfMaterialEffectsTypes > &typePattern)
 base class constructor with information common to all types of material effects. More...
 
virtual ~MaterialEffectsBase ()=default
 destructor. More...
 
virtual MaterialEffectsBaseclone () const =0
 Virtual constructor. More...
 
std::unique_ptr< MaterialEffectsBaseuniqueClone () const
 NVI uniqueClone. More...
 
double thicknessInX0 () const
 returns the actually traversed material \( t/X_0 \). More...
 
const SurfaceassociatedSurface () const
 returns the surface to which these m.eff. are associated. More...
 
bool type (const MaterialEffectsType &type) const
 returns the flags (bits) which types of ME are present More...
 
virtual MaterialEffectsDerivedType derivedType () const =0
 Returns the concrete derived type. More...
 
std::string dumpType () const
 returns a string with the type of the object More...
 
virtual MsgStream & dump (MsgStream &sl) const
 Interface method for output, can be overloaded by child classes. More...
 
virtual std::ostream & dump (std::ostream &sl) const
 Interface method for output, can be overloaded by child classes* *‍/. More...
 
const S * surfacePtr ()
 return the ptr we hold useful for tests More...
 
const S * release () noexcept
 release ala unique_ptr release More...
 
void destroySurface () noexcept
 destroySurface deletes the ptr if not null and the surface has not a associatedDetectorElement Usefull also for testing More...
 

Static Public Member Functions

static const S * cloneHelper (const S *input)
 Helper for cloning or not when we need depending on if we have an associatedDetectorElement. More...
 

Protected Member Functions

virtual void setValues (const Surface *assocSurface)
 allows POOL converter to recreate transient links to DetStore More...
 
 MaterialEffectsBase (const MaterialEffectsBase &rhs)=default
 copy constructor More...
 
MaterialEffectsBaseoperator= (const MaterialEffectsBase &rhs)=default
 Assignment operator. More...
 
 MaterialEffectsBase (MaterialEffectsBase &&rhs)=default
 move constructor More...
 
MaterialEffectsBaseoperator= (MaterialEffectsBase &&rhs)=default
 move Assignment operator More...
 

Protected Attributes

const S * m_associatedSurface = nullptr
 

Private Attributes

double m_tInX0 {}
 \( t/X_0 \) - the traversed thickness in RadiationLengths More...
 
long m_typeFlags {}
 

Friends

class ::MaterialEffectsBaseCnv_p1
 
class ::MaterialEffectsBaseCnv_p2
 
class ::MaterialEffectsOnTrackCnv_p2
 
class ::TrackCollectionCnv
 
class ::ScatteringAngleOnTrackCnv_p1
 

Detailed Description

base class to integrate material effects on Trk::Track in a flexible way.

It holds the pointer to an associated surface (free or from DetStore) and the layer thickness which was used in estimated the material effects. In case they are external (Calo measurement) they can be 0.

Author
Wolfgang.Liebig http://consult.cern.ch/xwho/people/

Definition at line 34 of file MaterialEffectsBase.h.

Member Enumeration Documentation

◆ MaterialEffectsDerivedType

Enumerator
ESTIMATED_BREM_ON_TRACK 
MATERIAL_EFFECTS_ON_TRACK 
NTYPES 

Definition at line 37 of file MaterialEffectsBase.h.

37  {
40  NTYPES
41  };

◆ MaterialEffectsType

Enumerator
ScatteringEffects 

contains material effects due to multiple scattering

EnergyLossEffects 

contains energy loss corrections

MaterialThickness 

contains only thickness, needs M.E.Updator to calculate effects

BremPoint 

contains q/p covariance noise term

UsesMeasurement 

contains energy loss correction based on Calo measurement

FittedMaterialEffects 

contains values obtained by fitting the scatterer or e-loss

Unknown 

new category

NumberOfMaterialEffectsTypes 

Definition at line 42 of file MaterialEffectsBase.h.

43  {
47  // trouble: avoid name clash Trk::Energyloss vs MET::EnergyLoss
52  BremPoint = 3,
54  UsesMeasurement = 4,
58  Unknown = 6,
60  // WARNING need to edit MaterialEffectsOnTrack.cxx if these enums change
61  };

Constructor & Destructor Documentation

◆ MaterialEffectsBase() [1/4]

Trk::MaterialEffectsBase::MaterialEffectsBase ( )

default constructor for POOL

◆ MaterialEffectsBase() [2/4]

Trk::MaterialEffectsBase::MaterialEffectsBase ( double  thicknessInX0,
const Surface assocSurf,
const std::bitset< MaterialEffectsBase::NumberOfMaterialEffectsTypes > &  typePattern 
)

base class constructor with information common to all types of material effects.

Parameters
[in]thicknessInX0is the actually traversed materia t in terms of radiation length x0, including all projective and bending corrections.
[in]assocSurfreference to the Surface the material effects are expressed at
[in]typePatternbitset to describe and identify the type of material effects at base-class level

◆ ~MaterialEffectsBase()

virtual Trk::MaterialEffectsBase::~MaterialEffectsBase ( )
virtualdefault

destructor.

Being virtual forces derived classes to call also this base destructor

◆ MaterialEffectsBase() [3/4]

Trk::MaterialEffectsBase::MaterialEffectsBase ( const MaterialEffectsBase rhs)
protecteddefault

copy constructor

◆ MaterialEffectsBase() [4/4]

Trk::MaterialEffectsBase::MaterialEffectsBase ( MaterialEffectsBase &&  rhs)
protecteddefault

move constructor

Member Function Documentation

◆ associatedSurface()

const Surface& Trk::MaterialEffectsBase::associatedSurface ( ) const

returns the surface to which these m.eff. are associated.

◆ clone()

virtual MaterialEffectsBase* Trk::MaterialEffectsBase::clone ( ) const
pure virtual

Virtual constructor.

Implemented in Trk::MaterialEffectsOnTrack, and Trk::EstimatedBremOnTrack.

◆ cloneHelper()

template<typename S >
static const S* Trk::SurfacePtrHolderImplDetEl< S >::cloneHelper ( const S *  input)
inlinestaticinherited

Helper for cloning or not when we need depending on if we have an associatedDetectorElement.

Definition at line 236 of file SurfaceHolderImpl.h.

237  {
238  return (input && input->associatedDetectorElement() == nullptr
239  ? input->clone()
240  : input);
241  }

◆ derivedType()

virtual MaterialEffectsDerivedType Trk::MaterialEffectsBase::derivedType ( ) const
pure virtual

Returns the concrete derived type.

Implemented in Trk::MaterialEffectsOnTrack, and Trk::EstimatedBremOnTrack.

◆ destroySurface()

template<typename S >
void Trk::SurfacePtrHolderImplDetEl< S >::destroySurface ( )
inlinenoexceptinherited

destroySurface deletes the ptr if not null and the surface has not a associatedDetectorElement Usefull also for testing

Definition at line 224 of file SurfaceHolderImpl.h.

225  {
226  if (m_associatedSurface &&
227  m_associatedSurface->associatedDetectorElement() == nullptr) {
228  delete m_associatedSurface;
229  }
230  //
231  m_associatedSurface = nullptr;
232  }

◆ dump() [1/2]

MsgStream & Trk::MaterialEffectsBase::dump ( MsgStream &  sl) const
virtual

Interface method for output, can be overloaded by child classes.

Reimplemented in Trk::MaterialEffectsOnTrack, and Trk::EstimatedBremOnTrack.

Definition at line 65 of file MaterialEffectsBase.cxx.

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 }

◆ dump() [2/2]

std::ostream & Trk::MaterialEffectsBase::dump ( std::ostream &  sl) const
virtual

Interface method for output, can be overloaded by child classes* *‍/.

Reimplemented in Trk::MaterialEffectsOnTrack, and Trk::EstimatedBremOnTrack.

Definition at line 85 of file MaterialEffectsBase.cxx.

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 }

◆ dumpType()

std::string Trk::MaterialEffectsBase::dumpType ( ) const

returns a string with the type of the object

Definition at line 16 of file MaterialEffectsBase.cxx.

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 }

◆ operator=() [1/2]

MaterialEffectsBase& Trk::MaterialEffectsBase::operator= ( const MaterialEffectsBase rhs)
protecteddefault

Assignment operator.

◆ operator=() [2/2]

MaterialEffectsBase& Trk::MaterialEffectsBase::operator= ( MaterialEffectsBase &&  rhs)
protecteddefault

move Assignment operator

◆ release()

template<typename S >
const S* Trk::SurfacePtrHolderImplDetEl< S >::release ( )
inlinenoexceptinherited

release ala unique_ptr release

Definition at line 215 of file SurfaceHolderImpl.h.

216  {
217  const S* tmp = m_associatedSurface;
218  m_associatedSurface = nullptr;
219  return tmp;
220  }

◆ setValues()

virtual void Trk::MaterialEffectsBase::setValues ( const Surface assocSurface)
protectedvirtual

allows POOL converter to recreate transient links to DetStore

◆ surfacePtr()

template<typename S >
const S* Trk::SurfacePtrHolderImplDetEl< S >::surfacePtr ( )
inlineinherited

return the ptr we hold useful for tests

Definition at line 213 of file SurfaceHolderImpl.h.

213 { return m_associatedSurface; }

◆ thicknessInX0()

double Trk::MaterialEffectsBase::thicknessInX0 ( ) const

returns the actually traversed material \( t/X_0 \).

Leave 0.0 for external ME.

◆ type()

bool Trk::MaterialEffectsBase::type ( const MaterialEffectsType type) const

returns the flags (bits) which types of ME are present

Use this method to find out if the ME is of a certain type: i.e. if ( mefot->type(MaterialEffectsBase::EnergyLoss) { //etc }

Returns
true if the MaterialEffectsBase is of this type

◆ uniqueClone()

std::unique_ptr<MaterialEffectsBase> Trk::MaterialEffectsBase::uniqueClone ( ) const
inline

NVI uniqueClone.

Definition at line 87 of file MaterialEffectsBase.h.

88  {
89  return std::unique_ptr<MaterialEffectsBase>(clone());
90  }

Friends And Related Function Documentation

◆ ::MaterialEffectsBaseCnv_p1

friend class ::MaterialEffectsBaseCnv_p1
friend

Definition at line 132 of file MaterialEffectsBase.h.

◆ ::MaterialEffectsBaseCnv_p2

friend class ::MaterialEffectsBaseCnv_p2
friend

Definition at line 133 of file MaterialEffectsBase.h.

◆ ::MaterialEffectsOnTrackCnv_p2

friend class ::MaterialEffectsOnTrackCnv_p2
friend

Definition at line 134 of file MaterialEffectsBase.h.

◆ ::ScatteringAngleOnTrackCnv_p1

friend class ::ScatteringAngleOnTrackCnv_p1
friend

Definition at line 136 of file MaterialEffectsBase.h.

◆ ::TrackCollectionCnv

friend class ::TrackCollectionCnv
friend

Definition at line 135 of file MaterialEffectsBase.h.

Member Data Documentation

◆ m_associatedSurface

template<typename S >
const S* Trk::SurfacePtrHolderImplDetEl< S >::m_associatedSurface = nullptr
protectedinherited

Definition at line 244 of file SurfaceHolderImpl.h.

◆ m_tInX0

double Trk::MaterialEffectsBase::m_tInX0 {}
private

\( t/X_0 \) - the traversed thickness in RadiationLengths

Definition at line 139 of file MaterialEffectsBase.h.

◆ m_typeFlags

long Trk::MaterialEffectsBase::m_typeFlags {}
private

Definition at line 140 of file MaterialEffectsBase.h.


The documentation for this class was generated from the following files:
Trk::MaterialEffectsBase::clone
virtual MaterialEffectsBase * clone() const =0
Virtual constructor.
Trk::MaterialEffectsBase::FittedMaterialEffects
@ FittedMaterialEffects
contains values obtained by fitting the scatterer or e-loss
Definition: MaterialEffectsBase.h:56
Trk::MaterialEffectsBase::thicknessInX0
double thicknessInX0() const
returns the actually traversed material .
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
Trk::SurfacePtrHolderImplDetEl::m_associatedSurface
const S * m_associatedSurface
Definition: SurfaceHolderImpl.h:244
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
Trk::MaterialEffectsBase::MATERIAL_EFFECTS_ON_TRACK
@ MATERIAL_EFFECTS_ON_TRACK
Definition: MaterialEffectsBase.h:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
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
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Trk::MaterialEffectsBase::Unknown
@ Unknown
new category
Definition: MaterialEffectsBase.h:58
Trk::MaterialEffectsBase::EnergyLossEffects
@ EnergyLossEffects
contains energy loss corrections
Definition: MaterialEffectsBase.h:48
Trk::MaterialEffectsBase::NTYPES
@ NTYPES
Definition: MaterialEffectsBase.h:40
Trk::MaterialEffectsBase::NumberOfMaterialEffectsTypes
@ NumberOfMaterialEffectsTypes
Definition: MaterialEffectsBase.h:59
Trk::MaterialEffectsBase::m_typeFlags
long m_typeFlags
Definition: MaterialEffectsBase.h:140
Trk::MaterialEffectsBase::BremPoint
@ BremPoint
contains q/p covariance noise term
Definition: MaterialEffectsBase.h:52
Trk::MaterialEffectsBase::ESTIMATED_BREM_ON_TRACK
@ ESTIMATED_BREM_ON_TRACK
Definition: MaterialEffectsBase.h:38
Trk::MaterialEffectsBase::MaterialThickness
@ MaterialThickness
contains only thickness, needs M.E.Updator to calculate effects
Definition: MaterialEffectsBase.h:50
Trk::MaterialEffectsBase::associatedSurface
const Surface & associatedSurface() const
returns the surface to which these m.eff. are associated.