Attaching vector as a branch to an existing TTree

Hi Jakob,
Thank you for the explanation on RDataFrame! It’s a tool I’ll definitely be using in the future. I believe this solution is being stopped from working by an error I encountered in previous code, but ignored on the basis it seemed to have no effect on my output. This error is detailed here: Creating a TH1 type branch error

The error the RDataFrame produces looks like:

Error in <TBranchProxy::Read>: Unable to initialize BranchName
Error in <TTree::Branch>: Reference interface requires a valid object (for branch: BranchName!)
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)

Best wishes,
Jaiden