Skip to content

Snapshotting TLVectors #1

@mroguljic

Description

@mroguljic

Python3 version of TIMBER complains if one wants to save derived STL classes, such as vectors of FatJet vectors (TLVectors).
The errors message is

Error in <TTree::Branch>: The class requested (vector<ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> >,ROOT::Detail::VecOps::RAdoptAllocator<ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > > >) for the branch "FatJet_vec" is an instance of an stl collection and does not have a compiled CollectionProxy. Please generate the dictionary for this collection (vector<ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> >,ROOT::Detail::VecOps::RAdoptAllocator<ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > > >) to avoid to write corrupted data.

The solution is hinted at here
Current workaround is to generate a file "TLVec_dict.h" with the following content:

#include <vector>
#include <Math/PtEtaPhiM4D.h>
#include <Math/LorentzVector.h>
#include <ROOT/RAdoptAllocator.hxx>

#pragma link C++ class vector<ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> >,ROOT::Detail::VecOps::RAdoptAllocator<ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > > >;

and add the following line in the script before snapshotting: r.gInterpreter.ProcessLine('.L TLVec_dict.h+')

To do:
Figure out a way to systematically do it with TIMBER. That is, instead of calling it from a script, this line shoud be automatically called by TIMBER either always or when TLVectors are used. We should also include the .so, .pcm and .d file, created after the ProcessLine call, so that we skip the compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions