CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CMSCGEN.h
Go to the documentation of this file.
1 #ifndef CMSCGEN_h
2 #define CMSCGEN_h
3 
4 //
5 // CMSCGEN.cc version 3.0 Thomas Hebbeker 2007-05-15
6 //
7 // implemented in CMSSW by P. Biallass 2007-05-28
8 //
9 // documentation: CMS internal note 2007 "Improved Parametrization of the Cosmic Muon Flux for the generator CMSCGEN" by Biallass + Hebbeker
10 //
11 // inspired by fortran version l3cgen.f, version 4.0, 1999
12 //
13 // history: new version of parametrization of energy and angular distribution of cosmic muons,
14 // now based on new version 6.60 of CORSIKA (2007). Revisited parametrization, now using slightly different polynomials and new coefficients.
15 //
16 // new range: 3...3000 GeV, cos(incident angle) = 0.1...1 which means theta=0°...84.26° where z-axis vertical axis
17 // Now parametrization obtained from full range, thus no extrapolation to any angles or energies needed any more.
18 // accuracy: now well known, see internal note for details
19 // 7% for range 10...500 GeV, 50% for 3000 GeV and 25% for 3 GeV
20 
21 #include <iostream>
22 
24 
25 namespace CLHEP {
26  class HepRandomEngine;
27 }
28 
29 class CMSCGEN {
30  // all units: GeV
31 
32 private:
33  int initialization; // energy and cos theta range set ?
34 
35  double pmin;
36  double pmax;
37  double cmin;
38  double cmax;
39  double cmin_in;
40  double cmax_in;
41 
42  double pq;
43  double c;
44 
45  double xemin;
46  double xemax;
47 
48  double pmin_min;
49  double pmin_max;
50 
51  double cmax_min;
52  double cmax_max;
53 
54  double Lmin;
55  double Lmax;
56  double Lfac;
57 
58  double c1;
59  double c2;
60 
61  double b0;
62  double b1;
63  double b2;
64 
66 
67  double cemax;
68 
69  double pe[9];
70  double b0c[3], b1c[3], b2c[3];
71  double corr[101];
72 
73  CLHEP::HepRandomEngine* RanGen2; // random number generator
74  bool delRanGen;
75 
78 
79  //variables for upgoing muons from neutrinos
80  double enumin;
81  double enumax;
82 
83 public:
84  // constructor
85  CMSCGEN();
86 
87  //destructor
88  ~CMSCGEN();
89 
90  void setRandomEngine(CLHEP::HepRandomEngine* v);
91 
92  // to set the energy and cos theta range
93  int initialize(double, double, double, double, CLHEP::HepRandomEngine*, bool, bool);
94  int initialize(double, double, double, double, int, bool, bool);
95 
96  int generate();
97  // to generate energy*charge and cos theta for one cosmic
98 
99  double momentum_times_charge();
100 
101  double cos_theta();
102 
103  double flux();
104 
105  //upward going muons from neutrinos
106  int initializeNuMu(double, double, double, double, double, double, double, double, double, CLHEP::HepRandomEngine*);
107  int initializeNuMu(double, double, double, double, double, double, double, double, double, int);
108  int generateNuMu();
109 
110  double Rnunubar; //Ration of nu to nubar
111  double ProdAlt; //production altitude in atmosphere
112  double sigma;
113  double AR;
114  double dNdEmudEnu(double Enu, double Emu, double theta);
116  double negabs, negfrac;
117 };
118 #endif
double enumax
Definition: CMSCGEN.h:81
double sigma
Definition: CMSCGEN.h:112
double b1c[3]
Definition: CMSCGEN.h:70
double AR
Definition: CMSCGEN.h:113
double c2
Definition: CMSCGEN.h:59
double pmax
Definition: CMSCGEN.h:36
CLHEP::HepRandomEngine * RanGen2
Definition: CMSCGEN.h:73
double ProdAlt
Definition: CMSCGEN.h:111
Geom::Theta< T > theta() const
int initialize(double, double, double, double, CLHEP::HepRandomEngine *, bool, bool)
Definition: CMSCGEN.cc:27
void setRandomEngine(CLHEP::HepRandomEngine *v)
Definition: CMSCGEN.cc:20
double negfrac
Definition: CMSCGEN.h:116
CMSCGEN()
Definition: CMSCGEN.cc:13
double c1
Definition: CMSCGEN.h:58
int initialization
Definition: CMSCGEN.h:33
double corr[101]
Definition: CMSCGEN.h:71
double b0
Definition: CMSCGEN.h:61
double cmax_min
Definition: CMSCGEN.h:51
double cmin_in
Definition: CMSCGEN.h:39
~CMSCGEN()
Definition: CMSCGEN.cc:15
double cmax
Definition: CMSCGEN.h:38
bool TIFOnly_const
Definition: CMSCGEN.h:76
double xemin
Definition: CMSCGEN.h:45
double cos_theta()
Definition: CMSCGEN.cc:431
double cmax_max
Definition: CMSCGEN.h:52
double Lfac
Definition: CMSCGEN.h:56
bool delRanGen
Definition: CMSCGEN.h:74
int generate()
Definition: CMSCGEN.cc:249
double flux()
Definition: CMSCGEN.cc:441
double negabs
Definition: CMSCGEN.h:116
double b0c[3]
Definition: CMSCGEN.h:70
double b2
Definition: CMSCGEN.h:63
double Lmax
Definition: CMSCGEN.h:55
double integrated_flux
Definition: CMSCGEN.h:65
bool TIFOnly_lin
Definition: CMSCGEN.h:77
double pmin_min
Definition: CMSCGEN.h:48
double cmin
Definition: CMSCGEN.h:37
double pmin
Definition: CMSCGEN.h:35
double momentum_times_charge()
Definition: CMSCGEN.cc:422
double pe[9]
Definition: CMSCGEN.h:69
double pmin_max
Definition: CMSCGEN.h:49
double b1
Definition: CMSCGEN.h:62
double b2c[3]
Definition: CMSCGEN.h:70
double dNdEmudEnu(double Enu, double Emu, double theta)
Definition: CMSCGEN.cc:544
double xemax
Definition: CMSCGEN.h:46
double pq
Definition: CMSCGEN.h:42
double cemax
Definition: CMSCGEN.h:67
double c
Definition: CMSCGEN.h:43
int initializeNuMu(double, double, double, double, double, double, double, double, double, CLHEP::HepRandomEngine *)
Definition: CMSCGEN.cc:450
int generateNuMu()
Definition: CMSCGEN.cc:556
double cmax_in
Definition: CMSCGEN.h:40
double enumin
Definition: CMSCGEN.h:80
double Lmin
Definition: CMSCGEN.h:54
double dNdEmudEnuMax
Definition: CMSCGEN.h:115
double Rnunubar
Definition: CMSCGEN.h:110