elegent is hosted by Hepforge, IPPP Durham
Elegent
Generator.h
1 /********************************************************************************
2 
3  Copyright 2013 Jan Kašpar
4 
5  This file is part of Elegent (http://elegent.hepforge.org/).
6 
7  Elegent is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Elegent is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Elegent. If not, see <http://www.gnu.org/licenses/>.
19 
20 ********************************************************************************/
21 
22 #ifndef _elegent_elegent_
23 #define _elegent_elegent_
24 
25 #include <string>
26 
27 class TGraph;
28 
29 namespace HepMC {
30  class GenEvent;
31 }
32 
33 namespace Elegent
34 {
35 
41 class Generator
42 {
43  public:
44  Generator(const std::string &_file, const std::string &_path, double _t_min, double _t_max, unsigned int _verbosity=1);
45  ~Generator() {}
46 
47  unsigned int Init();
48 
49  static const int PID = 2212;
50  static const int ElasticScattering = 91;
51  static const int FinalState = 1;
52  static const int NullState = 0;
53 
54  protected:
56  std::string fileName;
57 
59  std::string modelPath;
60 
62  double t_min, t_max;
63 
65  unsigned int verbosity;
66 
68  double E_cms;
69 
71  double p_cms;
72 
74  TGraph *icdf;
75 
76  public:
78  void GenerateBase(double rn1, double rn2, HepMC::GenEvent* gE);
79 
81  void Generate(HepMC::GenEvent* gE);
82 };
83 
84 } // namespace
85 
86 #endif
Definition: BHModel.h:28
double t_min
|t| values in GeV^2, bounds for CDF
Definition: Generator.h:62
std::string fileName
name of file containing the cumulative distribution function (CDF)
Definition: Generator.h:56
TGraph * icdf
graph with inverse c.d.f.
Definition: Generator.h:74
MC generator of proton-proton elastic scattering events.
Definition: Generator.h:41
void GenerateBase(double rn1, double rn2, HepMC::GenEvent *gE)
generates one event provided two random numbers with uniform distribution on (0, 1) ...
Definition: Generator.cc:138
void Generate(HepMC::GenEvent *gE)
generates one event, using ROOT random number generator TRandom2
Definition: Generator.cc:181
unsigned int verbosity
verbosity level (0 = no, 1 = normal, 2 = debug)
Definition: Generator.h:65
double p_cms
[GeV] cms proton momentum
Definition: Generator.h:71
std::string modelPath
path of the (CDF) within the file
Definition: Generator.h:59
double E_cms
[GeV] cms (one) proton energy
Definition: Generator.h:68
Definition: Generator.h:29