/* Handeling the root files etc This is part of the code of when the .root file was made (in the program BinToRoot.cpp): if( ! ( f = fopen( argv[0], "r" ) ) ) die( "fopen" ); // Open the ROOT file (second argument) TFile *rootFile=new TFile(argv[1],"recreate"); // Declare the tree TTree *tree=new TTree("data","Hades Data"); // Define the branches tree->Branch("TimeStamp",&timeStamp,"TimeStamp/i"); tree->Branch("ADC1",&adc[0],"ADC1/s"); tree->Branch("ADC2",&adc[1],"ADC2/s"); tree->Branch("ADC3",&adc[2],"ADC3/s"); tree->Branch("ADC4",&adc[3],"ADC4/s"); while( !feof( f ) ) { pobj( f, no, decode ); if(!feof(f)) { tree->Fill(); } } rootFile->Write(); rootFile->Close(); fclose( f ); The program above works and produces root files with properties shown below: The "HADES root files" consist of the following stuff that can be seen with the command data.Print() ****************************************************************************** *Tree :data : Hades Data * *Entries : 81254 : Total = 980789 bytes File Size = 529771 * * : : Tree compression factor = 1.85 * ****************************************************************************** *Br 0 :TimeStamp : TimeStamp/i * *Entries : 81254 : Total Size= 326486 bytes File Size = 311481 * *Baskets : 10 : Basket Size= 32000 bytes Compression= 1.03 * *............................................................................* *Br 1 :ADC1 : ADC1/s * *Entries : 81254 : Total Size= 163499 bytes File Size = 35589 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 4.50 * *............................................................................* *Br 2 :ADC2 : ADC2/s * *Entries : 81254 : Total Size= 163499 bytes File Size = 86185 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 1.86 * *............................................................................* *Br 3 :ADC3 : ADC3/s * *Entries : 81254 : Total Size= 163499 bytes File Size = 84447 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 1.89 * *............................................................................* *Br 4 :ADC4 : ADC4/s * *Entries : 81254 : Total Size= 163499 bytes File Size = 1215 * *Baskets : 5 : Basket Size= 32000 bytes Compression= 131.68 * *............................................................................* so the variables are: TTree : data Br : TimeStamp, ADC1, ADC2, ADC3 (Br= Branches) The command below shows the data of the chosen variables data->Scan("TimeStamp:ADC1:ADC2:ADC3") ************************************************************ * Row * TimeStamp * ADC1 * ADC2 * ADC3 * ************************************************************ * 0 * 2495966 * 0 * 0 * 169 * * 1 * 7521115 * 0 * 0 * 2061 * * 2 * 14389177 * 0 * 0 * 613 * * 3 * 16308387 * 0 * 250 * 0 * * 4 * 82182597 * 0 * 0 * 119 * * 5 * 104654444 * 0 * 650 * 0 * * 6 * 108552198 * 0 * 2497 * 0 * * 7 * 125267814 * 0 * 1822 * 0 * * 8 * 141802437 * 0 * 0 * 832 * * 9 * 158192311 * 0 * 0 * 364 * * 10 * 160741608 * 0 * 0 * 1969 * * 11 * 162137955 * 1882 * 0 * 0 * * 12 * 163241243 * 0 * 0 * 2330 * * 13 * 165688062 * 0 * 2505 * 0 * * 14 * 167783339 * 304 * 0 * 0 * * 15 * 180723842 * 0 * 0 * 192 * To show the first event, use the command data->Show(24) - ======> EVENT:24 TimeStamp = 248791530 ADC1 = 0 ADC2 = 1011 ADC3 = 0 ADC4 = 0 */