Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Par01DetectorConstruction Class Reference

#include <Par01DetectorConstruction.hh>

Inheritance diagram for Par01DetectorConstruction:
Collaboration diagram for Par01DetectorConstruction:

Public Member Functions

 Par01DetectorConstruction ()
 
virtual ~Par01DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 41 of file Par01DetectorConstruction.hh.

Constructor & Destructor Documentation

Par01DetectorConstruction::Par01DetectorConstruction ( )

Definition at line 57 of file Par01DetectorConstruction.cc.

58 {;}
Par01DetectorConstruction::~Par01DetectorConstruction ( )
virtual

Definition at line 62 of file Par01DetectorConstruction.cc.

63 {;}

Member Function Documentation

G4VPhysicalVolume * Par01DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 67 of file Par01DetectorConstruction.cc.

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

Here is the call graph for this function:

void Par01DetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 269 of file Par01DetectorConstruction.cc.

270 {
271  //--------- Sensitive detector -------------------------------------
273  G4String calorimeterSDname = "Par01/Calorimeter";
274  Par01CalorimeterSD* CalorimeterSD = new Par01CalorimeterSD( calorimeterSDname,
275  fnX*fnY,
276  "CalCollection" );
277  SDman->AddNewDetector( CalorimeterSD );
278  fCrystalLog->SetSensitiveDetector(CalorimeterSD);
279 
280  G4String hadCalorimeterSDname = "Par01/HadronCalorimeter";
281  Par01CalorimeterSD* HadCalorimeterSD = new Par01CalorimeterSD( hadCalorimeterSDname,
282  fnXhad*fnYhad,
283  "HadCollection" );
284  SDman->AddNewDetector( HadCalorimeterSD );
285  fTowerLog->SetSensitiveDetector(HadCalorimeterSD);
286 
287  // --------------- fast simulation ----------------------------
288  G4RegionStore* regionStore = G4RegionStore::GetInstance();
289 
290  G4Region* caloRegion = regionStore->GetRegion("EM_calo_region");
291  // builds a model and sets it to the envelope of the calorimeter:
292  new Par01EMShowerModel("emShowerModel",caloRegion);
293 }
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static G4RegionStore * GetInstance()
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)

Here is the call graph for this function:


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