From 2dc2334d9e4427917fe843326dfef7baddc5f562 Mon Sep 17 00:00:00 2001 From: Frank Gaede <frank.gaede@desy.de> Date: Tue, 1 Jul 2014 12:08:45 +0000 Subject: [PATCH] - added method SurfaceType::isMeasurment1D() --- DDSurfaces/include/DDSurfaces/ISurface.h | 15 ++++++++++++++- examples/ILDExDet/src/ILDExSIT_geo.cpp | 24 +++++------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/DDSurfaces/include/DDSurfaces/ISurface.h b/DDSurfaces/include/DDSurfaces/ISurface.h index 3c3bb0355..b750f1a8a 100644 --- a/DDSurfaces/include/DDSurfaces/ISurface.h +++ b/DDSurfaces/include/DDSurfaces/ISurface.h @@ -118,7 +118,8 @@ namespace DDSurfaces { Helper, ParallelToZ, OrthogonalToZ, - Invisible + Invisible, + Measurement1D } ; ///default c'tor @@ -149,6 +150,15 @@ namespace DDSurfaces { _bits.set( prop2 ) ; _bits.set( prop3 ) ; } + + // c'tor that sets five properties + SurfaceType( unsigned prop0 , unsigned prop1 , unsigned prop2, unsigned prop3, unsigned prop4 ) : _bits(0) { + _bits.set( prop0 ) ; + _bits.set( prop1 ) ; + _bits.set( prop2 ) ; + _bits.set( prop3 ) ; + _bits.set( prop4 ) ; + } /// set the given peorperty void setProperty( unsigned prop , bool val = true ) { _bits.set( prop , val ) ; } @@ -184,6 +194,9 @@ namespace DDSurfaces { /// true if this is a plane orthogonal to Z bool isZDisk() const { return ( _bits[ SurfaceType::Plane ] && _bits[ SurfaceType::OrthogonalToZ ] ) ; } + /// true if the mesurement is only 1D, i.e. the second direction v is not used + bool isMeasurment1D() const { return _bits[ SurfaceType::Measurement1D ] ; } + /// true if all properties of otherType are also true for this type. bool isSimilar( const SurfaceType& otherType) const { diff --git a/examples/ILDExDet/src/ILDExSIT_geo.cpp b/examples/ILDExDet/src/ILDExSIT_geo.cpp index 2a368231e..b5ef41891 100644 --- a/examples/ILDExDet/src/ILDExSIT_geo.cpp +++ b/examples/ILDExDet/src/ILDExSIT_geo.cpp @@ -62,21 +62,7 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { Volume laddervol (layername+"_ladder",ladderbox , suppmat ); -#if 0 /// debug: replacing Box with Trap ... - Trap sensbox( zhalf, - 0.0, - 0.0, - width/2., - sens_thick/2., - sens_thick/2., - 0.0, - width/2., - sens_thick/2., - sens_thick/2., - 0.0 ) ; -#else Box sensbox (sens_thick/2.,width/2.,zhalf); -#endif Volume sensvol (layername+"_sens",sensbox, sensmat ); @@ -104,17 +90,17 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, SensitiveDetector sens) { // implement 7 deg stereo angle if( layer_id % 2 ){ - u.fill( 0. , cos( 3.5/180.*M_PI ) , sin( 3.5/180.*M_PI ) ) ; - v.fill( 0. , -sin( 3.5/180.*M_PI ) , cos( 3.5/180.*M_PI ) ) ; + u.fill( 0. , cos( 3.5*dd4hep::deg ) , sin( 3.5*dd4hep::deg ) ) ; + v.fill( 0. , -sin( 3.5*dd4hep::deg ) , cos( 3.5*dd4hep::deg ) ) ; } else { - u.fill( 0. , cos( 3.5/180.*M_PI ) , -sin( 3.5/180.*M_PI ) ) ; - v.fill( 0. , sin( 3.5/180.*M_PI ) , cos( 3.5/180.*M_PI ) ) ; + u.fill( 0. , cos( 3.5*dd4hep::deg ) , -sin( 3.5*dd4hep::deg ) ) ; + v.fill( 0. , sin( 3.5*dd4hep::deg ) , cos( 3.5*dd4hep::deg ) ) ; } Vector3D n( 1. , 0. , 0. ) ; - VolPlane surf( sensvol , SurfaceType(SurfaceType::Sensitive) , sens_thick/2 + supp_thick/2 , sens_thick/2 , u,v,n ) ; + VolPlane surf( sensvol , SurfaceType( SurfaceType::Sensitive, SurfaceType::Measurement1D ) , sens_thick/2 + supp_thick/2 , sens_thick/2 , u,v,n ) ; // Position senspos (-(sens_thick+supp_thick)/2.+sens_thick/2.,0,0); -- GitLab