Using ROOT only¶
If you know ROOT, the framework developed by CERN for particle physics data analysis, you can use it to look directly at the data files.
Note
Ignore this if you do not know ROOT. For most purposes, you do not need to know ROOT in order to use lartpc_mlreco3d
.
In ROOT¶
In the command line, you can open the file with root -b -l larcv.root
. The option -b
(batch mode) disables graphical usage and the option -l
tells it to skip the ROOT banner. Now you can examine it interactively using the usual ROOT commands.
The ROOT file contains several TTrees (which you can list with .ls
in the prompt). There are three types of TTrees in our ROOT files. The type of object stored in these TTrees depends on their name:
sparse3d_*
refers to a larcv::EventSparseTensor3D.cluster3d_*
refers to a larcv::EventClusterVoxel3D, a list of clusters of voxels.particle_*
refers to a larcv::EventParticle, a list oflarcv::Particle
objects.
In Python¶
Another way is to use PyROOT, the Python interface for ROOT.
import ROOT
from ROOT import TFile, TChain
Welcome to JupyROOT 6.22/09
Now open the file using ROOT:
import os
DATA_DIR = os.environ.get('DATA_DIR')
example = TFile(os.path.join(DATA_DIR, 'mpvmpr_012022_test_small.root' ))
example.ls()
TFile** /sdf/home/l/ldomine/lartpc_mlreco3d_tutorials/book/data/mpvmpr_012022_test_small.root
TFile* /sdf/home/l/ldomine/lartpc_mlreco3d_tutorials/book/data/mpvmpr_012022_test_small.root
KEY: TTree particle_mpv_tree;1 mpv tree
KEY: TTree neutrino_mpv_tree;1 mpv tree
KEY: TTree particle_mpr_tree;1 mpr tree
KEY: TTree neutrino_mpr_tree;1 mpr tree
KEY: TTree cluster3d_mcst_tree;1 mcst tree
KEY: TTree cluster3d_pcluster_tree;1 pcluster tree
KEY: TTree cluster3d_sed_tree;1 sed tree
KEY: TTree cluster3d_masked_true2reco_tree;1 masked_true2reco tree
KEY: TTree sparse3d_reco_tree;1 reco tree
KEY: TTree sparse3d_pcluster_index_tree;1 pcluster_index tree
KEY: TTree sparse3d_masked_true_tree;1 masked_true tree
KEY: TTree cluster3d_pcluster_highE_tree;1 pcluster_highE tree
KEY: TTree cluster3d_pcluster_lowE_tree;1 pcluster_lowE tree
KEY: TTree sparse3d_pcluster_leftover_tree;1 pcluster_leftover tree
KEY: TTree sparse3d_pcluster_semantics_tree;1 pcluster_semantics tree
KEY: TTree particle_pcluster_tree;1 pcluster tree
KEY: TTree cluster3d_sed_at_tree;1 sed_at tree
KEY: TTree sparse3d_reco_charge_asym_tree;1 reco_charge_asym tree
KEY: TTree sparse3d_reco_chi2_tree;1 reco_chi2 tree
KEY: TTree sparse3d_reco_occupancy_tree;1 reco_occupancy tree
KEY: TTree sparse3d_reco_hit_charge0_tree;1 reco_hit_charge0 tree
KEY: TTree sparse3d_reco_hit_charge1_tree;1 reco_hit_charge1 tree
KEY: TTree sparse3d_reco_hit_charge2_tree;1 reco_hit_charge2 tree
KEY: TTree sparse3d_reco_hit_amp0_tree;1 reco_hit_amp0 tree
KEY: TTree sparse3d_reco_hit_amp1_tree;1 reco_hit_amp1 tree
KEY: TTree sparse3d_reco_hit_amp2_tree;1 reco_hit_amp2 tree
KEY: TTree sparse3d_reco_hit_time0_tree;1 reco_hit_time0 tree
KEY: TTree sparse3d_reco_hit_time1_tree;1 reco_hit_time1 tree
KEY: TTree sparse3d_reco_hit_time2_tree;1 reco_hit_time2 tree
KEY: TTree sparse3d_reco_hit_rms0_tree;1 reco_hit_rms0 tree
KEY: TTree sparse3d_reco_hit_rms1_tree;1 reco_hit_rms1 tree
KEY: TTree sparse3d_reco_hit_rms2_tree;1 reco_hit_rms2 tree
KEY: TTree sparse3d_reco_hit_mult0_tree;1 reco_hit_mult0 tree
KEY: TTree sparse3d_reco_hit_mult1_tree;1 reco_hit_mult1 tree
KEY: TTree sparse3d_reco_hit_mult2_tree;1 reco_hit_mult2 tree
KEY: TTree sparse3d_reco_hit_cryo0_tree;1 reco_hit_cryo0 tree
KEY: TTree sparse3d_reco_hit_cryo1_tree;1 reco_hit_cryo1 tree
KEY: TTree sparse3d_reco_hit_cryo2_tree;1 reco_hit_cryo2 tree
KEY: TTree sparse3d_reco_hit_tpc0_tree;1 reco_hit_tpc0 tree
KEY: TTree sparse3d_reco_hit_tpc1_tree;1 reco_hit_tpc1 tree
KEY: TTree sparse3d_reco_hit_tpc2_tree;1 reco_hit_tpc2 tree
KEY: TTree sparse3d_pcluster_tree;1 pcluster tree
KEY: TTree sparse3d_sed_tree;1 sed tree
KEY: TTree sparse3d_pcluster_semantics_ghost_tree;1 pcluster_semantics_ghost tree
KEY: TTree particle_corrected_tree;1 corrected tree
Warning in <TClass::Init>: no dictionary for class larcv::EventNeutrino is available
Warning in <TClass::Init>: no dictionary for class larcv::NeutrinoSet is available
Warning in <TClass::Init>: no dictionary for class larcv::Neutrino is available
You can then manually browse the file. For example, if you wanted to look at the tree cluster3d_sed_tree
, see how many clusters are there and what is the size of each cluster:
tree = example.Get("cluster3d_pcluster_tree")
for entry in range(tree.GetEntries()):
tree.GetEntry(entry)
event = tree.cluster3d_pcluster_branch
clusters = event.as_vector()
print("Number of clusters = ", len(clusters))
for c in clusters:
clust = c.as_vector()
print("\t", clust.size())
Number of clusters = 51
1363
196
134
434
80
194
10
14
105
17
22
4
13
132
513
5
1
144
2
277
26
76
18
18
3
13
4
8
22
14
34
14
4
21
15
38
8
50
40
18
1
3
11
147
28
72
2
27
0
392
31
Number of clusters = 27
765
57
907
7
10
26
12
11
5
16
45
14
90
981
241
1640
35
64
8
1
27
0
51
17
0
0
0
Number of clusters = 32
135
34
129
510
172
16
8
1071
6
8
36
98
51
21
11
1
36
36
458
1048
281
146
960
27
0
23
0
37
0
0
0
46
Number of clusters = 9
746
264
2
812
0
0
0
0
0
Number of clusters = 36
1185
503
43
16
9
5
19
37
19
176
83
27
36
11
2
52
2
31
2
11
30
10
11
21
47
1
1856
192
21
48
37
44
0
0
0
0
Number of clusters = 22
110
117
27
18
16
13
459
99
1
5
29
3
13
44
24
13
4
1349
1444
0
56
84
Number of clusters = 17
249
32
217
64
100
87
97
9
161
70
0
1618
517
1027
22
0
4
Number of clusters = 28
749
152
26
8
4
1
30
267
126
7
19
85
45
57
1010
1083
326
2322
55
0
0
88
24
42
27
0
7
0
Number of clusters = 27
691
144
585
459
53
44
128
4
1
47
156
17
12
16
17
4
11
27
0
101
287
2147
21
21
44
73
0
Number of clusters = 27
773
153
190
107
708
2
129
45
36
3
11
13
4
11
86
31
38
11
654
0
0
0
0
0
0
0
0
Number of clusters = 23
0
975
106
320
65
35
20
192
11
38
15
37
12
15
0
0
236
150
1572
0
0
0
0
Number of clusters = 26
117
860
303
30
19
2
19
15
35
22
19
1
12
34
5
1
11
56
46
37
20
355
1824
57
11
7
Number of clusters = 12
2096
232
91
212
5
110
99
23
0
363
0
0
Number of clusters = 27
54
50
565
153
116
4
4
4
9
15
0
0
0
311
14
54
0
1307
1045
0
9
69
22
0
0
0
7
Number of clusters = 38
472
35
175
257
252
23
4
19
20
7
151
472
43
7
288
5
10
33
16
1
23
15
81
184
16
105
11
25
27
0
1577
905
0
72
76
0
17
0
Number of clusters = 46
1128
332
1220
52
491
28
575
33
13
15
6
4
8
155
13
15
13
1
90
12
352
131
12
11
58
182
24
8
17
16
12
14
55
5
22
18
1552
1060
38
56
0
23
36
5
0
0
Number of clusters = 21
692
496
432
12
15
21
11
91
3
7
1
15
40
13
56
23
11
160
474
0
0
Number of clusters = 29
369
332
34
404
417
0
690
3
1
70
10
24
13
140
23
28
11
52
20
7
7
31
5
5
3
0
0
0
0
Number of clusters = 57
629
194
36
333
4
144
906
80
12
79
6
90
26
14
14
48
27
14
42
16
30
221
846
5
1
13
3
2
37
4
22
11
11
11
2
1
13
38
16
10
72
54
9
6
135
12
18
10
3
2
3
69
20
708
113
12
0
Number of clusters = 30
552
526
8
6
5
497
274
59
73
8
98
1
1
16
0
0
1027
63
2761
983
76
9
18
0
29
22
16
0
0
9
Number of clusters = 35
386
90
43
345
88
208
12
6
7
6
21
114
41
11
5
61
60
8
9
16
8
7
13
8
6
8
43
36
35
700
896
0
0
0
7
Number of clusters = 22
299
153
494
222
15
8
11
85
17
16
5
7
15
8
6
1189
0
0
95
13
0
0
Number of clusters = 30
453
236
139
88
70
118
10
11
11
9
11
44
132
188
55
2
17
60
12
39
16
62
20
1
669
710
1331
0
0
0
Number of clusters = 33
833
429
91
4
4
4
7
119
117
216
124
159
40
74
13
21
12
42
44
22
5
23
20
37
207
547
866
125
27
115
48
30
25
Number of clusters = 27
1391
229
105
108
372
2
176
7
129
36
12
11
98
340
315
6
3
27
16
30
13
12
0
326
42
0
0
Number of clusters = 46
664
514
39
140
214
901
41
148
41
11
35
24
4
2
16
120
15
33
3
2
117
14
17
30
38
30
71
9
35
41
7
9
155
1
7
12
11
5
11
6
910
146
15
37
0
7
Number of clusters = 35
807
341
282
273
122
342
12
24
30
5
429
156
3
19
311
34
17
11
3
107
20
24
25
64
12
62
20
969
0
0
72
37
0
0
0
Number of clusters = 32
263
62
407
430
426
5
9
189
7
12
11
5
33
6
21
2
19
43
11
28
6
7
2
5
11
16
21
1729
0
0
0
0
Number of clusters = 43
838
75
71
38
179
607
1
32
16
30
6
104
5
3
7
0
13
348
59
5
17
355
51
6
2
3
55
13
7
25
34
11
15
786
320
0
0
0
0
31
0
120
30
Number of clusters = 53
953
19
852
136
145
492
42
34
17
30
221
34
19
17
43
10
5
14
11
12
16
52
105
231
3
15
7
11
11
134
157
16
169
29
9
1364
2258
0
22
97
26
44
31
0
5
35
0
116
1
0
0
0
3
Number of clusters = 24
73
337
369
525
301
10
98
233
70
5
45
1
26
75
17
14
0
0
0
41
0
0
0
0
Number of clusters = 12
645
216
9
150
909
214
93
0
60
27
18
6
Number of clusters = 13
2016
254
161
69
1360
858
0
76
20
0
83
60
9
Number of clusters = 22
219
464
55
33
7
135
380
215
10
15
26
14
2
11
24
1422
578
623
62
0
37
0
Number of clusters = 27
372
30
372
67
3
8
5
300
7
11
3
11
139
3
17
41
563
978
226
0
38
18
11
24
1
6
5
Number of clusters = 20
310
188
311
246
125
7
8
8
18
830
111
22
37
377
0
36
433
1321
49
0
Number of clusters = 26
689
154
43
301
50
88
42
11
35
24
27
131
48
1375
1627
271
38
0
28
52
0
29
14
57
18
11
Number of clusters = 20
394
409
106
246
333
215
77
72
36
58
11
5
23
3
46
5
85
7
805
92
Number of clusters = 41
220
523
125
59
579
288
4
303
1
8
2
23
14
18
8
26
23
11
468
242
260
102
90
55
66
9
137
0
949
1287
40
0
4
71
14
0
0
14
38
0
0
Number of clusters = 34
1298
159
488
162
571
3
11
6
10
6
8
11
3
24
323
220
43
25
12
3
1
1
36
9
4
82
737
247
22
20
12
78
25
0
Number of clusters = 27
168
187
141
393
818
54
5
7
6
6
37
7
265
212
56
17
10
13
15
0
1468
0
0
0
33
0
0
Number of clusters = 34
268
340
38
145
14
121
6
4
72
320
111
7
15
69
15
37
15
344
3
12
217
867
585
86
25
5
4
2
0
0
0
0
0
0
Number of clusters = 16
280
278
219
125
128
122
34
13
1908
313
1465
62
18
0
38
18
Number of clusters = 24
336
30
19
60
86
5
1
246
6
6
11
72
1
62
129
16
299
14
12
299
192
363
25
0
Number of clusters = 15
405
765
106
102
12
8
156
444
159
294
39
6
53
34
18
Number of clusters = 30
370
136
462
336
36
9
34
21
177
655
137
14
93
14
35
14
20
18
146
103
44
15
1
14
21
247
320
229
0
4
Number of clusters = 25
1052
22
71
604
52
20
10
11
11
2
9
6
14
5
7
4
30
0
0
0
0
0
0
0
0
Number of clusters = 31
143
99
580
506
59
29
15
118
446
12
31
1
193
14
17
14
31
45
3
622
160
0
471
289
28
0
133
28
27
0
6
Number of clusters = 12
397
170
260
39
38
20
27
197
67
239
71
5
Number of clusters = 30
299
51
101
498
321
26
7
6
124
15
7
4
17
8
65
53
36
2096
1203
1688
145
187
10
15
8
11
26
44
0
0
Number of clusters = 16
967
136
101
18
71
13
5
38
11
20
8
11
249
864
120
112
Number of clusters = 49
928
472
210
52
23
12
19
22
18
8
18
98
143
263
88
45
87
37
77
10
12
16
17
136
123
278
65
11
2
4
37
9
1776
367
25
0
0
0
0
37
120
20
27
0
22
0
0
16
6
Number of clusters = 36
2043
375
91
91
431
249
143
2
279
153
71
27
37
8
4
14
61
8
6
6
103
4
4
57
54
35
16
57
19
1944
533
47
275
37
62
23
Number of clusters = 17
196
18
146
181
86
6
178
162
86
560
36
29
29
0
114
80
45
Number of clusters = 22
928
114
55
180
10
12
0
113
1306
198
526
7
31
18
0
36
13
7
12
2
8
2
Number of clusters = 31
511
228
215
28
13
7
184
223
49
3
20
145
6
32
16
26
15
10
18
55
39
47
44
1182
189
13
7
50
15
0
0
Number of clusters = 63
1825
443
143
374
117
12
65
35
4
106
20
16
15
13
2
64
184
52
16
108
420
329
132
13
2
10
3
33
22
4
20
18
115
25
23
2
101
8
19
3
32
6
29
11
4
13
13
4
8
13
17
17
169
1051
929
24
12
0
31
11
16
2
0
Number of clusters = 38
274
105
175
143
16
37
14
422
2
10
11
323
36
35
37
42
76
149
287
15
52
31
11
164
11
69
4
214
26
55
0
0
0
0
59
17
0
0
Number of clusters = 17
788
89
109
587
6
2
16
18
59
11
4
295
695
251
79
0
0
Number of clusters = 25
274
142
27
465
69
35
14
52
391
283
42
4
111
31
77
14
7
69
199
30
0
0
102
7
0
Number of clusters = 23
897
86
87
53
117
324
1161
3
2
5
13
11
14
1
21
105
97
12
66
378
1179
0
0
Number of clusters = 13
1123
246
51
8
1642
176
159
58
15
70
39
0
0
Number of clusters = 27
393
88
667
30
11
31
70
67
502
9
48
1
17
26
6
71
32
0
1918
629
213
0
57
129
3
0
0
Number of clusters = 38
243
557
437
412
237
98
23
54
1
85
15
118
31
42
28
247
7
6
3
30
11
28
13
24
453
958
1261
33
0
0
34
0
3
0
0
0
0
0
Number of clusters = 40
1409
117
189
378
160
72
32
8
58
5
15
11
76
151
13
31
1
7
13
6
6
87
27
22
12
3
118
725
2940
0
0
0
0
53
27
91
0
139
34
0
Number of clusters = 34
1046
394
259
149
304
10
1
16
17
2
48
90
20
1
5
6
40
13
10
1
41
37
5
5
62
0
58
950
317
18
4
0
0
0
Number of clusters = 27
458
132
349
69
437
385
18
5
14
11
105
28
224
4
87
25
12
2
11
412
376
999
1241
24
0
12
5
Number of clusters = 16
191
56
273
13
51
9
3
799
221
469
0
0
17
14
0
2
Number of clusters = 31
154
472
575
160
388
137
31
75
4
90
79
16
62
2
6
6
1030
38
12
11
6
1
1
11
28
19
20
20
0
0
0
Number of clusters = 15
677
132
0
538
842
122
1857
1281
103
0
20
0
0
42
55
Number of clusters = 12
1265
227
94
11
105
1306
882
17
129
44
0
73
Number of clusters = 42
434
368
50
136
492
400
27
44
38
33
37
213
31
151
96
13
11
132
20
18
194
220
20
16
77
6
49
146
67
7
23
195
13
38
126
207
82
0
0
0
0
0
Number of clusters = 36
796
516
672
95
18
10
0
0
9
77
17
215
1
18
361
5
11
61
31
2
268
34
11
71
24
2
3
39
449
50
31
24
14
11
29
0
Number of clusters = 17
315
81
339
61
39
9
2
16
19
1265
88
108
0
0
41
19
0
Number of clusters = 15
1290
85
169
19
12
21
32
47
0
4
0
1172
0
0
0
Number of clusters = 39
681
486
101
233
268
1
335
98
103
22
8
13
12
15
178
61
5
23
373
379
104
19
31
33
41
15
9
58
24
74
66
4
29
49
16
86
44
0
0
Number of clusters = 31
555
13
97
58
54
37
560
14
12
17
11
37
84
2
8
15
14
13
10
11
4
27
14
20
64
11
37
10
296
0
0
Number of clusters = 14
1455
202
44
238
42
0
1294
1921
32
5
152
24
109
18
Number of clusters = 33
659
650
18
220
35
6
27
33
7
166
147
110
31
3
24
1
134
11
23
160
975
1999
458
0
0
55
30
19
28
0
25
18
6
Number of clusters = 36
819
364
14
117
20
82
133
154
21
6
6
13
1
72
16
107
68
65
22
12
34
14
25
13
5
22
26
24
15
0
206
5
14
48
0
0
Number of clusters = 20
110
152
8
4
1265
592
182
472
2065
18
34
0
7
21
12
31
28
30
0
0
Number of clusters = 17
2098
97
82
63
3
7
11
27
20
21
31
23
0
0
0
0
0
Number of clusters = 9
269
460
8
100
8
24
760
0
0
Number of clusters = 18
1312
15
165
272
65
6
6
55
16
13
0
1584
53
3
36
36
0
0
Number of clusters = 27
274
792
11
9
6
2
2
197
255
183
10
80
36
22
6
17
11
1580
5
26
22
0
0
0
0
0
0
Number of clusters = 32
297
702
132
436
12
8
5
6
392
128
2
95
21
15
21
78
11
11
10
3
21
15
49
165
2320
998
0
0
50
27
177
0
Number of clusters = 22
877
58
275
93
18
9
5
12
1
40
796
0
127
710
138
0
0
0
0
0
0
25
Number of clusters = 34
1394
196
278
41
59
7
23
115
131
181
19
9
5
48
128
13
14
31
7
11
30
77
9
126
12
13
15
44
6
15
12
0
0
0
Number of clusters = 35
2098
300
45
33
12
5
4
5
19
6
4
2
27
11
34
15
12
2
2
3
22
71
13
6
11
3
11
3
31
5
1096
0
60
0
0
Number of clusters = 38
914
170
52
95
66
1
98
121
146
38
71
20
71
451
121
25
16
17
5
36
25
11
9
23
16
11
233
27
2
24
14
1
135
88
637
42
0
0
Number of clusters = 37
1353
148
565
27
195
217
25
111
17
57
92
496
602
88
19
48
6
23
16
14
65
8
25
36
7
12
66
3
39
7
435
6
51
85
19
26
0
Number of clusters = 9
0
408
298
33
2
1061
0
0
0
Number of clusters = 34
1584
39
1014
34
83
267
11
22
4
31
23
5
85
1
13
58
12
145
12
13
6
41
427
93
71
17
2
1
20
3
0
0
0
26
Number of clusters = 12
714
629
90
31
1446
238
1359
47
20
0
66
1
Number of clusters = 25
1803
55
61
122
2
125
4
14
21
2
2
31
25
30
0
790
1205
396
133
21
0
0
0
0
0
Number of clusters = 29
943
689
41
677
49
178
125
129
39
31
25
13
13
19
8
2
25
19
68
2
7
16
18
48
11
392
1310
159
14
Number of clusters = 22
1059
176
12
577
213
225
7
164
34
7
13
25
119
62
556
242
83
72
0
80
22
0
Number of clusters = 11
662
36
45
56
881
594
0
25
101
0
0
Number of clusters = 22
274
134
145
165
6
16
21
4
10
26
9
17
133
3
42
31
1
11
0
0
0
0
Number of clusters = 33
1047
146
78
423
67
126
9
19
22
61
4
18
4
5
18
68
164
196
17
241
29
16
67
39
0
18
1118
881
0
0
43
0
0
Number of clusters = 14
32
311
180
10
224
40
8
122
35
192
37
0
0
3
Using LArCV to retrieve the image and visualize¶
Note
TODO Coming soon