Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
155
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
34
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
Merge requests
!32
GAUDI-1099: revert to old behaviour on bad input
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
GAUDI-1099: revert to old behaviour on bad input
clemenci/Gaudi:GAUDI-1099
into
master
Overview
1
Commits
3
Pipelines
0
Changes
Merged
Marco Clemencic
requested to merge
clemenci/Gaudi:GAUDI-1099
into
master
9 years ago
Overview
1
Commits
3
Pipelines
0
Changes
-
Expand
👍
0
👎
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d99de2ad
3 commits,
9 years ago
+
13
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
RootHistCnv/src/RDirectoryCnv.cpp
+
13
−
1
Options
@@ -6,6 +6,8 @@
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/NTuple.h"
#include "boost/optional.hpp"
#include "RDirectoryCnv.h"
// Root files
@@ -20,6 +22,16 @@
#include "TH2.h"
#include "TH3.h"
namespace {
constexpr struct maybe_stol_t {
boost::optional<int> operator()(const std::string& s) const {
auto pos = s.find_first_of("0123456789+-");
if ( pos == std::string::npos ) return boost::none;
return std::stol( s.substr(pos) );
}
} maybe_stol {};
}
DECLARE_NAMESPACE_CONVERTER_FACTORY(RootHistCnv,RDirectoryCnv)
@@ -84,7 +96,7 @@ RootHistCnv::RDirectoryCnv::fillObjRefs(IOpaqueAddress* pAddr,DataObject* pObj)
std::string title = obj->GetTitle();
std::string sid = obj->GetName();
std::string f2 = full + "/" + sid;
int idh =
std::
stol(
sid
.substr(sid.find_first_of("0123456789"))
);
int idh =
maybe_
stol(sid
).get_value_or(0
);
// introduced by Grigori Rybkine
std::string clname = key->GetClassName();
std::string clnm = clname.substr(0,3);
Loading