Skip to content
Snippets Groups Projects
Commit 8a6ec5c6 authored by Danilo Piparo's avatar Danilo Piparo
Browse files

Further optimise TThreadedObject for histograms

parent bc822b3c
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ namespace ROOT {
}
/// Return a copy of the object or a "Clone" if the copy constructor is not implemented.
template<class T, bool isCopyConstructible = std::is_copy_constructible<T>::value>
template<class T, bool isCopyConstructible = std::is_copy_constructible<T>::value, bool ISHISTO = std::is_base_of<TH1,T>::value>
struct Cloner {
static T *Clone(const T *obj, TDirectory* d = nullptr) {
T* clone;
......@@ -56,7 +56,7 @@ namespace ROOT {
};
template<class T>
struct Cloner<T, false> {
struct Cloner<T, false, false> {
static T *Clone(const T *obj, TDirectory* d = nullptr) {
T* clone;
if (d){
......@@ -69,6 +69,20 @@ namespace ROOT {
}
};
template<class T>
struct Cloner<T, true, true> {
static T *Clone(const T *obj, TDirectory* d = nullptr) {
T* clone;
if (d){
clone = (T*)obj->Clone();
} else {
clone = (T*)obj->Clone();
}
clone->SetDirectory(nullptr);
return clone;
}
};
template<class T, bool ISHISTO = std::is_base_of<TH1,T>::value>
struct DirCreator{
static std::vector<TDirectory*> Create(unsigned maxSlots) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment