# Extract data from UShort\_t

**URL:** <https://root-forum.cern.ch/t/extract-data-from-ushort-t/59260>\
**Category:** ROOT\
**Created:** [May 7, 2024, 2:30pm UTC](https://root-forum.cern.ch/t/extract-data-from-ushort-t/59260 "2024-05-07T14:30:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KillianUB](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@KillianUB](https://root-forum.cern.ch/u/KillianUB)\
**Post date:** [May 7, 2024, 2:30pm UTC](https://root-forum.cern.ch/t/extract-data-from-ushort-t/59260/1 "2024-05-07T14:30:34Z")

</div>

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.

```auto
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) {
   tree->GetEntry(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.

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [May 7, 2024, 4:54pm UTC](https://root-forum.cern.ch/t/extract-data-from-ushort-t/59260/2 "2024-05-07T16:54:36Z")

</div>

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](https://root-forum.cern.ch/t/how-to-get-the-data-for-only-one-branch/59240/9)

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 21, 2024, 4:54pm UTC](https://root-forum.cern.ch/t/extract-data-from-ushort-t/59260/3 "2024-05-21T16:54:59Z")

</div>

Closed on May 21, 2024, 4:54pm UTC

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