ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimDetectorConstruction.hh
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 11/2004
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 
10 #ifndef ActarSimDetectorConstruction_h
11 #define ActarSimDetectorConstruction_h 1
12 
13 #include "G4VUserDetectorConstruction.hh"
14 
16 #include "globals.hh"
17 
18 class G4Box;
19 class G4Tubs;
20 class G4LogicalVolume;
21 class G4VPhysicalVolume;
22 class G4Material;
23 class G4LogicalVolume;
24 class G4VPhysicalVolume;
25 class G4AssemblyVolume;
27 
28 class ActarSimGasSD;
29 class ActarSimSilSD;
30 class ActarSimSilRingSD;
31 class ActarSimSciSD;
32 class ActarSimSciRingSD;
33 class ActarSimPlaSD;
40 
41 class ActarSimDetectorConstruction : public G4VUserDetectorConstruction {
42 private:
43  ActarSimGasSD* gasSD; ///< Pointer to gas sensitive detector
44  ActarSimSilSD* silSD; ///< Pointer to silicon sensitive detector
45  ActarSimSilRingSD* silRingSD; ///< Pointer to silicon ring sensitive detector
46  ActarSimSciSD* sciSD; ///< Pointer to scintillator sensitive detector
47  ActarSimSciRingSD* sciRingSD; ///< Pointer to scintillator ring sensitive detector
48  ActarSimPlaSD* plaSD; ///< Pointer to plastic sensitive detector
49 
50  G4Box* solidWorld;
51 
52  G4LogicalVolume* worldLog; ///< Pointer to logic world
53  G4LogicalVolume* chamberLog; ///< Pointer to logic chamber
54  G4LogicalVolume* AlplateLog; ///< Pointer to logic aluminium plate
55  G4LogicalVolume* DiamondLog; ///< Pointer to logic Diamond detector
56  G4LogicalVolume* SupportLog; ///< Pointer to logic CageField support
57 
58  G4VPhysicalVolume* worldPhys; ///< Pointer to physical world
59  G4VPhysicalVolume* chamberPhys; ///< Pointer to physical chamber
60  G4VPhysicalVolume* AlplatePhys; ///< Pointer to physical Al plate
61  G4VPhysicalVolume* DiamondPhys; ///< Pointer to physical Diamond detector
62  G4VPhysicalVolume* SupportPhys; ///< Pointer to physical CageField support
63 
64  //Assembly of slits
65  //G4AssemblyVolume* SlitMask; //NOT USED IN THIS FILE
66 
67  G4Material* mediumMaterial; ///< Pointer to the medium material
68  G4Material* defaultMaterial; ///< Pointer to the default material
69  G4Material* chamberMaterial; ///< Pointer to the chamber material
70  G4Material* windowMaterial; ///< Pointer to the window material
71 
72  ActarSimUniformEMField* emField; ///< Pointer to the uniform em. field
73 
74  G4ThreeVector eField; ///< Electric field vector
75  G4ThreeVector mField; ///< Magnetic field vector
76 
77  G4double worldSizeX; ///< World X half-lengths (always centered at (0,0,0))
78  G4double worldSizeY; ///< World Y half-lengths (always centered at (0,0,0))
79  G4double worldSizeZ; ///< World Z half-lengths (always centered at (0,0,0))
80 
81  G4double chamberSizeX; ///< Chamber X half-lengths
82  G4double chamberSizeY; ///< Chamber Y half-lengths
83  G4double chamberSizeZ; ///< Chamber Z half-lengths
84 
85  G4double chamberCenterX; ///< Chamber X Center
86  G4double chamberCenterY; ///< Chamber Y Center
87  G4double chamberCenterZ; ///< Chamber Z Center
88 
89  G4String MaikoGeoIncludedFlag; ///< Control variable for including MAIKO
90  G4String ACTARTPCDEMOGeoIncludedFlag; ///< Control variable for including ACTARTPCDEMO
91  G4String ACTARTPCGeoIncludedFlag; ///< Control variable for including ACTARTPC
92  G4String gasGeoIncludedFlag; ///< Control variable for including a gas volume
93  G4String silGeoIncludedFlag; ///< Control variable for including the silicons
94  G4String sciGeoIncludedFlag; ///< Control variable for including the scintillators
95  G4String SpecMATGeoIncludedFlag; ///< Control variable for including SpecMAT
96  G4String OthersGeoIncludedFlag; ///< Control variable for including other geometries
97 
98  ActarSimGasDetectorConstruction* gasDet; ///< Pointer to target constructor
99  ActarSimSilDetectorConstruction* silDet; ///< Pointer to recoil silicon constructor
100  ActarSimSilRingDetectorConstruction* silRingDet; ///< Pointer to silRing for MAIKO constructor
101  ActarSimSciDetectorConstruction* sciDet; ///< Pointer to scintillator constructor
102  ActarSimSciRingDetectorConstruction* sciRingDet; ///< Pointer to sciRing for MAIKO constructor
103  ActarSimPlaDetectorConstruction* plaDet; ///< Pointer to Hodoscope constructor
104 
105  ActarSimDetectorMessenger* detectorMessenger; ///< Pointer to the Messenger
106 
107  void DefineMaterials();
108  G4VPhysicalVolume* ConstructEmptyWorld();
109  G4VPhysicalVolume* ConstructActarTPC();
110  G4VPhysicalVolume* ConstructActarTPCDEMO();
111  G4VPhysicalVolume* ConstructSpecMAT();
112  G4VPhysicalVolume* ConstructMAIKO();
113  G4VPhysicalVolume* ConstructOthers();
114 
115 public:
118 
119  G4VPhysicalVolume* Construct();
120 
121  void SetWorldSizeX(G4double val){worldSizeX = val;}
122  void SetWorldSizeY(G4double val){worldSizeY = val;}
123  void SetWorldSizeZ(G4double val){worldSizeZ = val;}
124 
125  void SetChamberSizeX(G4double val){chamberSizeX = val;}
126  void SetChamberSizeY(G4double val){chamberSizeY = val;}
127  void SetChamberSizeZ(G4double val){chamberSizeZ = val;}
128 
129  void SetChamberCenterX(G4double val){chamberCenterX = val;}
130  void SetChamberCenterY(G4double val){chamberCenterY = val;}
131  void SetChamberCenterZ(G4double val){chamberCenterZ = val;}
132 
133  void SetMediumMaterial(G4String);
134  void SetDefaultMaterial(G4String);
135  void SetChamberMaterial(G4String);
136  void SetWindowMaterial (G4String);
137  void SetUpdateChamberMaterial(G4Material*);
138 
139  void SetMaikoGeoIncludedFlag(G4String val){MaikoGeoIncludedFlag=val;}
140  void SetACTARTPCDEMOGeoIncludedFlag(G4String val){ACTARTPCDEMOGeoIncludedFlag=val;}
141  void SetACTARTPCGeoIncludedFlag(G4String val){ACTARTPCGeoIncludedFlag=val;}
142  void SetSpecMATGeoIncludedFlag(G4String val){SpecMATGeoIncludedFlag=val;}
143  void SetOthersGeoIncludedFlag(G4String val){OthersGeoIncludedFlag=val;}
144 
145  void SetGasGeoIncludedFlag(G4String val){gasGeoIncludedFlag=val;}
146  void SetSilGeoIncludedFlag(G4String val){silGeoIncludedFlag=val;}
147  void SetSciGeoIncludedFlag(G4String val){sciGeoIncludedFlag=val;}
148 
149  ActarSimGasSD* GetGasSD(void){return gasSD;}
150  ActarSimSilSD* GetSilSD(void){return silSD;}
152  ActarSimSciSD* GetSciSD(void){return sciSD;}
154  ActarSimPlaSD* GetPlaSD(void){return plaSD;}
155 
157 
158  G4LogicalVolume* GetWorldLogicalVolume(){return worldLog;}
159  G4VPhysicalVolume* GetWorldPhysicalVolume(){return worldPhys;}
160  G4LogicalVolume* GetChamberLogicalVolume(){return chamberLog;}
161  G4VPhysicalVolume* GetChamberPhysicalVolume(){return chamberPhys;}
162 
163  G4double GetWorldSizeX(void){return worldSizeX;}
164  G4double GetWorldSizeY(void){return worldSizeY;}
165  G4double GetWorldSizeZ(void){return worldSizeZ;}
166 
167  G4double GetChamberSizeX(void){return chamberSizeX;}
168  G4double GetChamberSizeY(void){return chamberSizeY;}
169  G4double GetChamberSizeZ(void){return chamberSizeZ;}
170 
171  G4double GetChamberCenterX(void){return chamberCenterX;}
172  G4double GetChamberCenterY(void){return chamberCenterY;}
173  G4double GetChamberCenterZ(void){return chamberCenterZ;}
174 
175  G4Material* GetMediumMaterial() {return mediumMaterial;};
176  G4Material* GetDefaultMaterial() {return defaultMaterial;};
177  G4Material* GetChamberMaterial() {return chamberMaterial;};
178 
185 
191 
192  void UpdateGeometry();
193  void UpdateEMField();
194 
195  void SetEleField(G4ThreeVector eVector);
196  void SetMagField(G4ThreeVector mVector);
197 
199 };
200 #endif
void SetMagField(G4ThreeVector mVector)
Setting the uniform magnetic field vector.
G4String silGeoIncludedFlag
Control variable for including the silicons.
G4String gasGeoIncludedFlag
Control variable for including a gas volume.
G4String ACTARTPCDEMOGeoIncludedFlag
Control variable for including ACTARTPCDEMO.
ActarSimSilDetectorConstruction * silDet
Pointer to recoil silicon constructor.
G4String SpecMATGeoIncludedFlag
Control variable for including SpecMAT.
G4VPhysicalVolume * DiamondPhys
Pointer to physical Diamond detector.
G4double chamberCenterZ
Chamber Z Center.
G4ThreeVector mField
Magnetic field vector.
ActarSimPlaSD * plaSD
Pointer to plastic sensitive detector.
G4String sciGeoIncludedFlag
Control variable for including the scintillators.
ActarSimSciSD * sciSD
Pointer to scintillator sensitive detector.
ActarSimSilRingDetectorConstruction * silRingDet
Pointer to silRing for MAIKO constructor.
G4double chamberCenterY
Chamber Y Center.
G4LogicalVolume * DiamondLog
Pointer to logic Diamond detector.
ActarSimSciRingDetectorConstruction * GetSciRingDetector()
ActarSimDetectorMessenger * GetDetectorMessenger()
ActarSimSilRingSD * silRingSD
Pointer to silicon ring sensitive detector.
G4Material * windowMaterial
Pointer to the window material.
G4double worldSizeY
World Y half-lengths (always centered at (0,0,0))
ActarSimDetectorMessenger * detectorMessenger
Pointer to the Messenger.
G4VPhysicalVolume * chamberPhys
Pointer to physical chamber.
G4VPhysicalVolume * SupportPhys
Pointer to physical CageField support.
G4double worldSizeZ
World Z half-lengths (always centered at (0,0,0))
G4Material * defaultMaterial
Pointer to the default material.
G4VPhysicalVolume * AlplatePhys
Pointer to physical Al plate.
ActarSimGasDetectorConstruction * gasDet
Pointer to target constructor.
void SetChamberMaterial(G4String)
Sets the material the chamber is made of (the same as GasBox)
ActarSimSilDetectorConstruction * GetSilDetector()
G4LogicalVolume * AlplateLog
Pointer to logic aluminium plate.
G4VPhysicalVolume * worldPhys
Pointer to physical world.
G4String OthersGeoIncludedFlag
Control variable for including other geometries.
G4double worldSizeX
World X half-lengths (always centered at (0,0,0))
void SetWindowMaterial(G4String)
Sets the material the window is made of.
G4double chamberCenterX
Chamber X Center.
G4double chamberSizeX
Chamber X half-lengths.
G4ThreeVector eField
Electric field vector.
ActarSimPlaDetectorConstruction * plaDet
Pointer to Hodoscope constructor.
ActarSimGasDetectorConstruction * GetGasDetector()
G4LogicalVolume * worldLog
Pointer to logic world.
G4Material * mediumMaterial
Pointer to the medium material.
ActarSimSciRingDetectorConstruction * sciRingDet
Pointer to sciRing for MAIKO constructor.
G4LogicalVolume * chamberLog
Pointer to logic chamber.
G4String ACTARTPCGeoIncludedFlag
Control variable for including ACTARTPC.
ActarSimSciRingSD * sciRingSD
Pointer to scintillator ring sensitive detector.
G4String MaikoGeoIncludedFlag
Control variable for including MAIKO.
ActarSimSilRingDetectorConstruction * GetSilRingDetector()
void UpdateGeometry()
Updates any change on the geometry of the detectors.
ActarSimPlaDetectorConstruction * GetPlaDetector()
void SetMediumMaterial(G4String)
Sets the material the medium is made of.
G4double chamberSizeY
Chamber Y half-lengths.
void PrintDetectorParameters()
Print current detector parameters.
ActarSimSciDetectorConstruction * sciDet
Pointer to scintillator constructor.
G4LogicalVolume * SupportLog
Pointer to logic CageField support.
ActarSimSilSD * silSD
Pointer to silicon sensitive detector.
ActarSimDetectorConstruction()
Constructor: initialize all variables, materials and pointers.
void SetDefaultMaterial(G4String)
Sets the default material.
void UpdateEMField()
Setting the uniform EM field.
ActarSimSciDetectorConstruction * GetSciDetector()
G4double chamberSizeZ
Chamber Z half-lengths.
ActarSimUniformEMField * emField
Pointer to the uniform em. field.
G4Material * chamberMaterial
Pointer to the chamber material.
ActarSimGasSD * gasSD
Pointer to gas sensitive detector.