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
28
29#include "CLHEP/Random/RandFlat.h"
30#include "CLHEP/Random/RandGauss.h"
31#include "CLHEP/Vector/LorentzVector.h"
32
33class IBesRndmGenSvc;
34
36 enum {FixedMode = 1, GaussMode = 2,FlatMode = 3};
37};
39 enum {EMode = 1, PtMode = 2};
40};
41
43public:
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
51private:
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
TTree * sigma
manage multiple CLHEP random engines as named streams
virtual StatusCode fillEvt(GenEvent *evt)
virtual StatusCode genFinalize()
virtual StatusCode genInitialize()
virtual StatusCode callGenerator()