Files
geant4/examples/extended/electromagnetic/TestEm4/src/DetectorConstruction.cc
T
2016-06-09 12:11:21 +02:00

98 lines
3.7 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: DetectorConstruction.cc,v 1.2 2003/10/06 14:51:17 maire Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "G4Material.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::~DetectorConstruction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::Construct()
{
//
// define a material from its elements. case 1: chemical molecule
//
G4double a, z;
G4double density;
G4int ncomponents, natoms;
G4Element* C = new G4Element("Carbon" ,"C" , z= 6., a= 12.01*g/mole);
G4Element* F = new G4Element("Fluorine","N" , z= 9., a= 18.99*g/mole);
G4Material* C6F6 =
new G4Material("FluorCarbonate", density= 1.61*g/cm3, ncomponents=2);
C6F6->AddElement(C, natoms=6);
C6F6->AddElement(F, natoms=6);
G4cout << C6F6 << G4endl;
//
// Container
//
G4double Rmin=0., Rmax=5*cm, deltaZ= 5*cm, Phimin=0., deltaPhi=360*degree;
G4Tubs*
solidWorld = new G4Tubs("C6F6", //its name
Rmin,Rmax,deltaZ,Phimin,deltaPhi); //its size
G4LogicalVolume*
logicWorld = new G4LogicalVolume(solidWorld, //its solid
C6F6, //its material
"C6F6"); //its name
G4VPhysicalVolume*
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"C6F6", //its name
0, //its mother volume
false, //no boolean operation
0); //copy number
//
//always return the physical World
//
return physiWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......