Skip to content

Commit fd02555

Browse files
authored
Encode Geometry Tag w/in DB macros (#422)
The Geometry.{tag}.C "database" macros establish the connection between the geometry tag (defined by the BFC chain options and/or timestamp) and the code which instantiates the geometry model. The macro is loaded / executed by St_db_Maker whenever GetDataBase("VmcGeometry") is called. This PR encodes the geometry tag inside of each database macro, rather than using the ROOT interpreter's introspection capabilities to read the tag from the filename of the currently executing macro. This works well under ROOT 5 / CINT. But I think the way that we load macros in St_db_Maker confuses ROOT 6 / CINT. The simplest solution is to encode the geometry tag within each database macro.
1 parent 10774c5 commit fd02555

89 files changed

Lines changed: 178 additions & 2759 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev13"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev14"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev2016"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev2020"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev2021"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev2022"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev2022m"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("dev2022sm"); }

StarDb/AgMLGeometry/Geometry.devE.C

100755100644
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("devE"); }
Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1+
class TDataSet;
12
#include "CreateGeometry.h"
2-
TDataSet *CreateTable()
3-
{
4-
// Name of the macro including the full path
5-
TString myname = gInterpreter->GetCurrentMacroName();
6-
7-
// Get an array of TString separated by "/"
8-
TObjArray *array = myname.Tokenize("/");
9-
10-
// Get the name of the macro itself
11-
TString name = ((TObjString *)array->Last())->GetString();
12-
13-
// Isolate the geometry tag
14-
array = name.Tokenize(".");
15-
16-
// Get the geometry tag
17-
TString tag = ((TObjString *)array->At(1))->GetString();
18-
19-
// Ensure that we are not looking at the template
20-
if ( tag=="C" )
21-
{
22-
std::cout << "Please use one of the Geometry.[TAG].C macros" << std::endl;
23-
std::cout << "to instantiate the geometry specified by the " << std::endl;
24-
std::cout << "given [TAG]." << std::endl;
25-
return NULL;
26-
}
27-
28-
// Return the requested geometry
29-
return CreateGeometry(tag);
30-
31-
}
32-
3+
TDataSet* CreateTable() { return CreateGeometry("eStar2"); }

0 commit comments

Comments
 (0)