EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
EicBoxGenerator.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EicBoxGenerator.h
1
//
2
// AYK (ayk@bnl.gov), 2015/07/15
3
//
4
// A complete re-write;
5
//
6
7
#include <vector>
8
9
#include <
EicProtoGenerator.h
>
10
11
#ifndef _EIC_BOX_GENERATOR_
12
#define _EIC_BOX_GENERATOR_
13
14
class
EicBoxGenerator
:
public
EicProtoGenerator
15
{
16
public
:
17
EicBoxGenerator
():
EicProtoGenerator
(
"EicBoxGenerator"
) {
ResetVars
();
mMult
= 0; };
18
19
void
ResetVars
() {
20
//memset(mCoord, 0x00, sizeof(mCoord));
21
//memset(mCoordSigma, 0x00, sizeof(mCoordSigma));
22
//memset(mCoordRange, 0x00, sizeof(mCoordRange));
23
24
mFlipCounter
= 0;
25
26
//mGaussianCoordinateSmearing = true;
27
28
mPmin
=
mPmax
= 0.0;
29
mThetaMin
= 0.0;
30
mThetaMax
= 180.0;
31
mPhiMin
= 0.0;
32
mPhiMax
= 360.0;
33
};
34
35
EicBoxGenerator
(Int_t
pdg
, UInt_t mult = 1):
EicProtoGenerator
(
"EicBoxGenerator"
),
mMult
(mult) {
36
ResetVars
();
37
38
AddPDG
(pdg);
39
};
40
41
void
AddPDG
(
int
pdg
) {
mPDGs
.push_back(pdg); };
42
#if _MOVED_
43
// Well, do I need more intelligent access methods here?; FIXME: should be moved
44
// to EicProtoGenerator at some point;
45
void
SetVertex
(
double
x
,
double
y
,
double
z
= 0.0) {
46
mCoord
[0] =
x
;
mCoord
[1] =
y
;
mCoord
[2] =
z
;
47
};
48
double
GetVx
()
const
{
return
mCoord
[0]; };
49
double
GetVy
()
const
{
return
mCoord
[1]; };
50
double
GetVz
()
const
{
return
mCoord
[2]; };
51
void
SetVertexSmearing
(
double
sx,
double
sy,
double
sz = 0.0) {
52
mCoordSigma
[0] = sx;
mCoordSigma
[1] = sy;
mCoordSigma
[2] = sz;
53
mGaussianCoordinateSmearing
=
true
;
54
};
55
void
SetVertexRange
(
double
rx,
double
ry,
double
rz = 0.0) {
56
mCoordRange
[0] = rx;
mCoordRange
[1] = ry;
mCoordRange
[2] = rz;
57
mGaussianCoordinateSmearing
=
false
;
58
};
59
60
double
GetVxSmearing
()
const
{
return
mCoordSigma
[0]; };
61
double
GetVySmearing
()
const
{
return
mCoordSigma
[1]; };
62
double
GetVzSmearing
()
const
{
return
mCoordSigma
[2]; };
63
#endif
64
void
SetThetaRange
(
double
min
,
double
max
,
bool
uniform =
false
) {
65
mThetaMin
=
min
;
mThetaMax
=
max
;
mUniformTheta
= uniform;
66
};
67
void
SetTheta
(
double
theta
) {
mThetaMin
=
mThetaMax
=
theta
; };
68
void
SetPhiRange
(
double
min
,
double
max
) {
mPhiMin
=
min
;
mPhiMax
=
max
; };
69
void
SetPhi
(
double
phi
) {
mPhiMin
=
mPhiMax
=
phi
; };
70
void
SetMomentumRange
(
double
min
,
double
max
) {
mPmin
=
min
;
mPmax
=
max
; };
71
void
SetMomentum
(
double
momentum
) {
mPmin
=
mPmax
=
momentum
; };
72
73
virtual
Bool_t
ReadEvent
(
FairPrimaryGenerator
* primGen);
74
75
protected
:
76
//Double_t mCoord[3]; // (average) vertex coordinates in [cm]; default: (0,0,0)
77
//Double_t mCoordSigma[3]; // gaussian vertex smearing (if any) in [cm]; default: (0,0,0)
78
//Double_t mCoordRange[3]; // uniform vertex range (if any) in [cm]; default: (0,0,0)
79
//Bool_t mGaussianCoordinateSmearing; // use gaussian coordinate smearing (default);
80
81
Double_t
mPmin
;
// min.momentum
82
Double_t
mPmax
;
// max.momentum
83
Double_t
mThetaMin
;
// min.theta in [degree]; default: 0.0
84
Double_t
mThetaMax
;
// max.theta in [degree]; default: 180.0
85
bool
mUniformTheta
;
// use uniform rather than cos(theta) weighted distribution
86
Double_t
mPhiMin
;
// min.phi in [degree]; default: 0.0
87
Double_t
mPhiMax
;
// max.phi in [degree]; default: 360.
88
89
UInt_t
mMult
;
// multiplicity
90
91
private
:
92
std::vector<Int_t>
mPDGs
;
// PDGs
93
// This index will be run-long rather than event-long;
94
UInt_t
mFlipCounter
;
// current index in PDG vector
95
96
ClassDef
(
EicBoxGenerator
,8);
97
};
98
99
#endif
EicRoot
blob
master
eic
base
EicBoxGenerator.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:33
using
1.8.2 with
EIC GitHub integration