1 | # $Id: detector.py,v 1.3 2003/06/26 11:54:13 dressel Exp $ |
---|
2 | # ------------------------------------------------------------------- |
---|
3 | # GEANT4 tag $Name: $ |
---|
4 | # ------------------------------------------------------------------- |
---|
5 | # |
---|
6 | |
---|
7 | # A detector is either the of the "simple" or "ring" type. |
---|
8 | # the volumina of the "simple" detectors are the same at all |
---|
9 | # positions (00, 20, 40 cm off beam axis). The "ring" type detectors |
---|
10 | # have different volumina at the different positions. |
---|
11 | # For convinience a class Detector is provided to link a detector |
---|
12 | # position and it's volume. |
---|
13 | |
---|
14 | |
---|
15 | d00Volume = 1608.8 # volume of the 12.9 cm x 12.9 cm cyinder |
---|
16 | d20Volume = 20268.3 # volume of the ring at 20 cm |
---|
17 | d40Volume = 40536.6 # volume of the ring at 40 cm |
---|
18 | |
---|
19 | # map of distances to volumina for the 12.9 cm x 12.9 cm detectors |
---|
20 | SimpleDetectorVolume = {"00":d00Volume, "20":d00Volume, "40":d00Volume} |
---|
21 | # map of distances to volumina for ring detectors |
---|
22 | RingDetectorVolume = {"00":d00Volume, "20":d20Volume, "40":d40Volume} |
---|
23 | |
---|
24 | # map of detector type to distance-volumina map |
---|
25 | DetectorVolume = {"simple":SimpleDetectorVolume, |
---|
26 | "ring" :RingDetectorVolume} |
---|
27 | |
---|
28 | |
---|
29 | # the area of the beam pipe needed for scaling |
---|
30 | beamPipeArea = 93.31 |
---|
31 | |
---|
32 | # the source detector volume: beamPipeArea * 0.1 cm |
---|
33 | sourceDetectorVolume = 9.33 |
---|
34 | |
---|
35 | # source flux from the TIARA paper |
---|
36 | Fexp43_Coli = 1.76E+04 |
---|
37 | Fexp43 = 1.94E+04 |
---|
38 | Fexp68_Coli = 2.04E+04 |
---|
39 | Fexp68 = 2.46E+04 |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | class Detector(object): |
---|
44 | "Distance and volume of a Detector." |
---|
45 | def __init__(self, dist, detType): |
---|
46 | self.name = dist |
---|
47 | self.volume = DetectorVolume[detType][dist] |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | # function to calculate the scale factor |
---|
54 | |
---|
55 | def detScale(ngen, energy, coli): |
---|
56 | """Detrmine scale. |
---|
57 | |
---|
58 | Determine scale according to the number of generated neutrons, |
---|
59 | the proton beam energy. If coli == 1, the flux at the |
---|
60 | colimator exit is used, else the flux at 401 cm is used. |
---|
61 | """ |
---|
62 | Asrc = beamPipeArea |
---|
63 | Fexp = 0 |
---|
64 | if energy == "43": |
---|
65 | if coli == 1: |
---|
66 | Fexp = Fexp43_Coli |
---|
67 | else: |
---|
68 | Fexp = Fexp43 |
---|
69 | else: |
---|
70 | if energy == "68": |
---|
71 | if coli == 1: |
---|
72 | Fexp = Fexp68_Coli |
---|
73 | else: |
---|
74 | Fexp = Fexp68 |
---|
75 | |
---|
76 | S = Fexp * Asrc / ngen |
---|
77 | |
---|
78 | return S |
---|
79 | |
---|
80 | |
---|