Extract data from UShort_t

Hello, is it possible to extract the data from a UShort_t data ? I mean, i believ i have in my tree, a branch named Psd_All_Shift and i can get it’s data in UShort_t. Those data should be array, one array per entry.

std::unique_ptr<TFile> myFile( TFile::Open("RAW148OS_treeFF01.root") );
auto tree = myFile->Get<TTree>("Analysis_All");
UShort_t variable;
tree->SetBranchAddress("PsdNdRShift", &variable);

for (int iEntry = 0; tree->LoadTree(iEntry) >= 0; ++iEntry) {
   std::cout << "Entrée " << iEntry << ": " << variable << std::endl;

As you can see here, i can get the value of my branch per entry. But this value is useless since i can’t get what’s inside. I don’t really know if what i’m asking have any sense to you since i’m a very begginer on root, but i hope you’ll understand my problem.

Dear @KillianUB ,

Thanks for the new post. You have already asked the same question, I answered on the original one at How to get the data for only one branch - #9 by vpadulan


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.