Skip to content

CHG: Enclose all cout statements in g_Verbosity - #205

Merged
fhagemann merged 1 commit into
cositools:develop/emfrom
fhagemann:verbosity
Sep 22, 2026
Merged

fhagemann merged 1 commit into
cositools:develop/emfrom
fhagemann:verbosity

Conversation

@fhagemann

Copy link
Copy Markdown

Some cout statements were not enclosed in any g_Verbosity level statement, which should be fixed with this PR.

Or another side not: currently, when running with verbosity c_Info, the terminal gets flooded with output, mostly from the energy calibration printing every ADC to keV conversion. We might want to make use of the c_Chatty or c_Extreme verbosity levels from megalib also here in nuclearizer by moving some extreme output (especially that printed for EVERY strip hit) to c_Chatty or c_Extreme:

//! The global verbosity
extern int g_Verbosity;
// and its levels
extern const int c_Quiet;
extern const int c_Error;
extern const int c_Warning;
extern const int c_Info;
extern const int c_Chatty;
extern const int c_Extreme;

@fhagemann
fhagemann requested a review from zoglauer September 3, 2026 22:30
@fhagemann fhagemann added the cleanup Code cleanup label Sep 3, 2026
MParser Parser;
if (Parser.Open(m_DeadtimeFileName) == false) {
cout << m_Name << ": Unable to open deadtime parameters file: " << m_DeadtimeFileName << endl;
if (g_Verbosity >= c_Error) cout << m_Name << ": Unable to open deadtime parameters file: " << m_DeadtimeFileName << endl;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we add e.g. "ERROR in src/MSubModuleShieldTrigger:ParseDeadtimeFile: " for the DEE submodules without the XmlTags, like you have for MSubModuleShieldTrigger?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm fine doing whatever for the DEE SubModules 😃
Should this be part of this PR or of a follow-up PR?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Up to you, if you want to handle this in a follow-on PR, then I'd call this good to go once you rebase again.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Let's move this to a follow-up PR

@fhagemann

Copy link
Copy Markdown
Author

I also see that this needs to be rebased, now that #194 was merged and this affects some files.

@fhagemann
fhagemann force-pushed the verbosity branch 2 times, most recently from 7f34590 to 750fefb Compare September 15, 2026 06:03

@fhagemann fhagemann left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

With the latest force-push, I am rebasing this onto the changes from #194 to enclose all cout statements in MModuleTACCalibration also in g_Verbosity.

See the two comments about using g_Warning, even though the error message says "Error"

Comment on lines +232 to 235
if (g_Verbosity >= c_Warning) cout<<m_XmlTag
<<": Error: DetID "<<DetID
<<" has no TAC calibration entries - skipping event"
<<endl;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This statement says Error, but it's being run for every MReadOutAssembly* Event and would spam the terminal output, that's why I chose c_Warning here.

Comment on lines +241 to 244
if (g_Verbosity >= c_Warning) cout<<m_XmlTag
<<": Error: Unable to identify Side "<<Side
<<" - skipping event"
<<endl;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This statement says Error, but it's being run for every MReadOutAssembly* Event and would spam the terminal output, that's why I chose c_Warning here.

@fhagemann

Copy link
Copy Markdown
Author

I just rebased this.

@fhagemann
fhagemann merged commit 624ce76 into cositools:develop/em Sep 22, 2026
1 check passed
@fhagemann
fhagemann deleted the verbosity branch September 22, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants