Hello,
My root files consist of 4 Branches: TimeStamp, ADC1, ADC2, ADC3 and ADC4 (with events from 24 hours).
I have many of these root files and would like to add for example ADC1 in several root files.
I have made some print outs from root to show how the tree looks (see also in nicer organized form in the attached file):
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
After a lot of searching and reading of the documentation, I still don’t know how to start - it’s just such an immense lot of information for a beginner I need to do the following things:
- Access the branches and energy calibrate with the expressions below + then make histograms:
- konst2 * ADC2 + M2
- konst3 * ADC3 + M3
-
Save the histograms (i guess?).
-
Do the same for all my root-files in the same folder (from the same week of measurements). They are called for example s00074_001, s00074_002 etc which data from 24h in each.
-
Add all the ADC1 histograms from all consequtive days together and do the same for ADC2 and ADC3. This should now be OK since they are energy calibrated with the expressions above (in 1) so the peaks should end up on the same places. Is that correct?
How do I go about this?
Should I create a new tree called for example s00074 with all the summed histos in?
Or should I just save the histos in the first tree (data in s00074_001.root)?
How do I in the smartest way fill a histo with a branch and use the expression at the same time so it’s calibrated?
I guess I should be able to use an “add” function on the histos, to add all together?
Sorry for all the basics, but I hope to learn something from this (in combination with the continous reading of the documentation, since I have no one around to ask)
root_commands_&_specs.cpp (4.38 KB)