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

Hide AgML library codes from the macros which load the geometry. #623

Merged
merged 3 commits into from
Dec 1, 2023
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
19 changes: 4 additions & 15 deletions StarDb/AgMLGeometry/CreateGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#if !defined(__CINT__) || defined(__CLING__)
#include "StBFChain/StBFChain.h"
#include "StarVMC/StarAgmlLib/AgModule.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probable culprit for the test failures. The AgML library codes are overly complex... especially the shape and structure handling codes. Would not be surprise if cling doesn't handle them well...

#include "StarVMC/StarAgmlLib/StarTGeoStacker.h"
#include "StarVMC/StarGeometry/StarGeo.h"
#endif

Expand Down Expand Up @@ -33,27 +31,18 @@ TDataSet *CreateGeometry(const Char_t *name="y2011") {
// Append geom.root to the extentionless filename
filename+=".geom.root";

// Detect second call to the system
if ( AgModule::Find("HALL") ) {
if ( chain->GetOption("Sti") ||
chain->GetOption("StiCA") ||
chain->GetOption("StiVMC") ){
cout << "AgML geometry: HALL exists. Restore from cache file "
<< filename.Data() << endl;
if ( gGeoManager ) {
if ( chain->GetOption("Sti") || chain->GetOption("StiCA") ) {
gGeoManager = 0;
assert(0);
assert(0); // this assert should be called in our Sti reconstruction chains... why not?
TGeoManager::Import( filename );
assert(gGeoManager);
}
return geom;
}

cout << "AgML: Building geometry " << name << " " << endl;

// Create the geometry using TGeo
AgBlock::SetStacker( new StarTGeoStacker() );

Geometry *build = new Geometry();
build->InitAgML( "StarTGeoStacker" );

// Suppress copious ROOT warnings
Long_t save = gErrorIgnoreLevel; gErrorIgnoreLevel = 9999;
Expand Down
17 changes: 15 additions & 2 deletions mgr/Dyson/Export/AgROOT.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ class StarGeometry {
static TDataSet* Construct( const char* name = "%s");
static bool List ( const char* name = "%s");
static void Whitelist( const char* name, int value=1 ){ whitelist[name]=value; }
static void InitAgML ( const char* stacker="StarTGeoStacker");
StarGeometry(){ /* nada */ };
virtual ~StarGeometry(){ /* nada */ }
private:
Expand All @@ -709,7 +710,7 @@ class Geometry : public StarGeometry {
document.head(header)

implement1 = """
#include "StarVMC/StarGeometry/StarGeo.h"
#include "StarVMC/StarGeometry/StarGeo.h"
#include "TObjectSet.h"
#include "TGeoManager.h"
#include <string>
Expand Down Expand Up @@ -744,7 +745,19 @@ class Geometry : public StarGeometry {
output = ' if (all||tag=="%s") { %s::list(); found = true; }' %(name,name)
document.impl( output, unit='global' )
document.impl( 'if ( 0==found ) LOG_INFO << tag << " not defined" << endm;', unit='global' )
document.impl( 'return true;};', unit='global' )
document.impl( 'return true;};', unit='global' )

implement1 = """
#include "StarVMC/StarAgmlLib/StarNoStacker.h"
#include "StarVMC/StarAgmlLib/StarTGeoStacker.h"
void StarGeometry::InitAgML( const char* s ) {
std::string sname = s;
if ( sname=="StarNoStacker" ) AgBlock::SetStacker( new StarNoStacker );
else AgBlock::SetStacker( new StarTGeoStacker );
};
"""
document.impl( implement1, unit='global' )




Expand Down
Loading