Import Geant4 10.5.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2018-06-29 10:58:11 +02:00
parent fe81a77428
commit 6aa23be517
1581 changed files with 124288 additions and 83758 deletions
@@ -37,14 +37,11 @@
#include "LXeTrackingAction.hh"
#include "LXeSteppingAction.hh"
#include "LXeStackingAction.hh"
#include "LXeSteppingVerbose.hh"
#include "LXeRecorderBase.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeActionInitialization::LXeActionInitialization(LXeRecorderBase* recorder)
: G4VUserActionInitialization(), fRecorder(recorder)
LXeActionInitialization::LXeActionInitialization()
: G4VUserActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,7 +53,7 @@ LXeActionInitialization::~LXeActionInitialization()
void LXeActionInitialization::BuildForMaster() const
{
SetUserAction(new LXeRunAction(fRecorder));
SetUserAction(new LXeRunAction());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -65,19 +62,13 @@ void LXeActionInitialization::Build() const
{
SetUserAction(new LXePrimaryGeneratorAction());
SetUserAction(new LXeStackingAction());
LXeEventAction* eventAction = new LXeEventAction();
SetUserAction(eventAction);
SetUserAction(new LXeStackingAction(eventAction));
SetUserAction(new LXeRunAction(fRecorder));
SetUserAction(new LXeEventAction(fRecorder));
SetUserAction(new LXeTrackingAction(fRecorder));
SetUserAction(new LXeSteppingAction(fRecorder));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VSteppingVerbose* LXeActionInitialization::InitializeSteppingVerbose() const
{
return new LXeSteppingVerbose();
SetUserAction(new LXeRunAction());
SetUserAction(new LXeTrackingAction());
SetUserAction(new LXeSteppingAction(eventAction));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeDetectorConstruction.cc 104474 2017-06-01 07:35:19Z gcosmo $
// $Id: LXeDetectorConstruction.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeDetectorConstruction.cc
/// \brief Implementation of the LXeDetectorConstruction class
@@ -66,19 +66,20 @@ G4bool LXeDetectorConstruction::fSphereOn = true;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeDetectorConstruction::LXeDetectorConstruction()
: fLXe_mt(NULL), fMPTPStyrene(NULL)
: fLXe_mt(nullptr), fMPTPStyrene(nullptr)
{
fExperimentalHall_box = NULL;
fExperimentalHall_log = NULL;
fExperimentalHall_phys = NULL;
fExperimentalHall_box = nullptr;
fExperimentalHall_log = nullptr;
fExperimentalHall_phys = nullptr;
fLXe = fAl = fAir = fVacuum = fGlass = NULL;
fPstyrene = fPMMA = fPethylene1 = fPethylene2 = NULL;
fLXe = fAl = fAir = fVacuum = fGlass = nullptr;
fPstyrene = fPMMA = fPethylene1 = fPethylene2 = nullptr;
fN = fO = fC = fH = NULL;
fN = fO = fC = fH = nullptr;
SetDefaults();
DefineMaterials();
fDetectorMessenger = new LXeDetectorMessenger(this);
}
@@ -250,7 +251,6 @@ G4VPhysicalVolume* LXeDetectorConstruction::Construct(){
G4LogicalBorderSurface::CleanSurfaceTable();
}
DefineMaterials();
return ConstructDetector();
}
@@ -357,44 +357,52 @@ void LXeDetectorConstruction::ConstructSDandField() {
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims) {
this->fScint_x=dims[0];
this->fScint_y=dims[1];
this->fScint_z=dims[2];
//this->fScint_x=dims[0];
//this->fScint_y=dims[1];
//this->fScint_z=dims[2];
fScint_x=dims[0];
fScint_y=dims[1];
fScint_z=dims[2];
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl) {
this->fD_mtl=d_mtl;
//this->fD_mtl=d_mtl;
fD_mtl=d_mtl;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNX(G4int nx) {
this->fNx=nx;
//this->fNx=nx;
fNx=nx;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNY(G4int ny) {
this->fNy=ny;
//this->fNy=ny;
fNy=ny;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetNZ(G4int nz) {
this->fNz=nz;
//this->fNz=nz;
fNz=nz;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt) {
this->fOuterRadius_pmt=outerRadius_pmt;
//this->fOuterRadius_pmt=outerRadius_pmt;
fOuterRadius_pmt=outerRadius_pmt;
G4RunManager::GetRunManager()->ReinitializeGeometry();
}
@@ -416,13 +424,13 @@ void LXeDetectorConstruction::SetDefaults() {
fOuterRadius_pmt = 2.3*cm;
fSphereOn = true;
fRefl=1.0;
fRefl = 1.0;
fNfibers=15;
fWLSslab=false;
fMainVolumeOn=true;
fMainVolume=NULL;
fSlab_z=2.5*mm;
fNfibers = 15;
fWLSslab = false;
fMainVolumeOn = true;
fMainVolume = nullptr;
fSlab_z = 2.5*mm;
G4UImanager::GetUIpointer()
->ApplyCommand("/LXe/detector/scintYieldFactor 1.");
@@ -1,127 +0,0 @@
//
// ********************************************************************
// * 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: LXeEMPhysics.cc 81557 2014-06-03 08:32:44Z gcosmo $
//
/// \file optical/LXe/src/LXeEMPhysics.cc
/// \brief Implementation of the LXeEMPhysics class
//
//
#include "LXeEMPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEMPhysics::LXeEMPhysics(const G4String& name)
: G4VPhysicsConstructor(name)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEMPhysics::~LXeEMPhysics() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4NeutrinoE.hh"
#include "G4AntiNeutrinoE.hh"
void LXeEMPhysics::ConstructParticle()
{
// gamma
G4Gamma::GammaDefinition();
// electron
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProcessManager.hh"
void LXeEMPhysics::ConstructProcess()
{
G4PhotoElectricEffect* fPhotoEffect =
new G4PhotoElectricEffect();
G4ComptonScattering* fComptonEffect =
new G4ComptonScattering();
G4GammaConversion* fPairProduction =
new G4GammaConversion();
// Electron physics
G4eMultipleScattering* fElectronMultipleScattering =
new G4eMultipleScattering();
G4eIonisation* fElectronIonisation =
new G4eIonisation();
G4eBremsstrahlung* fElectronBremsStrahlung =
new G4eBremsstrahlung();
//Positron physics
G4eMultipleScattering* fPositronMultipleScattering =
new G4eMultipleScattering();
G4eIonisation* fPositronIonisation =
new G4eIonisation();
G4eBremsstrahlung* fPositronBremsStrahlung =
new G4eBremsstrahlung();
G4eplusAnnihilation* fAnnihilation =
new G4eplusAnnihilation();
G4ProcessManager* pManager = 0;
// Gamma Physics
pManager = G4Gamma::Gamma()->GetProcessManager();
pManager->AddDiscreteProcess(fPhotoEffect);
pManager->AddDiscreteProcess(fComptonEffect);
pManager->AddDiscreteProcess(fPairProduction);
// Electron Physics
pManager = G4Electron::Electron()->GetProcessManager();
pManager->AddProcess(fElectronMultipleScattering, -1, 1, 1);
pManager->AddProcess(fElectronIonisation, -1, 2, 2);
pManager->AddProcess(fElectronBremsStrahlung, -1, 3, 3);
//Positron Physics
pManager = G4Positron::Positron()->GetProcessManager();
pManager->AddProcess(fPositronMultipleScattering, -1, 1, 1);
pManager->AddProcess(fPositronIonisation, -1, 2, 2);
pManager->AddProcess(fPositronBremsStrahlung, -1, 3, 3);
pManager->AddProcess(fAnnihilation, 0,-1, 4);
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEventAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
// $Id: LXeEventAction.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeEventAction.cc
/// \brief Implementation of the LXeEventAction class
@@ -32,9 +32,9 @@
#include "LXeEventAction.hh"
#include "LXeScintHit.hh"
#include "LXePMTHit.hh"
#include "LXeUserEventInformation.hh"
#include "LXeTrajectory.hh"
#include "LXeRecorderBase.hh"
#include "LXeRun.hh"
#include "LXeHistoManager.hh"
#include "G4EventManager.hh"
#include "G4SDManager.hh"
@@ -50,11 +50,23 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeEventAction::LXeEventAction(LXeRecorderBase* r)
: fRecorder(r),fSaveThreshold(0),fScintCollID(-1),fPMTCollID(-1),fVerbose(0),
LXeEventAction::LXeEventAction()
: fSaveThreshold(0),fScintCollID(-1),fPMTCollID(-1),fVerbose(0),
fPMTThreshold(1),fForcedrawphotons(false),fForcenophotons(false)
{
fEventMessenger = new LXeEventMessenger(this);
fHitCount = 0;
fPhotonCount_Scint = 0;
fPhotonCount_Ceren = 0;
fAbsorptionCount = 0;
fBoundaryAbsorptionCount = 0;
fTotE = 0.0;
fConvPosSet = false;
fEdepMax = 0.0;
fPMTsAboveThreshold = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -63,28 +75,31 @@ LXeEventAction::~LXeEventAction(){}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeEventAction::BeginOfEventAction(const G4Event* anEvent){
void LXeEventAction::BeginOfEventAction(const G4Event*) {
//New event, add the user information object
G4EventManager::
GetEventManager()->SetUserInformation(new LXeUserEventInformation);
fHitCount = 0;
fPhotonCount_Scint = 0;
fPhotonCount_Ceren = 0;
fAbsorptionCount = 0;
fBoundaryAbsorptionCount = 0;
fTotE = 0.0;
fConvPosSet = false;
fEdepMax = 0.0;
fPMTsAboveThreshold = 0;
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(fScintCollID<0)
fScintCollID=SDman->GetCollectionID("scintCollection");
if(fPMTCollID<0)
fPMTCollID=SDman->GetCollectionID("pmtHitCollection");
if(fRecorder)fRecorder->RecordBeginOfEvent(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
LXeUserEventInformation* eventInformation
=(LXeUserEventInformation*)anEvent->GetUserInformation();
G4TrajectoryContainer* trajectoryContainer=anEvent->GetTrajectoryContainer();
G4int n_trajectories = 0;
@@ -103,14 +118,18 @@ void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
}
}
LXeScintHitsCollection* scintHC = 0;
LXePMTHitsCollection* pmtHC = 0;
LXeScintHitsCollection* scintHC = nullptr;
LXePMTHitsCollection* pmtHC = nullptr;
G4HCofThisEvent* hitsCE = anEvent->GetHCofThisEvent();
//Get the hit collections
if(hitsCE){
if(fScintCollID>=0)scintHC = (LXeScintHitsCollection*)(hitsCE->GetHC(fScintCollID));
if(fPMTCollID>=0)pmtHC = (LXePMTHitsCollection*)(hitsCE->GetHC(fPMTCollID));
if(fScintCollID>=0) {
scintHC = (LXeScintHitsCollection*)(hitsCE->GetHC(fScintCollID));
}
if(fPMTCollID>=0) {
pmtHC = (LXePMTHitsCollection*)(hitsCE->GetHC(fPMTCollID));
}
}
//Hits in scintillator
@@ -122,21 +141,25 @@ void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
for(int i=0;i<n_hit;i++){ //gather info on hits in scintillator
edep=(*scintHC)[i]->GetEdep();
eventInformation->IncEDep(edep); //sum up the edep
fTotE += edep;
eWeightPos += (*scintHC)[i]->GetPos()*edep;//calculate energy weighted pos
if(edep>edepMax){
edepMax=edep;//store max energy deposit
G4ThreeVector posMax=(*scintHC)[i]->GetPos();
eventInformation->SetPosMax(posMax,edep);
fPosMax = posMax;
fEdepMax = edep;
}
}
if(eventInformation->GetEDep()==0.){
G4AnalysisManager::Instance()->FillH1(7, fTotE);
if(fTotE == 0.){
if(fVerbose>0)G4cout<<"No hits in the scintillator this event."<<G4endl;
}
else{
//Finish calculation of energy weighted position
eWeightPos/=eventInformation->GetEDep();
eventInformation->SetEWeightPos(eWeightPos);
eWeightPos /= fTotE;
fEWeightPos = eWeightPos;
if(fVerbose>0){
G4cout << "\tEnergy weighted position of hits in LXe : "
<< eWeightPos/mm << G4endl;
@@ -144,7 +167,7 @@ void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
}
if(fVerbose>0){
G4cout << "\tTotal energy deposition in scintillator : "
<< eventInformation->GetEDep() / keV << " (keV)" << G4endl;
<< fTotE / keV << " (keV)" << G4endl;
}
}
@@ -153,55 +176,72 @@ void LXeEventAction::EndOfEventAction(const G4Event* anEvent){
G4int pmts=pmtHC->entries();
//Gather info from all PMTs
for(G4int i=0;i<pmts;i++){
eventInformation->IncHitCount((*pmtHC)[i]->GetPhotonCount());
fHitCount += (*pmtHC)[i]->GetPhotonCount();
reconPos+=(*pmtHC)[i]->GetPMTPos()*(*pmtHC)[i]->GetPhotonCount();
if((*pmtHC)[i]->GetPhotonCount()>=fPMTThreshold){
eventInformation->IncPMTSAboveThreshold();
fPMTsAboveThreshold++;
}
else{//wasnt above the threshold, turn it back off
(*pmtHC)[i]->SetDrawit(false);
}
}
if(eventInformation->GetHitCount()>0){//dont bother unless there were hits
reconPos/=eventInformation->GetHitCount();
G4AnalysisManager::Instance()->FillH1(1, fHitCount);
G4AnalysisManager::Instance()->FillH1(2, fPMTsAboveThreshold);
if(fHitCount > 0) {//dont bother unless there were hits
reconPos/=fHitCount;
if(fVerbose>0){
G4cout << "\tReconstructed position of hits in LXe : "
<< reconPos/mm << G4endl;
}
eventInformation->SetReconPos(reconPos);
fReconPos = reconPos;
}
pmtHC->DrawAllHits();
}
G4AnalysisManager::Instance()->FillH1(3, fPhotonCount_Scint);
G4AnalysisManager::Instance()->FillH1(4, fPhotonCount_Ceren);
G4AnalysisManager::Instance()->FillH1(5, fAbsorptionCount);
G4AnalysisManager::Instance()->FillH1(6, fBoundaryAbsorptionCount);
if(fVerbose>0){
//End of event output. later to be controlled by a verbose level
G4cout << "\tNumber of photons that hit PMTs in this event : "
<< eventInformation->GetHitCount() << G4endl;
<< fHitCount << G4endl;
G4cout << "\tNumber of PMTs above threshold("<<fPMTThreshold<<") : "
<< eventInformation->GetPMTSAboveThreshold() << G4endl;
<< fPMTsAboveThreshold << G4endl;
G4cout << "\tNumber of photons produced by scintillation in this event : "
<< eventInformation->GetPhotonCount_Scint() << G4endl;
<< fPhotonCount_Scint << G4endl;
G4cout << "\tNumber of photons produced by cerenkov in this event : "
<< eventInformation->GetPhotonCount_Ceren() << G4endl;
<< fPhotonCount_Ceren << G4endl;
G4cout << "\tNumber of photons absorbed (OpAbsorption) in this event : "
<< eventInformation->GetAbsorptionCount() << G4endl;
<< fAbsorptionCount << G4endl;
G4cout << "\tNumber of photons absorbed at boundaries (OpBoundary) in "
<< "this event : " << eventInformation->GetBoundaryAbsorptionCount()
<< G4endl;
G4cout << "Unacounted for photons in this event : "
<< (eventInformation->GetPhotonCount_Scint() +
eventInformation->GetPhotonCount_Ceren() -
eventInformation->GetAbsorptionCount() -
eventInformation->GetHitCount() -
eventInformation->GetBoundaryAbsorptionCount())
<< "this event : " << fBoundaryAbsorptionCount << G4endl;
G4cout << "Unaccounted for photons in this event : "
<< (fPhotonCount_Scint + fPhotonCount_Ceren -
fAbsorptionCount - fHitCount - fBoundaryAbsorptionCount)
<< G4endl;
}
//If we have set the flag to save 'special' events, save here
if(fSaveThreshold&&eventInformation->GetPhotonCount() <= fSaveThreshold)
G4RunManager::GetRunManager()->rndmSaveThisEvent();
if(fRecorder)fRecorder->RecordEndOfEvent(anEvent);
// update the run statistics
LXeRun* run = static_cast<LXeRun*>(
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
run->IncHitCount(fHitCount);
run->IncPhotonCount_Scint(fPhotonCount_Scint);
run->IncPhotonCount_Ceren(fPhotonCount_Ceren);
run->IncEDep(fTotE);
run->IncAbsorption(fAbsorptionCount);
run->IncBoundaryAbsorption(fBoundaryAbsorptionCount);
run->IncHitsAboveThreshold(fPMTsAboveThreshold);
//If we have set the flag to save 'special' events, save here
if (fSaveThreshold &&
(fPhotonCount_Scint + fPhotonCount_Ceren <= fSaveThreshold))
G4RunManager::GetRunManager()->rndmSaveThisEvent();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeEventMessenger.cc 70256 2013-05-28 07:29:30Z gcosmo $
// $Id: LXeEventMessenger.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeEventMessenger.cc
/// \brief Implementation of the LXeEventMessenger class
@@ -95,6 +95,5 @@ void LXeEventMessenger::SetNewValue(G4UIcommand* command, G4String newValue){
else if(command == fForceDrawNoPhotonsCmd){
fLXeEvent->SetForceDrawNoPhotons(fForceDrawNoPhotonsCmd
->GetNewBoolValue(newValue));
G4cout<<"TEST"<<G4endl;
}
}
@@ -23,67 +23,71 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeGeneralPhysics.cc 100259 2016-10-17 08:02:30Z gcosmo $
//
/// \file optical/LXe/src/LXeGeneralPhysics.cc
/// \brief Implementation of the LXeGeneralPhysics class
/// \file optical/LXe/src/LXeHistoManager.cc
/// \brief Implementation of the LXeHistoManager class
//
//
#include "LXeGeneralPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include <iomanip>
#include "G4Decay.hh"
// $Id: LXeHistoManager.cc
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeGeneralPhysics::LXeGeneralPhysics(const G4String& name)
: G4VPhysicsConstructor(name) {}
#include "LXeHistoManager.hh"
#include "G4UnitsTable.hh"
//#include<vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeGeneralPhysics::~LXeGeneralPhysics() {
//fDecayProcess = NULL;
LXeHistoManager::LXeHistoManager()
: fFileName("lxe")
{
Book();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4Geantino.hh"
#include "G4ChargedGeantino.hh"
#include "G4GenericIon.hh"
#include "G4Proton.hh"
void LXeGeneralPhysics::ConstructParticle()
LXeHistoManager::~LXeHistoManager()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
G4GenericIon::GenericIonDefinition();
delete G4AnalysisManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeGeneralPhysics::ConstructProcess()
void LXeHistoManager::Book()
{
G4Decay* fDecayProcess = new G4Decay();
// Create or get analysis manager
// The choice of analysis technology is done via selection of a namespace
// in LXeHistoManager.hh
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->SetFileName(fFileName);
analysisManager->SetVerboseLevel(1);
analysisManager->SetActivation(true); // enable inactivation of histograms
// Add Decay Process
auto particleIterator=GetParticleIterator();
particleIterator->reset();
while( (*particleIterator)() ){
G4ParticleDefinition* particle = particleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(fDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
}
// Define histogram indices, titles
std::vector<std::pair<G4String, G4String> > histograms =
{ std::pair<G4String, G4String>("0", "dummy"),
std::pair<G4String, G4String>("1", "hits per event"),
std::pair<G4String, G4String>("2", "hits per event above threshold"),
std::pair<G4String, G4String>("3", "scintillation photons per event"),
std::pair<G4String, G4String>("4", "Cerenkov photons per event"),
std::pair<G4String, G4String>("5", "absorbed photons per event"),
std::pair<G4String, G4String>
("6", "photons absorbed at boundary per event"),
std::pair<G4String, G4String>
("7", "energy deposition in scintillator per event"),
};
// Default values (to be reset via /analysis/h1/set command)
G4int nbins = 100;
G4double vmin = 0.;
G4double vmax = 100.;
// Create all histograms as inactivated
// as we have not yet set nbins, vmin, vmax
for (auto histogram : histograms) {
G4int ih = analysisManager->
CreateH1("h" + histogram.first, histogram.second, nbins, vmin, vmax);
analysisManager->SetH1Activation(ih, false);
}
}
@@ -1,126 +0,0 @@
//
// ********************************************************************
// * 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: LXeMuonPhysics.cc 85911 2014-11-06 08:56:31Z gcosmo $
//
/// \file optical/LXe/src/LXeMuonPhysics.cc
/// \brief Implementation of the LXeMuonPhysics class
//
//
#include "LXeMuonPhysics.hh"
#include "globals.hh"
#include "G4ios.hh"
#include "G4PhysicalConstants.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeMuonPhysics::LXeMuonPhysics(const G4String& name)
: G4VPhysicsConstructor(name) {
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeMuonPhysics::~LXeMuonPhysics() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4PionZero.hh"
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
void LXeMuonPhysics::ConstructParticle()
{
// Mu
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
//These are needed for the mu- capture
G4Neutron::Neutron();
G4Proton::Proton();
G4PionMinus::PionMinus();
G4PionZero::PionZero();
G4PionPlus::PionPlus();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProcessManager.hh"
void LXeMuonPhysics::ConstructProcess()
{
G4MuIonisation* fMuPlusIonisation =
new G4MuIonisation();
G4MuMultipleScattering* fMuPlusMultipleScattering =
new G4MuMultipleScattering();
G4MuBremsstrahlung* fMuPlusBremsstrahlung=
new G4MuBremsstrahlung();
G4MuPairProduction* fMuPlusPairProduction=
new G4MuPairProduction();
G4MuIonisation* fMuMinusIonisation =
new G4MuIonisation();
G4MuMultipleScattering* fMuMinusMultipleScattering =
new G4MuMultipleScattering();
G4MuBremsstrahlung* fMuMinusBremsstrahlung =
new G4MuBremsstrahlung();
G4MuPairProduction* fMuMinusPairProduction =
new G4MuPairProduction();
G4MuonMinusCapture* fMuMinusCaptureAtRest =
new G4MuonMinusCapture();
G4ProcessManager * pManager = 0;
// Muon Plus Physics
pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
pManager->AddProcess(fMuPlusMultipleScattering,-1, 1, 1);
pManager->AddProcess(fMuPlusIonisation, -1, 2, 2);
pManager->AddProcess(fMuPlusBremsstrahlung, -1, 3, 3);
pManager->AddProcess(fMuPlusPairProduction, -1, 4, 4);
// Muon Minus Physics
pManager = G4MuonMinus::MuonMinus()->GetProcessManager();
pManager->AddProcess(fMuMinusMultipleScattering,-1, 1, 1);
pManager->AddProcess(fMuMinusIonisation, -1, 2, 2);
pManager->AddProcess(fMuMinusBremsstrahlung, -1, 3, 3);
pManager->AddProcess(fMuMinusPairProduction, -1, 4, 4);
pManager->AddRestProcess(fMuMinusCaptureAtRest);
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePMTHit.cc 72250 2013-07-12 08:59:26Z gcosmo $
// $Id: LXePMTHit.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXePMTHit.cc
/// \brief Implementation of the LXePMTHit class
@@ -42,7 +42,7 @@ G4ThreadLocal G4Allocator<LXePMTHit>* LXePMTHitAllocator=0;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePMTHit::LXePMTHit()
: fPmtNumber(-1),fPhotons(0),fPhysVol(0),fDrawit(false) {}
: fPmtNumber(-1),fPhotons(0),fPhysVol(nullptr),fDrawit(false) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXePMTSD.cc 73915 2013-09-17 07:32:26Z gcosmo $
// $Id: LXePMTSD.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXePMTSD.cc
/// \brief Implementation of the LXePMTSD class
@@ -47,8 +47,8 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePMTSD::LXePMTSD(G4String name)
: G4VSensitiveDetector(name),fPMTHitCollection(0),fPMTPositionsX(0)
,fPMTPositionsY(0),fPMTPositionsZ(0)
: G4VSensitiveDetector(name),fPMTHitCollection(nullptr),
fPMTPositionsX(nullptr),fPMTPositionsY(nullptr),fPMTPositionsZ(nullptr)
{
collectionName.insert("pmtHitCollection");
}
@@ -109,7 +109,7 @@ G4bool LXePMTSD::ProcessHits_constStep(const G4Step* aStep,
//Find the correct hit collection
G4int n=fPMTHitCollection->entries();
LXePMTHit* hit=NULL;
LXePMTHit* hit = nullptr;
for(G4int i=0;i<n;i++){
if((*fPMTHitCollection)[i]->GetPMTNumber()==pmtNumber){
hit=(*fPMTHitCollection)[i];
@@ -117,7 +117,7 @@ G4bool LXePMTSD::ProcessHits_constStep(const G4Step* aStep,
}
}
if(hit==NULL){//this pmt wasnt previously hit in this event
if (hit == nullptr) {//this pmt wasnt previously hit in this event
hit = new LXePMTHit(); //so create new hit
hit->SetPMTNumber(pmtNumber);
hit->SetPMTPhysVol(physVol);
@@ -1,86 +0,0 @@
//
// ********************************************************************
// * 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: LXePhysicsList.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXePhysicsList.cc
/// \brief Implementation of the LXePhysicsList class
//
//
#include "LXePhysicsList.hh"
#include "LXeGeneralPhysics.hh"
#include "LXeEMPhysics.hh"
#include "LXeMuonPhysics.hh"
#include "G4OpticalPhysics.hh"
#include "G4OpticalProcessIndex.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePhysicsList::LXePhysicsList() : G4VModularPhysicsList()
{
// default cut value (1.0mm)
defaultCutValue = 1.0*mm;
// General Physics
RegisterPhysics( new LXeGeneralPhysics("general") );
// EM Physics
RegisterPhysics( new LXeEMPhysics("standard EM"));
// Muon Physics
RegisterPhysics( new LXeMuonPhysics("muon"));
// Optical Physics
G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
RegisterPhysics( opticalPhysics );
opticalPhysics->SetWLSTimeProfile("delta");
opticalPhysics->SetScintillationYieldFactor(1.0);
opticalPhysics->SetScintillationExcitationRatio(0.0);
opticalPhysics->SetMaxNumPhotonsPerStep(100);
opticalPhysics->SetMaxBetaChangePerStep(10.0);
opticalPhysics->SetTrackSecondariesFirst(kCerenkov,true);
opticalPhysics->SetTrackSecondariesFirst(kScintillation,true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXePhysicsList::~LXePhysicsList() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXePhysicsList::SetCuts(){
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
}
+157
View File
@@ -0,0 +1,157 @@
//
// ********************************************************************
// * 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: LXeRunAction.cc 66587 2012-12-21 11:06:44Z ihrivnac $
//
/// \file optical/LXe/src/LXeRun.cc
/// \brief Implementation of the LXeRun class
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "LXeRun.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeRun::LXeRun() : G4Run()
{
fHitCount = fHitCount2 = 0;
fPhotonCount_Scint = fPhotonCount_Scint2 = 0;
fPhotonCount_Ceren = fPhotonCount_Ceren2 = 0;
fAbsorptionCount = fAbsorptionCount2 = 0;
fBoundaryAbsorptionCount = fBoundaryAbsorptionCount2 = 0;
fPMTsAboveThreshold = fPMTsAboveThreshold2 = 0;
fTotE = fTotE2 = 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeRun::~LXeRun()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRun::Merge(const G4Run* run)
{
const LXeRun* localRun = static_cast<const LXeRun*>(run);
fHitCount += localRun->fHitCount;
fHitCount2 += localRun->fHitCount2;
fPMTsAboveThreshold += localRun->fPMTsAboveThreshold;
fPMTsAboveThreshold2 += localRun->fPMTsAboveThreshold2;
fPhotonCount_Scint += localRun->fPhotonCount_Scint;
fPhotonCount_Scint2 += localRun->fPhotonCount_Scint2;
fPhotonCount_Ceren += localRun->fPhotonCount_Ceren;
fPhotonCount_Ceren2 += localRun->fPhotonCount_Ceren2;
fAbsorptionCount += localRun->fAbsorptionCount;
fAbsorptionCount2 += localRun->fAbsorptionCount2;
fBoundaryAbsorptionCount += localRun->fBoundaryAbsorptionCount;
fBoundaryAbsorptionCount2 += localRun->fBoundaryAbsorptionCount2;
fTotE += localRun->fTotE;
fTotE2 += localRun->fTotE2;
G4Run::Merge(run);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRun::EndOfRun()
{
G4cout << "\n ======================== run summary ======================\n";
G4int prec = G4cout.precision();
G4int n_evt = numberOfEvent;
G4cout << "The run was " << n_evt << " events." << G4endl;
G4cout.precision(4);
G4double hits = G4double(fHitCount)/n_evt;
G4double hits2 = G4double(fHitCount2)/n_evt;
G4double rms_hits = hits2 - hits*hits;
if (rms_hits > 0.) rms_hits = std::sqrt(rms_hits/n_evt);
else rms_hits = 0.;
G4cout << "Number of hits per event:\t " << hits << " +- " << rms_hits
<< G4endl;
G4double hitsAbove = G4double(fPMTsAboveThreshold)/n_evt;
G4double hitsAbove2 = G4double(fPMTsAboveThreshold2)/n_evt;
G4double rms_hitsAbove = hitsAbove2 - hitsAbove*hitsAbove;
if (rms_hitsAbove > 0.) rms_hitsAbove = std::sqrt(rms_hitsAbove/n_evt);
else rms_hitsAbove = 0.;
G4cout << "Number of hits per event above threshold:\t " << hitsAbove
<< " +- " << rms_hitsAbove << G4endl;
G4double scint = G4double(fPhotonCount_Scint)/n_evt;
G4double scint2 = G4double(fPhotonCount_Scint2)/n_evt;
G4double rms_scint = scint2 - scint*scint;
if (rms_scint > 0.) rms_scint = std::sqrt(rms_scint/n_evt);
else rms_scint = 0.;
G4cout << "Number of scintillation photons per event :\t " << scint << " +- "
<< rms_scint << G4endl;
G4double ceren = G4double(fPhotonCount_Ceren)/n_evt;
G4double ceren2 = G4double(fPhotonCount_Ceren2)/n_evt;
G4double rms_ceren = ceren2 - ceren*ceren;
if (rms_ceren > 0.) rms_ceren = std::sqrt(rms_ceren/n_evt);
else rms_ceren = 0.;
G4cout << "Number of Cerenkov photons per event:\t " << ceren << " +- "
<< rms_ceren << G4endl;
G4double absorb = G4double(fAbsorptionCount)/n_evt;
G4double absorb2 = G4double(fAbsorptionCount2)/n_evt;
G4double rms_absorb = absorb2 - absorb*absorb;
if (rms_absorb > 0.) rms_absorb = std::sqrt(rms_absorb/n_evt);
else rms_absorb = 0.;
G4cout << "Number of absorbed photons per event :\t " << absorb << " +- "
<< rms_absorb << G4endl;
G4double bdry = G4double(fBoundaryAbsorptionCount)/n_evt;
G4double bdry2 = G4double(fBoundaryAbsorptionCount2)/n_evt;
G4double rms_bdry = bdry2 - bdry*bdry;
if (rms_bdry > 0.) rms_bdry = std::sqrt(rms_bdry/n_evt);
else rms_bdry = 0.;
G4cout << "Number of photons absorbed at boundary per event:\t " << bdry
<< " +- " << rms_bdry << G4endl;
//G4cout << "Number of unaccounted for photons: " << G4endl;
G4double en = fTotE/n_evt;
G4double en2 = fTotE2/n_evt;
G4double rms_en = en2 - en*en;
if (rms_en > 0.) rms_en = std::sqrt(rms_en/n_evt);
else rms_en = 0.;
G4cout << "Total energy deposition in scintillator per event:\t " << en/keV
<< " +- " << rms_en/keV << " keV." << G4endl;
G4cout << G4endl;
G4cout.precision(prec);
}
@@ -23,31 +23,57 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeRunAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
// $Id: LXeRunAction.cc 109784 2018-05-09 08:14:08Z gcosmo $
//
/// \file optical/LXe/src/LXeRunAction.cc
/// \brief Implementation of the LXeRunAction class
//
//
#include "LXeRunAction.hh"
#include "LXeRecorderBase.hh"
#include "LXeRun.hh"
#include "LXeHistoManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeRunAction::LXeRunAction(LXeRecorderBase* r) : fRecorder(r) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeRunAction::~LXeRunAction() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRunAction::BeginOfRunAction(const G4Run* aRun){
if(fRecorder)fRecorder->RecordBeginOfRun(aRun);
LXeRunAction::LXeRunAction() : fRun(nullptr), fHistoManager(nullptr)
{
// Book predefined histograms
fHistoManager = new LXeHistoManager();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRunAction::EndOfRunAction(const G4Run* aRun){
if(fRecorder)fRecorder->RecordEndOfRun(aRun);
LXeRunAction::~LXeRunAction()
{
delete fHistoManager;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4Run* LXeRunAction::GenerateRun()
{
fRun = new LXeRun();
return fRun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRunAction::BeginOfRunAction(const G4Run*)
{
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
if (analysisManager->IsActive()) {
analysisManager->OpenFile();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeRunAction::EndOfRunAction(const G4Run*){
if (isMaster) fRun->EndOfRun();
// save histograms
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
if (analysisManager->IsActive()) {
analysisManager->Write();
analysisManager->CloseFile();
}
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeScintHit.cc 72250 2013-07-12 08:59:26Z gcosmo $
// $Id: LXeScintHit.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeScintHit.cc
/// \brief Implementation of the LXeScintHit class
@@ -37,11 +37,11 @@
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
G4ThreadLocal G4Allocator<LXeScintHit>* LXeScintHitAllocator=0;
G4ThreadLocal G4Allocator<LXeScintHit>* LXeScintHitAllocator = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeScintHit::LXeScintHit() : fEdep(0.), fPos(0.), fPhysVol(0) {}
LXeScintHit::LXeScintHit() : fEdep(0.), fPos(0.), fPhysVol(nullptr) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeScintSD.cc 68752 2013-04-05 10:23:47Z gcosmo $
// $Id: LXeScintSD.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeScintSD.cc
/// \brief Implementation of the LXeScintSD class
@@ -46,7 +46,7 @@
LXeScintSD::LXeScintSD(G4String name)
: G4VSensitiveDetector(name)
{
fScintCollection = NULL;
fScintCollection = nullptr;
collectionName.insert("scintCollection");
}
@@ -23,14 +23,14 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeStackingAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
// $Id: LXeStackingAction.cc 109652 2018-05-04 08:49:34Z gcosmo $
//
/// \file optical/LXe/src/LXeStackingAction.cc
/// \brief Implementation of the LXeStackingAction class
//
//
#include "LXeStackingAction.hh"
#include "LXeUserEventInformation.hh"
#include "LXeEventAction.hh"
#include "LXeSteppingAction.hh"
#include "G4ios.hh"
@@ -43,7 +43,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeStackingAction::LXeStackingAction() {}
LXeStackingAction::LXeStackingAction(LXeEventAction* ea)
: fEventAction(ea)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -54,19 +56,15 @@ LXeStackingAction::~LXeStackingAction() {}
G4ClassificationOfNewTrack
LXeStackingAction::ClassifyNewTrack(const G4Track * aTrack){
LXeUserEventInformation* eventInformation=
(LXeUserEventInformation*)G4EventManager::GetEventManager()
->GetConstCurrentEvent()->GetUserInformation();
//Count what process generated the optical photons
if(aTrack->GetDefinition()==G4OpticalPhoton::OpticalPhotonDefinition()){
// particle is optical photon
if(aTrack->GetParentID()>0){
// particle is secondary
if(aTrack->GetCreatorProcess()->GetProcessName()=="Scintillation")
eventInformation->IncPhotonCount_Scint();
fEventAction->IncPhotonCount_Scint();
else if(aTrack->GetCreatorProcess()->GetProcessName()=="Cerenkov")
eventInformation->IncPhotonCount_Ceren();
fEventAction->IncPhotonCount_Ceren();
}
}
else{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeSteppingAction.cc 73915 2013-09-17 07:32:26Z gcosmo $
// $Id: LXeSteppingAction.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeSteppingAction.cc
/// \brief Implementation of the LXeSteppingAction class
@@ -35,9 +35,7 @@
#include "LXeTrajectory.hh"
#include "LXePMTSD.hh"
#include "LXeUserTrackInformation.hh"
#include "LXeUserEventInformation.hh"
#include "LXeSteppingMessenger.hh"
#include "LXeRecorderBase.hh"
#include "G4SteppingManager.hh"
#include "G4SDManager.hh"
@@ -54,8 +52,9 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingAction::LXeSteppingAction(LXeRecorderBase* r)
: fRecorder(r),fOneStepPrimaries(false)
LXeSteppingAction::LXeSteppingAction(LXeEventAction* ea)
: fOneStepPrimaries(false),
fEventAction(ea)
{
fSteppingMessenger = new LXeSteppingMessenger(this);
@@ -76,9 +75,6 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
LXeUserTrackInformation* trackInformation
=(LXeUserTrackInformation*)theTrack->GetUserInformation();
LXeUserEventInformation* eventInformation
=(LXeUserEventInformation*)G4EventManager::GetEventManager()
->GetConstCurrentEvent()->GetUserInformation();
G4StepPoint* thePrePoint = theStep->GetPreStepPoint();
G4VPhysicalVolume* thePrePV = thePrePoint->GetPhysicalVolume();
@@ -87,7 +83,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
G4OpBoundaryProcessStatus boundaryStatus=Undefined;
static G4ThreadLocal G4OpBoundaryProcess* boundary=NULL;
static G4ThreadLocal G4OpBoundaryProcess* boundary = nullptr;
//find the boundary process only once
if(!boundary){
@@ -114,7 +110,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
//If we havent already found the conversion position and there were
//secondaries generated, then search for it
if(!eventInformation->IsConvPosSet() && tN2ndariesTot>0 ){
if(!fEventAction->IsConvPosSet() && tN2ndariesTot>0 ){
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
const G4VProcess* creator=(*fSecondary)[lp1]->GetCreatorProcess();
@@ -123,7 +119,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
if(creatorName=="phot"||creatorName=="compt"||creatorName=="conv"){
//since this is happening before the secondary is being tracked
//the Vertex position has not been set yet(set in initial step)
eventInformation->SetConvPos((*fSecondary)[lp1]->GetPosition());
fEventAction->SetConvPos((*fSecondary)[lp1]->GetPosition());
}
}
}
@@ -152,7 +148,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
//Was the photon absorbed by the absorption process
if(thePostPoint->GetProcessDefinedStep()->GetProcessName()
=="OpAbsorption"){
eventInformation->IncAbsorption();
fEventAction->IncAbsorption();
trackInformation->AddTrackStatusFlag(absorbed);
}
@@ -177,7 +173,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
switch(boundaryStatus){
case Absorption:
trackInformation->AddTrackStatusFlag(boundaryAbsorbed);
eventInformation->IncBoundaryAbsorption();
fEventAction->IncBoundaryAbsorption();
break;
case Detection: //Note, this assumes that the volume causing detection
//is the photocathode because it is the only one with
@@ -188,7 +184,7 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4String sdName="/LXeDet/pmtSD";
LXePMTSD* pmtSD = (LXePMTSD*)SDman->FindSensitiveDetector(sdName);
if(pmtSD)pmtSD->ProcessHits_constStep(theStep,NULL);
if(pmtSD)pmtSD->ProcessHits_constStep(theStep, nullptr);
trackInformation->AddTrackStatusFlag(hitPMT);
break;
}
@@ -208,6 +204,4 @@ void LXeSteppingAction::UserSteppingAction(const G4Step * theStep){
trackInformation->AddTrackStatusFlag(hitSphere);
}
}
if(fRecorder)fRecorder->RecordStep(theStep);
}
@@ -1,176 +0,0 @@
//
// ********************************************************************
// * 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: LXeSteppingVerbose.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeSteppingVerbose.cc
/// \brief Implementation of the LXeSteppingVerbose class
//
//
#include "LXeSteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingVerbose::LXeSteppingVerbose() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeSteppingVerbose::~LXeSteppingVerbose() {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeSteppingVerbose::StepInfo()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << std::setw( 5) << "#Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
}
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
G4cout << " "
<< std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
} else {
G4cout << " UserLimit";
}
G4cout << G4endl;
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << std::setw(3) << tN2ndariesTot
<< "(Rest=" << std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeSteppingVerbose::TrackingStarted()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< " ";
if(fTrack->GetNextVolume()){
G4cout << std::setw(10) << fTrack->GetVolume()->GetName();
} else {
G4cout << std::setw(10) << "OutOfWorld";
}
G4cout << " initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeTrackingAction.cc 68752 2013-04-05 10:23:47Z gcosmo $
// $Id: LXeTrackingAction.cc 109784 2018-05-09 08:14:08Z gcosmo $
//
/// \file optical/LXe/src/LXeTrackingAction.cc
/// \brief Implementation of the LXeTrackingAction class
@@ -33,7 +33,6 @@
#include "LXeTrackingAction.hh"
#include "LXeUserTrackInformation.hh"
#include "LXeDetectorConstruction.hh"
#include "LXeRecorderBase.hh"
#include "G4TrackingManager.hh"
#include "G4Track.hh"
@@ -41,8 +40,8 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeTrackingAction::LXeTrackingAction(LXeRecorderBase* r)
: fRecorder(r) {}
LXeTrackingAction::LXeTrackingAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -66,7 +65,8 @@ void LXeTrackingAction::PreUserTrackingAction(const G4Track* aTrack)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void LXeTrackingAction::PostUserTrackingAction(const G4Track* aTrack){
LXeTrajectory* trajectory=(LXeTrajectory*)fpTrackingManager->GimmeTrajectory();
LXeTrajectory* trajectory =
(LXeTrajectory*)fpTrackingManager->GimmeTrajectory();
LXeUserTrackInformation*
trackInformation=(LXeUserTrackInformation*)aTrack->GetUserInformation();
@@ -95,6 +95,4 @@ void LXeTrackingAction::PostUserTrackingAction(const G4Track* aTrack){
if(trackInformation->GetForceDrawTrajectory())
trajectory->SetDrawTrajectory(true);
if(fRecorder)fRecorder->RecordTrack(aTrack);
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeTrajectory.cc 72349 2013-07-16 12:13:16Z gcosmo $
// $Id: LXeTrajectory.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeTrajectory.cc
/// \brief Implementation of the LXeTrajectory class
@@ -42,14 +42,15 @@
#include "G4VVisManager.hh"
#include "G4Polymarker.hh"
G4ThreadLocal G4Allocator<LXeTrajectory>* LXeTrajectoryAllocator = 0;
G4ThreadLocal G4Allocator<LXeTrajectory>* LXeTrajectoryAllocator = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeTrajectory::LXeTrajectory()
:G4Trajectory(),fWls(false),fDrawit(false),fForceNoDraw(false),fForceDraw(false)
:G4Trajectory(),fWls(false),fDrawit(false),
fForceNoDraw(false),fForceDraw(false)
{
fParticleDefinition=0;
fParticleDefinition = nullptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -1,43 +0,0 @@
//
// ********************************************************************
// * 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: LXeUserEventInformation.cc 68752 2013-04-05 10:23:47Z gcosmo $
//
/// \file optical/LXe/src/LXeUserEventInformation.cc
/// \brief Implementation of the LXeUserEventInformation class
//
//
#include "LXeUserEventInformation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeUserEventInformation::LXeUserEventInformation()
:fHitCount(0),fPhotonCount_Scint(0),fPhotonCount_Ceren(0),fAbsorptionCount(0),
fBoundaryAbsorptionCount(0),fTotE(0.),fEWeightPos(0.),fReconPos(0.),fConvPos(0.),
fConvPosSet(false),fPosMax(0.),fEdepMax(0.),fPMTsAboveThreshold(0) {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
LXeUserEventInformation::~LXeUserEventInformation() {}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeWLSFiber.cc 77486 2013-11-25 10:14:16Z gcosmo $
// $Id: LXeWLSFiber.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeWLSFiber.cc
/// \brief Implementation of the LXeWLSFiber class
@@ -35,7 +35,7 @@
#include "G4LogicalBorderSurface.hh"
#include "G4SystemOfUnits.hh"
G4LogicalVolume* LXeWLSFiber::fClad2_log=NULL;
G4LogicalVolume* LXeWLSFiber::fClad2_log = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: LXeWLSSlab.cc 77486 2013-11-25 10:14:16Z gcosmo $
// $Id: LXeWLSSlab.cc 110138 2018-05-16 07:31:43Z gcosmo $
//
/// \file optical/LXe/src/LXeWLSSlab.cc
/// \brief Implementation of the LXeWLSSlab class
@@ -37,7 +37,7 @@
#include "G4LogicalBorderSurface.hh"
#include "G4SystemOfUnits.hh"
G4LogicalVolume* LXeWLSSlab::fScintSlab_log=NULL;
G4LogicalVolume* LXeWLSSlab::fScintSlab_log = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......