Line | |
---|
1 | # $Id: tiaraDetectors.py,v 1.4 2004/06/09 15:04:36 daquinog Exp $ |
---|
2 | # ------------------------------------------------------------------- |
---|
3 | # GEANT4 tag $Name: $ |
---|
4 | # ------------------------------------------------------------------- |
---|
5 | # |
---|
6 | import CLHEP |
---|
7 | import G4Kernel |
---|
8 | |
---|
9 | class ScoreDetector(object): |
---|
10 | def __init__(self, name): |
---|
11 | self.name = name |
---|
12 | self.phys = "" |
---|
13 | self.scorer = "" |
---|
14 | |
---|
15 | class DetectorSlab(object): |
---|
16 | def __init__(self): |
---|
17 | pass |
---|
18 | def createScoreDetectors(self, tiaraHall): |
---|
19 | scoreDets = [] |
---|
20 | scoreDets.append(ScoreDetector("detectorSlab")) |
---|
21 | scoreDets[0].phys = tiaraHall.AddDetectorSlab(scoreDets[0].name) |
---|
22 | print "+++ DetectorSlab: created slab detector." |
---|
23 | return scoreDets |
---|
24 | |
---|
25 | class ThreeZylindricDetectors(object): |
---|
26 | def __init__(self): |
---|
27 | pass |
---|
28 | def createScoreDetectors(self, tiaraHall): |
---|
29 | scoreDets = [] |
---|
30 | scoreDets.append(ScoreDetector("detector_00")) |
---|
31 | scoreDets.append(ScoreDetector("detector_20")) |
---|
32 | scoreDets.append(ScoreDetector("detector_40")) |
---|
33 | dist = 0.0 |
---|
34 | for det in scoreDets: |
---|
35 | if dist > 0.0: |
---|
36 | det.phys = tiaraHall.AddPhysicalRingDetector(dist, |
---|
37 | det.name) |
---|
38 | else: |
---|
39 | det.phys = tiaraHall.AddPhysicalDetector(dist, det.name) |
---|
40 | dist += 20*CLHEP.cm |
---|
41 | print "+++ ThreeZylindricDetectors: created 3 zylindric detectors" |
---|
42 | return scoreDets |
---|
Note: See
TracBrowser
for help on using the repository browser.