TTree::Draw of TRef (2)

Hi,

I open a new one since the original (https://root-forum.cern.ch/t/ttree-draw-of-tref/56272) has been closed automatically since nobody replied to me. Now @pcanal answered to me and I cannot reply…

To reply

  • so:

https://root-forum.cern.ch/t/ttree-draw-of-tref/56272/5?u=bozzochet

yes, I understood this and it is not a problem.

  • instead:

https://root-forum.cern.ch/t/ttree-draw-of-tref/56272/6?u=bozzochet

maybe I didn’t explain well…

TRef refCalPed[2][9]

is 2D, and this TRef points to

static calibelemAMSL0 calped[2][9];

Each calibelemAMSL0 is a struct with inside only

float value[1024]

so at the end it is a 3D object, not 2D. Why I need four indices to plot not 1 single element but all the 1024? Since is 3D I would expect the need to pass three indices to plot 1 single element of the struct data member. Instead I need to pass one index more (4 indices) and to plot the full struct data member array. There is a problem of two indices…

Isn’t it?

Thanks,
Matteo


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

_ROOT Version: 6.26/06
_Platform: M1Pro / MacOs Monterey 12.6.8
_Compiler: Apple clang version 14.0.0 (clang-1400.0.29.202)


Did you mean that each element in TRef refCalPed[2][9] points to one of the element in calped[2][9]?

Then indeed something seems to be going awry. I am not sure why and would need a standalone reproduce to investigate.

Yes,

each element points to a single element (i.e. a struct that inside has only a 1024 floats array…).

I’ll try to create a standalone reproducer in the next days…

Thanks,
Matteo

Hi,

I created a reproducer. I make it as a single file, to be compiled via ACLiC.

reproducer.C (4.1 KB)

To compile and use it:

bozzo@MBP-di-Bozzo:reproducer> root   
root [0] .L reproducer.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Volumes/amssw/duranti/btdaq/trunkBT/Decode/reproducer/./reproducer_C.so
root [1] reproducer()
The choosen compression level is 102
Processed 999 events
(int) 0
root [2] .q
bozzo@MBP-di-Bozzo:reproducer> root
root [0] .L reproducer.C++
Info in <TMacOSXSystem::ACLiC>: creating shared library /Volumes/amssw/duranti/btdaq/trunkBT/Decode/reproducer/./reproducer_C.so
root [1] TFile *_file0 = TFile::Open("foutput.root")
(TFile *) 0x135805c00
root [2] t4->Draw("refCalPed[0][0][0][0].value", "", "", 1)
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
(long long) 1024
root [3] .q

and it reproduces the effect I discussed.

Thanks,
Matteo

@pcanal did you find time to try my reproduce?

Thanks,
Matteo

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