Warning in <TTree::ReadStream>: Couldn't read formatted data in "Voltaje(mV)" for branch Voltaje(mV) on line 1; ignoring line
Warning in <TTree::ReadStream>: Read too few columns (1 < 8) in line 1; ignoring line
16
Error in <TTree::SetBranchAddress>: The pointer type given "Float_t" (5) does not correspond to the type needed "Double_t" (8) by the branch: Voltaje(mV)
Warning in <TTree::ReadStream>: Couldn't read formatted data in "Voltaje(mV)" for branch Voltaje_mV on line 1; ignoring line
Warning in <TTree::ReadStream>: Read too few columns (1 < 8) in line 1; ignoring line
I need this data to make a graph. I cannot ignore the warning.
Thanks @eguiraud ,
I tried to use TTree before directly and it works. I was trying to understand how to call TTree.ReadFile with other parameters than default ones. Using TTree directly makes my data as Float_t (this is enough for me now); nevertheless, I was trying to create Double_t data.
Hi,
I upload things here, the .cvs is a .txt since I can’t upload .csv here, just change extension. Here is the error:
------------------------------------------------------------------
| Welcome to ROOT 6.24/06 https://root.cern |
| (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for linuxx8664gcc on Sep 02 2021, 14:20:23 |
| From tags/v6-24-06@v6-24-06 |
| With |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0]
Processing Minimal.c...
Warning in <TTree::ReadStream>: Couldn't read formatted data in "Voltaje(mV)" for branch Voltaje_mV on line 1; ignoring line
Warning in <TTree::ReadStream>: Read too few columns (1 < 8) in line 1; ignoring line
Error in <TTree::SetBranchAddress>: unknown branch -> Voltaje(mV)
Error in <TTree::SetBranchAddress>: unknown branch -> Etension(mV)
Hi @acgc99 ,
you can check with tree->Print() what schema the tree constructed from your CSV file has:
******************************************************************************
*Tree :tree : tree title *
*Entries : 16 : Total = 6552 bytes File Size = 0 *
* : : Tree compression factor = 1.00 *
******************************************************************************
*Br 0 :Voltaje_mV : Voltaje_mV/D *
*Entries : 16 : Total Size= 811 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 1 :CH1 : CH1/D *
*Entries : 16 : Total Size= 769 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 2 :CH2 : CH2/D *
*Entries : 16 : Total Size= 769 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 3 :CH12 : CH12/D *
*Entries : 16 : Total Size= 775 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 4 :Etension_mV : Etension_mV/D *
*Entries : 16 : Total Size= 817 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 5 :ECH1 : ECH1/D *
*Entries : 16 : Total Size= 775 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 6 :ECH2 : ECH2/D *
*Entries : 16 : Total Size= 775 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
*Br 7 :ECH12 : ECH12/D *
*Entries : 16 : Total Size= 781 bytes One basket in memory *
*Baskets : 0 : Basket Size= 32000 bytes Compression= 1.00 *
*............................................................................*
As you see the name of the “Voltaje(mV)” column has been transformed to “Voltaje_mV”. So changing your code to mimic what @Wile_E_Coyote suggests should do the trick (and adding a # at the beginning of the first line will remove the warnings).