Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:04:13

0001 #ifndef CMSCGEN_h
0002 #define CMSCGEN_h
0003 
0004 //
0005 // CMSCGEN.cc  version 3.0     Thomas Hebbeker 2007-05-15
0006 //
0007 // implemented in CMSSW by P. Biallass 2007-05-28
0008 //
0009 // documentation: CMS internal note 2007 "Improved Parametrization of the Cosmic Muon Flux for the generator CMSCGEN" by Biallass + Hebbeker
0010 //
0011 // inspired by fortran version l3cgen.f, version 4.0, 1999
0012 //
0013 // history: new version of parametrization of energy and angular distribution of cosmic muons,
0014 //          now based on new version 6.60 of CORSIKA (2007). Revisited parametrization, now using slightly different polynomials and new coefficients.
0015 //
0016 // new range: 3...3000 GeV, cos(incident angle) = 0.1...1 which means theta=0°...84.26° where z-axis vertical axis
0017 //            Now parametrization obtained from full range, thus no extrapolation to any angles or energies needed any more.
0018 // accuracy: now well known, see internal note for details
0019 //           7% for range 10...500 GeV, 50% for 3000 GeV and 25% for 3 GeV
0020 
0021 #include <iostream>
0022 
0023 #include "GeneratorInterface/CosmicMuonGenerator/interface/CosmicMuonParameters.h"
0024 
0025 namespace CLHEP {
0026   class HepRandomEngine;
0027 }
0028 
0029 class CMSCGEN {
0030   // all units: GeV
0031 
0032 private:
0033   int initialization;  // energy and cos theta range set ?
0034 
0035   double pmin;
0036   double pmax;
0037   double cmin;
0038   double cmax;
0039   double cmin_in;
0040   double cmax_in;
0041 
0042   double pq;
0043   double c;
0044 
0045   double xemin;
0046   double xemax;
0047 
0048   double pmin_min;
0049   double pmin_max;
0050 
0051   double cmax_min;
0052   double cmax_max;
0053 
0054   double Lmin;
0055   double Lmax;
0056   double Lfac;
0057 
0058   double c1;
0059   double c2;
0060 
0061   double b0;
0062   double b1;
0063   double b2;
0064 
0065   double integrated_flux;
0066 
0067   double cemax;
0068 
0069   double pe[9];
0070   double b0c[3], b1c[3], b2c[3];
0071   double corr[101];
0072 
0073   CLHEP::HepRandomEngine* RanGen2;  // random number generator
0074   bool delRanGen;
0075 
0076   bool TIFOnly_const;
0077   bool TIFOnly_lin;
0078 
0079   //variables for upgoing muons from neutrinos
0080   double enumin;
0081   double enumax;
0082 
0083 public:
0084   // constructor
0085   CMSCGEN();
0086 
0087   //destructor
0088   ~CMSCGEN();
0089 
0090   void setRandomEngine(CLHEP::HepRandomEngine* v);
0091 
0092   // to set the energy and cos theta range
0093   int initialize(double, double, double, double, CLHEP::HepRandomEngine*, bool, bool);
0094   int initialize(double, double, double, double, int, bool, bool);
0095 
0096   int generate();
0097   // to generate energy*charge and cos theta for one cosmic
0098 
0099   double momentum_times_charge();
0100 
0101   double cos_theta();
0102 
0103   double flux();
0104 
0105   //upward going muons from neutrinos
0106   int initializeNuMu(double, double, double, double, double, double, double, double, double, CLHEP::HepRandomEngine*);
0107   int initializeNuMu(double, double, double, double, double, double, double, double, double, int);
0108   int generateNuMu();
0109 
0110   double Rnunubar;  //Ration of nu to nubar
0111   double ProdAlt;   //production altitude in atmosphere
0112   double sigma;
0113   double AR;
0114   double dNdEmudEnu(double Enu, double Emu, double theta);
0115   double dNdEmudEnuMax;
0116   double negabs, negfrac;
0117 };
0118 #endif