diff --git a/StarVMC/Geometry/macros/testGeom.C b/StarVMC/Geometry/macros/testGeom.C new file mode 100644 index 00000000000..56490883db2 --- /dev/null +++ b/StarVMC/Geometry/macros/testGeom.C @@ -0,0 +1,24 @@ +void testGeom( const char* name="y2015a", const char* sdt = "sdt20150216" ) +{ + gROOT->LoadMacro("bfc.C"); + + if ( sdt == 0 ) bfc(0,""); + else { + bfc(0,Form("%s agml usexgeom %s",name,sdt)); + AgPosition::SetReal(); + } + + AgModule::SetStacker( new StarTGeoStacker() ); + + // StarGeometry::y2015a::select(); + // StarGeometry::AgML::construct(); + if (name) construct(name); +} + +void construct(const char * name ) { + // Geometry *geometry = new Geometry(); + // geometry -> ConstructGeometry( name ); + + StarGeometry::Construct(name); + +} diff --git a/StarVMC/Geometry/macros/testGeometry.csh b/StarVMC/Geometry/macros/testGeometry.csh new file mode 100755 index 00000000000..549af35d966 --- /dev/null +++ b/StarVMC/Geometry/macros/testGeometry.csh @@ -0,0 +1,50 @@ +#! /usr/local/bin/tcsh -f +set tag = $1 +#if (! $tag) set tag = "y2015a"; + +set clobber + +cat < /tmp/test_1.C +{ + gROOT->LoadMacro("StarVMC/Geometry/macros/testGeom.C"); + testGeom("$tag"); + gGeoManager->Export("${tag}_1.C"); +} +EOF +root4star -q -b /tmp/test_1.C > /tmp/a.log +sed '/_[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]/d' ${tag}_1.C | sed 's/-0.000000/0.000000/' | sed 's/360.000000/0.000000/' > ${tag}_1 + +mv .${STAR_HOST_SYS} ${STAR_HOST_SYS} + +cat < /tmp/test_2.C +{ + gROOT->LoadMacro("StarVMC/Geometry/macros/testGeom.C"); + testGeom("$tag"); + gGeoManager->Export("${tag}_2.C"); +} +EOF +root4star -q -b /tmp/test_2.C > /tmp/a.log +sed '/_[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]/d' ${tag}_2.C | sed 's/-0.000000/0.000000/' | sed 's/360.000000/0.000000/' > ${tag}_2 + +mv ${STAR_HOST_SYS} .${STAR_HOST_SYS} + +gvimdiff ${tag}_1 ${tag}_2 + + +#echo "Generate in old library" +#cat < b.C +#{ +#gROOT->LoadMacro("StarVMC/Geometry/macros/testGeom.C"); +#testGeom("$tag"); +#gGeoManager->Export("${tag}_2.C"); +#} +#EOF +#root4star -q -b b.C > b.log +#sed '/_[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]/d' ${tag}_2.C | sed 's/-0.000000/0.000000/' | sed 's/360.000000/0.000000/' > ${tag}_2 +#rm .$STAR_HOST_SYS +# +## Restore +#mv $STAR_HOST_SYS .$STAR_HOST_SYS +# + +