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