BOSS
8.0.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
#ifndef GENERATORMODULESSINGLEPARTICLEGUN_H
24
#define GENERATORMODULESSINGLEPARTICLEGUN_H
25
26
#include "GeneratorModule/GenModule.h"
27
28
#include "CLHEP/Random/RandFlat.h"
29
#include "CLHEP/Random/RandGauss.h"
30
#include "CLHEP/Vector/LorentzVector.h"
31
32
class
IBesRndmGenSvc
;
33
34
struct
SingleParticleGunGenMode
{
35
enum
{
FixedMode
= 1,
GaussMode
= 2,
FlatMode
= 3 };
36
};
37
struct
SingleEnergyMode
{
38
enum
{
EMode
= 1,
PtMode
= 2 };
39
};
40
41
class
SingleParticleGun
:
public
GenModule
{
42
public
:
43
SingleParticleGun
(
const
std::string& name, ISvcLocator* pSvcLocator );
44
virtual
~SingleParticleGun
();
45
virtual
StatusCode
genInitialize
();
46
virtual
StatusCode
callGenerator
();
47
virtual
StatusCode
genFinalize
();
48
virtual
StatusCode
fillEvt
( GenEvent* evt );
49
50
private
:
51
// Setable Properties:-
52
double
m_requestedPt;
53
double
m_requestedPhi;
54
double
m_requestedE;
55
double
m_requestedTheta;
56
double
m_requestedX;
57
double
m_requestedY;
58
double
m_requestedZ;
59
double
m_requestedT;
60
double
m_minPt;
61
double
m_minE;
62
double
m_minTheta;
63
double
m_minPhi;
64
double
m_maxE;
65
double
m_maxPt;
66
double
m_maxTheta;
67
double
m_maxPhi;
68
double
m_sigmaPt;
69
double
m_sigmaE;
70
double
m_sigmaTheta;
71
double
m_sigmaPhi;
72
int
m_PtGenMode;
73
int
m_EGenMode;
74
int
m_ThetaGenMode;
75
int
m_PhiGenMode;
76
int
m_pdgCode;
77
int
m_Emode;
78
// event counter
79
int
m_events;
80
81
// Local Member Data:-
82
IBesRndmGenSvc
* p_BesRndmGenSvc;
83
std::vector<long int> m_seeds;
84
85
double
m_mass;
86
CLHEP::HepLorentzVector m_fourMom;
87
CLHEP::HepLorentzVector m_fourPos;
88
89
// Private Methods:=
90
double
generateValue(
int
mode,
double
val,
double
sigma,
double
min
,
double
max
);
91
};
92
93
#endif
min
#define min(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:157
max
#define max(a, b)
Definition
Eepipi/src/ee2eepp/basesv5.1/f2c.h:158
GenModule::GenModule
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Definition
GenModule.cxx:37
IBesRndmGenSvc
manage multiple CLHEP random engines as named streams
Definition
Control/BesRndmGenSvc/include/BesRndmGenSvc/IBesRndmGenSvc.h:23
SingleParticleGun::fillEvt
virtual StatusCode fillEvt(GenEvent *evt)
Definition
SingleParticleGun.cxx:233
SingleParticleGun::genFinalize
virtual StatusCode genFinalize()
Definition
SingleParticleGun.cxx:227
SingleParticleGun::genInitialize
virtual StatusCode genInitialize()
Definition
SingleParticleGun.cxx:86
SingleParticleGun::callGenerator
virtual StatusCode callGenerator()
Definition
SingleParticleGun.cxx:167
SingleParticleGun::SingleParticleGun
SingleParticleGun(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SingleParticleGun.cxx:34
SingleParticleGun::~SingleParticleGun
virtual ~SingleParticleGun()
Definition
SingleParticleGun.cxx:79
SingleEnergyMode
Definition
SingleParticleGun.h:37
SingleEnergyMode::PtMode
@ PtMode
Definition
SingleParticleGun.h:38
SingleEnergyMode::EMode
@ EMode
Definition
SingleParticleGun.h:38
SingleParticleGunGenMode
Definition
SingleParticleGun.h:34
SingleParticleGunGenMode::FixedMode
@ FixedMode
Definition
SingleParticleGun.h:35
SingleParticleGunGenMode::GaussMode
@ GaussMode
Definition
SingleParticleGun.h:35
SingleParticleGunGenMode::FlatMode
@ FlatMode
Definition
SingleParticleGun.h:35
8.0.0
BOSS_Gen
SingleParticleGun
src
SingleParticleGun.h
Generated by
1.16.1