Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage TG4EllipticalTube and/or TGeoEltu #19

Closed
mt82 opened this issue Feb 17, 2021 · 1 comment
Closed

Manage TG4EllipticalTube and/or TGeoEltu #19

mt82 opened this issue Feb 17, 2021 · 1 comment
Assignees
Milestone

Comments

@mt82
Copy link

mt82 commented Feb 17, 2021

Make Edep-sim usable with gdml
with TG4EllipticalTube (TGeoEltu)

A solution could be:

diff --git a/src/EDepSimRootGeometryManager.cc b/src/EDepSimRootGeometryManager.cc
index 9436ee3..46db263 100644
--- a/src/EDepSimRootGeometryManager.cc
+++ b/src/EDepSimRootGeometryManager.cc
@@ -15,6 +15,7 @@
#include <TGeoTrd2.h>
#include <TGeoTrd2.h>
#include <TGeoSphere.h>
#include <TGeoPgon.h>
+#include <TGeoEltu.h>
#include <TGeoArb8.h>
#include <TGeoBoolNode.h>
#include <TGeoCompositeShape.h>
@@ -41,6 +42,7 @@
#include <G4Sphere.hh>
#include <G4Polyhedra.hh>
#include <G4Polycone.hh>
+#include <G4EllipticalTube.hh>
#include <G4Trap.hh>
#include <G4SubtractionSolid.hh>
#include <G4UnionSolid.hh>
@@ -232,6 +234,14 @@ TGeoShape* EDepSim::RootGeometryManager::CreateShape(const G4VSolid* theSolid,
box->GetYHalfLength()/CLHEP::mm,
box->GetZHalfLength()/CLHEP::mm);
}

  • else if (geometryType == "G4EllipticalTube") {
  •    const G4EllipticalTube* eltube = dynamic_cast<const G4EllipticalTube*>(theSolid);
    
  •    // Create an elliptical tube.
    
  •    double a = eltube->GetDx()/CLHEP::mm;
    
  •    double b = eltube->GetDy()/CLHEP::mm;
    
  •    double dz = eltube->GetDz()/CLHEP::mm;
    
  •    theShape = new TGeoEltu(a, b, dz);
    
  • }
    else if (geometryType == "G4Tubs") {
    const G4Tubs* tube = dynamic_cast<const G4Tubs*>(theSolid);
    // Root takes the angles in degrees so there is no extra
    (END)
@ClarkMcGrew ClarkMcGrew self-assigned this Feb 17, 2021
@ClarkMcGrew
Copy link
Owner

Thanks @mt82,

I've marked this for the next release, and should have it all ready for next week. The new release will basically the current marked issues, plus what is in master.

Cheers,
Clark

ClarkMcGrew added a commit that referenced this issue Feb 25, 2021
This closes Issue #19 which requests adding a translation for
G4EllipticalTube into a ROOT TGeoEltu object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants