CMS 3D CMS Logo

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 
9 
11 
12 
13 //count muons which are around 100GeV and theta<33 deg (~vertical), do this for EVERY generated cosmic
14 
16 {
17  if(energy > 99.5 && energy < 100.5){
18  n100=n100+1;
19 
20  if(1.-cos(theta) < 1./(2.*Pi)) { //theta is in rad
21  n100cos = n100cos + 1 ;
22  }
23  }
24  return n100cos;
25 }
26 
27 
28 // determine normalization using known flux, do this in the end. Percentage of rejected events and surface needs to be corrected for later!
29 // Note that the number of actually DICED cosmics is needed for normalisation, and sufficient statistics to have muons at 100 GeV!
30 
32 {
33  flux = 2.63e-3 ; // +- 0.06e-3 [1/m**2/sr/GeV/s]
34 
35  n = n100cos ; // [1/sr/GeV]
36 
37  //rate=N/runtime --> Nnorm ~ (1/runtime/m^2 at surface plane) as rate corresponds to known flux
38  Nnorm = flux/n ;
39 
40  //err of Nnorm = Nnorm* 1/sqrt(n)
41 
42  return Nnorm;
43 }
44 
45 
const double Pi
float norm(int n100cos)
Definition: CMSCGENnorm.cc:31
int events_n100cos(double energy, double theta)
Definition: CMSCGENnorm.cc:15
Geom::Theta< T > theta() const
float flux
Definition: CMSCGENnorm.h:39
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float Nnorm
Definition: CMSCGENnorm.h:40