Skip to content
Snippets Groups Projects

Draft: Multiple scattering in dd4hep

Closed Andrii Usachov requested to merge materials_in_dd4hep into 2024-patches
Files
9
+ 26
10
@@ -12,10 +12,9 @@
#include <Core/DeIOV.h>
#include <TGeoMaterial.h>
#include <TGeoMedium.h>
using LHCb::Detector::NotImplemented;
namespace LHCb::Detector {
/**
@@ -31,15 +30,32 @@ namespace LHCb::Detector {
/// Material radiation length [cm]
double radiationLength() const { return radLength(); };
/// Mean excitiation energy
double I() const { throw NotImplemented(); }
double I() const { return getMaterialProperty( "I" ); }
double C() const { return getMaterialProperty( "C" ); }
double a() const { return getMaterialProperty( "a" ); }
double m() const { return getMaterialProperty( "m" ); }
double X1() const { return getMaterialProperty( "X1" ); }
double X0() const { return getMaterialProperty( "X0" ); }
/// Parameters for density effect correction
double C() const { throw NotImplemented(); }
double a() const { throw NotImplemented(); }
double m() const { throw NotImplemented(); }
double X1() const { throw NotImplemented(); }
double X0() const { throw NotImplemented(); }
private:
double getMaterialProperty( const std::string& propertyName ) const {
TGeoMedium* geoMedium = this->ptr();
if ( geoMedium ) {
TGeoMaterial* rootMaterial = geoMedium->GetMaterial();
if ( rootMaterial ) {
return rootMaterial->GetConstProperty( propertyName.c_str() );
} else {
throw std::runtime_error( "Property '" + propertyName + "' is not available in this material" );
}
} else {
throw std::runtime_error( "TGeoMedium is not available" );
}
}
};
} // namespace LHCb::Detector
Loading