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
32class IBesRndmGenSvc;
33
35 enum { FixedMode = 1, GaussMode = 2, FlatMode = 3 };
36};
38 enum { EMode = 1, PtMode = 2 };
39};
40
42public:
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
50private:
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
#define min(a, b)
#define max(a, b)
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Definition GenModule.cxx:37
manage multiple CLHEP random engines as named streams
virtual StatusCode fillEvt(GenEvent *evt)
virtual StatusCode genFinalize()
virtual StatusCode genInitialize()
virtual StatusCode callGenerator()
SingleParticleGun(const std::string &name, ISvcLocator *pSvcLocator)