Functions | Variables
soup Namespace Reference

Functions

def mean_density (fs, ds)
 
def tot_weight (compos)
 
def tot_fractions (fs)
 
def elem_frac (compos, elem)
 
def elem_frac_total (elem, comps, fs)
 
def soup_composition ()
 
def old_soup_composition ()
 
def radlength (compos, name, verbose)
 
def totalstoppingpower (compos, name, verbose)
 

Variables

dictionary compositions
 
 gluecomp = print_composition(compositions['glue'])
 
 scintcomp = print_composition(compositions['scint early'])
 
 pvccomp = print_composition(compositions['pvc'])
 
dictionary fractions
 
dictionary nd_fractions
 
dictionary densities
 
 soup = soup_composition()
 
 old_soup = old_soup_composition()
 
float plane = 6.61
 
 oldmeandensity = mean_density(old_fractions, old_densities)
 
 newmeandensity = mean_density( fractions, densities)
 
 nd_newmeandensity = mean_density( nd_fractions, densities)
 
 oldrl = radlength(old_soup, "Old Soup", True)
 
 poldrl = oldrl/mean_density(old_fractions, old_densities)
 
 newrl = radlength(soup, "Soup", True)
 
 pnewrl = newrl/mean_density(fractions, densities)
 
 oldstop = totalstoppingpower(old_soup, "Old Soup", True)
 
 newstop = totalstoppingpower(soup, "Soup", True)
 

Function Documentation

def soup.elem_frac (   compos,
  elem 
)

Definition at line 86 of file soup.py.

References tot_weight().

Referenced by elem_frac_total().

86 def elem_frac(compos, elem):
87  if elem in compos:
88  return compos[elem] / tot_weight(compos)
89  else:
90  return 0
91 
def elem_frac(compos, elem)
Definition: soup.py:86
def tot_weight(compos)
Definition: soup.py:74
def soup.elem_frac_total (   elem,
  comps,
  fs 
)

Definition at line 92 of file soup.py.

References elem_frac(), and tot_fractions().

Referenced by old_soup_composition(), and soup_composition().

92 def elem_frac_total(elem, comps, fs):
93  frac = 0
94  for material, compos in comps.items():
95  frac += elem_frac(compos, elem) * fs[material]
96  return frac / tot_fractions(fs)
97 
98 
def elem_frac_total(elem, comps, fs)
Definition: soup.py:92
def elem_frac(compos, elem)
Definition: soup.py:86
def tot_fractions(fs)
Definition: soup.py:80
def soup.mean_density (   fs,
  ds 
)

Definition at line 66 of file soup.py.

66 def mean_density(fs, ds):
67  volume = 0
68  totmass = 0
69  for material, mass in fs.items():
70  volume += mass/ds[material]
71  totmass += mass
72  return totmass/volume
73 
def mean_density(fs, ds)
Definition: soup.py:66
def soup.old_soup_composition ( )

Definition at line 114 of file soup.py.

References elem_frac_total(), novadaq::HexUtils.format(), and print.

115 
116  the_composition = { }
117 
118  for elem in elemlist:
119  the_composition[elem] = elem_frac_total(elem, old_compositions, old_fractions)
120  print("Old Soup:")
121  for elem in elemlist:
122  print("const double soup_{0:<2s} = {1:.8f};"
123  .format(elem, elem_frac_total(elem, old_compositions, old_fractions)))
124 
125  return the_composition
126 
def elem_frac_total(elem, comps, fs)
Definition: soup.py:92
def old_soup_composition()
Definition: soup.py:114
bool print
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
def soup.radlength (   compos,
  name,
  verbose 
)

Definition at line 130 of file soup.py.

References novadaq::HexUtils.format(), and print.

Referenced by totalstoppingpower().

130 def radlength(compos, name, verbose):
131  totilength = 0
132  for elem in elemlist:
133  if elem in compos:
134  totilength += compos[elem]*inverseradlength[elem]
135  if verbose:
136  print("{0:12s} radiation length: {1:.2f} g/cm^2".format(name, 1/totilength)),
137  return 1/totilength
138 
139 # takes a mass fraction composition
def radlength(compos, name, verbose)
Definition: soup.py:130
bool print
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
def soup.soup_composition ( )

Definition at line 99 of file soup.py.

References elem_frac_total(), novadaq::HexUtils.format(), and print.

100 
101  the_composition = { }
102 
103  for elem in elemlist:
104  the_composition[elem] = elem_frac_total(elem, compositions, fractions)
105  print("Soup:")
106  for elem in elemlist:
107  print("const double soup_{0:<2s} = {1:.8f};"
108  .format(elem, elem_frac_total(elem, compositions, fractions)))
109 
110  return the_composition
111 
def elem_frac_total(elem, comps, fs)
Definition: soup.py:92
bool print
def soup_composition()
Definition: soup.py:99
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
def soup.tot_fractions (   fs)

Definition at line 80 of file soup.py.

Referenced by elem_frac_total().

80 def tot_fractions(fs):
81  tions = 0
82  for material, fraction in fs.items():
83  tions += fraction
84  return tions
85 
def tot_fractions(fs)
Definition: soup.py:80
def soup.tot_weight (   compos)

Definition at line 74 of file soup.py.

