Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
N21-01-21
GenieSNova
src
GFluxWindow.cxx
Go to the documentation of this file.
1
// ROOT includes
2
#include "TVector3.h"
3
4
// GENIE includes
5
#include "GENIE/Framework/Messenger/Messenger.h"
6
#include "GENIE/Framework/Numerical/RandomGen.h"
7
#include "GENIE/Framework/Conventions/Units.h"
8
9
// NOvASoft includes
10
#include "
GenieSNova/src/GFluxWindow.h
"
11
12
using namespace
genie::supernova
;
13
14
15
//.......................................................................
16
GFluxWindow::GFluxWindow
(TVector3
pos
,
double
size
):
17
fPosition(pos),
18
fDirection(-pos.
Unit
()),
19
fSize(size)
20
{
21
CalculateBasis
();
22
}
23
24
25
//.......................................................................
26
void
GFluxWindow::GenerateNext
(
GenParticle
& particle)
27
{
28
particle.
SetDirection
(
fDirection
);
29
particle.
fPos
.SetVect(
GenPosition
() * 0.01);
30
}
31
32
33
//.......................................................................
34
TVector3
GFluxWindow::Direction
()
35
{
36
return
fDirection
;
37
}
38
39
40
//.......................................................................
41
double
GFluxWindow::Area
()
42
{
43
return
fSize
*
fSize
;
44
}
45
46
47
//.......................................................................
48
TVector3
GFluxWindow::GenPosition
()
49
{
50
genie::RandomGen
*
rnd
=
genie::RandomGen::Instance
();
51
double
x
= rnd->
RndFlux
().Uniform(-0.5, 0.5);
52
double
y
= rnd->
RndFlux
().Uniform(-0.5, 0.5);
53
return
(
fBasisX
* x) + (
fBasisY
*
y
) +
fPosition
;
54
}
55
56
57
//.......................................................................
58
void
GFluxWindow::CalculateBasis
()
59
{
60
// Calculate Basis vectors
61
fBasisX
=
fDirection
.Cross(TVector3(0, 1, 0));
62
if
(
fBasisX
.Mag2() == 0)
63
fBasisX
=
fDirection
.Cross(TVector3(0, 0, 1));
64
65
fBasisY
=
fBasisX
.Cross(
fDirection
);
66
67
//normalize basis
68
fBasisX
=
fBasisX
.Unit() *
fSize
;
69
fBasisY
=
fBasisY
.Unit() *
fSize
;
70
}
genie::supernova::GFluxWindow::CalculateBasis
void CalculateBasis()
Definition:
GFluxWindow.cxx:58
genie::supernova::GFluxWindow::fSize
double fSize
Definition:
GFluxWindow.h:26
genie::RandomGen::Instance
static RandomGen * Instance()
Access instance.
Definition:
RandomGen.cxx:79
genie::supernova::GFluxWindow::GenerateNext
void GenerateNext(GenParticle &)
Definition:
GFluxWindow.cxx:26
genie::supernova::GFluxWindow::Area
double Area()
Definition:
GFluxWindow.cxx:41
elec2geo.pos
pos
Definition:
elec2geo.py:33
genie::supernova
Definition:
GeneratorBase.h:9
genie::RandomGen
A singleton holding random number generator classes. All random number generation in GENIE should tak...
Definition:
RandomGen.h:30
submit_syst.y
y
Definition:
submit_syst.py:249
genie::supernova::GFluxWindow::fBasisX
TVector3 fBasisX
Definition:
GFluxWindow.h:28
genie::supernova::GFluxWindow::fBasisY
TVector3 fBasisY
basis vectors in X for position generation
Definition:
GFluxWindow.h:29
submit_syst.x
x
Definition:
submit_syst.py:249
generate_hists.rnd
rnd
Definition:
generate_hists.py:58
gen_hdf5record.size
size
Definition:
gen_hdf5record.py:445
GFluxWindow.h
Unit
TVector3 Unit() const
Definition:
SRVector3DAddons.h:14
genie::supernova::GenParticle::SetDirection
void SetDirection(const TVector3 &dir)
Definition:
GenParticle.cxx:25
genie::supernova::GenParticle::fPos
TLorentzVector fPos
Definition:
GenParticle.h:28
genie::supernova::GFluxWindow::GenPosition
TVector3 GenPosition()
Definition:
GFluxWindow.cxx:48
genie::supernova::GFluxWindow::fDirection
TVector3 fDirection
Definition:
GFluxWindow.h:25
genie::supernova::GenParticle
Definition:
GenParticle.h:10
genie::supernova::GFluxWindow::Direction
TVector3 Direction()
Definition:
GFluxWindow.cxx:34
genie::RandomGen::RndFlux
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
Definition:
RandomGen.h:72
genie::supernova::GFluxWindow::fPosition
TVector3 fPosition
Definition:
GFluxWindow.h:24
genie::supernova::GFluxWindow::GFluxWindow
GFluxWindow(TVector3 pos, double size)
Definition:
GFluxWindow.cxx:16
Generated on Thu Jan 21 2021 14:13:53 for NOvA by
1.8.11