Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -47,6 +47,7 @@ set(OpNovice2_SCRIPTS
glisur.mac
electron.mac
scint_by_particle.mac
wls.mac
)
foreach(_script ${OpNovice2_SCRIPTS})
@@ -13,6 +13,19 @@ track of all tags.
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
May 29, 2020 D.Sawkey (OpNovice2-V10-06-03)
- add code to generate statistics for wavelength shifting
- add wls.mac to test WLS and new process WLS2
May 24, 2020 D.Sawkey (OpNovice2-V10-06-02)
- use new scintillation time constant parameter
January 30, 2020 D.Sawkey (OpNovice2-V10-06-01)
- remove redundant G4AnalysisManager::Instance calls
January 21, 2020 D.Sawkey (OpNovice2-V10-06-00)
- remove string comparisons and redundant calls in SteppingAction
November 26, 2019 I. Hrivnacova (OpNovice2-V10-05-02)
- Fixed formatting in .README.txt
@@ -8,16 +8,21 @@
/opnovice2/boxProperty ABSLENGTH 0.000002 1 0.000005 2 0.000008 3
/opnovice2/boxProperty RAYLEIGH 0.000002 1 0.000008 1
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty FASTCOMPONENT 0.000002 1.0 0.000008 1.3
/opnovice2/boxProperty SLOWCOMPONENT 0.000002 0.1 0.000003 0.2 0.000004 0.4 0.000005 0.6 0.000006 0.8 0.000007 0.9 .000008 1.0
/opnovice2/boxProperty SCINTILLATIONCOMPONENT1 0.000002 1.0 0.000005 1.1 0.000008 1.3
/opnovice2/boxProperty SCINTILLATIONCOMPONENT2 0.000002 0.1 0.000003 0.2 0.000004 0.4 0.000005 0.6 0.000006 0.8 0.000007 0.9 .000008 1.0
/opnovice2/boxProperty SCINTILLATIONCOMPONENT3 0.000002 0.2 0.000005 0.1 0.000008 0.05
/opnovice2/boxConstProperty FASTTIMECONSTANT 20 ## ns
/opnovice2/boxConstProperty SLOWTIMECONSTANT 100
/opnovice2/boxConstProperty SCINTILLATIONTIMECONSTANT1 20 ## ns
/opnovice2/boxConstProperty SCINTILLATIONTIMECONSTANT2 100
/opnovice2/boxConstProperty SCINTILLATIONTIMECONSTANT3 200
/opnovice2/boxConstProperty SCINTILLATIONYIELD 5000.0
/opnovice2/boxConstProperty YIELDRATIO 0.5
/opnovice2/boxConstProperty SCINTILLATIONYIELD1 1.0
/opnovice2/boxConstProperty SCINTILLATIONYIELD2 1.0
/opnovice2/boxConstProperty SCINTILLATIONYIELD3 0.1
/opnovice2/boxConstProperty RESOLUTIONSCALE 1
/opnovice2/boxConstProperty FASTSCINTILLATIONRISETIME 3
/opnovice2/boxConstProperty SLOWSCINTILLATIONRISETIME 10
/opnovice2/boxConstProperty SCINTILLATIONRISETIME1 3
/opnovice2/boxConstProperty SCINTILLATIONRISETIME2 10
/opnovice2/boxConstProperty SCINTILLATIONRISETIME3 20
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 100 0.000005 100 0.000008 100
@@ -39,7 +44,7 @@
/process/optical/cerenkov/setMaxPhotons 3
/process/optical/cerenkov/setMaxBetaChange 10
/process/optical/scintillation/setExcitationRatio .5
/process/optical/scintillation/setEnhancedTimeConstants true
/process/optical/scintillation/setByParticleType false
/process/optical/scintillation/setTrackInfo false
/process/optical/scintillation/setFiniteRiseTime true
@@ -54,9 +59,9 @@
/analysis/h1/set 2 100 0 10
/analysis/h1/setXaxis 2 "Energy [eV]"
/analysis/h1/setYaxis 2 "Number of photons"
/analysis/h1/set 13 400 0 200
/analysis/h1/setXaxis 13 "Creation time [ns]"
/analysis/h1/setYaxis 13 "Number of photons"
/analysis/h1/set 3 400 0 200
/analysis/h1/setXaxis 3 "Creation time [ns]"
/analysis/h1/setYaxis 3 "Number of photons"
/gun/particle e-
@@ -28,16 +28,16 @@
/opnovice2/gun/optPhotonPolar
#
/analysis/setFileName glisur
/analysis/h1/set 3 40 -1 39
/analysis/h1/set 4 100 -1.1 1.1
/analysis/h1/set 5 100 -1.1 1.1
/analysis/h1/set 6 100 -1.1 1.1
/analysis/h1/set 7 100 -1.1 1.1
/analysis/h1/set 8 100 -1.1 1.1
/analysis/h1/set 9 100 -1.1 1.1
/analysis/h1/set 10 100 -1.1 1.1
/analysis/h1/set 10 40 -1 39
/analysis/h1/set 11 100 -1.1 1.1
/analysis/h1/set 12 100 -1.1 1.1
/analysis/h1/set 13 100 -1.1 1.1
/analysis/h1/set 14 100 -1.1 1.1
/analysis/h1/set 15 100 -1.1 1.1
/analysis/h1/set 16 100 -1.1 1.1
/analysis/h1/set 17 100 -1.1 1.1
/analysis/h1/set 18 100 -1.1 1.1
/analysis/h1/set 19 100 -1.1 1.1
############################# polished ########################################
@@ -47,13 +47,22 @@ class Run : public G4Run
void SetPrimary(G4ParticleDefinition* particle, G4double energy);
// spectrum of Cerenkov radiation
// particle energy
void AddCerenkovEnergy(G4double en) {fCerenkovEnergy += en;}
void AddScintillationEnergy(G4double en) {fScintEnergy += en;}
void AddWLSAbsorptionEnergy(G4double en) {fWLSAbsorptionEnergy += en;}
void AddWLSEmissionEnergy(G4double en) {fWLSEmissionEnergy += en;}
void AddWLS2AbsorptionEnergy(G4double en) {fWLS2AbsorptionEnergy += en;}
void AddWLS2EmissionEnergy(G4double en) {fWLS2EmissionEnergy += en;}
// number of particles
void AddCerenkov(void) {fCerenkovCount += 1;}
void AddScintillation(void) {fScintCount += 1;}
void AddRayleigh(void) {fRayleighCount += 1;}
void AddWLSAbsorption(void) {fWLSAbsorptionCount += 1;}
void AddWLSEmission(void) {fWLSEmissionCount += 1;}
void AddWLS2Absorption(void) {fWLS2AbsorptionCount += 1;}
void AddWLS2Emission(void) {fWLS2EmissionCount += 1;}
void AddOpAbsorption(void) {fOpAbsorption += 1;}
void AddOpAbsorptionPrior(void) {fOpAbsorptionPrior += 1;}
@@ -144,10 +153,18 @@ class Run : public G4Run
G4double fCerenkovEnergy;
G4double fScintEnergy;
G4double fWLSAbsorptionEnergy;
G4double fWLSEmissionEnergy;
G4double fWLS2AbsorptionEnergy;
G4double fWLS2EmissionEnergy;
// number of particles
G4int fCerenkovCount;
G4int fScintCount;
G4int fWLSAbsorptionCount;
G4int fWLSEmissionCount;
G4int fWLS2AbsorptionCount;
G4int fWLS2EmissionCount;
// number of events
G4int fRayleighCount;
@@ -7,16 +7,32 @@
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty ABSLENGTH 0.000002 1 0.000005 2 0.000008 3
/opnovice2/boxProperty FASTCOMPONENT 0.000002 1.0 0.000008 1.3
/opnovice2/boxConstProperty FASTTIMECONSTANT 20 ## ns
/opnovice2/boxProperty SCINTILLATIONCOMPONENT1 0.000002 1.0 0.000005 1.1 0.000008 1.3
/opnovice2/boxProperty SCINTILLATIONCOMPONENT2 0.000002 0.8 0.000005 0.6 0.000008 0.3
/opnovice2/boxConstProperty SCINTILLATIONTIMECONSTANT1 20 ## ns
/opnovice2/boxConstProperty SCINTILLATIONTIMECONSTANT2 200 ## ns
/opnovice2/boxConstProperty SCINTILLATIONRISETIME1 5 ## ns
/opnovice2/boxConstProperty SCINTILLATIONRISETIME2 10 ## ns
/opnovice2/boxConstProperty RESOLUTIONSCALE 1
/opnovice2/boxProperty SCINTILLATIONYIELD 5000.
#/opnovice2/boxProperty SCINTILLATIONYIELD 5000.
/opnovice2/boxProperty PROTONSCINTILLATIONYIELD 0 50 10 5000
/opnovice2/boxConstProperty PROTONSCINTILLATIONYIELD1 0.2
/opnovice2/boxConstProperty PROTONSCINTILLATIONYIELD2 0.8
/opnovice2/boxProperty DEUTERONSCINTILLATIONYIELD 0 50 10 5000
/opnovice2/boxConstProperty DEUTERONSCINTILLATIONYIELD1 0.6
/opnovice2/boxConstProperty DEUTERONSCINTILLATIONYIELD2 0.4
/opnovice2/boxProperty TRITONSCINTILLATIONYIELD 0 50 10 5000
/opnovice2/boxConstProperty TRITONSCINTILLATIONYIELD1 0.5
/opnovice2/boxConstProperty TRITONSCINTILLATIONYIELD2 0.5
/opnovice2/boxProperty ALPHASCINTILLATIONYIELD 0 50 10 50000
/opnovice2/boxConstProperty ALPHASCINTILLATIONYIELD1 0.7
/opnovice2/boxConstProperty ALPHASCINTILLATIONYIELD2 0.3
/opnovice2/boxProperty IONSCINTILLATIONYIELD 0 50 10 5000
/opnovice2/boxConstProperty IONSCINTILLATIONYIELD1 0.7
/opnovice2/boxConstProperty IONSCINTILLATIONYIELD2 0.3
/opnovice2/boxProperty ELECTRONSCINTILLATIONYIELD 0 5000 10 500000
/opnovice2/boxConstProperty ELECTRONSCINTILLATIONYIELD1 0.8
/opnovice2/boxConstProperty ELECTRONSCINTILLATIONYIELD2 0.2
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 100 0.000005 100 0.000008 100
@@ -31,8 +47,9 @@
/process/optical/verbose 0
/process/optical/scintillation/setEnhancedTimeConstants true
/process/optical/scintillation/setYieldFactor 10
/process/optical/scintillation/setExcitationRatio .5
#/process/optical/scintillation/setExcitationRatio .5
/process/optical/scintillation/setByParticleType true
/process/optical/scintillation/setTrackInfo false
/process/optical/scintillation/setFiniteRiseTime false
@@ -48,9 +65,9 @@
/analysis/h1/set 2 100 0 10
/analysis/h1/setXaxis 2 "Energy [eV]"
/analysis/h1/setYaxis 2 "Number of photons"
/analysis/h1/set 13 400 0 200
/analysis/h1/setXaxis 13 "Creation time [ns]"
/analysis/h1/setYaxis 13 "Number of photons"
/analysis/h1/set 3 400 0 200
/analysis/h1/setXaxis 3 "Creation time [ns]"
/analysis/h1/setYaxis 3 "Number of photons"
#
/gun/particle e-
@@ -62,25 +62,32 @@ void HistoManager::Book()
analysisManager->SetActivation(true); // enable inactivation of histograms
// Define histogram indices, titles
G4int maxHisto = 13;
G4int maxHisto = 15;
G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10","11","12","13" };
"10","11","12","13","14","15","16","17","18","19" };
// TODO change throughout code
G4String title[] = {
"dummy", // 0
"Cerenkov spectrum", // 1
"scintillation spectrum", // 2
"boundary process status", // 3
"X momentum dir of backward-going photons", // 4
"Y momentum dir of backward-going photons", // 5
"Z momentum dir of backward-going photons", // 6
"X momentum dir of forward-going photons", // 7
"Y momentum dir of forward-going photons", // 8
"Z momentum dir of forward-going photons", // 9
"X momentum dir of Fresnel-refracted photons", //10
"Y momentum dir of Fresnel-refracted photons", //11
"Z momentum dir of Fresnel-refracted photons", //12
"scintillation photons creation time", //13
"scintillation photons creation time", // 3
"WLS absorption spectrum", // 4
"WLS emission spectrum", // 5
"WLS emission time", // 6
"WLS2 absorption spectrum", // 7
"WLS2 emission spectrum", // 8
"WLS2 emission time", // 9
"boundary process status", //10
"X momentum dir of backward-going photons", //11
"Y momentum dir of backward-going photons", //12
"Z momentum dir of backward-going photons", //13
"X momentum dir of forward-going photons", //14
"Y momentum dir of forward-going photons", //15
"Z momentum dir of forward-going photons", //16
"X momentum dir of Fresnel-refracted photons", //17
"Y momentum dir of Fresnel-refracted photons", //18
"Z momentum dir of Fresnel-refracted photons", //19
};
// Default values (to be reset via /analysis/h1/set command)
+57 -8
View File
@@ -47,10 +47,18 @@ Run::Run()
fEkin = -1.;
fCerenkovEnergy = 0.0;
fScintEnergy = 0.0;
fScintEnergy = 0.0;
fWLSAbsorptionEnergy = 0.0;
fWLSEmissionEnergy = 0.0;
fWLS2AbsorptionEnergy = 0.0;
fWLS2EmissionEnergy = 0.0;
fCerenkovCount = 0;
fScintCount = 0;
fScintCount = 0;
fWLSAbsorptionCount = 0;
fWLSEmissionCount = 0;
fWLS2AbsorptionCount = 0;
fWLS2EmissionCount = 0;
fRayleighCount = 0;
fOpAbsorption = 0;
@@ -87,9 +95,17 @@ void Run::Merge(const G4Run* run)
fCerenkovEnergy += localRun->fCerenkovEnergy;
fScintEnergy += localRun->fScintEnergy;
fWLSAbsorptionEnergy += localRun->fWLSAbsorptionEnergy;
fWLSEmissionEnergy += localRun->fWLSEmissionEnergy;
fWLS2AbsorptionEnergy += localRun->fWLS2AbsorptionEnergy;
fWLS2EmissionEnergy += localRun->fWLS2EmissionEnergy;
fCerenkovCount += localRun->fCerenkovCount;
fScintCount += localRun->fScintCount;
fWLSAbsorptionCount += localRun->fWLSAbsorptionCount;
fWLSEmissionCount += localRun->fWLSEmissionCount;
fWLS2AbsorptionCount += localRun->fWLS2AbsorptionCount;
fWLS2EmissionCount += localRun->fWLS2EmissionCount;
fRayleighCount += localRun->fRayleighCount;
fTotalSurface += localRun->fTotalSurface;
@@ -107,8 +123,8 @@ void Run::Merge(const G4Run* run)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::EndOfRun()
{
G4int TotNbofEvents = numberOfEvent;
if (TotNbofEvents == 0) return;
if (numberOfEvent == 0) return;
G4double TotNbofEvents = (G4double)numberOfEvent;
const DetectorConstruction* det = (const DetectorConstruction*)
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
@@ -120,6 +136,7 @@ void Run::EndOfRun()
G4cout << "---------------------------------\n";
G4cout << "Primary particle was: " << fParticle->GetParticleName()
<< " with energy " << G4BestUnit(fEkin, "Energy") << "." << G4endl;
G4cout << "Number of events: " << numberOfEvent << G4endl;
G4cout << "Material of world: " << det->GetWorldMaterial()->GetName()
<< G4endl;
@@ -132,18 +149,50 @@ void Run::EndOfRun()
G4cout << "Average number of Cerenkov photons created per event: "
<< fCerenkovCount/TotNbofEvents << G4endl;
if (fCerenkovCount > 0) {
G4cout << " Average energy: " << (fCerenkovEnergy/eV)/fCerenkovCount
<< " eV." << G4endl;
G4cout << " Average energy per photon: "
<< (fCerenkovEnergy/eV)/fCerenkovCount << " eV." << G4endl;
}
G4cout << "Average energy of scintillation photons created per event: "
<< (fScintEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of scintillation photons created per event: "
<< fScintCount/TotNbofEvents << G4endl;
if (fScintCount > 0) {
G4cout << " Average energy: " << (fScintEnergy/eV)/fScintCount << " eV."
<< G4endl;
G4cout << " Average energy per photon: "
<< (fScintEnergy/eV)/fScintCount << " eV." << G4endl;
}
}
G4cout << "Average number of photons absorbed by WLS per event: "
<< fWLSAbsorptionCount/G4double(TotNbofEvents) << " " << G4endl;
if (fWLSAbsorptionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLSAbsorptionEnergy/eV)/fWLSAbsorptionCount << " eV." <<G4endl;
}
G4cout << "Average number of photons created by WLS per event: "
<< fWLSEmissionCount/TotNbofEvents << G4endl;
if (fWLSEmissionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLSEmissionEnergy/eV)/fWLSEmissionCount << " eV." << G4endl;
}
G4cout << "Average energy of WLS photons created per event: "
<< (fWLSEmissionEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of photons absorbed by WLS2 per event: "
<< fWLS2AbsorptionCount/G4double(TotNbofEvents) << " " << G4endl;
if (fWLS2AbsorptionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLS2AbsorptionEnergy/eV)/fWLS2AbsorptionCount << " eV." <<G4endl;
}
G4cout << "Average number of photons created by WLS2 per event: "
<< fWLS2EmissionCount/TotNbofEvents << G4endl;
if (fWLS2EmissionCount > 0) {
G4cout << " Average energy per photon: "
<< (fWLS2EmissionEnergy/eV)/fWLS2EmissionCount << " eV." << G4endl;
}
G4cout << "Average energy of WLS2 photons created per event: "
<< (fWLS2EmissionEnergy/eV)/TotNbofEvents << " eV." << G4endl;
G4cout << "Average number of OpRayleigh per event: "
<< fRayleighCount/TotNbofEvents << G4endl;
G4cout << "Average number of OpAbsorption per event: "
@@ -63,8 +63,9 @@ SteppingAction::~SteppingAction()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingAction::UserSteppingAction(const G4Step* step)
{
static G4ParticleDefinition* opticalphoton =
static G4ParticleDefinition* opticalphoton =
G4OpticalPhoton::OpticalPhotonDefinition();
G4AnalysisManager* analysisMan = G4AnalysisManager::Instance();
Run* run = static_cast<Run*>(
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
@@ -73,38 +74,69 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
G4StepPoint* endPoint = step->GetPostStepPoint();
G4StepPoint* startPoint = step->GetPreStepPoint();
G4String particleName = track->GetDynamicParticle()->
GetParticleDefinition()->GetParticleName();
const G4DynamicParticle* theParticle = track->GetDynamicParticle();
const G4ParticleDefinition* particleDef = theParticle->
GetParticleDefinition();
TrackInformation* trackInfo =
TrackInformation* trackInfo =
(TrackInformation*)(track->GetUserInformation());
if (particleName == "opticalphoton") {
if (particleDef == opticalphoton) {
const G4VProcess* pds = endPoint->GetProcessDefinedStep();
if (pds->GetProcessName() == "OpAbsorption") {
run->AddOpAbsorption();
G4String procname = pds->GetProcessName();
if (procname.compare("OpAbsorption") == 0) {
run->AddOpAbsorption();
if (trackInfo->GetIsFirstTankX()) {
run->AddOpAbsorptionPrior();
}
}
else if (pds->GetProcessName() == "OpRayleigh") {
else if (procname.compare("OpRayleigh") == 0) {
run->AddRayleigh();
}
else if (procname.compare("OpWLS") == 0) {
G4double en = track->GetKineticEnergy();
run->AddWLSAbsorption();
run->AddWLSAbsorptionEnergy(en);
analysisMan->FillH1(4, en/eV); //absorption energy
// loop over secondaries, create statistics
//const std::vector<const G4Track*>* secondaries =
auto secondaries = step->GetSecondaryInCurrentStep();
for (auto sec : *secondaries) {
en = sec->GetKineticEnergy();
run->AddWLSEmission();
run->AddWLSEmissionEnergy(en);
analysisMan->FillH1(5, en/eV); // emission energy
G4double time = sec->GetGlobalTime();
analysisMan->FillH1(6, time/ns);
}
}
else if (procname.compare("OpWLS2") == 0) {
G4double en = track->GetKineticEnergy();
run->AddWLS2Absorption();
run->AddWLS2AbsorptionEnergy(en);
analysisMan->FillH1(7, en/eV); //absorption energy
// loop over secondaries, create statistics
//const std::vector<const G4Track*>* secondaries =
auto secondaries = step->GetSecondaryInCurrentStep();
for (auto sec : *secondaries) {
en = sec->GetKineticEnergy();
run->AddWLS2Emission();
run->AddWLS2EmissionEnergy(en);
analysisMan->FillH1(8, en/eV); // emission energy
G4double time = sec->GetGlobalTime();
analysisMan->FillH1(9, time/ns);
}
}
// optical process has endpt on bdry,
if (endPoint->GetStepStatus() == fGeomBoundary) {
const G4DynamicParticle* theParticle = track->GetDynamicParticle();
G4ThreeVector oldMomentumDir = theParticle->GetMomentumDirection();
G4ThreeVector m0 = startPoint->GetMomentumDirection();
G4ThreeVector m1 = endPoint->GetMomentumDirection();
G4OpBoundaryProcessStatus theStatus = Undefined;
G4ProcessManager* OpManager =
G4OpticalPhoton::OpticalPhoton()->GetProcessManager();
G4ProcessManager* OpManager = opticalphoton->GetProcessManager();
G4int MAXofPostStepLoops =
OpManager->GetPostStepProcessVector()->entries();
G4ProcessVector* postStepDoItVector =
@@ -116,13 +148,13 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
G4double py1 = momdir.y();
G4double pz1 = momdir.z();
if (px1 < 0.) {
analysisMan->FillH1(4, px1);
analysisMan->FillH1(5, py1);
analysisMan->FillH1(6, pz1);
} else if (px1 >= 0.) {
analysisMan->FillH1(7, px1);
analysisMan->FillH1(8, py1);
analysisMan->FillH1(9, pz1);
analysisMan->FillH1(11, px1);
analysisMan->FillH1(12, py1);
analysisMan->FillH1(13, pz1);
} else {
analysisMan->FillH1(14, px1);
analysisMan->FillH1(15, py1);
analysisMan->FillH1(16, pz1);
}
trackInfo->SetIsFirstTankX(false);
@@ -135,15 +167,15 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
dynamic_cast<G4OpBoundaryProcess*>(currentProcess);
if (opProc) {
theStatus = opProc->GetStatus();
analysisMan->FillH1(3, theStatus);
analysisMan->FillH1(10, theStatus);
if (theStatus == Transmission) {
run->AddTransmission();
}
else if (theStatus == FresnelRefraction) {
run->AddFresnelRefraction();
analysisMan->FillH1(10, px1);
analysisMan->FillH1(11, py1);
analysisMan->FillH1(12, pz1);
analysisMan->FillH1(17, px1);
analysisMan->FillH1(18, py1);
analysisMan->FillH1(19, pz1);
}
else if (theStatus == FresnelReflection) {
run->AddFresnelReflection();
@@ -279,11 +311,12 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
G4int n_scint = 0;
G4int n_cer = 0;
for (G4int i = 0; i < n_proc; ++i) {
if ((*proc_vec)[i]->GetProcessName().compare("Cerenkov") == 0) {
G4String proc_name = (*proc_vec)[i]->GetProcessName();
if (proc_name.compare("Cerenkov") == 0) {
auto cer = (G4Cerenkov*)(*proc_vec)[i];
n_cer = cer->GetNumPhotons();
}
else if ((*proc_vec)[i]->GetProcessName().compare("Scintillation") == 0) {
else if (proc_name.compare("Scintillation") == 0) {
auto scint = (G4Scintillation*)(*proc_vec)[i];
n_scint = scint->GetNumPhotons();
}
@@ -302,21 +335,21 @@ void SteppingAction::UserSteppingAction(const G4Step* step)
for (auto sec : *secondaries) {
if (sec->GetDynamicParticle()->GetParticleDefinition() == opticalphoton){
if (sec->GetCreatorProcess()->GetProcessName().compare("Cerenkov")==0){
G4String creator_process = sec->GetCreatorProcess()->GetProcessName();
if (creator_process.compare("Cerenkov") == 0){
G4double en = sec->GetKineticEnergy();
run->AddCerenkovEnergy(en);
run->AddCerenkov();
G4AnalysisManager::Instance()->FillH1(1, en/eV);
analysisMan->FillH1(1, en/eV);
}
else if (sec->GetCreatorProcess()
->GetProcessName().compare("Scintillation") == 0) {
else if (creator_process.compare("Scintillation") == 0) {
G4double en = sec->GetKineticEnergy();
run->AddScintillationEnergy(en);
run->AddScintillation();
G4AnalysisManager::Instance()->FillH1(2, en/eV);
analysisMan->FillH1(2, en/eV);
G4double time = sec->GetGlobalTime();
analysisMan->FillH1(13, time/ns);
analysisMan->FillH1(3, time/ns);
}
}
}
@@ -31,16 +31,16 @@
/opnovice2/gun/optPhotonPolar
#
/analysis/setFileName unified
/analysis/h1/set 3 40 -1 39
/analysis/h1/set 4 100 -1.1 1.1
/analysis/h1/set 5 100 -1.1 1.1
/analysis/h1/set 6 100 -1.1 1.1
/analysis/h1/set 7 100 -1.1 1.1
/analysis/h1/set 8 100 -1.1 1.1
/analysis/h1/set 9 100 -1.1 1.1
/analysis/h1/set 10 100 -1.1 1.1
/analysis/h1/set 10 40 -1 39
/analysis/h1/set 11 100 -1.1 1.1
/analysis/h1/set 12 100 -1.1 1.1
/analysis/h1/set 13 100 -1.1 1.1
/analysis/h1/set 14 100 -1.1 1.1
/analysis/h1/set 15 100 -1.1 1.1
/analysis/h1/set 16 100 -1.1 1.1
/analysis/h1/set 17 100 -1.1 1.1
/analysis/h1/set 18 100 -1.1 1.1
/analysis/h1/set 19 100 -1.1 1.1
/run/beamOn 10000
@@ -0,0 +1,59 @@
/control/verbose 2
/tracking/verbose 0
/process/optical/verbose 0
/control/cout/ignoreThreadsExcept 0
/opnovice2/boxMaterial G4_BGO
/opnovice2/worldMaterial G4_AIR
/opnovice2/boxProperty ABSLENGTH 0.000002 1 0.000005 2 0.000008 3
/opnovice2/boxProperty RAYLEIGH 0.000002 1 0.000008 1
/opnovice2/boxProperty RINDEX 0.000002 1.3 0.000008 1.4
/opnovice2/boxProperty WLSABSLENGTH 0.000005 100000 0.000006 0.06 0.000007 0.08 0.000008 0.09 .000009 100000
/opnovice2/boxProperty WLSCOMPONENT 0.000003 0.1 0.000004 0.4 0.000005 0.7 0.000006 0.6 0.000007 0.1
/opnovice2/boxProperty WLSABSLENGTH2 0.000002 100000 0.000003 0.36 0.000004 0.18 0.000005 0.09 .000006 10000
/opnovice2/boxProperty WLSCOMPONENT2 0.000002 0.1 0.000003 0.8 0.000004 0.9 .000005 0.1
/opnovice2/boxConstProperty WLSMEANNUMBERPHOTONS 1
/opnovice2/boxConstProperty WLSMEANNUMBERPHOTONS2 3
/opnovice2/boxConstProperty WLSTIMECONSTANT 1.0 # ns
/opnovice2/boxConstProperty WLSTIMECONSTANT2 2.0 # ns
/opnovice2/worldProperty RINDEX 0.000002 1.01 0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 100 0.000005 100 0.000008 100
/process/optical/wls/setTimeProfile delta
/process/optical/wls2/setTimeProfile exponential
/run/initialize
/analysis/setFileName wls
## WLS process
/analysis/h1/set 4 100 0 10
/analysis/h1/setXaxis 4 "Energy [eV]"
/analysis/h1/setYaxis 4 "Number of photons"
/analysis/h1/set 5 100 0 10
/analysis/h1/setXaxis 5 "Energy [eV]"
/analysis/h1/setYaxis 5 "Number of photons"
/analysis/h1/set 6 100 0 10
/analysis/h1/setXaxis 6 "Creation time [ns]"
/analysis/h1/setYaxis 6 "Number of photons"
## WLS2 process
/analysis/h1/set 7 100 0 10
/analysis/h1/setXaxis 7 "Energy [eV]"
/analysis/h1/setYaxis 7 "Number of photons"
/analysis/h1/set 8 100 0 10
/analysis/h1/setXaxis 8 "Energy [eV]"
/analysis/h1/setYaxis 8 "Number of photons"
/analysis/h1/set 9 100 0 50
/analysis/h1/setXaxis 9 "Creation time [ns]"
/analysis/h1/setYaxis 9 "Number of photons"
/gun/particle opticalphoton
/gun/energy 7 eV
/gun/position 0 0 0 m
/gun/direction 1 0 0
/opnovice2/gun/optPhotonPolar
#
/run/printProgress 1000
/run/beamOn 10000