Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NeutrinoPhysics.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27//---------------------------------------------------------------------------
28//
29// ClassName: G4NeutrinoPhysics
30//
31// Author: 2023 V. Ivanchenko extracted from G4EmExtraPhysics
32//
33// Modified:
34//
35//
36///////////////////////////////////////////////////////////////
37
38#include "G4NeutrinoPhysics.hh"
39
40#include "G4SystemOfUnits.hh"
42#include "G4ProcessManager.hh"
43
44#include "G4Electron.hh"
45#include "G4AntiNeutrinoE.hh"
46#include "G4NeutrinoE.hh"
47#include "G4AntiNeutrinoMu.hh"
48#include "G4NeutrinoMu.hh"
49#include "G4AntiNeutrinoTau.hh"
50#include "G4NeutrinoTau.hh"
51
56
60#include "G4NuVacOscProcess.hh"
61
65
70
75
80
81// factory
83//
85
86//////////////////////////////////////
87
89 G4VPhysicsConstructor("NeutrinoPhys"),
90 verbose(ver)
91{
92 theMessenger = new G4NeutrinoPhysicsMessenger(this);
93 if(verbose > 1) G4cout << "### G4NeutrinoPhysics" << G4endl;
94}
95
97{
98 delete theMessenger;
99}
100
102{
103 fNuETotXscActivated = val;
104}
105
107{
108 fNuOscillation = val;
109}
110
112{
113 if(bf > 0.0) fNuEleCcBias = bf;
114}
115
117{
118 if(bf > 0.0) fNuEleNcBias = bf;
119}
120
122{
123 if(bf > 0.0) fNuNucleusBias = bf;
124}
125
127{
128 if(bf > 0.0) fNuOscDistanceBias = bf;
129}
130
132{
133 fNuDetectorName = dn;
134}
135
137{
138 fNuOscDistanceName = dn;
139}
140
141/////////////////////////////////////////////////
142
153
155{
156 const G4ParticleDefinition* p[6] = {
163 };
164
165 // neutrino vacuum oscillation process
166 if (fNuOscillation) {
167 auto theNuVacOscProcess = new G4NuVacOscProcess(fNuOscDistanceName);
168 theNuVacOscProcess->SetBiasingFactor(fNuOscDistanceBias);
169
170
171 for (G4int i=0; i<6; ++i) {
172 p[i]->GetProcessManager()->AddDiscreteProcess(theNuVacOscProcess);
173 }
174 }
175
176 // neutrino-electron process
177 auto theNuEleProcess = new G4NeutrinoElectronProcess(fNuDetectorName);
179
180 if (fNuETotXscActivated) {
181 G4double bftot = std::max(fNuEleCcBias, fNuEleNcBias);
182 theNuEleProcess->SetBiasingFactor(bftot);
183 }
184 else {
185 theNuEleProcess->SetBiasingFactors(fNuEleCcBias, fNuEleNcBias);
186 theNuEleTotXsc->SetBiasingFactors(fNuEleCcBias, fNuEleNcBias);
187 }
188 theNuEleProcess->AddDataSet(theNuEleTotXsc);
189
192 theNuEleProcess->RegisterMe(ccModel);
193 theNuEleProcess->RegisterMe(ncModel);
194
195 for (G4int i=0; i<6; ++i) {
196 p[i]->GetProcessManager()->AddDiscreteProcess(theNuEleProcess);
197 }
198
199 // nu_mu nucleus interactions
200 auto theNuMuNucleusProcess = new G4MuNeutrinoNucleusProcess(fNuDetectorName);
201 auto theNuMuNucleusTotXsc = new G4MuNeutrinoNucleusTotXsc();
202
203 if (fNuETotXscActivated) {
204 theNuMuNucleusProcess->SetBiasingFactor(fNuNucleusBias);
205 }
206 theNuMuNucleusProcess->AddDataSet(theNuMuNucleusTotXsc);
207
208 G4NuMuNucleusCcModel* numunuclcc = new G4NuMuNucleusCcModel();
209 G4NuMuNucleusNcModel* numunuclnc = new G4NuMuNucleusNcModel();
210 G4ANuMuNucleusCcModel* anumunuclcc = new G4ANuMuNucleusCcModel();
211 G4ANuMuNucleusNcModel* anumunuclnc = new G4ANuMuNucleusNcModel();
212
213 theNuMuNucleusProcess->RegisterMe(numunuclcc);
214 theNuMuNucleusProcess->RegisterMe(numunuclnc);
215 theNuMuNucleusProcess->RegisterMe(anumunuclcc);
216 theNuMuNucleusProcess->RegisterMe(anumunuclnc);
217
218 for (G4int i=2; i<=3; ++i) {
219 p[i]->GetProcessManager()->AddDiscreteProcess(theNuMuNucleusProcess);
220 }
221
222 // nu_tau nucleus interactions
223 auto theNuTauNucleusProcess = new G4TauNeutrinoNucleusProcess(fNuDetectorName);
224 auto theNuTauNucleusTotXsc = new G4TauNeutrinoNucleusTotXsc();
225
226 if(fNuETotXscActivated) {
227 theNuTauNucleusProcess->SetBiasingFactor(fNuNucleusBias);
228 }
229 theNuTauNucleusProcess->AddDataSet(theNuTauNucleusTotXsc);
230
231 G4NuTauNucleusCcModel* nutaunuclcc = new G4NuTauNucleusCcModel();
232 G4NuTauNucleusNcModel* nutaunuclnc = new G4NuTauNucleusNcModel();
235
236 theNuTauNucleusProcess->RegisterMe(nutaunuclcc);
237 theNuTauNucleusProcess->RegisterMe(nutaunuclnc);
238 theNuTauNucleusProcess->RegisterMe(anutaunuclcc);
239 theNuTauNucleusProcess->RegisterMe(anutaunuclnc);
240
241 for (G4int i=4; i<=5; ++i) {
242 p[i]->GetProcessManager()->AddDiscreteProcess(theNuTauNucleusProcess);
243 }
244
245 // nu_e nucleus interactions
246 auto theNuElNucleusProcess = new G4ElNeutrinoNucleusProcess(fNuDetectorName);
247 auto theNuElNucleusTotXsc = new G4ElNeutrinoNucleusTotXsc();
248
249 if (fNuETotXscActivated) {
250 theNuElNucleusProcess->SetBiasingFactor(fNuNucleusBias);
251 }
252 theNuElNucleusProcess->AddDataSet(theNuElNucleusTotXsc);
253
254 G4NuElNucleusCcModel* nuelnuclcc = new G4NuElNucleusCcModel();
255 G4NuElNucleusNcModel* nuelnuclnc = new G4NuElNucleusNcModel();
256 G4ANuElNucleusCcModel* anuelnuclcc = new G4ANuElNucleusCcModel();
257 G4ANuElNucleusNcModel* anuelnuclnc = new G4ANuElNucleusNcModel();
258
259 theNuElNucleusProcess->RegisterMe(nuelnuclcc);
260 theNuElNucleusProcess->RegisterMe(nuelnuclnc);
261 theNuElNucleusProcess->RegisterMe(anuelnuclcc);
262 theNuElNucleusProcess->RegisterMe(anuelnuclnc);
263
264 for (G4int i=0; i<=1; ++i) {
265 p[i]->GetProcessManager()->AddDiscreteProcess(theNuElNucleusProcess);
266 }
267}
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4AntiNeutrinoE * AntiNeutrinoE()
static G4AntiNeutrinoMu * AntiNeutrinoMu()
static G4AntiNeutrinoTau * AntiNeutrinoTau()
static G4Electron * Electron()
Definition G4Electron.cc:91
static G4NeutrinoE * NeutrinoE()
void SetBiasingFactors(G4double bfCc, G4double bfNc)
static G4NeutrinoMu * NeutrinoMu()
G4NeutrinoPhysics(G4int ver=1)
void SetNuEleNcBias(G4double bf)
void ConstructProcess() override
void SetNuDetectorName(const G4String &dn)
void NuETotXscActivated(G4bool val)
void SetNuOscDistanceName(const G4String &dn)
~G4NeutrinoPhysics() override
void ConstructParticle() override
void SetNuNucleusBias(G4double bf)
void SetNuEleCcBias(G4double bf)
void SetNuOscillation(G4bool val)
void SetNuOscDistanceBias(G4double bf)
static G4NeutrinoTau * NeutrinoTau()
G4ProcessManager * GetProcessManager() const
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)