Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions StarVMC/Geometry/macros/testGeom.C
Original file line number Diff line number Diff line change
@@ -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);

}
50 changes: 50 additions & 0 deletions StarVMC/Geometry/macros/testGeometry.csh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#! /usr/local/bin/tcsh -f
set tag = $1
#if (! $tag) set tag = "y2015a";

set clobber

cat <<EOF > /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 <<EOF > /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 <<EOF > 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
#