I'm Stuck with my code

Hello, I’m trying to extract the data from Branch named as Psd_All_Shift. Those data are Column ROOT::VecOps::RVec<UShort_t> has type ROOT::VecOps::RVec<UShort_t>.
TTree::Scan(“Psd_All_Shift”) returns me :

wish is exacltly what i’m looking for. ROW is my event number, Instance is my detector, and Psd_All_S is the bin where my neutron/gamma has been detected.

I’ve tried this code to extract those data :

TFile f("RAW148OS_treeFF01.root");
std::unique_ptr<TTree> tree(dynamic_cast<TTree*>(f.Get("Analysis_All")));
ROOT::EnableImplicitMT(); // Enable ROOT's implicit multi-threading
ROOT::RDataFrame d("Analysis_All", "RAW148OS_treeFF01.root"); // Interface to TTree and TChain

// Obtention d'un vecteur de données à partir de l'élément "Psd_All_Shift" de l'arbre
auto rvec = d.Take<ROOT::RVec<UShort_t>>("Psd_All_Shift");
// Affichage des valeurs de rvec
for (const auto& value : rvec) {
    std::cout << value << std::endl;

wish returns me :

as you can see, it doesn’t makes sens and doesn’t match with the tree->Scan().
Does anyone know why ?
By the way, I’m a real begginer on root, I’ve read the manual as much as possible but here i’m stuck.
Thanks !


Why do you say it does not make sense?


Hello; the picture I sent litterally show that one detection has been registred in one detector with the same energy for hundreds event. But if you look at how it should looks on that pics wish is TTree::Scan(“Branch”) ;

This is the data i want, here you can see for event 2278, detectors 14,16 and 27 has detected somthing on the bin 2149,2289 and 2018.

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