A TFriendElement
that remembers the list of files and slicing of a ChainSlice.
#include <FriendUtils.h>
◆ SlicedFriendElement() [1/4]
◆ SlicedFriendElement() [2/4]
Constructs an SlicedFriendElement without attaching it to the parent.
See the corresponding TFriendElement
constructor.
41 : TFriendElement(parent, friendChain, alias)
49 for (
const TObject * el : *friendChain->GetListOfFiles()) {
51 auto named =
dynamic_cast<const TNamed *
>(el);
54 BOOST_THROW_EXCEPTION(
55 std::logic_error(
"unexpected chain structure"));
57 auto name = TString(el->GetTitle()) +
"?#" + el->GetName();
◆ ~SlicedFriendElement() [1/2]
◆ SlicedFriendElement() [3/4]
◆ SlicedFriendElement() [4/4]
◆ ~SlicedFriendElement() [2/2]
◆ AddTo() [1/2]
Adds a ChainSlice
as a friend to a TTree
.
The chain is added to the list of friends of the tree. Entry 0 in the tree is matched to entry 0 in the chain, taking the offset into account. The chain offset must be set before using this function or it will not be stored correctly.
- Todo:
- ROOT does a few extra checks when adding a friend. Easier to do if upstreaming.
86 auto friends = tree->GetListOfFriends();
91 tree->RemoveFriend(&t);
92 friends = tree->GetListOfFriends();
96 BOOST_THROW_EXCEPTION(
97 std::logic_error(
"could not create TTree list of friends"));
101 friends->Add(element);
◆ AddTo() [2/2]
◆ GetBegin() [1/2]
Long64_t GetBegin |
( |
| ) |
const |
|
inline |
Index of the first entry to use in the chain.
◆ GetBegin() [2/2]
Long64_t GetBegin |
( |
| ) |
const |
|
inline |
Index of the first entry to use in the chain.
◆ GetEnd() [1/2]
Long64_t GetEnd |
( |
| ) |
const |
|
inline |
Index of a past-the-end entry to use in the chain.
◆ GetEnd() [2/2]
Long64_t GetEnd |
( |
| ) |
const |
|
inline |
Index of a past-the-end entry to use in the chain.
◆ GetFile() [1/2]
◆ GetFile() [2/2]
Always returns nullptr
, as ChainSlice cover multiple files.
◆ GetListOfTrees() [1/2]
TList* GetListOfTrees |
( |
| ) |
const |
|
inline |
Returns the list of trees in the associated chain.
The list contains strings in a format suitable for TChain::AddFileInfoList
.
◆ GetListOfTrees() [2/2]
TList* GetListOfTrees |
( |
| ) |
const |
|
inline |
Returns the list of trees in the associated chain.
The list contains strings in a format suitable for TChain::AddFileInfoList
.
◆ GetTree() [1/2]
See TFriendElement::GetTree
.
This returns a ChainSlice.
117 fChain->RegisterExternalFriend(
this);
157 if (!
fNotify.IsLinked() && !
dynamic_cast<TChain *
>(GetParentTree())) {
158 fNotify.PrependLink(*GetParentTree());
◆ GetTree() [2/2]
◆ Notify() [1/2]
Gets notification about modified TTrees.
◆ Notify() [2/2]
◆ Print() [1/2]
void Print |
( |
Option_t * |
opt = 0 | ) |
const |
|
override |
◆ Print() [2/2]
void Print |
( |
Option_t * |
opt = 0 | ) |
const |
|
override |
Prints information about the trees in this friend element.
195 Printf(
"Contains %d trees, slice [%lld:%lld):",
fTrees->GetSize(),
fBegin,
fEnd);
196 for (
const TObject * tree : *
fTrees)
197 Printf(
"- %s", tree->GetName());
199 Printf(
"Contains no trees, slice [%lld:%lld)",
fBegin,
fEnd);
◆ fBegin
◆ fChain
◆ fEnd
◆ fNotify
◆ fOwnsChain
! Whether we own the tree.
◆ fTrees
The list of trees in the chain.
The list contains strings in a format suitable for TChain::AddFileInfoList
. We keep track of this separately from the chain because fChain
isn't saved. This list does get saved.
The documentation for this class was generated from the following files:
- /builds/cms-analysis/general/DasAnalysisSystem/Core/Installer/Darwin/interface/FriendUtils.h
- /builds/cms-analysis/general/DasAnalysisSystem/Core/Installer/Darwin/src/FriendUtils.cc