CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CMSCGENnorm.cc
Go to the documentation of this file.
1 //
2 // CMSCGENnorm.cc P. Biallass 2006
3 //
4 // code based on l3cgen.f by T.Hebbeker
5 // implemented in CMSSW by P. Biallass 11.04.2006
6 // see header for documentation
7 //
8 
10 
11 //count muons which are around 100GeV and theta<33 deg (~vertical), do this for EVERY generated cosmic
12 
14  if (energy > 99.5 && energy < 100.5) {
15  n100 = n100 + 1;
16 
17  if (1. - cos(theta) < 1. / (2. * Pi)) { //theta is in rad
18  n100cos = n100cos + 1;
19  }
20  }
21  return n100cos;
22 }
23 
24 // determine normalization using known flux, do this in the end. Percentage of rejected events and surface needs to be corrected for later!
25 // Note that the number of actually DICED cosmics is needed for normalisation, and sufficient statistics to have muons at 100 GeV!
26 
27 float CMSCGENnorm::norm(int n100cos) {
28  flux = 2.63e-3; // +- 0.06e-3 [1/m**2/sr/GeV/s]
29 
30  n = n100cos; // [1/sr/GeV]
31 
32  //rate=N/runtime --> Nnorm ~ (1/runtime/m^2 at surface plane) as rate corresponds to known flux
33  Nnorm = flux / n;
34 
35  //err of Nnorm = Nnorm* 1/sqrt(n)
36 
37  return Nnorm;
38 }
const double Pi
float norm(int n100cos)
Definition: CMSCGENnorm.cc:27
int events_n100cos(double energy, double theta)
Definition: CMSCGENnorm.cc:13
Geom::Theta< T > theta() const
float flux
Definition: CMSCGENnorm.h:34
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float Nnorm
Definition: CMSCGENnorm.h:35