Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/zip/inc/Compression.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class CompressionConfig

};

class PrecisionCascadeCompressionConfig : CompressionConfig
class PrecisionCascadeCompressionConfig : public CompressionConfig
{
public:
PrecisionCascadeCompressionConfig(RCompressionSetting::EAlgorithm::EValues algo,
Expand Down
1 change: 1 addition & 0 deletions tree/tree/inc/TBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class TBranch : public TNamed , public TAttFill {
void PrintCacheInfo() const;
virtual void ReadBasket(TBuffer &b);
void Register(UInt_t level, ROOT::Detail::TBranchPrecisionCascade &);
void Register(UInt_t level);
virtual void Refresh(TBranch *b);
virtual void Reset(Option_t *option="");
virtual void ResetAfterMerge(TFileMergeInfo *);
Expand Down
1 change: 1 addition & 0 deletions tree/tree/inc/TTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ class TTree : public TNamed, public TAttLine, public TAttFill, public TAttMarker
virtual void RemoveExternalFriend(TFriendElement *);
virtual void RemoveFriend(TTree*);
virtual void RecursiveRemove(TObject *obj);
void Register(UInt_t level);
virtual void Reset(Option_t* option = "");
virtual void ResetAfterMerge(TFileMergeInfo *);
virtual void ResetBranchAddress(TBranch *);
Expand Down
27 changes: 27 additions & 0 deletions tree/tree/src/TBranch.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include "TVirtualPerfStats.h"
#include "strlcpy.h"
#include "snprintf.h"
#include "TBranchPrecisionCascade.h"
#include "core/zip/src/PrecisionCascadeConfigArrayContent.h" // this file is not in an include path, so something must change

#include "TBranchIMTHelper.h"

Expand Down Expand Up @@ -2432,6 +2434,25 @@ void TBranch::Register(UInt_t level, ROOT::Detail::TBranchPrecisionCascade &prec
(*fPrecisionCascades)[level] = &precisionCascade;
}

////////////////////////////////////////////////////////////////////////////////
/// Register a new Precision Cascade element for this branch.
///
/// \param[in] level level or rank of the precision (starts at 1)
/// \param[in] precisionCascade Pointer to the information used to find the cascade elements.

void TBranch::Register(UInt_t level)
{
if (!fPrecisionCascades)
fPrecisionCascades = new std::vector<ROOT::Detail::TBranchPrecisionCascade *>;
// CHECK: should we require registration in incremental order?
if (fPrecisionCascades->size() < level + 1)
{
fPrecisionCascades->resize(level + 1);
(*fPrecisionCascades)[level] = new ROOT::Detail::TBranchPrecisionCascade(level,*this);
fTree->Register(level);
}
}

////////////////////////////////////////////////////////////////////////////////
/// Loop on all leaves of this branch to fill Basket buffer.

Expand Down Expand Up @@ -2764,6 +2785,12 @@ void TBranch::SetCompressionSettings(ROOT::CompressionConfig &config)
fCompConfig = new char[fNCompConfig];
std::memcpy(fCompConfig, config.GetConfigArray(), fNCompConfig);

if (fNCompConfig>0)
{
for (Int_t level=0;(size_t) level<((ROOT::Internal::PrecisionCascadeConfigArrayContent*) fCompConfig)->fLen;level++)
Register(level);
}

Int_t nb = fBranches.GetEntriesFast();
for (Int_t i=0;i<nb;i++) {
TBranch *branch = (TBranch*)fBranches.UncheckedAt(i);
Expand Down
16 changes: 16 additions & 0 deletions tree/tree/src/TTree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3286,6 +3286,22 @@ void TTree::Register(UInt_t level, ROOT::Detail::TTreePrecisionCascade &precisio

}

////////////////////////////////////////////////////////////////////////////////
/// Register a new TTreePrecisionCascade.
void TTree::Register(UInt_t level)
{
if (!fPrecisionCascades)
fPrecisionCascades = new std::vector<ROOT::Detail::TTreePrecisionCascade *>;
// CHECK: should we require registration in incremental order?
if (fPrecisionCascades->size() < level +1)
{
fPrecisionCascades->resize(level + 1);
(*fPrecisionCascades)[level] = new ROOT::Detail::TTreePrecisionCascade(*this,level);
}

}


////////////////////////////////////////////////////////////////////////////////
/// Open and connect to the Precission Cascade files when present.
/// Returns the number of opened files.
Expand Down