Dear all,
I am trying to reduce the size of my TTree by cloning only some branches.
I am using a variation of copytree2.C to try to make it happen.
The trees have the following structure (showing only the “MissingET” branch, but it is a Delphes tree so has a lot more objects):
*............................................................................*
*Br 268 :MissingET : Int_t MissingET_ *
*Entries : 50000 : Total Size= 427568 bytes File Size = 80349 *
*Baskets : 110 : Basket Size= 64000 bytes Compression= 5.10 *
*............................................................................*
*Br 269 :MissingET.fUniqueID : UInt_t fUniqueID[MissingET_] *
*Entries : 50000 : Total Size= 413308 bytes File Size = 81119 *
*Baskets : 110 : Basket Size= 6656 bytes Compression= 5.06 *
*............................................................................*
*Br 270 :MissingET.fBits : UInt_t fBits[MissingET_] *
*Entries : 50000 : Total Size= 412852 bytes File Size = 81230 *
*Baskets : 110 : Basket Size= 6656 bytes Compression= 5.05 *
*............................................................................*
*Br 271 :MissingET.MET : Float_t MET[MissingET_] *
*Entries : 50000 : Total Size= 412624 bytes File Size = 276628 *
*Baskets : 110 : Basket Size= 6656 bytes Compression= 1.48 *
*............................................................................*
*Br 272 :MissingET.Eta : Float_t Eta[MissingET_] *
*Entries : 50000 : Total Size= 412624 bytes File Size = 284151 *
*Baskets : 110 : Basket Size= 6656 bytes Compression= 1.44 *
*............................................................................*
*Br 273 :MissingET.Phi : Float_t Phi[MissingET_] *
*Entries : 50000 : Total Size= 412624 bytes File Size = 284844 *
*Baskets : 110 : Basket Size= 6656 bytes Compression= 1.44 *
*............................................................................*
*Br 274 :MissingET_size : MissingET_size/I *
*Entries : 50000 : Total Size= 211770 bytes File Size = 13748 *
*Baskets : 110 : Basket Size= 4137 bytes Compression= 15.22 *
*............................................................................*
Running this causes the following crash:
*** Break *** segmentation violation
Generating stack trace...
0x000000011d5a3163 in TBranchElement::GetEntry(long long, int) (in libTree.so) + 163
0x000000011d5e1faa in TTree::GetEntry(long long, int) (in libTree.so) + 186
0x000000011d5df0ed in TTree::CopyEntries(TTree*, long long, char const*) (in libTree.so) + 1805
0x0000000119b996af in <unknown function>
0x0000000119b9904d in <unknown function>
0x0000000107f9aadf in cling::IncrementalExecutor::executeWrapper(llvm::StringRef, cling::Value*) (in libCling.so) + 383
0x0000000107f98f3a in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in libCling.so) + 154
0x0000000107f983e9 in cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) (in l
0x0000000107f97da2 in cling::Interpreter::process(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::Value*, cling::Transaction**) (in libCling.so) + 98
0x0000000107fd32ab in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in libCling.so) + 427
0x0000000107ea8275 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in libCling.so) + 981
0x0000000107c171ed in TRint::ProcessLineNr(char const*, char const*, int*) (in libRint.so) + 205
0x0000000107c17d29 in TRint::HandleTermInput() (in libRint.so) + 649
0x00000001079cd387 in TUnixSystem::CheckDescriptors() (in libCore.so) + 327
0x00000001079d620b in TMacOSXSystem::DispatchOneEvent(bool) (in libCore.so) + 395
0x000000010794b75a in TSystem::InnerLoop() (in libCore.so) + 26
0x000000010794b5ae in TSystem::Run() (in libCore.so) + 206
0x00000001078e7d34 in TApplication::Run(bool) (in libCore.so) + 36
0x0000000107c170af in TRint::Run(bool) (in libRint.so) + 1375
0x000000010786eebf in main (in root.exe) + 79
0x00007fff9e0025ad in start (in libdyld.dylib) + 1
Root > .q
So, at this point I am at a loss. I understand that this has to do with the subtleties of the split level of the branches, TClonesArray, and so on; however, up until now I have not managed to navigate this? Can somebody give me some hints?
Cheers,
Thiago
copytree2.C (4.03 KB)