Hello all,
This is maybe a more C++ related question, but I didn’t find a solution for the problem.
- I have a tree that as branch as an array, that is, if I do
t1->Print()
I have as output something like:
*.......................................................................................................................*
*Br 109 :myval : myval[npoints]/F
*Entries : 110 : Total Size= 2135 bytes File Size = 354
*Baskets : 1 : Basket Size= 32000 bytes Compression= 4.01
*.......................................................................................................................*
I have a script that reads everything just fine. However, I am currently using something like:
const Int_t npoints = 10;
class DATA{
public:
Floart_t val[npoints];
};
And this works fine. However, I have different npoints for different root files and I would like to be able to run it more easily.
One way that works, but gives me " *** Break *** segmentation violation" error is doing so:
class DATA{
public:
Float_t *val;
DATA(const Int_t npoints){
val = new Float_t[npoints];
}
};
Where I can initialize the class with npoints as parameter.
Is there any way that I can read the branch setting the length of the array at the beginning of the code?
PS.: vector’s also worked giving the same error.
PS2.: If needed I can try to create a quick example to reproduce the problem. But in principal, the reading (and writing) methods are shown in tutorial/tree2.C
Best regards,
Henrique
ROOT Version: 26.04
Platform: Ubuntu 21.10 impish (x86-64)
Compiler: (gcc/g++ 11.2.0)