Commit 099f014c authored by MARCOS ANTONIO DE OLIVEIRA DEROS's avatar MARCOS ANTONIO DE OLIVEIRA DEROS

Merge branch 'remove-B1s'

removing the B1 of file
parents fa0d23e2 2834e694
......@@ -28,24 +28,24 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
# Locate sources and headers for this project
# NB: headers are included so they will show up in IDEs
#
set(PROJECT_SRC
set(PROJECT_SRC
src/B1ActionInitialization.cc
src/B1DetectorConstruction.cc
src/B1EventAction.cc
src/B1PrimaryGeneratorAction.cc
src/B1RunAction.cc
src/B1SteppingAction.cc
src/ActionInitialization.cc
src/DetectorConstruction.cc
src/EventAction.cc
src/PrimaryGeneratorAction.cc
src/RunAction.cc
src/SteppingAction.cc
)
set(PROJECT_HEADER
include/B1ActionInitialization.hh
include/B1DetectorConstruction.hh
include/B1EventAction.hh
include/B1PrimaryGeneratorAction.hh
include/B1RunAction.hh
include/B1SteppingAction.hh
include/B1Analysis.hh
set(PROJECT_HEADER
include/ActionInitialization.hh
include/DetectorConstruction.hh
include/EventAction.hh
include/PrimaryGeneratorAction.hh
include/RunAction.hh
include/SteppingAction.hh
include/Analysis.hh
)
#----------------------------------------------------------------------------
......@@ -60,8 +60,8 @@ target_link_libraries(cosmic_rays ${Geant4_LIBRARIES})
# relies on these scripts being in the current working directory.
#
set(EXAMPLEB1_SCRIPTS
exampleB1.in
exampleB1.out
init_vis.mac
run1.mac
run2.mac
......@@ -81,5 +81,3 @@ endforeach()
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS cosmic_rays DESTINATION bin)
......@@ -27,8 +27,8 @@
/// \file exampleB1.cc
/// \brief Main program of the B1 example
#include "B1DetectorConstruction.hh"
#include "B1ActionInitialization.hh"
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#ifdef G4MULTITHREADED
#include "G4MTRunManager.hh"
......@@ -71,7 +71,7 @@ int main(int argc,char** argv)
// Set mandatory initialization classes
//
// Detector construction
runManager->SetUserInitialization(new B1DetectorConstruction());
runManager->SetUserInitialization(new DetectorConstruction());
// Physics list - FTFP_BERT - p/shower
// added verbose to the physics list
......@@ -80,7 +80,7 @@ int main(int argc,char** argv)
runManager->SetUserInitialization(physicsList);
// User action initialization
runManager->SetUserInitialization(new B1ActionInitialization());
runManager->SetUserInitialization(new ActionInitialization());
// Initialize visualization
// (if you don't want the image, just delete the G4VisManager objetc and everything that concerns it)
......
......@@ -2,15 +2,8 @@
/run/initialize
# gamma 6 MeV
/gun/particle gamma
/gun/energy 6 MeV
#
/run/printProgress 100
/run/beamOn 1000
#
# proton 210 MeV
# proton 100 TeV
/gun/particle proton
/gun/energy 210 MeV
/gun/energy 100 TeV
#
/run/beamOn 1000
/run/beamOn 10
......@@ -27,18 +27,18 @@
/// \file B1ActionInitialization.hh
/// \brief Definition of the B1ActionInitialization class
#ifndef B1ActionInitialization_h
#define B1ActionInitialization_h 1
#ifndef ActionInitialization_h
#define ActionInitialization_h 1
#include "G4VUserActionInitialization.hh"
/// Action initialization class.
class B1ActionInitialization : public G4VUserActionInitialization
class ActionInitialization : public G4VUserActionInitialization
{
public:
B1ActionInitialization();
virtual ~B1ActionInitialization();
ActionInitialization();
virtual ~ActionInitialization();
virtual void BuildForMaster() const;
virtual void Build() const;
......
#ifndef B1Analysis_h
#define B1Analysis_h 1
#ifndef Analysis_h
#define Analysis_h 1
//Como vamos utilizar o root como software de análise de dados:
#include "g4root.hh"
......
......@@ -27,8 +27,8 @@
/// \file B1DetectorConstruction.hh
/// \brief Definition of the B1DetectorConstruction class
#ifndef B1DetectorConstruction_h
#define B1DetectorConstruction_h 1
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
......@@ -38,11 +38,11 @@ class G4LogicalVolume;
/// Detector construction class to define materials and geometry.
class B1DetectorConstruction : public G4VUserDetectorConstruction
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
B1DetectorConstruction();
virtual ~B1DetectorConstruction();
DetectorConstruction();
virtual ~DetectorConstruction();
virtual G4VPhysicalVolume* Construct();
......
......@@ -27,22 +27,22 @@
/// \file B1EventAction.hh
/// \brief Definition of the B1EventAction class
#ifndef B1EventAction_h
#define B1EventAction_h 1
#ifndef EventAction_h
#define EventAction_h 1
#include "G4UserEventAction.hh"
#include "globals.hh"
class B1RunAction;
class RunAction;
/// Event action class
///
class B1EventAction : public G4UserEventAction
class EventAction : public G4UserEventAction
{
public:
B1EventAction(B1RunAction* runAction);
virtual ~B1EventAction();
EventAction(RunAction* runAction);
virtual ~EventAction();
virtual void BeginOfEventAction(const G4Event* event);
virtual void EndOfEventAction(const G4Event* event);
......@@ -50,7 +50,7 @@ class B1EventAction : public G4UserEventAction
void AddEdep(G4double edep) { fEdep += edep; }
private:
B1RunAction* fRunAction;
RunAction* fRunAction;
G4double fEdep;
};
......
......@@ -27,8 +27,8 @@
/// \file B1PrimaryGeneratorAction.hh
/// \brief Definition of the B1PrimaryGeneratorAction class
#ifndef B1PrimaryGeneratorAction_h
#define B1PrimaryGeneratorAction_h 1
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
......@@ -43,11 +43,11 @@ class G4Box;
/// The default kinematic is a 6 MeV gamma, randomly distribued
/// in front of the phantom across 80% of the (X,Y) phantom size.
class B1PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
B1PrimaryGeneratorAction();
virtual ~B1PrimaryGeneratorAction();
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
// method from the base class
virtual void GeneratePrimaries(G4Event*);
......
......@@ -27,8 +27,8 @@
/// \file B1RunAction.hh
/// \brief Definition of the B1RunAction class
#ifndef B1RunAction_h
#define B1RunAction_h 1
#ifndef RunAction_h
#define RunAction_h 1
#include "G4UserRunAction.hh"
#include "G4Accumulable.hh"
......@@ -42,11 +42,11 @@ class G4Run;
/// from the energy deposit accumulated via stepping and event actions.
/// The computed dose is then printed on the screen.
class B1RunAction : public G4UserRunAction
class RunAction : public G4UserRunAction
{
public:
B1RunAction();
virtual ~B1RunAction();
RunAction();
virtual ~RunAction();
// virtual G4Run* GenerateRun();
virtual void BeginOfRunAction(const G4Run*);
......
......@@ -27,31 +27,31 @@
/// \file B1SteppingAction.hh
/// \brief Definition of the B1SteppingAction class
#ifndef B1SteppingAction_h
#define B1SteppingAction_h 1
#ifndef SteppingAction_h
#define SteppingAction_h 1
#include "G4UserSteppingAction.hh"
#include "globals.hh"
class B1EventAction;
class EventAction;
class G4LogicalVolume;
/// Stepping action class
///
class B1SteppingAction : public G4UserSteppingAction
class SteppingAction : public G4UserSteppingAction
{
public:
B1SteppingAction(B1EventAction* eventAction);
virtual ~B1SteppingAction();
SteppingAction(EventAction* eventAction);
virtual ~SteppingAction();
// method from the base class
virtual void UserSteppingAction(const G4Step*);
private:
B1EventAction* fEventAction;
EventAction* fEventAction;
G4LogicalVolume* fScoringVolume;
};
......
......@@ -27,44 +27,44 @@
/// \file B1ActionInitialization.cc
/// \brief Implementation of the B1ActionInitialization class
#include "B1ActionInitialization.hh"
#include "B1PrimaryGeneratorAction.hh"
#include "B1RunAction.hh"
#include "B1EventAction.hh"
#include "B1SteppingAction.hh"
#include "ActionInitialization.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "SteppingAction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1ActionInitialization::B1ActionInitialization()
ActionInitialization::ActionInitialization()
: G4VUserActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1ActionInitialization::~B1ActionInitialization()
ActionInitialization::~ActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1ActionInitialization::BuildForMaster() const
void ActionInitialization::BuildForMaster() const
{
B1RunAction* runAction = new B1RunAction;
RunAction* runAction = new RunAction;
SetUserAction(runAction);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1ActionInitialization::Build() const
void ActionInitialization::Build() const
{
SetUserAction(new B1PrimaryGeneratorAction);
SetUserAction(new PrimaryGeneratorAction);
B1RunAction* runAction = new B1RunAction;
RunAction* runAction = new RunAction;
SetUserAction(runAction);
B1EventAction* eventAction = new B1EventAction(runAction);
EventAction* eventAction = new EventAction(runAction);
SetUserAction(eventAction);
SetUserAction(new B1SteppingAction(eventAction));
SetUserAction(new SteppingAction(eventAction));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -27,7 +27,7 @@
/// \file B1DetectorConstruction.cc
/// \brief Implementation of the B1DetectorConstruction class
#include "B1DetectorConstruction.hh"
#include "DetectorConstruction.hh"
#include "G4RunManager.hh"
#include "G4NistManager.hh"
......@@ -43,19 +43,19 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1DetectorConstruction::B1DetectorConstruction()
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
fScoringVolume(0)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1DetectorConstruction::~B1DetectorConstruction()
DetectorConstruction::~DetectorConstruction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* B1DetectorConstruction::Construct()
G4VPhysicalVolume* DetectorConstruction::Construct()
{
// Get nist material manager
G4NistManager* nist = G4NistManager::Instance();
......
......@@ -27,15 +27,15 @@
/// \file B1EventAction.cc
/// \brief Implementation of the B1EventAction class
#include "B1EventAction.hh"
#include "B1RunAction.hh"
#include "EventAction.hh"
#include "RunAction.hh"
#include "G4Event.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1EventAction::B1EventAction(B1RunAction* runAction)
EventAction::EventAction(RunAction* runAction)
: G4UserEventAction(),
fRunAction(runAction),
fEdep(0.)
......@@ -43,19 +43,19 @@ B1EventAction::B1EventAction(B1RunAction* runAction)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1EventAction::~B1EventAction()
EventAction::~EventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1EventAction::BeginOfEventAction(const G4Event*)
void EventAction::BeginOfEventAction(const G4Event*)
{
fEdep = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1EventAction::EndOfEventAction(const G4Event*)
void EventAction::EndOfEventAction(const G4Event*)
{
// accumulate statistics in run action
fRunAction->AddEdep(fEdep);
......
......@@ -27,7 +27,7 @@
/// \file B1PrimaryGeneratorAction.cc
/// \brief Implementation of the B1PrimaryGeneratorAction class
#include "B1PrimaryGeneratorAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4LogicalVolume.hh"
......@@ -41,7 +41,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1PrimaryGeneratorAction::B1PrimaryGeneratorAction()
PrimaryGeneratorAction::PrimaryGeneratorAction()
: G4VUserPrimaryGeneratorAction(),
fParticleGun(0),
fEnvelopeBox(0)
......@@ -61,14 +61,14 @@ B1PrimaryGeneratorAction::B1PrimaryGeneratorAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1PrimaryGeneratorAction::~B1PrimaryGeneratorAction()
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete fParticleGun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of ecah event
//
......
......@@ -27,13 +27,15 @@
/// \file B1RunAction.cc
/// \brief Implementation of the B1RunAction class
#include "B1RunAction.hh"
#include "B1PrimaryGeneratorAction.hh"
#include "B1DetectorConstruction.hh"
#include "B1SteppingAction.hh"
#include "RunAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "SteppingAction.hh"
// #include "B1Run.hh"
// Adicionando header de análise de dados:
#include "B1Analysis.hh"
#include "Analysis.hh"
#include "G4RunManager.hh"
#include "G4Run.hh"
#include "G4AccumulableManager.hh"
......@@ -45,7 +47,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1RunAction::B1RunAction()
RunAction::RunAction()
: G4UserRunAction(),
fEdep(0.),
fEdep2(0.)
......@@ -70,12 +72,12 @@ B1RunAction::B1RunAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1RunAction::~B1RunAction()
RunAction::~RunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1RunAction::BeginOfRunAction(const G4Run*)
void RunAction::BeginOfRunAction(const G4Run*)
{
createHistogram();
// inform the runManager to save random number seed
......@@ -89,7 +91,7 @@ void B1RunAction::BeginOfRunAction(const G4Run*)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1RunAction::EndOfRunAction(const G4Run* run)
void RunAction::EndOfRunAction(const G4Run* run)
{
G4int nofEvents = run->GetNumberOfEvent();
if (nofEvents == 0) return;
......@@ -106,8 +108,8 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
G4double rms = edep2 - edep*edep/nofEvents;
if (rms > 0.) rms = std::sqrt(rms); else rms = 0.;
const B1DetectorConstruction* detectorConstruction
= static_cast<const B1DetectorConstruction*>
const DetectorConstruction* detectorConstruction
= static_cast<const DetectorConstruction*>
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
G4double mass = detectorConstruction->GetScoringVolume()->GetMass();
G4double dose = edep/mass;
......@@ -116,8 +118,8 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
// Run conditions
// note: There is no primary generator action object for "master"
// run manager for multi-threaded mode.
const B1PrimaryGeneratorAction* generatorAction
= static_cast<const B1PrimaryGeneratorAction*>
const PrimaryGeneratorAction* generatorAction
= static_cast<const PrimaryGeneratorAction*>
(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
G4String runCondition;
if (generatorAction)
......@@ -160,13 +162,13 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1RunAction::AddEdep(G4double edep)
void RunAction::AddEdep(G4double edep)
{
fEdep += edep;
fEdep2 += edep*edep;
}
void B1RunAction::createHistogram()
void RunAction::createHistogram()
{
//Avisa que está criando
G4cout << "CRIANDO HISTOGRAMAS" << G4endl;
......@@ -195,7 +197,7 @@ void B1RunAction::createHistogram()
}
void B1RunAction::WriteHistogram()
void RunAction::WriteHistogram()
{
G4cout<<"ESCREVENDO"<<G4endl;
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
......
......@@ -27,10 +27,10 @@
/// \file B1SteppingAction.cc
/// \brief Implementation of the B1SteppingAction class
#include "B1SteppingAction.hh"
#include "B1EventAction.hh"
#include "B1DetectorConstruction.hh"
#include "B1Analysis.hh"
#include "SteppingAction.hh"
#include "EventAction.hh"
#include "DetectorConstruction.hh"
#include "Analysis.hh"
#include "G4Step.hh"
#include "G4SystemOfUnits.hh"
......@@ -40,7 +40,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1SteppingAction::B1SteppingAction(B1EventAction* eventAction)
SteppingAction::SteppingAction(EventAction* eventAction)
: G4UserSteppingAction(),
fEventAction(eventAction),
fScoringVolume(0)
......@@ -48,17 +48,17 @@ B1SteppingAction::B1SteppingAction(B1EventAction* eventAction)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1SteppingAction::~B1SteppingAction()
SteppingAction::~SteppingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void B1SteppingAction::UserSteppingAction(const G4Step* step)
void SteppingAction::UserSteppingAction(const G4Step* step)
{
G4double e_minus, p, pi_p, pi_m, mu_p, mu_m, e_p, neutron, gamma = 0;
if (!fScoringVolume) {
const B1DetectorConstruction* detectorConstruction
= static_cast<const B1DetectorConstruction*>
const DetectorConstruction* detectorConstruction
= static_cast<const DetectorConstruction*>
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
fScoringVolume = detectorConstruction->GetScoringVolume();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment