Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Par01DetectorConstruction Class Reference

#include <Doxymodules_parameterisations.h>

Inheritance diagram for Par01DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 Par01DetectorConstruction ()
 
virtual ~Par01DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 

Private Attributes

G4LogicalVolumefCrystalLog
 
G4LogicalVolumefTowerLog
 
G4int fnX
 
G4int fnY
 
G4int fnXhad
 
G4int fnYhad
 

Detailed Description

Definition at line 20 of file Doxymodules_parameterisations.h.

Constructor & Destructor Documentation

◆ Par01DetectorConstruction()

Par01DetectorConstruction::Par01DetectorConstruction ( )

Definition at line 56 of file Par01DetectorConstruction.cc.

57{;}

◆ ~Par01DetectorConstruction()

Par01DetectorConstruction::~Par01DetectorConstruction ( )
virtual

Definition at line 61 of file Par01DetectorConstruction.cc.

62{;}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * Par01DetectorConstruction::Construct ( )
virtual

Definition at line 66 of file Par01DetectorConstruction.cc.

67{
68 G4cout << "\nPar01DetectorConstruction....\n" << G4endl;
69
70 //--------- Material definition ---------
71 // Get nist material manager
72 G4NistManager* nistManager = G4NistManager::Instance();
73
74 // Build materials
75 G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
76 G4Material* csi = nistManager->FindOrBuildMaterial("G4_CESIUM_IODIDE");
77 G4Material* helium = nistManager->FindOrBuildMaterial("G4_He");
78 G4Material* iron = nistManager->FindOrBuildMaterial("G4_Fe");
79
80
81 //--------- G4VSolid, G4LogicalVolume, G4VPhysicalVolume ---------
82
83 //--------------
84 // World:
85 //--------------
86 G4Box *WorldBox= new G4Box("WorldBox",400*cm, 400*cm, 400*cm);
87 G4LogicalVolume *WorldLog=new G4LogicalVolume(WorldBox,air,
88 "WorldLogical", 0, 0, 0);
89 G4PVPlacement *WorldPhys=new G4PVPlacement(0,G4ThreeVector(),
90 "WorldPhysical",
91 WorldLog,
92 0,false,0);
93 // Size of detectors:
94 G4double detectSize = 125*cm;
95
96 //-----------------------------
97 // "Drift Chamber":
98 // Not used in parameterisation.
99 //-----------------------------
100 // -- Logical volume:
101 G4Box *driftChamberBox
102 = new G4Box("DriftChamberSolid", detectSize, detectSize, 40*cm);
103 G4LogicalVolume *driftChamberLog
104 = new G4LogicalVolume(driftChamberBox,helium,
105 "DriftChamberLogical", 0, 0, 0);
106 // -- Placement:
107 // G4PVPlacement *driftChamberPhys =
108 new G4PVPlacement(0,G4ThreeVector(0., 0., 50*cm),
109 "DriftChamberPhysical",
110 driftChamberLog,
111 WorldPhys,false,0);
112
113 //--------------------------
114 // "Calorimeter": used in
115 // parameterisation below
116 //--------------------------
117 // -- Logical volume:
118 G4Box *calorimeterBox
119 = new G4Box("CalorimeterSolid", detectSize, detectSize, 20*cm);
120 G4LogicalVolume *calorimeterLog = new G4LogicalVolume(calorimeterBox,air,
121 "CalorimeterLogical", 0, 0, 0);
122 // -- Placement:
123 G4PVPlacement *calorimeterPhys = new G4PVPlacement(0,G4ThreeVector(0., 0., 120*cm),
124 "CalorimeterPhysical",
125 calorimeterLog,
126 WorldPhys,false,0);
127
128 //--------------------------------------
129 // The calorimeter is filled with
130 // crystals:
131 //--------------------------------------
132 // -- Logical volume:
133 G4double CrystalX = 2.5*cm;
134 G4double CrystalY = CrystalX;
135 G4double CrystalZ = 20*cm;
136 G4Box *CrystalSolid = new G4Box("CrystalSolid", CrystalX, CrystalY, CrystalZ);
137 fCrystalLog = new G4LogicalVolume(CrystalSolid,csi,
138 "CrystalLogical", 0, 0, 0);
139
140 G4String tName1("Crystal"); // Allow all target physicals to share
141 // same name (delayed copy)
142
143 // -- and placements inside the calorimeter:
144 G4int copyNo=0;
145 G4double xTlate, yTlate;
146 fnX = 48;
147 fnY = 48;
148 for (G4int j = 0; j < fnY; j++)
149 {
150 yTlate = -detectSize + 3*CrystalY + j*2*CrystalY;
151 for (G4int i = 0; i < fnX; i++)
152 {
153 xTlate = -detectSize + 3*CrystalX + i*2*CrystalX;
154 new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
155 tName1,
157 calorimeterPhys,false,copyNo++);
158 }
159 }
160
161
162 //--------------------------
163 // "Hadron Calorimeter": used
164 // in parameterisation with
165 // a parallel geometry
166 //--------------------------
167 // -- Logical volume:
168 G4Box *hadCaloBox
169 = new G4Box("HadCaloSolid", detectSize, detectSize, 50*cm);
170 G4LogicalVolume *hadCaloLog = new G4LogicalVolume(hadCaloBox,air,
171 "HadCaloLogical", 0, 0, 0);
172 // -- Placement:
173 G4PVPlacement *hadCaloPhys = new G4PVPlacement(0,G4ThreeVector(0., 0., 200*cm),
174 "HadCaloPhysical",
175 hadCaloLog,
176 WorldPhys,false,0);
177
178 //--------------------------------------
179 // The calorimeter is filled with
180 // towers:
181 //--------------------------------------
182 // -- Logical volume:
183 G4double TowerX = 5*cm;
184 G4double TowerY = TowerX;
185 G4double TowerZ = 45*cm;
186 G4Box *TowerSolid = new G4Box("TowerSolid", TowerX, TowerY, TowerZ);
187 fTowerLog = new G4LogicalVolume(TowerSolid,iron,
188 "TowerLogical", 0, 0, 0);
189
190 G4String tName2("Tower");
191
192 // -- and placements inside the calorimeter:
193 copyNo=0;
194 fnXhad = 23;
195 fnYhad = 23;
196 for (G4int jj = 0; jj < fnYhad; jj++)
197 {
198 yTlate = -detectSize + 3*TowerY + jj*2*TowerY;
199 for (G4int i = 0; i < fnXhad; i++)
200 {
201 xTlate = -detectSize + 3*TowerX + i*2*TowerX;
202 new G4PVPlacement(0,G4ThreeVector(xTlate,yTlate,0*cm),
203 tName2,
204 fTowerLog,
205 hadCaloPhys,false,copyNo++);
206 }
207 }
208
209
210
211
212 // -- Makes the calorimeterLog volume becoming a G4Region:
213 G4Region* caloRegion = new G4Region("EM_calo_region");
214 caloRegion->AddRootLogicalVolume(calorimeterLog);
215 std::vector<double> cuts;
216 cuts.push_back(1.0*mm);cuts.push_back(1.0*mm);cuts.push_back(1.0*mm);cuts.push_back(1.0*mm);
217 caloRegion->SetProductionCuts(new G4ProductionCuts());
218 caloRegion->GetProductionCuts()->SetProductionCuts(cuts);
219
220 // Makes had. calo a region to:
221 G4Region* hadRegion = new G4Region("HAD_calo_region");
222 hadRegion->AddRootLogicalVolume(hadCaloLog);
223 cuts.clear();
224 cuts.push_back(1.0*cm);cuts.push_back(1.0*cm);cuts.push_back(1.0*cm);cuts.push_back(1.0*cm);
225 hadRegion->SetProductionCuts(new G4ProductionCuts());
226 hadRegion->GetProductionCuts()->SetProductionCuts(cuts);
227
228 //--------- Visualization attributes -------------------------------
229 WorldLog->SetVisAttributes(G4VisAttributes::GetInvisible());
230
231 auto driftchamberTubeVisAtt
232 = new G4VisAttributes(G4Colour(0.0,1.0,0.0));
233 driftchamberTubeVisAtt->SetForceWireframe(true);
234 driftChamberLog->SetVisAttributes(driftchamberTubeVisAtt);
235
236 auto calorimeterBoxVisAtt
237 = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
238 calorimeterBoxVisAtt->SetForceWireframe(true);
239 calorimeterLog->SetVisAttributes(calorimeterBoxVisAtt);
240
241 auto crystalVisAtt
242 = new G4VisAttributes(G4Colour(1.0,0.0,0.0));
243 crystalVisAtt->SetForceWireframe(true);
244 fCrystalLog->SetVisAttributes(crystalVisAtt);
245
246 auto hadCaloBoxVisAtt
247 = new G4VisAttributes(G4Colour(1.0,0.0,1.0));
248 hadCaloBoxVisAtt->SetForceWireframe(true);
249 hadCaloLog->SetVisAttributes(hadCaloBoxVisAtt);
250
251 auto towerVisAtt
252 = new G4VisAttributes(G4Colour(0.5,0.0,1.0));
253 towerVisAtt->SetForceWireframe(true);
254 fTowerLog->SetVisAttributes(towerVisAtt);
255
256 //------------------------------------------------------------------
257
258
259 //-----------------------
260 // Returns the pointer to
261 // the physical world:
262 //-----------------------
263 return WorldPhys;
264}

◆ ConstructSDandField()

void Par01DetectorConstruction::ConstructSDandField ( )
virtual

Definition at line 268 of file Par01DetectorConstruction.cc.

269{
270 //--------- Sensitive detector -------------------------------------
271 G4SDManager* SDman = G4SDManager::GetSDMpointer();
272 G4String calorimeterSDname = "Par01/Calorimeter";
273 Par01CalorimeterSD* CalorimeterSD = new Par01CalorimeterSD( calorimeterSDname,
274 fnX*fnY,
275 "CalCollection" );
276 SDman->AddNewDetector( CalorimeterSD );
277 fCrystalLog->SetSensitiveDetector(CalorimeterSD);
278
279 G4String hadCalorimeterSDname = "Par01/HadronCalorimeter";
280 Par01CalorimeterSD* HadCalorimeterSD = new Par01CalorimeterSD( hadCalorimeterSDname,
282 "HadCollection" );
283 SDman->AddNewDetector( HadCalorimeterSD );
284 fTowerLog->SetSensitiveDetector(HadCalorimeterSD);
285
286 // --------------- fast simulation ----------------------------
287 G4RegionStore* regionStore = G4RegionStore::GetInstance();
288
289 G4Region* caloRegion = regionStore->GetRegion("EM_calo_region");
290 // builds a model and sets it to the envelope of the calorimeter:
291 new Par01EMShowerModel("emShowerModel",caloRegion);
292}

Member Data Documentation

◆ fCrystalLog

G4LogicalVolume* Par01DetectorConstruction::fCrystalLog
private

Definition at line 51 of file Par01DetectorConstruction.hh.

◆ fTowerLog

G4LogicalVolume* Par01DetectorConstruction::fTowerLog
private

Definition at line 52 of file Par01DetectorConstruction.hh.

◆ fnX

G4int Par01DetectorConstruction::fnX
private

Definition at line 53 of file Par01DetectorConstruction.hh.

◆ fnY

G4int Par01DetectorConstruction::fnY
private

Definition at line 53 of file Par01DetectorConstruction.hh.

◆ fnXhad

G4int Par01DetectorConstruction::fnXhad
private

Definition at line 54 of file Par01DetectorConstruction.hh.

◆ fnYhad

G4int Par01DetectorConstruction::fnYhad
private

Definition at line 54 of file Par01DetectorConstruction.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration