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

#include <Doxymodules_eventgenerator.h>

Inheritance diagram for ExN04DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 ExN04DetectorConstruction ()
 
 ~ExN04DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 

Private Member Functions

void DefineMaterials ()
 

Private Attributes

G4MaterialfAir
 
G4MaterialfAr
 
G4MaterialfSilicon
 
G4MaterialfScinti
 
G4MaterialfLead
 

Detailed Description

Definition at line 38 of file Doxymodules_eventgenerator.h.

Constructor & Destructor Documentation

◆ ExN04DetectorConstruction()

ExN04DetectorConstruction::ExN04DetectorConstruction ( )

◆ ~ExN04DetectorConstruction()

ExN04DetectorConstruction::~ExN04DetectorConstruction ( )

Definition at line 67 of file ExN04DetectorConstruction.cc.

68{
69}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * ExN04DetectorConstruction::Construct ( )
virtual

Definition at line 99 of file ExN04DetectorConstruction.cc.

100{
101 //-------------------------------------------------------------------------
102 // Magnetic field
103 //-------------------------------------------------------------------------
104
105 static G4bool fieldIsInitialized = false;
106 if ( !fieldIsInitialized ) {
107 ExN04Field* myField = new ExN04Field;
108 G4FieldManager* fieldMgr
109 = G4TransportationManager::GetTransportationManager()->
110 GetFieldManager();
111 fieldMgr-> SetDetectorField(myField);
112 fieldMgr-> CreateChordFinder(myField);
113 fieldIsInitialized = true;
114 }
115
116 //-------------------------------------------------------------------------
117 // Materials
118 //-------------------------------------------------------------------------
120
121 //-------------------------------------------------------------------------
122 // Detector geometry
123 //-------------------------------------------------------------------------
124
125 //------------------------------ experimental hall
126 G4Box* experimentalHall_box =
127 new G4Box("expHall_b", fexpHall_x, fexpHall_y, fexpHall_z);
128 G4LogicalVolume* experimentalHall_log =
129 new G4LogicalVolume(experimentalHall_box, fAir,"expHall_L", 0,0,0);
130 G4VPhysicalVolume * experimentalHall_phys =
131 new G4PVPlacement(0, G4ThreeVector(), experimentalHall_log,
132 "expHall_P", 0, false,0);
133 G4VisAttributes* experimentalHallVisAtt =
134 new G4VisAttributes(G4Colour(1.,1.,1.));
135 experimentalHallVisAtt-> SetForceWireframe(true);
136 experimentalHall_log-> SetVisAttributes(experimentalHallVisAtt);
137
138 //------------------------------ tracker
139 G4VSolid* tracker_tubs
140 = new G4Tubs("trkTubs_tubs", ftrkTubs_rmin, ftrkTubs_rmax, ftrkTubs_dz,
142 G4LogicalVolume* tracker_log
143 = new G4LogicalVolume(tracker_tubs, fAr,"trackerT_L",0,0,0);
144 // G4VPhysicalVolume * tracker_phys =
145 new G4PVPlacement(0,G4ThreeVector(), tracker_log, "tracker_phys",
146 experimentalHall_log, false, 0);
147 G4VisAttributes* tracker_logVisAtt
148 = new G4VisAttributes(G4Colour(1.0,0.0,1.0));
149 tracker_logVisAtt->SetForceWireframe(true);
150 tracker_log->SetVisAttributes(tracker_logVisAtt);
151
152 //------------------------------ tracker layers
153 // As an example for Parameterised volume
154 // dummy values for G4Tubs -- modified by parameterised volume
155 G4VSolid* trackerLayer_tubs
156 = new G4Tubs("trackerLayer_tubs", ftrkTubs_rmin, ftrkTubs_rmax, ftrkTubs_dz,
158 G4LogicalVolume* trackerLayer_log
159 = new G4LogicalVolume(trackerLayer_tubs, fSilicon,"trackerB_L",0,0,0);
160 G4VPVParameterisation* trackerParam
162 // dummy value : kXAxis -- modified by parameterised volume
163 // G4VPhysicalVolume *trackerLayer_phys =
164 new G4PVParameterised("trackerLayer_phys", trackerLayer_log, tracker_log,
165 kXAxis, fnotrkLayers, trackerParam);
166 G4VisAttributes* trackerLayer_logVisAtt
167 = new G4VisAttributes(G4Colour(0.5,0.0,1.0));
168 trackerLayer_logVisAtt->SetForceWireframe(true);
169 trackerLayer_log->SetVisAttributes(trackerLayer_logVisAtt);
170
171 //------------------------------ calorimeter
172 G4VSolid* calorimeter_tubs
173 = new G4Tubs("calorimeter_tubs", fcaloTubs_rmin, fcaloTubs_rmax,
175 G4LogicalVolume* calorimeter_log
176 = new G4LogicalVolume(calorimeter_tubs, fScinti, "caloT_L",0,0,0);
177 // G4VPhysicalVolume * calorimeter_phys =
178 new G4PVPlacement(0,G4ThreeVector(), calorimeter_log, "caloM_P",
179 experimentalHall_log, false,0);
180 G4VisAttributes* calorimeter_logVisATT
181 = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
182 calorimeter_logVisATT->SetForceWireframe(true);
183 calorimeter_log->SetVisAttributes(calorimeter_logVisATT);
184
185 //------------------------------- Lead layers
186 // As an example for Parameterised volume
187 // dummy values for G4Tubs -- modified by parameterised volume
188 G4VSolid* caloLayer_tubs
189 = new G4Tubs("caloLayer_tubs", fcaloRing_rmin, fcaloRing_rmax,
191 G4LogicalVolume* caloLayer_log
192 = new G4LogicalVolume(caloLayer_tubs, fLead, "caloR_L",0,0,0);
193 G4VPVParameterisation* calorimeterParam
195 // dummy value : kXAxis -- modified by parameterised volume
196 // G4VPhysicalVolume * caloLayer_phys =
197 new G4PVParameterised("caloLayer_phys",caloLayer_log,calorimeter_log,
198 kXAxis, fnocaloLayers, calorimeterParam);
199 G4VisAttributes* caloLayer_logVisAtt
200 = new G4VisAttributes(G4Colour(0.7,1.0,0.0));
201 caloLayer_logVisAtt->SetForceWireframe(true);
202 caloLayer_log->SetVisAttributes(caloLayer_logVisAtt);
203
204 //------------------------------ muon counters
205 // As an example of CSG volumes with rotation
206 G4VSolid* muoncounter_box
207 = new G4Box("muoncounter_box", fmuBox_width, fmuBox_thick, fmuBox_length);
208 G4LogicalVolume* muoncounter_log
209 = new G4LogicalVolume(muoncounter_box, fScinti, "mucounter_L",0,0,0);
210 G4VPhysicalVolume* muoncounter_phys;
211 for( G4int i = 0; i < fnomucounter; i++ ) {
212 G4double phi, x, y, z;
213 phi = 360.*deg/fnomucounter*i;
214 x = fmuBox_radius*std::sin(phi);
215 y = fmuBox_radius*std::cos(phi);
216 z = 0.*cm;
217 G4RotationMatrix rm;
218 rm.rotateZ(phi);
219 muoncounter_phys
220 = new G4PVPlacement(G4Transform3D(rm,G4ThreeVector(x,y,z)),
221 muoncounter_log, "muoncounter_P",
222 experimentalHall_log,false,i);
223 }
224 G4VisAttributes* muoncounter_logVisAtt
225 = new G4VisAttributes(G4Colour(0.0,1.0,1.0));
226 muoncounter_logVisAtt->SetForceWireframe(true);
227 muoncounter_log->SetVisAttributes(muoncounter_logVisAtt);
228
229 //------------------------------------------------------------------
230 // Sensitive Detector
231 //------------------------------------------------------------------
232
233 G4SDManager* SDman = G4SDManager::GetSDMpointer();
234
235 G4String trackerSDname = "/mydet/tracker";
236 ExN04TrackerSD * trackerSD = new ExN04TrackerSD(trackerSDname);
237 SDman->AddNewDetector(trackerSD);
238 trackerLayer_log->SetSensitiveDetector(trackerSD);
239
240 G4String calorimeterSDname = "/mydet/calorimeter";
241 ExN04CalorimeterSD* calorimeterSD = new ExN04CalorimeterSD(calorimeterSDname);
242 G4String ROgeometryName = "CalorimeterROGeom";
243 G4VReadOutGeometry* calRO = new ExN04CalorimeterROGeometry(ROgeometryName);
244 calRO->BuildROGeometry();
245 calorimeterSD->SetROgeometry(calRO);
246 SDman->AddNewDetector(calorimeterSD);
247 calorimeter_log->SetSensitiveDetector(calorimeterSD);
248
249 G4String muonSDname = "/mydet/muon";
250 ExN04MuonSD* muonSD = new ExN04MuonSD(muonSDname);
251 SDman->AddNewDetector(muonSD);
252 muoncounter_log->SetSensitiveDetector(muonSD);
253
254 //------------------------------------------------------------------
255 // Digitizer modules
256 //------------------------------------------------------------------
257
258 return experimentalHall_phys;
259}
G4double fcaloRing_rmin
G4double fcaloTubs_dz
G4double fcaloTubs_sphi
G4double fmuBox_length
G4double fexpHall_z
G4double fcaloTubs_rmax
G4double fmuBox_thick
G4double fcaloRing_dphi
G4double ftrkTubs_dz
G4double fmuBox_radius
G4double fexpHall_y
G4double ftrkTubs_sphi
G4int fnomucounter
G4double fcaloTubs_rmin
G4int fnotrkLayers
G4double fcaloRing_rmax
G4double fcaloRing_sphi
G4double ftrkTubs_rmax
G4double fmuBox_width
G4double ftrkTubs_dphi
G4double fcaloTubs_dphi
G4int fnocaloLayers
G4double ftrkTubs_rmin
G4double fexpHall_x
G4double fcaloRing_dz

◆ DefineMaterials()

void ExN04DetectorConstruction::DefineMaterials ( )
private

Definition at line 72 of file ExN04DetectorConstruction.cc.

73{
74 //-------------------------------------------------------------------------
75 // Materials
76 //-------------------------------------------------------------------------
77 G4NistManager* nistManager = G4NistManager::Instance();
78 fAir = nistManager->FindOrBuildMaterial("G4_AIR");
79 fLead = nistManager->FindOrBuildMaterial("G4_Pb");
80 fSilicon = nistManager->FindOrBuildMaterial("G4_Si");
81
82 G4double a, z, density;
83 G4int nel;
84
85 // Argon gas
86 a= 39.95*g/mole;
87 density= 1.782e-03*g/cm3;
88 fAr= new G4Material("ArgonGas", z=18., a, density);
89
90 // Scintillator
91 G4Element* elH = nistManager->FindOrBuildElement("H");
92 G4Element* elC = nistManager->FindOrBuildElement("C");
93 fScinti = new G4Material("Scintillator", density= 1.032*g/cm3, nel=2);
94 fScinti-> AddElement(elC, 9);
95 fScinti-> AddElement(elH, 10);
96}
std::vector< ExP01TrackerHit * > a

Member Data Documentation

◆ fAir

G4Material* ExN04DetectorConstruction::fAir
private

Definition at line 52 of file ExN04DetectorConstruction.hh.

◆ fAr

G4Material* ExN04DetectorConstruction::fAr
private

Definition at line 53 of file ExN04DetectorConstruction.hh.

◆ fSilicon

G4Material* ExN04DetectorConstruction::fSilicon
private

Definition at line 54 of file ExN04DetectorConstruction.hh.

◆ fScinti

G4Material* ExN04DetectorConstruction::fScinti
private

Definition at line 55 of file ExN04DetectorConstruction.hh.

◆ fLead

G4Material* ExN04DetectorConstruction::fLead
private

Definition at line 56 of file ExN04DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration