src
GeneratorInterface
CosmicMuonGenerator
src
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
#include "
GeneratorInterface/CosmicMuonGenerator/interface/CMSCGENnorm.h
"
10
11
//count muons which are around 100GeV and theta<33 deg (~vertical), do this for EVERY generated cosmic
12
13
int
CMSCGENnorm::events_n100cos
(
double
energy
,
double
theta
) {
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
}
Pi
const double Pi
Definition:
CosmicMuonParameters.h:18
CMSCGENnorm::n100cos
int n100cos
Definition:
CMSCGENnorm.h:32
CMSCGENnorm::norm
float norm(int n100cos)
Definition:
CMSCGENnorm.cc:27
CMSCGENnorm::events_n100cos
int events_n100cos(double energy, double theta)
Definition:
CMSCGENnorm.cc:13
CMSCGENnorm::n
int n
Definition:
CMSCGENnorm.h:33
CMSCGENnorm::n100
int n100
Definition:
CMSCGENnorm.h:31
tauSpinnerTable_cfi.theta
theta
Definition:
tauSpinnerTable_cfi.py:7
CMSCGENnorm.h
HBHEDarkening_cff.energy
energy
Definition:
HBHEDarkening_cff.py:10
CMSCGENnorm::flux
float flux
Definition:
CMSCGENnorm.h:34
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
CMSCGENnorm::Nnorm
float Nnorm
Definition:
CMSCGENnorm.h:35
Generated for CMSSW Reference Manual by
1.8.14