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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

const Surfacem_associatedSurface

Private Attributes

double m_tInX0 {}
 \( t/X_0 \) - the traversed thickness in RadiationLengths
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.

◆ 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,
58 Unknown = 6,
60 // WARNING need to edit MaterialEffectsOnTrack.cxx if these enums change
61 };
@ 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

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::EstimatedBremOnTrack, and Trk::MaterialEffectsOnTrack.

◆ cloneHelper()

const Surface * Trk::SurfacePtrHolderImplDetEl< Surface >::cloneHelper ( const Surface * input)
inlinestaticinherited

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

Definition at line 213 of file SurfaceHolderImpl.h.

214 {
215 return (input && input->associatedDetectorElement() == nullptr
216 ? input->clone()
217 : input);
218 }

◆ derivedType()

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

Returns the concrete derived type.

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

◆ destroySurface()

void Trk::SurfacePtrHolderImplDetEl< Surface >::destroySurface ( )
inlinenoexceptinherited

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

Definition at line 201 of file SurfaceHolderImpl.h.

202 {
204 m_associatedSurface->associatedDetectorElement() == nullptr) {
205 delete m_associatedSurface;
206 }
207 //
208 m_associatedSurface = nullptr;
209 }

◆ dump() [1/2]

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

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

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

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}
#define endmsg
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

◆ 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::EstimatedBremOnTrack, and Trk::MaterialEffectsOnTrack.

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}
bool type(const MaterialEffectsType &type) const
returns the flags (bits) which types of ME are present

◆ 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()

const Surface * Trk::SurfacePtrHolderImplDetEl< Surface >::release ( )
inlinenoexceptinherited

release ala unique_ptr release

Definition at line 192 of file SurfaceHolderImpl.h.

193 {
194 const S* tmp = m_associatedSurface;
195 m_associatedSurface = nullptr;
196 return tmp;
197 }

◆ setValues()

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

allows POOL converter to recreate transient links to DetStore

◆ surfacePtr()

const Surface * Trk::SurfacePtrHolderImplDetEl< Surface >::surfacePtr ( )
inlineinherited

return the ptr we hold useful for tests

Definition at line 190 of file SurfaceHolderImpl.h.

190{ 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 }
virtual MaterialEffectsBase * clone() const =0
Virtual constructor.

◆ ::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

const Surface* Trk::SurfacePtrHolderImplDetEl< Surface >::m_associatedSurface
protectedinherited

Definition at line 221 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.

139{};

◆ m_typeFlags

long Trk::MaterialEffectsBase::m_typeFlags {}
private

Definition at line 140 of file MaterialEffectsBase.h.

140{};

The documentation for this class was generated from the following files: