Files
geant4/examples/extended/electromagnetic/TestEm5/include/Em5DetectorConstruction.hh
T
2016-06-08 16:57:27 +02:00

148 lines
5.2 KiB
C++

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em5DetectorConstruction.hh,v 1.4 2001/10/16 11:56:27 maire Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef Em5DetectorConstruction_h
#define Em5DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
class G4Box;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4UniformMagField;
class Em5DetectorMessenger;
class Em5CalorimeterSD;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class Em5DetectorConstruction : public G4VUserDetectorConstruction
{
public:
Em5DetectorConstruction();
~Em5DetectorConstruction();
public:
void SetAbsorberMaterial (G4String);
void SetAbsorberThickness(G4double);
void SetAbsorberSizeYZ (G4double);
void SetAbsorberXpos(G4double);
void SetWorldMaterial(G4String);
void SetWorldSizeX (G4double);
void SetWorldSizeYZ (G4double);
void SetMagField(G4double);
G4VPhysicalVolume* Construct();
void UpdateGeometry();
public:
void PrintCalorParameters();
G4Material* GetAbsorberMaterial() {return AbsorberMaterial;};
G4double GetAbsorberThickness() {return AbsorberThickness;};
G4double GetAbsorberSizeYZ() {return AbsorberSizeYZ;};
G4double GetAbsorberXpos() {return XposAbs;};
G4double GetxstartAbs() {return xstartAbs;};
G4double GetxendAbs() {return xendAbs;};
G4Material* GetWorldMaterial() {return WorldMaterial;};
G4double GetWorldSizeX() {return WorldSizeX;};
G4double GetWorldSizeYZ() {return WorldSizeYZ;};
const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
const G4VPhysicalVolume* GetAbsorber() {return physiAbsorber;};
private:
G4Material* AbsorberMaterial;
G4double AbsorberThickness;
G4double AbsorberSizeYZ;
G4double XposAbs;
G4double xstartAbs, xendAbs;
G4Material* WorldMaterial;
G4double WorldSizeX;
G4double WorldSizeYZ;
G4bool defaultWorld;
G4Box* solidWorld; //pointer to the solid World
G4LogicalVolume* logicWorld; //pointer to the logical World
G4VPhysicalVolume* physiWorld; //pointer to the physical World
G4Box* solidAbsorber; //pointer to the solid Absorber
G4LogicalVolume* logicAbsorber; //pointer to the logical Absorber
G4VPhysicalVolume* physiAbsorber; //pointer to the physical Absorber
G4UniformMagField* magField; //pointer to the magnetic field
Em5DetectorMessenger* detectorMessenger; //pointer to the Messenger
Em5CalorimeterSD* calorimeterSD; //pointer to the sensitive detector
private:
void DefineMaterials();
void ComputeCalorParameters();
G4VPhysicalVolume* ConstructCalorimeter();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void Em5DetectorConstruction::ComputeCalorParameters()
{
// Compute derived parameters of the calorimeter
xstartAbs = XposAbs-0.5*AbsorberThickness;
xendAbs = XposAbs+0.5*AbsorberThickness;
if (defaultWorld)
{
WorldSizeX = 1.5*AbsorberThickness; WorldSizeYZ= 1.2*AbsorberSizeYZ;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif