@@ -42,6 +42,7 @@ npy/NNodeUncoincide npy/NNodeNudger
4242#include " G4Ellipsoid.hh"
4343#include " G4Box.hh"
4444#include " G4Tubs.hh"
45+ #include " G4Trap.hh"
4546#include " G4Polycone.hh"
4647#include " G4Cons.hh"
4748#include " G4Hype.hh"
6768 _G4Ellipsoid,
6869 _G4Box,
6970 _G4Tubs,
71+ _G4Trap,
7072 _G4Polycone,
7173 _G4Cons,
7274 _G4Hype,
@@ -85,6 +87,7 @@ struct U4Solid
8587 static constexpr const char * G4Ellipsoid_ = " Ell" ;
8688 static constexpr const char * G4Box_ = " Box" ;
8789 static constexpr const char * G4Tubs_ = " Tub" ;
90+ static constexpr const char * G4Trap_ = " Trp" ;
8891 static constexpr const char * G4Polycone_ = " Pol" ;
8992 static constexpr const char * G4Cons_ = " Con" ;
9093 static constexpr const char * G4Hype_ = " Hyp" ;
@@ -132,6 +135,7 @@ struct U4Solid
132135 void init_Ellipsoid ();
133136 void init_Box ();
134137 void init_Tubs ();
138+ void init_Trap ();
135139 void init_Polycone ();
136140 void init_Cons ();
137141 void init_Hype ();
@@ -279,6 +283,7 @@ inline int U4Solid::Type(const char* name) // static
279283 if ( strcmp (name, " G4Ellipsoid" ) == 0 ) type = _G4Ellipsoid ;
280284 if ( strcmp (name, " G4Box" ) == 0 ) type = _G4Box ;
281285 if ( strcmp (name, " G4Tubs" ) == 0 ) type = _G4Tubs ;
286+ if ( strcmp (name, " G4Trap" ) == 0 ) type = _G4Trap ;
282287 if ( strcmp (name, " G4Polycone" ) == 0 ) type = _G4Polycone ;
283288 if ( strcmp (name, " G4Cons" ) == 0 ) type = _G4Cons ;
284289 if ( strcmp (name, " G4Hype" ) == 0 ) type = _G4Hype ;
@@ -301,6 +306,7 @@ inline const char* U4Solid::Tag(int type) // static
301306 case _G4Ellipsoid: tag = G4Ellipsoid_ ; break ;
302307 case _G4Box: tag = G4Box_ ; break ;
303308 case _G4Tubs: tag = G4Tubs_ ; break ;
309+ case _G4Trap: tag = G4Trap_ ; break ;
304310 case _G4Polycone: tag = G4Polycone_ ; break ;
305311 case _G4Cons: tag = G4Cons_ ; break ;
306312 case _G4Hype: tag = G4Hype_ ; break ;
@@ -397,6 +403,7 @@ inline void U4Solid::init_Constituents()
397403 case _G4Ellipsoid : init_Ellipsoid () ; break ;
398404 case _G4Box : init_Box () ; break ;
399405 case _G4Tubs : init_Tubs () ; break ;
406+ case _G4Trap : init_Trap () ; break ;
400407 case _G4Polycone : init_Polycone () ; break ;
401408 case _G4Cons : init_Cons () ; break ;
402409 case _G4Hype : init_Hype () ; break ;
@@ -790,6 +797,20 @@ inline void U4Solid::init_Tubs()
790797}
791798
792799
800+ inline void U4Solid::init_Trap ()
801+ {
802+ const G4Trap* trap = dynamic_cast <const G4Trap*>(solid);
803+ assert (trap);
804+
805+ double z = 2 *trap->GetZHalfLength ()/CLHEP ::mm;
806+ double y = 2 *trap->GetYHalfLength1 ()/CLHEP ::mm;
807+ double x = 2 *trap->GetXHalfLength1 ()/CLHEP ::mm;
808+ double ltx = 2 *trap->GetXHalfLength2 ()/CLHEP ::mm;
809+
810+ root = sn::Trapezoid (z, y, x, ltx);
811+ }
812+
813+
793814inline void U4Solid::init_Polycone ()
794815{
795816 const G4Polycone* polycone = dynamic_cast <const G4Polycone*>(solid);
0 commit comments