Referenced by elem_frac().

74 def tot_weight(compos):
75  weight = 0
76  for element, number in compos.items():
77  weight += number
78  return weight
79 
def tot_weight(compos)
Definition: soup.py:74
def soup.totalstoppingpower (   compos,
  name,
  verbose 
)

Definition at line 140 of file soup.py.

References novadaq::HexUtils.format(), print, and radlength().

140 def totalstoppingpower(compos, name, verbose):
141  totstop = 0
142  for elem in elemlist:
143  if elem in compos:
144  totstop += compos[elem]*stoppingpower[elem]
145  if verbose:
146  print("{0:12s} stopping power: {1:.3f} MeV/cm^2/g".format(name, totstop)),
147  return totstop
148 
149 print("")
150 radlength(old_scint, "Old scint", True)
151 print("")
152 radlength(compositions['scint early'], "Early scintillator", True)
153 print(" ({0:+0.2f}% larger)".format(100*(radlength(compositions['scint early'], "", False)/radlength(old_scint, "", False)-1)))
154 radlength(compositions['scint late'], "Late scintillator", True)
155 print(" ({0:+0.2f}% larger)".format(100*(radlength(compositions['scint late'], "", False)/radlength(old_scint, "", False)-1)))
156 print("")
157 radlength(old_pvc, "Old PVC", True)
158 print("")
159 radlength(compositions['pvc'], "PVC", True)
160 print(" ({0:+0.2f}% larger)".format(100*(radlength(compositions['pvc'], "", False)/radlength(old_pvc, "", False)-1)))
161 print("")
162 radlength(old_glue, "Old glue", True)
163 print("")
164 radlength(compositions['glue'], "Glue", True)
165 print(" ({0:+0.2f}% larger)".format(100*(radlength(compositions['glue'], "", False)/radlength(old_glue, "", False)-1)))
166 
167 # z extent of the average plane = extrusion depth + glue + block gap
def radlength(compos, name, verbose)
Definition: soup.py:130
def totalstoppingpower(compos, name, verbose)
Definition: soup.py:140
bool print
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14

Variable Documentation

dictionary soup.compositions
Initial value:
1 = {
2  'glue' : glue_composition(),
3  'pvc' : pvc_composition(),
4  'scint early' : scint_composition_early(),
5  'scint late' : scint_composition_late(),
6  'air' : air_composition()
7 }
def pvc_composition()
Definition: pvc.py:125
def glue_composition()
Definition: glue.py:80
def air_composition()
Definition: air.py:49

Definition at line 18 of file soup.py.

dictionary soup.densities
Initial value:
1 = {
2  # FD MC as of 2016-06-29
3  'glue': 0.98,
4  'pvc': 1.482,
5  'scint early': 0.8530, # actually the average FD scint+fiber density
6  'scint late': 0.8530, # actually the average FD scint+fiber density
7  'scint nd' : 0.8576, # average ND scint+fiber density
8  'air': 0.001205,
9 }

Definition at line 56 of file soup.py.

dictionary soup.fractions
Initial value:
1 = {
2  # FD MC as of 2016-06-14
3  'glue': 98867.292555,
4  'pvc' : 5062151.135481,
5  'scint early': 760497,
6  'scint late' : 7935040,
7  'air' : 596.9,
8 }

Definition at line 35 of file soup.py.

soup.gluecomp = print_composition(compositions['glue'])

Definition at line 27 of file soup.py.

dictionary soup.nd_fractions
Initial value:
1 = {
2  # ND MC as of 2016-08-11
3  'glue': 1460.144683,
4  'pvc' : 75248.258120,
5  'scint early': 0,
6  'scint late' : 129871.066409,
7  'air' : 5.8, # I think? This is harder to count properly since there
8  # is air all around the detector. It is about half the fraction
9  # as compared to the FD, so it is reasonable.
10 }

Definition at line 45 of file soup.py.

soup.nd_newmeandensity = mean_density( nd_fractions, densities)

Definition at line 171 of file soup.py.

soup.newmeandensity = mean_density( fractions, densities)

Definition at line 170 of file soup.py.

soup.newrl = radlength(soup, "Soup", True)

Definition at line 180 of file soup.py.

soup.newstop = totalstoppingpower(soup, "Soup", True)

Definition at line 206 of file soup.py.

soup.old_soup = old_soup_composition()

Definition at line 127 of file soup.py.

soup.oldmeandensity = mean_density(old_fractions, old_densities)

Definition at line 169 of file soup.py.

soup.oldrl = radlength(old_soup, "Old Soup", True)

Definition at line 177 of file soup.py.

soup.oldstop = totalstoppingpower(old_soup, "Old Soup", True)

Definition at line 204 of file soup.py.

float soup.plane = 6.61

Definition at line 168 of file soup.py.

Definition at line 181 of file soup.py.

soup.poldrl = oldrl/mean_density(old_fractions, old_densities)

Definition at line 178 of file soup.py.

soup.pvccomp = print_composition(compositions['pvc'])

Definition at line 33 of file soup.py.

soup.scintcomp = print_composition(compositions['scint early'])

Definition at line 29 of file soup.py.

soup.soup = soup_composition()

Definition at line 112 of file soup.py.