Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaudi
Gaudi
Commits
4e698e4e
Commit
4e698e4e
authored
3 years ago
by
Stewart Martin-Haugh
Committed by
Frank Winklmeier
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Protect DEBUG/VERBOSE messages
parent
815e0b15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1284
THistSvc: cache TObject types
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GaudiSvc/src/THistSvc/THistSvc.cpp
+10
-3
10 additions, 3 deletions
GaudiSvc/src/THistSvc/THistSvc.cpp
GaudiSvc/src/THistSvc/THistSvc.icc
+20
-10
20 additions, 10 deletions
GaudiSvc/src/THistSvc/THistSvc.icc
with
30 additions
and
13 deletions
GaudiSvc/src/THistSvc/THistSvc.cpp
+
10
−
3
View file @
4e698e4e
...
...
@@ -121,7 +121,9 @@ StatusCode THistSvc::initialize() {
error
()
<<
"unable to get the FileMgr"
<<
endmsg
;
st
=
StatusCode
::
FAILURE
;
}
else
{
debug
()
<<
"got the FileMgr"
<<
endmsg
;
if
(
msgLevel
(
MSG
::
DEBUG
)
)
{
debug
()
<<
"got the FileMgr"
<<
endmsg
;
}
}
// Register open/close callback actions
...
...
@@ -582,7 +584,10 @@ StatusCode THistSvc::deReg( const std::string& id ) {
}
vhid_t
*
vh
=
itr
->
second
;
debug
()
<<
"will deregister "
<<
vh
->
size
()
<<
" elements of id
\"
"
<<
id
<<
"
\"
"
<<
endmsg
;
if
(
msgLevel
(
MSG
::
DEBUG
)
)
{
debug
()
<<
"will deregister "
<<
vh
->
size
()
<<
" elements of id
\"
"
<<
id
<<
"
\"
"
<<
endmsg
;
}
StatusCode
sc
(
StatusCode
::
SUCCESS
);
// vh will get deleted in deReg once empty, so we cannot query the list size in the loop
size_t
vh_size
=
vh
->
size
();
...
...
@@ -612,7 +617,9 @@ StatusCode THistSvc::deReg( TObject* obj ) {
if
(
vhid
->
size
()
==
1
)
{
// We are the last object, so we have to delete vhid properly
debug
()
<<
"vhid for "
<<
hid
.
id
<<
" is empty. deleting"
<<
endmsg
;
if
(
msgLevel
(
MSG
::
DEBUG
)
)
{
debug
()
<<
"vhid for "
<<
hid
.
id
<<
" is empty. deleting"
<<
endmsg
;
}
std
::
string
root
,
rem
;
parseString
(
hid
.
id
,
root
,
rem
);
...
...
This diff is collapsed.
Click to expand it.
GaudiSvc/src/THistSvc/THistSvc.icc
+
20
−
10
View file @
4e698e4e
...
...
@@ -37,7 +37,9 @@ StatusCode THistSvc::regHist_i( std::unique_ptr<T> hist_unique, const std::strin
// It is sad that we lose propper memory management here
T* hist = nullptr;
if ( hist_unique.get() != nullptr ) { hist = hist_unique.release(); }
debug() << "regHist_i obj: " << hist << " id: " << id << " s: " << shared << endmsg;
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "regHist_i obj: " << hist << " id: " << id << " s: " << shared << endmsg;
}
std::string idr( id );
removeDoubleSlash( idr );
...
...
@@ -70,7 +72,9 @@ StatusCode THistSvc::regHist_i( std::unique_ptr<T> hist_unique, const std::strin
delete hist;
return StatusCode::FAILURE;
} else {
debug() << "previously registered id \"" << uid << "\": num " << uitr->second->size() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "previously registered id \"" << uid << "\": num " << uitr->second->size() << endmsg;
}
}
}
...
...
@@ -142,11 +146,13 @@ StatusCode THistSvc::regHist_i( std::unique_ptr<T> hist_unique, const std::strin
fname = f->GetName();
}
debug() << "Registering" << ( shared ? " shared " : " " ) << System::typeinfoName( typeid( *hist ) ) << " title: \""
<< hist->GetTitle() << "\" id: \"" << uid
<< "\" dir: "
// << hist->GetDirectory()->GetPath() << " "
<< changeDir( hid )->GetPath() << " file: " << fname << endmsg;
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "Registering" << ( shared ? " shared " : " " ) << System::typeinfoName( typeid( *hist ) ) << " title: \""
<< hist->GetTitle() << "\" id: \"" << uid
<< "\" dir: "
// << hist->GetDirectory()->GetPath() << " "
<< changeDir( hid )->GetPath() << " file: " << fname << endmsg;
}
// create a mutex for all shared histograms
if ( shared ) { hid.mutex = new histMut_t; }
...
...
@@ -168,7 +174,7 @@ StatusCode THistSvc::regHist_i( std::unique_ptr<T> hist_unique, const std::strin
m_tobjs.emplace( to, std::pair<vhid_t*, size_t>( vi, 0 ) );
}
debug() << "regHist_i THistID: " << hid << endmsg;
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "regHist_i THistID: " << hid << endmsg;
}
return StatusCode::SUCCESS;
}
...
...
@@ -207,7 +213,9 @@ T* THistSvc::getHist_i( const std::string& id, const size_t& ind, bool quiet ) c
error() << "dcast failed, Hist id: \"" << id << "\"" << endmsg;
return nullptr;
}
verbose() << "found unique Hist title: \"" << hist->GetTitle() << "\" id: \"" << id << "\"" << endmsg;
if ( msgLevel( MSG::VERBOSE) ) {
verbose() << "found unique Hist title: \"" << hist->GetTitle() << "\" id: \"" << id << "\"" << endmsg;
}
}
return hist;
...
...
@@ -318,7 +326,9 @@ LockedHandle<T> THistSvc::getShared_i( const std::string& name ) const {
T* h1 = dynamic_cast<T*>( hid->obj );
hist = LockedHandle<T>( h1, hid->mutex );
debug() << "getSharedHist: found THistID: " << *hid << endmsg;
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "getSharedHist: found THistID: " << *hid << endmsg;
}
} else if ( i == 0 ) {
error() << "no histograms matching id \"" << name << "\" found" << endmsg;
} else {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment