CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/GeneratorInterface/CosmicMuonGenerator/interface/CMSCGEN.h

Go to the documentation of this file.
00001 #ifndef CMSCGEN_h
00002 #define CMSCGEN_h
00003 
00004 //
00005 // CMSCGEN.cc  version 3.0     Thomas Hebbeker 2007-05-15  
00006 //
00007 // implemented in CMSSW by P. Biallass 2007-05-28 
00008 //
00009 // documentation: CMS internal note 2007 "Improved Parametrization of the Cosmic Muon Flux for the generator CMSCGEN" by Biallass + Hebbeker
00010 //
00011 // inspired by fortran version l3cgen.f, version 4.0, 1999
00012 //
00013 // history: new version of parametrization of energy and angular distribution of cosmic muons,
00014 //          now based on new version 6.60 of CORSIKA (2007). Revisited parametrization, now using slightly different polynomials and new coefficients.
00015 //
00016 // new range: 3...3000 GeV, cos(incident angle) = 0.1...1 which means theta=0°...84.26° where z-axis vertical axis  
00017 //            Now parametrization obtained from full range, thus no extrapolation to any angles or energies needed any more.
00018 // accuracy: now well known, see internal note for details
00019 //           7% for range 10...500 GeV, 50% for 3000 GeV and 25% for 3 GeV
00020 
00021 
00022 #include <iostream>
00023 
00024 #include "GeneratorInterface/CosmicMuonGenerator/interface/CosmicMuonParameters.h"
00025 
00026 namespace CLHEP {
00027   class HepRandomEngine;
00028 }
00029 
00030 class CMSCGEN 
00031 {
00032 
00033 // all units: GeV 
00034 
00035 private:
00036 
00037   int initialization;  // energy and cos theta range set ?
00038 
00039   double pmin;
00040   double pmax;
00041   double cmin;
00042   double cmax;
00043   double cmin_in;
00044   double cmax_in;
00045 
00046   double pq;
00047   double c; 
00048 
00049   double xemin;
00050   double xemax;
00051 
00052   double pmin_min;
00053   double pmin_max;
00054 
00055   double cmax_min;
00056   double cmax_max;
00057 
00058   double Lmin;
00059   double Lmax;
00060   double Lfac;
00061 
00062   double c1;
00063   double c2;
00064 
00065   double b0;
00066   double b1;
00067   double b2;
00068 
00069   double integrated_flux;
00070 
00071   double cemax;
00072 
00073   double pe[9];
00074   double b0c[3], b1c[3], b2c[3];
00075   double corr[101];
00076 
00077 
00078   CLHEP::HepRandomEngine *RanGen2; // random number generator
00079   bool delRanGen;
00080 
00081   bool TIFOnly_const;
00082   bool TIFOnly_lin;
00083 
00084 
00085   //variables for upgoing muons from neutrinos
00086   double enumin;
00087   double enumax;
00088 
00089 public:
00090 
00091   // constructor
00092   CMSCGEN();
00093 
00094   //destructor
00095   ~CMSCGEN();
00096 
00097         // to set the energy and cos theta range
00098   int initialize(double,double,double,double,CLHEP::HepRandomEngine*,bool,bool);
00099   int initialize(double,double,double,double,int,bool,bool);
00100 
00101   int generate();
00102        // to generate energy*charge and cos theta for one cosmic
00103 
00104   double momentum_times_charge();
00105 
00106   double cos_theta();
00107 
00108   double flux();
00109    
00110   //upward going muons from neutrinos
00111   int initializeNuMu(double, double, double, double, double, double, double, double, double, CLHEP::HepRandomEngine*);
00112   int initializeNuMu(double, double, double, double, double, double, double, double, double, int);
00113   int generateNuMu();
00114 
00115 
00116 
00117   double Rnunubar; //Ration of nu to nubar
00118   double ProdAlt; //production altitude in atmosphere
00119   double sigma;
00120   double AR;
00121   double dNdEmudEnu(double Enu, double Emu, double theta);
00122   double dNdEmudEnuMax;
00123   double negabs, negfrac;
00124 
00125 };
00126 #endif
00127