-
Notifications
You must be signed in to change notification settings - Fork 17
CHG: Enclose all cout statements in g_Verbosity
#205
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,13 +113,13 @@ bool MModuleTACCalibration::Initialize() | |
| // Initialize the module | ||
|
|
||
| if (LoadTACCalFile(m_TACCalFile) == false) { | ||
| cout<<m_XmlTag<<": Error: TAC Calibration file could not be loaded."<<endl; | ||
| if (g_Verbosity >= c_Error) cout<<m_XmlTag<<": Error: TAC Calibration file could not be loaded."<<endl; | ||
| return false; | ||
| } | ||
|
|
||
| // Some sanity checks: | ||
| if (m_TACCal.size() == 0) { | ||
| cout<<m_XmlTag<<": The TAC calibration data set is empty"<<endl; | ||
| if (g_Verbosity >= c_Error) cout<<m_XmlTag<<": The TAC calibration data set is empty"<<endl; | ||
| return false; | ||
| } | ||
|
|
||
|
|
@@ -229,7 +229,7 @@ bool MModuleTACCalibration::ApplyTACCal(MReadOutAssembly* Event) | |
|
|
||
| // Check that this detector exists in the TAC calibration | ||
| if (m_TACCal.find(DetID) == m_TACCal.end()) { | ||
| cout<<m_XmlTag | ||
| if (g_Verbosity >= c_Warning) cout<<m_XmlTag | ||
| <<": Error: DetID "<<DetID | ||
| <<" has no TAC calibration entries - skipping event" | ||
| <<endl; | ||
|
|
@@ -238,7 +238,7 @@ bool MModuleTACCalibration::ApplyTACCal(MReadOutAssembly* Event) | |
|
|
||
| // Check that this side is understood | ||
| if (m_SideToIndex.find(Side) == m_SideToIndex.end()) { | ||
| cout<<m_XmlTag | ||
| if (g_Verbosity >= c_Warning) cout<<m_XmlTag | ||
| <<": Error: Unable to identify Side "<<Side | ||
| <<" - skipping event" | ||
| <<endl; | ||
|
Comment on lines
+241
to
244
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This statement says |
||
|
|
@@ -429,7 +429,7 @@ bool MModuleTACCalibration::LoadTACCalFile(MString FName) | |
| // ReadOutID, Detector, Side, Strip, TAC cal, TAC cal error, TAC offset, TAC offset error | ||
| MFile F; | ||
| if (F.Open(FName) == false) { | ||
| cout<<m_XmlTag<<": Error: failed to open TAC Calibration file."<<endl; | ||
| if (g_Verbosity >= c_Error) cout<<m_XmlTag<<": Error: failed to open TAC Calibration file."<<endl; | ||
| return false; | ||
| } | ||
| MString Line; | ||
|
|
@@ -442,7 +442,7 @@ bool MModuleTACCalibration::LoadTACCalFile(MString FName) | |
| MString SideString = Tokens[1+IndexOffset].Trim(); | ||
| char Side; | ||
| if (SideString.Length()!=1) { | ||
| cout<<m_XmlTag<<": Error: Expected 1 character Side, got string \""<<SideString<<"\" in TAC calibration file."<<endl; | ||
| if (g_Verbosity >= c_Error) cout<<m_XmlTag<<": Error: Expected 1 character Side, got string \""<<SideString<<"\" in TAC calibration file."<<endl; | ||
| return false; | ||
| } | ||
| else { | ||
|
|
@@ -475,7 +475,7 @@ bool MModuleTACCalibration::LoadTACCalFile(MString FName) | |
| if (m_SideToIndex.find(Side) != m_SideToIndex.end()) { | ||
| m_TACCal[DetID][m_SideToIndex[Side]][StripID] = CalValues; | ||
| } else { | ||
| cout<<m_XmlTag<<": Error: Unable to identify Side \""<<Side<<"\" in TAC calibration file."<<endl; | ||
| if (g_Verbosity >= c_Error) cout<<m_XmlTag<<": Error: Unable to identify Side \""<<Side<<"\" in TAC calibration file."<<endl; | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -269,18 +269,18 @@ bool MSubModuleShieldTrigger::ParseDeadtimeFile() | |
|
|
||
| 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; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine doing whatever for the DEE SubModules 😃
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's move this to a follow-up PR |
||
| return false; | ||
| } | ||
|
|
||
| if (Parser.GetNLines() < 4) { | ||
| cout << m_Name << ": Deadtime file does not have enough data" << endl; | ||
| if (g_Verbosity >= c_Error) cout << m_Name << ": Deadtime file does not have enough data" << endl; | ||
| return false; | ||
| } | ||
|
|
||
| MTokenizer* ShieldTokenizer = Parser.GetTokenizerAt(3); | ||
| if (ShieldTokenizer->GetNTokens() != 5) { | ||
| cout << m_Name << ": Shield deadtime row must contain exactly 5 values" << endl; | ||
| if (g_Verbosity >= c_Error) cout << m_Name << ": Shield deadtime row must contain exactly 5 values" << endl; | ||
| return false; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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 everyMReadOutAssembly* Eventand would spam the terminal output, that's why I chosec_Warninghere.