BOSS
7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
SingleParticleGun.h
Go to the documentation of this file.
1
// --------------------------------------------------
2
//
3
// File: SingleParticleGun/SingleParticleGun.h
4
// Description:
5
// This code is used to generate a single particle or a poissonly
6
// distributed set of particles with pt, theta and phi selected as
7
// specified by the JobOptionsService. Three modes of generation are
8
// possible:
9
// FixedMode: Generation with a fixed value
10
// GaussianMode: Generation with a gaussian of specified mean and
11
// sigma
12
// FlatMode: Generation of a flat distribution between a specified
13
// minimum and maximum value
14
// The mode can be separately selected for pt, theta and phi.
15
// or for E, theta and phi
16
// in PtMode user specifies Pt theta and phi
17
// in EMode user specifies E, theta and phi
18
// The particle species can also be specified
19
//
20
// The output will be stored in the transient event store so it can be
21
// passed to the simulation.
22
23
24
#ifndef GENERATORMODULESSINGLEPARTICLEGUN_H
25
#define GENERATORMODULESSINGLEPARTICLEGUN_H
26
27
#include "
GeneratorModule/GenModule.h
"
28
29
#include "CLHEP/Random/RandFlat.h"
30
#include "CLHEP/Random/RandGauss.h"
31
#include "CLHEP/Vector/LorentzVector.h"
32
33
class
IBesRndmGenSvc
;
34
35
struct
SingleParticleGunGenMode
{
36
enum
{
FixedMode
= 1,
GaussMode
= 2,
FlatMode
= 3};
37
};
38
struct
SingleEnergyMode
{
39
enum
{
EMode
= 1,
PtMode
= 2};
40
};
41
42
class
SingleParticleGun
:
public
GenModule
{
43
public
:
44
SingleParticleGun
(
const
std::string& name, ISvcLocator* pSvcLocator);
45
virtual
~SingleParticleGun
();
46
virtual
StatusCode
genInitialize
();
47
virtual
StatusCode
callGenerator
();
48
virtual
StatusCode
genFinalize
();
49
virtual
StatusCode
fillEvt
(GenEvent* evt);
50
51
private
:
52
// Setable Properties:-
53
double
m_requestedPt;
54
double
m_requestedPhi;
55
double
m_requestedE;
56
double
m_requestedTheta;
57
double
m_requestedX;
58
double
m_requestedY;
59
double
m_requestedZ;
60
double
m_requestedT;
61
double
m_minPt;
62
double
m_minE;
63
double
m_minTheta;
64
double
m_minPhi;
65
double
m_maxE;
66
double
m_maxPt;
67
double
m_maxTheta;
68
double
m_maxPhi;
69
double
m_sigmaPt;
70
double
m_sigmaE;
71
double
m_sigmaTheta;
72
double
m_sigmaPhi;
73
int
m_PtGenMode;
74
int
m_EGenMode;
75
int
m_ThetaGenMode;
76
int
m_PhiGenMode;
77
int
m_pdgCode;
78
int
m_Emode;
79
// event counter
80
int
m_events ;
81
82
// Local Member Data:-
83
IBesRndmGenSvc
* p_BesRndmGenSvc;
84
std::vector<long int> m_seeds;
85
86
double
m_mass;
87
CLHEP::HepLorentzVector m_fourMom;
88
CLHEP::HepLorentzVector m_fourPos;
89
90
91
// Private Methods:=
92
double
generateValue(
int
mode,
double
val,
double
sigma
,
double
min
,
93
double
max
);
94
95
};
96
97
#endif
sigma
TTree * sigma
Definition:
CurConst_dEdXCal.cxx:6
min
#define min(a, b)
Definition:
Eepipi/Eepipi-00-01-00/src/ee2eepp/basesv5.1/f2c.h:153
max
#define max(a, b)
Definition:
Eepipi/Eepipi-00-01-00/src/ee2eepp/basesv5.1/f2c.h:154
GenModule.h
GenModule
Definition:
GenModule.h:41
IBesRndmGenSvc
manage multiple CLHEP random engines as named streams
Definition:
IBesRndmGenSvc.h:24
SingleParticleGun
Definition:
SingleParticleGun.h:42
SingleParticleGun::fillEvt
virtual StatusCode fillEvt(GenEvent *evt)
Definition:
SingleParticleGun.cxx:225
SingleParticleGun::genFinalize
virtual StatusCode genFinalize()
Definition:
SingleParticleGun.cxx:219
SingleParticleGun::genInitialize
virtual StatusCode genInitialize()
Definition:
SingleParticleGun.cxx:87
SingleParticleGun::callGenerator
virtual StatusCode callGenerator()
Definition:
SingleParticleGun.cxx:158
SingleParticleGun::~SingleParticleGun
virtual ~SingleParticleGun()
Definition:
SingleParticleGun.cxx:80
SingleEnergyMode
Definition:
SingleParticleGun.h:38
SingleEnergyMode::PtMode
@ PtMode
Definition:
SingleParticleGun.h:39
SingleEnergyMode::EMode
@ EMode
Definition:
SingleParticleGun.h:39
SingleParticleGunGenMode
Definition:
SingleParticleGun.h:35
SingleParticleGunGenMode::FixedMode
@ FixedMode
Definition:
SingleParticleGun.h:36
SingleParticleGunGenMode::GaussMode
@ GaussMode
Definition:
SingleParticleGun.h:36
SingleParticleGunGenMode::FlatMode
@ FlatMode
Definition:
SingleParticleGun.h:36
source
Generator
SingleParticleGun
SingleParticleGun-01-01-01
SingleParticleGun
SingleParticleGun.h
Generated by
1.9.6