IAP GITLAB

Commit 54bc6771 authored by Ralf Ulrich's avatar Ralf Ulrich

geant4.10.04

parent 93545031
......@@ -3,6 +3,8 @@
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(mQsim)
set(CMAKE_BUILD_TYPE Debug)
#----------------------------------------------------------------------------
# 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
......
#include "G4RunManager.hh"
#if defined(G4UI_USE_QT)
#include "G4UIQt.hh"
......@@ -9,6 +8,16 @@
#include "DetectorConstructionDet.hh"
#include "PhysicsList.hh"
//#ifdef G4MULTITHREADED
//#warning multi-threaded
//#include "G4MTRunManager.hh"
//#else
#warning not-multi-threaded
#include "G4RunManager.hh"
//#endif
#include "G4UImanager.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "PrimaryGeneratorAction.hh"
......@@ -16,9 +25,18 @@
#include "StackingAction.hh"
#ifdef G4VIS_USE
#warning vis-use
#include "G4VisExecutive.hh"
#endif
#ifdef G4UI_USE
#warning ui-use
#include "G4UIExecutive.hh"
#endif
#include "G4UItcsh"
#include <iostream>
using namespace std;
......@@ -29,11 +47,28 @@ using namespace std;
int
main(int argc, char** argv)
{
G4RunManager * runManager = new G4RunManager;
#ifdef G4UI_USE
// Detect interactive mode (if no arguments) and define UI session
//
G4UIExecutive* ui = 0;
if ( argc == 1 ) {
ui = new G4UIExecutive(argc, argv);
}
#endif
//#ifdef G4MULTITHREADED
// auto runManager = new G4MTRunManager;
//#else
auto runManager = new G4RunManager;
//#endif
#ifdef G4VIS_USE
// Visualization manager construction
G4VisManager* visManager = new G4VisExecutive;
auto visManager = new G4VisExecutive;
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
// G4VisManager* visManager = new G4VisExecutive("Quiet");
visManager->Initialize();
#endif
......@@ -69,7 +104,19 @@ main(int argc, char** argv)
runManager->SetUserAction(new EventAction());
runManager->Initialize();
// Get the pointer to the User Interface manager
auto UImanager = G4UImanager::GetUIpointer();
#ifdef G4VIS_USE
UImanager->ApplyCommand("/control/execute vis.mac");
G4UIsession* session = new G4UIterminal(new G4UItcsh);
session->SessionStart();
#else
UImanager->ApplyCommand("/control/execute init.mac");
#endif
#if defined(G4UI_USE_QT)
if (!batch) {
G4UIQt* ui = new G4UIQt(argc, argv);
......
......@@ -36,8 +36,6 @@
#include "G4LogicalBorderSurface.hh"
#include "G4SubtractionSolid.hh"
#include "G4SDManager.hh"
#include <iostream>
using namespace std;
......@@ -72,7 +70,7 @@ DetectorConstructionDet::~DetectorConstructionDet()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstructionDet::Construct()
{
const double Qe = fQe;
//const double Qe = fQe;
//-------------------------------------------------------------------------
// Materials
......@@ -466,9 +464,9 @@ G4VPhysicalVolume* DetectorConstructionDet::Construct()
"Cathode"); // its name
G4VPhysicalVolume* pv_cathode =
new G4PVPlacement(0, G4ThreeVector(0, 0, heightCrystal/2+crystalCase/2),
cathodeLV, "Cathode", crystalAssemblyLV, false, 0, checkOverlays);
//G4VPhysicalVolume* pv_cathode =
new G4PVPlacement(0, G4ThreeVector(0, 0, heightCrystal/2+crystalCase/2),
cathodeLV, "Cathode", crystalAssemblyLV, false, 0, checkOverlays);
/*
G4VPhysicalVolume* pv_cathode =
new G4PVPlacement(0, G4ThreeVector(0, 0, heightCrystal/2-crystalCase/2),
......@@ -575,7 +573,7 @@ G4VPhysicalVolume* DetectorConstructionDet::Construct()
void DetectorConstructionDet::ConstructSDandField()
{
// G4SDManager::GetSDMpointer()->SetVerboseLevel(1);
auto sdManager = G4SDManager::GetSDMpointer();
//
// Sensitive detectors
......@@ -583,10 +581,11 @@ void DetectorConstructionDet::ConstructSDandField()
// int nofChannel = 3 * 20 * 20;
fSciSD = new DetectorSD("Scintillator", "ScintillatorHitsCollection", nlay, nGrid);
//SetSensitiveDetector("SciCol", sciSD);
sdManager->AddNewDetector(fSciSD);
SetSensitiveDetector("SciBlock", fSciSD);
PMTSD* aSD = new PMTSD("/Det/pmtSD");
sdManager->AddNewDetector(aSD);
SetSensitiveDetector("Cathode", aSD);
/*
......
......@@ -101,6 +101,9 @@ G4bool DetectorSD::ProcessHits(G4Step* step,
// cout << touchable->GetVolume()->
//}
if (!fHitsCollection)
return true;
// Get hit accounting data for this cell
DetectorHit* hit = (*fHitsCollection)[layerNumber];
......@@ -134,6 +137,9 @@ G4bool DetectorSD::ProcessHits(G4Step* step,
void DetectorSD::EndOfEvent(G4HCofThisEvent*)
{
if (!fHitsCollection)
return;
if ( verboseLevel>1 ) {
G4int nofHits = fHitsCollection->entries();
G4cout
......
#include "PhysicsList.hh"
#include "G4PhysicsListHelper.hh"
#include "G4DecayPhysics.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmExtraPhysics.hh"
......@@ -29,8 +31,12 @@
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "CLHEP/Units/PhysicalConstants.h"
#include <iostream>
using namespace std;
using namespace CLHEP;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::PhysicsList(double qe): G4VUserPhysicsList(), fQe(qe)
......@@ -116,6 +122,7 @@ PhysicsList::AddTransportation()
{
G4VUserPhysicsList::AddTransportation();
auto theParticleIterator=GetParticleIterator();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
......@@ -196,6 +203,7 @@ void PhysicsList::ConstructEM() {
opt.SetDEDXBinning(200);
opt.SetLambdaBinning(200);
auto theParticleIterator=GetParticleIterator();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
......@@ -394,6 +402,7 @@ void PhysicsList::ConstructOp()
// theRayleighScatteringProcess->SetVerboseLevel(OpVerbLevel);
theBoundaryProcess->SetVerboseLevel(OpVerbLevel);
auto theParticleIterator=GetParticleIterator();
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
......@@ -559,6 +568,7 @@ PhysicsList::ConstructHad()
G4ComponentGGNuclNuclXsc * ggNuclNuclXsec = new G4ComponentGGNuclNuclXsc();
G4VCrossSectionDataSet * theGGNuclNuclData = new G4CrossSectionInelastic(ggNuclNuclXsec);
auto theParticleIterator=GetParticleIterator();
theParticleIterator->reset();
while ((*theParticleIterator)())
{
......@@ -815,6 +825,7 @@ void PhysicsList::ConstructGeneral() {
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
auto theParticleIterator=GetParticleIterator();
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
......
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