source: trunk/examples/advanced/Tiara/source/py_modules/tiaraDetectors.py@ 1210

Last change on this file since 1210 was 807, checked in by garnier, 17 years ago

update

File size: 1.5 KB
Line 
1# $Id: tiaraDetectors.py,v 1.4 2004/06/09 15:04:36 daquinog Exp $
2# -------------------------------------------------------------------
3# GEANT4 tag $Name: $
4# -------------------------------------------------------------------
5#
6import CLHEP
7import G4Kernel
8
9class ScoreDetector(object):
10 def __init__(self, name):
11 self.name = name
12 self.phys = ""
13 self.scorer = ""
14
15class 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
25class 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.