Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
@@ -0,0 +1,185 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
#include "LXeDetectorMessenger.hh"
#include "LXeDetectorConstruction.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWith3VectorAndUnit.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcommand.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithABool.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4Scintillation.hh"
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeDetectorMessenger::LXeDetectorMessenger(LXeDetectorConstruction* LXeDetect)
:LXeDetector(LXeDetect)
{
//Setup a command directory for detector controls with guidance
detectorDir = new G4UIdirectory("/LXe/detector/");
detectorDir->SetGuidance("Detector geometry control");
volumesDir = new G4UIdirectory("/LXe/detector/volumes/");
volumesDir->SetGuidance("Enable/disable volumes");
//Various commands for modifying detector geometry
dimensionsCmd =
new G4UIcmdWith3VectorAndUnit("/LXe/detector/dimensions",this);
dimensionsCmd->SetGuidance("Set the dimensions of the detector volume.");
dimensionsCmd->SetParameterName("scint_x","scint_y","scint_z",false);
dimensionsCmd->SetDefaultUnit("cm");
housingThicknessCmd = new G4UIcmdWithADoubleAndUnit
("/LXe/detector/housingThickness",this);
housingThicknessCmd->SetGuidance("Set the thickness of the housing.");
housingThicknessCmd->SetParameterName("d_mtl",false);
housingThicknessCmd->SetDefaultUnit("cm");
pmtRadiusCmd = new G4UIcmdWithADoubleAndUnit
("/LXe/detector/pmtRadius",this);
pmtRadiusCmd->SetGuidance("Set the radius of the PMTs.");
pmtRadiusCmd->SetParameterName("radius",false);
pmtRadiusCmd->SetDefaultUnit("cm");
nxCmd = new G4UIcmdWithAnInteger("/LXe/detector/nx",this);
nxCmd->SetGuidance("Set the number of PMTs along the x-dimension.");
nxCmd->SetParameterName("nx",false);
nyCmd = new G4UIcmdWithAnInteger("/LXe/detector/ny",this);
nyCmd->SetGuidance("Set the number of PMTs along the y-dimension.");
nyCmd->SetParameterName("ny",false);
nzCmd = new G4UIcmdWithAnInteger("/LXe/detector/nz",this);
nzCmd->SetGuidance("Set the number of PMTs along the z-dimension.");
nzCmd->SetParameterName("nz",false);
sphereCmd = new G4UIcmdWithABool("/LXe/detector/volumes/sphere",this);
sphereCmd->SetGuidance("Enable/Disable the sphere.");
reflectivityCmd = new G4UIcmdWithADouble("/LXe/detector/reflectivity",this);
reflectivityCmd->SetGuidance("Set the reflectivity of the housing.");
wlsCmd = new G4UIcmdWithABool("/LXe/detector/volumes/wls",this);
wlsCmd->SetGuidance("Enable/Disable the WLS slab");
lxeCmd = new G4UIcmdWithABool("/LXe/detector/volumes/lxe",this);
wlsCmd->SetGuidance("Enable/Disable the main detector volume.");
nFibersCmd = new G4UIcmdWithAnInteger("/LXe/detector/nfibers",this);
nFibersCmd->SetGuidance("Set the number of WLS fibers in the WLS slab.");
updateCmd = new G4UIcommand("/LXe/detector/update",this);
updateCmd->SetGuidance("Update the detector geometry with changed values.");
updateCmd->SetGuidance
("Must be run before beamOn if detector has been changed.");
defaultsCmd = new G4UIcommand("/LXe/detector/defaults",this);
defaultsCmd->SetGuidance("Set all detector geometry values to defaults.");
defaultsCmd->SetGuidance("(Update still required)");
MainScintYield=new G4UIcmdWithADouble("/LXe/detector/MainScintYield",this);
MainScintYield->SetGuidance("Set scinitillation yield of main volume.");
MainScintYield->SetGuidance("Specified in photons/MeV");
WLSScintYield = new G4UIcmdWithADouble("/LXe/detector/WLSScintYield",this);
WLSScintYield->SetGuidance("Set scintillation yield of WLS Slab");
WLSScintYield->SetGuidance("Specified in photons/MeV");
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
LXeDetectorMessenger::~LXeDetectorMessenger()
{
delete dimensionsCmd;
delete housingThicknessCmd;
delete pmtRadiusCmd;
delete nxCmd;
delete nyCmd;
delete nzCmd;
delete updateCmd;
delete detectorDir;
delete volumesDir;
delete defaultsCmd;
delete sphereCmd;
delete wlsCmd;
delete lxeCmd;
delete nFibersCmd;
delete reflectivityCmd;
delete MainScintYield;
delete WLSScintYield;
}
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
void LXeDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if( command == dimensionsCmd ){
LXeDetector->SetDimensions(dimensionsCmd->GetNew3VectorValue(newValue));
}
else if (command == housingThicknessCmd){
LXeDetector->SetHousingThickness(housingThicknessCmd
->GetNewDoubleValue(newValue));
}
else if (command == pmtRadiusCmd){
LXeDetector->SetPMTRadius(pmtRadiusCmd->GetNewDoubleValue(newValue));
}
else if (command == nxCmd){
LXeDetector->SetNX(nxCmd->GetNewIntValue(newValue));
}
else if (command == nyCmd){
LXeDetector->SetNY(nyCmd->GetNewIntValue(newValue));
}
else if (command == nzCmd){
LXeDetector->SetNZ(nzCmd->GetNewIntValue(newValue));
}
else if (command == updateCmd){
LXeDetector->UpdateGeometry();
}
else if (command == defaultsCmd){
LXeDetector->SetDefaults();
}
else if (command == sphereCmd){
LXeDetector->SetSphereOn(sphereCmd->GetNewBoolValue(newValue));
}
else if (command == reflectivityCmd){
LXeDetector
->SetHousingReflectivity(reflectivityCmd->GetNewDoubleValue(newValue));
}
else if (command == wlsCmd){
LXeDetector->SetWLSSlabOn(wlsCmd->GetNewBoolValue(newValue));
}
else if (command == lxeCmd){
LXeDetector->SetMainVolumeOn(lxeCmd->GetNewBoolValue(newValue));
}
else if (command == nFibersCmd){
LXeDetector->SetNFibers(nFibersCmd->GetNewIntValue(newValue));
}
else if (command == MainScintYield){
LXeDetector->SetMainScintYield(MainScintYield->GetNewDoubleValue(newValue));
}
else if (command == WLSScintYield){
LXeDetector->SetWLSScintYield(WLSScintYield->GetNewDoubleValue(newValue));
}
}