Skip to content
Snippets Groups Projects
Commit 63c10475 authored by Luigui Miranda's avatar Luigui Miranda
Browse files

mas organizado.8

parent ec71f327
No related branches found
No related tags found
3 merge requests!3Master,!2Master,!1Initial commit
Showing
with 1 addition and 1026 deletions
......@@ -42,5 +42,5 @@ Para imprimir lo anterior en pantalla, es necesario descomentar las líneas 167
- En la carpeta `flujos`, el archivo `salidasimu.shw.bz2` contiene el flujo de neutrones sobre Bucaramanga (956 m s.n.m) se debe rehubicar en la carpeta `Simular_flujo_de_neutrones`.
- En la carpeta `flujos`, el script `flujo_artificial.py` genera un flujo artificial de neutrones con las características deseadas.
- En la carpeta flujos, el script auto_simulaciones.sh automatiza las simulaciones de un flujo monoenergético de neutrones. Si se desea utilizar, es necesario cambiar la energía de los neutrones antes de compilar este código.
- En la carpeta `flujos`, el script auto_simulaciones.sh automatiza las simulaciones de un flujo monoenergético de neutrones. Si se desea utilizar, es necesario cambiar la energía de los neutrones antes de compilar este código.
# Proyecto de Simulación de Interacción de Neutrones con Suelo
Este repositorio contiene dos carpetas principales que abordan las simulaciones realizadas para la interacción de neutrones con suelo húmedo.
## 1. Simulación de Flujo de Neutrones Monoenergeticos
La carpeta `Simular_flujo_de_neutrones` contiene archivos para simular la interacción de neutrones con suelo húmedo, contándolos a través de 6 anillos concéntricos de 2 metros, con radios de 10, 25, 45, 95, 145 y 195 metros. El sistema físico consta de un bloque de suelo de 800,000 m² dividido en tres partes. Durante las simulaciones, se varía únicamente la humedad de la primera capa. En la ubicación `Simular_flujo_de_neutrones/src/`, se encuentra el archivo `PrimaryGeneratorAction.cc`, que define la inyección de neutrones, su dirección y energía.
Para las simulaciones, se inyectaron 10,000 neutrones primarios en ángulos cenitales (θ) que variaban desde 0 grados hasta 45 grados, con incrementos de 5 grados. Asimismo, los neutrones son monoenergéticos en el rango de 1 eV a 10 MeV, aumentando de a 1 década.
La salida del código es un archivo .root que contiene 6 histogramas, uno para cada contador. Cada barra en estos histogramas representa el número de partículas que llegan a cada contador. El orden de las partículas en los histogramas es el siguiente:
1. Electrones y positrones
2. Gammas
3. Protones
4. Neutrones
Es posible realizar un seguimiento por paso de los siguientes parámetros: "ID", "X", "Y", "Z".
: ID de la partícula y posición de la partícula.
Para imprimir lo anterior en pantalla, es necesario descomentar las líneas 130 a 133 en el archivo `PrimaryGeneratorAction.cc`. Al realizar esta acción, se mostrará en la pantalla el ID del neutrón y su posición en cada paso de la simulación.
Lo anterior se realiza descomentando las lineas 130 - 133, realizando esto se imprime en la pantalla el ID del neutron y su posicion en cada step
## 2. Simulación de un Flujo de Neutrones
En la carpeta `Simular_neutrones_monoenergeticos`, se encuentran los archivos necesarios para simular la interacción de neutrones con suelo húmedo. El sistema físico consiste en un bloque de suelo de 400,000 m² y un contador en forma de cubo con arista de 2 metros, elevado a 3 metros sobre el suelo. Las simulaciones implican cambios en la humedad del bloque de suelo, y la modificación del flujo de neutrones se logra mediante el archivo `salidasimu.shw.bz2` en la carpeta `flujos`.
La salida del codigo en un archivo .root donde se generan 2 histogramas.
1. Numero de neutrones que llegan al contador
2. Energia de los neutrones que llegan al contador
Es posible realizar un seguimiento por paso de los siguientes parámetros: "N", "ID", "X", "Y", "Z", "PX", "PY", "PZ", "THETA", "PHY".
: ID de la partícula, posición de la partícula, momento de la partícula, y ángulos cenital y azimutal de la partícula.
Para imprimir lo anterior en pantalla, es necesario descomentar las líneas 167 a 176 en el archivo `PrimaryGeneratorAction.cc`. Al realizar esta acción, se mostrará en la pantalla el numero del evento, el ID del neutrón, su posición, su momento y los angulos cenital y asumutal en cada paso de la simulación.
## Archivos Adicionales
- En la carpeta `flujos`, el archivo `salidasimu.shw.bz2` contiene el flujo de neutrones sobre Bucaramanga (956 m s.n.m) se debe rehubicar en la carpeta `Simular_flujo_de_neutrones`.
- En la carpeta `flujos`, el script `flujo_artificial.py` genera un flujo artificial de neutrones con las características deseadas.
- En la carpeta flujos, el script auto_simulaciones.sh automatiza las simulaciones de un flujo monoenergético de neutrones. Si se desea utilizar, es necesario cambiar la energía de los neutrones antes de compilar este código.
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(wcd)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(wcd wcd.cc ${sources} ${headers})
target_link_libraries(wcd ${Geant4_LIBRARIES} )
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build OpNovice. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(wcd_SCRIPTS
init_vis.mac
input.in
optPhoton.mac
gui.mac
vis.mac
loop.sh
salidasimu.shw.bz2
)
foreach(_script ${wcd_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# For internal Geant4 use - but has no effect if you build this
# example standalone
#
add_custom_target(wcd-pmt-2 DEPENDS wcd)
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS wcd DESTINATION bin)
# $Id: GNUmakefile 68752 2013-04-05 10:23:47Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for examples module. Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------
name := wcd
G4TARGET := $(name)
G4EXLIB := true
ifndef G4INSTALL
G4INSTALL = ../../..
endif
.PHONY: all
all: lib bin
include $(G4INSTALL)/config/binmake.gmk
visclean:
rm -f g4*.prim g4*.eps g4*.wrl
rm -f .DAWN_*
# Archivos de la Tesis
Para compilar el código en una carpeta diferente, utiliza el siguiente comando:
```
cmake -DGeant4_DIR=/opt/geant4/lib/Geant4-10.3.3/ ../"direccion del directorio"/Simulacion_flujo_de_neutrones; make -j2
```
Para ejecutar el código, utiliza el siguiente comando:
```
./wcd -m input.in > archivo.txt
```
Si deseas cambiar la humedad, accede a la siguiente dirección: `/"direccion del directorio"/Simulacion_flujo_de_neutrones/src/`. Luego, ingresa al archivo `DetectorConstruction.cc` con el editor de texto de tu preferencia.
En la línea 103, escribe:
- `sueloBS` (0% de humedad),
- `sueloBH5` (5% de humedad),
- `sueloBH15` (15% de humedad),
- `sueloBH25` (25% de humedad),
- `sueloBH30` (30% de humedad).
#
# This file permits to customize, with commands,
# the menu bar of the G4UIXm, G4UIQt, G4UIWin32 sessions.
# It has no effect with G4UIterminal.
#
# Process vis.mac (and draw geometry)
#
/control/execute vis.mac
#
# File menu :
/gui/addMenu file File
/gui/addButton file Quit exit
#
# Run menu :
/gui/addMenu run Run
/gui/addButton run "beamOn 1" "/run/beamOn 1"
#/gui/addButton run run1 "/control/execute run1.mac"
#/gui/addButton run run2 "/control/execute run2.mac"
#
# Gun menu :
/gui/addMenu gun Gun
/gui/addButton gun "50 MeV" "/gun/energy 50 MeV"
/gui/addButton gun "1 GeV" "/gun/energy 1 GeV"
/gui/addButton gun "10 GeV" "/gun/energy 10 GeV"
/gui/addButton gun "e-" "/gun/particle e-"
/gui/addButton gun "pi0" "/gun/particle pi0"
/gui/addButton gun "pi+" "/gun/particle pi+"
/gui/addButton gun "neutron" "/gun/particle neutron"
/gui/addButton gun "proton" "/gun/particle proton"
#
# Field menu :
#/gui/addMenu field Field
#/gui/addButton field "off" "/B2/det/setField 0.2 tesla"
#/gui/addButton field "0.2 tesla" "/B2/det/setField 0.2 tesla"
#/gui/addButton field "2.0 tesla" "/B2/det/setField 2.0 tesla"
#
# Viewer menu :
/gui/addMenu viewer Viewer
/gui/addButton viewer "Set style surface" "/vis/viewer/set/style surface"
/gui/addButton viewer "Set style wireframe" "/vis/viewer/set/style wireframe"
/gui/addButton viewer "Refresh viewer" "/vis/viewer/refresh"
/gui/addButton viewer "Update viewer (interaction or end-of-file)" "/vis/viewer/update"
/gui/addButton viewer "Flush viewer (= refresh + update)" "/vis/viewer/flush"
/gui/addButton viewer "Update scene" "/vis/scene/notifyHandlers"
#
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ActionInitialization.hh 68058 2013-03-13 14:47:43Z gcosmo $
//
/// \file ActionInitialization.hh
/// \brief Definition of the ActionInitialization class
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
class B4DetectorConstruction;
/// Action initialization class.
///
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization();
virtual ~ActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
virtual G4VSteppingVerbose* InitializeSteppingVerbose() const;
};
#endif
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
// Geant4 Libraries
//
#include "globals.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4Cache.hh"
#include "G4Material.hh"
#include "G4Element.hh"
#include "G4LogicalVolume.hh"
#include "G4Box.hh"
#include "G4Ellipsoid.hh"
#include "G4Tubs.hh"
#include "G4OpticalSurface.hh"
// Local Libraries
//
//#include "PMTSD.hh"
class G4LogicalVolume;
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
virtual ~DetectorConstruction();
public:
virtual G4VPhysicalVolume* Construct();
/* G4VPhysicalVolume* GetWaterVolume() const
{
return fwaterVolume;
}*/
private:
};
#endif
#ifndef EventAction_h
#define EventAction_h 1
// Geant libraries
//
#include "G4UserEventAction.hh"
#include "globals.hh"
class RunAction;
class EventAction : public G4UserEventAction
{
public:
EventAction(RunAction* runAction);
virtual ~EventAction();
virtual void BeginOfEventAction(const G4Event* event);
//virtual void EndOfEventAction(const G4Event* event);
void AddEdep(G4double edep)
{
fEdep += edep;
}
private:
RunAction* fRunAction;
G4double fEdep;
};
#endif
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: ExtraPhysics.hh 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical//include/ExtraPhysics.hh
/// \brief Definition of the ExtraPhysics class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef ExtraPhysics_h
#define ExtraPhysics_h 1
#include "globals.hh"
#include "G4VPhysicsConstructor.hh"
class ExtraPhysics : public G4VPhysicsConstructor
{
public:
ExtraPhysics();
virtual ~ExtraPhysics();
virtual void ConstructParticle();
virtual void ConstructProcess();
};
#endif
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: OpticalPhysics.hh 69561 2013-05-08 12:25:56Z gcosmo $
//
/// \file optical//include/OpticalPhysics.hh
/// \brief Definition of the OpticalPhysics class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef OpticalPhysics_h
#define OpticalPhysics_h 1
#include "globals.hh"
#include "G4OpWLS.hh"
#include "G4Cerenkov.hh"
#include "G4Scintillation.hh"
#include "G4OpMieHG.hh"
#include "G4OpRayleigh.hh"
#include "G4OpAbsorption.hh"
#include "G4OpBoundaryProcess.hh"
#include "G4VPhysicsConstructor.hh"
class OpticalPhysics : public G4VPhysicsConstructor
{
public:
OpticalPhysics(G4bool toggle=true);
virtual ~OpticalPhysics();
virtual void ConstructParticle();
virtual void ConstructProcess();
G4OpWLS* GetProcess() {return fProcess;}
G4Cerenkov* GetCerenkovProcess() {return fCerenkovProcess;}
G4Scintillation* GetScintillationProcess() {return fScintProcess;}
G4OpAbsorption* GetAbsorptionProcess() {return fAbsorptionProcess;}
G4OpRayleigh* GetRayleighScatteringProcess() {return fRayleighScattering;}
G4OpMieHG* GetMieHGScatteringProcess() {return fMieHGScatteringProcess;}
G4OpBoundaryProcess* GetBoundaryProcess() { return fBoundaryProcess;}
void SetNbOfPhotonsCerenkov(G4int);
private:
G4OpWLS* fProcess;
G4Cerenkov* fCerenkovProcess;
G4Scintillation* fScintProcess;
G4OpAbsorption* fAbsorptionProcess;
G4OpRayleigh* fRayleighScattering;
G4OpMieHG* fMieHGScatteringProcess;
G4OpBoundaryProcess* fBoundaryProcess;
G4bool fAbsorptionOn;
};
#endif
#ifndef PMTHit_h
#define PMTHit_h 1
// Geant4 Libraries
//
#include "G4VHit.hh"
#include "G4THitsCollection.hh"
#include "G4Allocator.hh"
#include "G4ThreeVector.hh"
#include "G4LogicalVolume.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4VPhysicalVolume.hh"
#include "tls.hh"
// Local Libraries
//
class G4VTouchable;
class PMTHit //: public G4VHit
{
public:
PMTHit();
virtual ~PMTHit();
G4int askDetected(G4double);
void reset();
private:
void GetWavelength(G4double);
G4double waveLength;
};
#endif
#ifndef PMTSD_h
#define PMTSD_h 1
// Geant4 Libraries
//
//#include "G4DataVector.hh"
//#include "G4VSensitiveDetector.hh"
// Local Libraries
//
#include "PMTHit.hh"
// C++ Libraries
//
//#include <vector>
class G4Step;
class G4HCofThisEvent;
class PMTSD //: public G4VSensitiveDetector
{
public:
PMTSD();//G4String name);
virtual ~PMTSD();
virtual G4int ProcessHits(const G4Step* aStep);
void resetPMTSD();
G4double getPhoDetected()
{
return phoDetec;
}
private:
PMTHit *phoHit;
G4int phoDetec;
G4double kinEnergy;
};
#endif
#ifndef PhysicsList_h
#define PhysicsList_h 1
// Geant4 Libraries
//
#include "globals.hh"
#include "G4VModularPhysicsList.hh"
class G4VPhysicsConstructor;
class PhysicsListMessenger;
class StepMax;
class OpticalPhysics;
class PhysicsList: public G4VModularPhysicsList
{
public:
PhysicsList(G4String);
virtual ~PhysicsList();
void SetCuts();
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForPositron(G4double);
void SetStepMax(G4double);
StepMax* GetStepMaxProcess();
void AddStepMax();
/// Remove specific physics from physics list.
void RemoveFromPhysicsList(const G4String&);
/// Make sure that the physics list is empty.
void ClearPhysics();
virtual void ConstructParticle();
virtual void ConstructProcess();
// Turn on or off the absorption process
void SetAbsorption(G4bool);
void SetNbOfPhotonsCerenkov(G4int);
void SetVerbose(G4int);
private:
G4double fCutForGamma;
G4double fCutForElectron;
G4double fCutForPositron;
StepMax* fStepMaxProcess;
OpticalPhysics* fOpticalPhysics;
PhysicsListMessenger* fMessenger;
G4bool fAbsorptionOn;
G4VMPLData::G4PhysConstVectorData* fPhysicsVector;
};
#endif
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: PhysicsListMessenger.hh 69561 2013-05-08 12:25:56Z gcosmo $
//
/// \file optical//include/PhysicsListMessenger.hh
/// \brief Definition of the PhysicsListMessenger class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef PhysicsListMessenger_h
#define PhysicsListMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "G4DecayTable.hh"
#include "G4VDecayChannel.hh"
class PhysicsList;
class G4UIdirectory;
class G4UIcmdWithABool;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithoutParameter;
class G4UIcmdWithADoubleAndUnit;
/// Provide control of the physics list and cut parameters
class PhysicsListMessenger : public G4UImessenger
{
public:
PhysicsListMessenger(PhysicsList* );
virtual ~PhysicsListMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
PhysicsList* fPhysicsList;
G4UIdirectory* fDirectory;
G4UIdirectory* fDecayDirectory;
G4UIcmdWithABool* fSetAbsorptionCMD;
G4UIcmdWithAnInteger* fVerboseCmd;
G4UIcmdWithAnInteger* fCerenkovCmd;
G4UIcmdWithADoubleAndUnit* fGammaCutCMD;
G4UIcmdWithADoubleAndUnit* fElectCutCMD;
G4UIcmdWithADoubleAndUnit* fPosCutCMD;
G4UIcmdWithADoubleAndUnit* fAllCutCMD;
G4UIcmdWithADoubleAndUnit* fStepMaxCMD;
G4UIcmdWithAString* fRemovePhysicsCMD;
G4UIcmdWithoutParameter* fClearPhysicsCMD;
G4UIcmdWithoutParameter* fListCMD;
G4UIcmdWithoutParameter* fPienuCMD;
G4UIcmdWithoutParameter* fPimunuCMD;
};
#endif
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file /include/PrimaryGeneratorAction.hh
/// \brief Definition of the PrimaryGeneratorAction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
#include "G4ParticleGun.hh"
#include "PrimarySpectrum.hh"
class G4ParticleGun;
class G4Event;
class PrimaryGeneratorMessenger;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
public:
virtual void GeneratePrimaries(G4Event*);
const G4ParticleGun* GetParticleGun() const
{
return fParticleGun;
}
void SetOptPhotonPolar();
void SetOptPhotonPolar(G4double);
private:
G4double enerPart;
G4ParticleGun* fParticleGun;
PrimarySpectrum parPosDir;
PrimaryGeneratorMessenger* fGunMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif /*PrimaryGeneratorAction_h*/
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file /include/PrimaryGeneratorMessenger.hh
/// \brief Definition of the PrimaryGeneratorMessenger class
//
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PrimaryGeneratorMessenger_h
#define PrimaryGeneratorMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class PrimaryGeneratorAction;
class G4UIdirectory;
class G4UIcmdWithADoubleAndUnit;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PrimaryGeneratorMessenger: public G4UImessenger
{
public:
PrimaryGeneratorMessenger(PrimaryGeneratorAction* );
virtual ~PrimaryGeneratorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
PrimaryGeneratorAction* fAction;
G4UIdirectory* fGunDir;
G4UIcmdWithADoubleAndUnit* fPolarCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
#ifndef PrimarySpectrum_h
#define PrimarySpectrum_h 1
//Geant libraries
//
#include "globals.hh"
#include "G4ThreeVector.hh"
// c++ libraries
//
#include <math.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <stdlib.h>
#include <string>
#include <iomanip>
class PrimarySpectrumMessenger;
class PrimarySpectrum
{
public:
PrimarySpectrum();
~PrimarySpectrum();
void primaryPosition();
G4ThreeVector particlePosition;
G4ThreeVector particleDirection;
G4String parId;
void primaryMomento();
std::string inputFile; //[] = "tmpMachin24h.shw.bz2";
int openFile(std::string name);
private:
G4double pi;
G4double Ro;
G4double initx;
G4double inity;
G4double initz;
float r;
float theta;
G4int crkId;
G4double px;
G4double py;
G4double pz;
G4double x;
G4double y;
G4double z;
G4int shwId;
G4int prmId;
G4double prmEner;
G4double prmThe;
G4double prmPhi;
FILE *inFile = NULL;
PrimarySpectrumMessenger* fSpectMessenger;
};
#endif
#ifndef PrimarySpectrumMessenger_h
#define PrimarySpectrumMessenger_h 1
// Geant4 Libraries
#include "G4UImessenger.hh"
#include "globals.hh"
class PrimarySpectrum;
class G4UIdirectory;
class G4UIcmdWithAString;
class PrimarySpectrumMessenger: public G4UImessenger
{
public:
PrimarySpectrumMessenger(PrimarySpectrum* spectrum);
virtual ~PrimarySpectrumMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
private:
PrimarySpectrum* fSpectrum;
G4UIdirectory* fSpecDir;
G4UIcmdWithAString* inFile;
};
#endif
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file /include/RunAction.hh
/// \brief Definition of the RunAction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef RunAction_h
#define RunAction_h 1
#include "globals.hh"
#include "G4UserRunAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class G4Timer;
class G4Run;
class RunAction : public G4UserRunAction
{
public:
RunAction();
virtual ~RunAction();
public:
virtual void BeginOfRunAction(const G4Run* aRun);
virtual void EndOfRunAction(const G4Run* aRun);
private:
G4Timer* fTimer;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif /*RunAction_h*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment