create_imaplist.py
Go to the documentation of this file.
1 import os,sys
2 import ROOT
3 
4 
5 status=0
6 while status==0:
7  status= ROOT.gSystem.Load("libdk.so")
8 
9 print("STATUS ",status)
10 
11 input_rfile = str(sys.argv[1])
12 
13 dk2nu = ROOT.bsim.Dk2Nu
14 
15 _file = ROOT.TFile(input_rfile)
16 
17 _dk2nu = _file.Get("dk2nuTree")
18 
19 nentries = _dk2nu.GetEntriesFast()
20 print("Total Entries ",nentries)
21 
22 
23 vol_list={}
24 for i in range(0,nentries):
25  _dk2nu.GetEntry(i)
26  anc_size = _dk2nu.dk2nu.ancestor.size()
27  for j in range(0,anc_size):
28  mat_name = _dk2nu.dk2nu.ancestor[j].imat
29  vol_name = _dk2nu.dk2nu.ancestor[j].ivol
30  vol_list[vol_name]=mat_name
31 
32 
33 
34 #print(vol_list)
35 volume=[]
36 material=[]
37 
38 for vol in vol_list:
39  print(vol,vol_list[vol])
40  material_name = vol_list[vol]
41  volume_name = vol
42  if material_name=="Target":
43  material_name="Carbon"
44  if material_name=="TitaniumG5":
45  material_name="Titanium"
46  #print (volume_name," ",material_name)
47  volume.append(volume_name)
48  material.append(material_name)
49 
50 print (len(volume))
51 
52 print(volume)
53 
54 print("*********************************")
55 
56 print(material)
static QCString str