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

No StMaker functions if no StMaker loaded #693

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

genevb
Copy link
Contributor

@genevb genevb commented Jun 28, 2024

In ROOT6, it isn't enough to just hide a class's functions inside an if
clause checking the corresponding TClass's existence when the class isn't
loaded. This can be demonstrated currently in SL24x by simply executing:

root4star -b -l -q

...which produces an error when executing rootlogoff.C at quit. Maybe there
are other solutions, but this simple proposal breaks rootlogoff.C into two parts,
not even loading the second part unless the first part is true

  • test the existence of the StMaker class
  • execution of StMaker functions

I welcome other proposals.

@genevb genevb added the ROOT6 Issues and changes related to transition from ROOT5 to ROOT6 label Jun 28, 2024
if (mk) {
mk->Finish();
}
gROOT->Macro("rootlogoff2.C");
Copy link
Contributor Author

@genevb genevb Jun 28, 2024

Choose a reason for hiding this comment

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

This (gROOT->Macro()) seems to be a more protective wrapper around gInterpreter->ExecuteMacro(), but I don't know that it's really any better in this circumstance. But if anyone else has a perspective on which is better to use, please chime in.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't think of a simpler solution here, short of modifying our root4star application. But that means we lose this functionality when bfc is run under root.exe. If we can register a callback with the root ".q" command, then we would be in business. But a very quick search didn't turn up anything.

Copy link
Contributor

@klendathu2k klendathu2k left a comment

Choose a reason for hiding this comment

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

Bottom line... LGTM.

if (mk) {
mk->Finish();
}
gROOT->Macro("rootlogoff2.C");
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't think of a simpler solution here, short of modifying our root4star application. But that means we lose this functionality when bfc is run under root.exe. If we can register a callback with the root ".q" command, then we would be in business. But a very quick search didn't turn up anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ROOT6 Issues and changes related to transition from ROOT5 to ROOT6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants