add units
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////*/
|
||||
|
||||
// G4 Solid //
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
#include <Geant4/G4LogicalVolume.hh>
|
||||
#include <Geant4/G4Material.hh>
|
||||
#include <Geant4/G4NistManager.hh>
|
||||
@@ -43,11 +44,13 @@
|
||||
|
||||
namespace uLib {
|
||||
|
||||
class DetectorsSolidPimpl {
|
||||
class DetectorsSolidImpl {
|
||||
public:
|
||||
static G4ThreeVector getG4Vector3f(const Vector3f &vector) {
|
||||
return G4ThreeVector(vector(0), vector(1), vector(2));
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Solid::Solid()
|
||||
@@ -139,9 +142,9 @@ void TessellatedSolid::SetMesh(TriangleMesh &mesh) {
|
||||
for (int i = 0; i < mesh.Triangles().size(); ++i) {
|
||||
const Vector3i &trg = mesh.Triangles().at(i);
|
||||
G4TriangularFacet *facet = new G4TriangularFacet(
|
||||
DetectorsSolidPimpl::getG4Vector3f(mesh.Points().at(trg(0))),
|
||||
DetectorsSolidPimpl::getG4Vector3f(mesh.Points().at(trg(1))),
|
||||
DetectorsSolidPimpl::getG4Vector3f(mesh.Points().at(trg(2))), ABSOLUTE);
|
||||
DetectorsSolidImpl::getG4Vector3f(mesh.Points().at(trg(0))),
|
||||
DetectorsSolidImpl::getG4Vector3f(mesh.Points().at(trg(1))),
|
||||
DetectorsSolidImpl::getG4Vector3f(mesh.Points().at(trg(2))), ABSOLUTE);
|
||||
ts->AddFacet((G4VFacet *)facet);
|
||||
}
|
||||
this->m_Logical->SetSolid(ts);
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
void SetNistMaterial(const char *name);
|
||||
void SetMaterial(G4Material *material);
|
||||
|
||||
void SetSizeUnit(const char *unit);
|
||||
// Implementiamo SetParent qui, per tutti.
|
||||
virtual void SetParent(Solid *parent);
|
||||
|
||||
@@ -65,7 +65,6 @@ protected:
|
||||
G4Material *m_Material;
|
||||
G4LogicalVolume *m_Logical;
|
||||
G4VPhysicalVolume *m_Physical; // <-- Memorizza l'oggetto posizionato
|
||||
|
||||
G4ThreeVector *m_Position; // <-- Offset rispetto al centro del padre
|
||||
G4RotationMatrix* m_Rotation; // <-- Rotazione rispetto al padre
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user