#include <CosmicsGenerator.h>
Definition at line 38 of file CosmicsGenerator.h.
◆ CosmicsGenerator()
CosmicsGenerator::CosmicsGenerator |
( |
| ) |
|
|
inline |
◆ ~CosmicsGenerator()
virtual CosmicsGenerator::~CosmicsGenerator |
( |
| ) |
|
|
inlinevirtual |
Definition at line 42 of file CosmicsGenerator.h.
42 {
44 cout<<
nInside<<
" events have been generated."<<endl;
45 cout<<
"There is a total of "<<
nInside<<
"/"<<
nTest<<
" muons that passed close enough to the detector."<<endl;
46 cout<<"Including the given weight this corresponds to ";
48 cout<<
" real cosmic muons = "<<
n_EVENTS<<
" simulated events)."<<endl;
49 };
◆ ClassDef()
◆ DetectorBox()
Bool_t CosmicsGenerator::DetectorBox |
( |
| ) |
|
|
protected |
◆ GenerateDynamics()
void CosmicsGenerator::GenerateDynamics |
( |
| ) |
|
|
protected |
Definition at line 58 of file CosmicsGenerator.cxx.
58 {
59
60 do{
62
65 px = TMath::Sin(phi)*TMath::Sin(
theta);
66 pz = TMath::Cos(phi)*TMath::Sin(
theta);
68
73}
double Uniform(Float_t min, Float_t max)
◆ Init()
Bool_t CosmicsGenerator::Init |
( |
Bool_t |
largeMom | ) |
|
|
virtual |
Definition at line 75 of file CosmicsGenerator.cxx.
75 {
76
78 TDatabasePDG* pdgBase = TDatabasePDG::Instance();
79 mass = pdgBase->GetParticle(13)->Mass();
80 cout<<"----------------------------------------------------------------------"<<endl;
81 cout<<"configuration for the CMBG as defined in $FAIRSHIP/python/CMBG_conf.py: "<<endl;
82 cout<<
"x_dist: "<<
xdist<<endl;
83 cout<<
"z_dist: "<<
zdist<<endl;
84 cout<<
"x_box: "<<
xBox<<endl;
85 cout<<
"y_box: "<<
yBox<<endl;
86 cout<<
"z_box: "<<
zBox<<endl;
88 cout<<
"minE: "<<
minE<<endl<<endl;
89 if (
xdist*
zdist*
n_EVENTS == 0){cout<<
"check the configuration for unphysical behavior."<<endl<<
"We stop the execution."<<endl<<endl;
return kFALSE;}
90
92 if (
high) cout<<
"Simulation for high momentum"<<endl;
93 else cout<<"Simulation for low momentum"<<endl;
94
95
96
97
98
99
100 double weight_flux, weight_DetectorBox;
103 if (
minE > 100) {cout<<
"choose minE < 100 !"<<endl;
return kFALSE;}
104 double dt = TMath::Pi()/2/100;
105 for (
double t= dt/2;
t< TMath::Pi()/2;
t += dt){
107 }
109 cout<<
"LowE CM flux with P < minE = "<<
minE<<
" : "<<
FluxIntegral<<
"m-2s-1"<<endl;
110 }
111 else {
113 cout<<
"HighE CM flux: "<<
FluxIntegral<<
"m-2s-1"<<endl;
114 }
120 }
122 weight = weight_flux / weight_DetectorBox;
123 cout<<
"weight_DetectorBox: "<< weight_DetectorBox<<
", weight: "<<
weight<<endl;
124 cout<<"----------------------------------------------------------------------"<<endl<<endl;
126
127 return kTRUE;
128}
double fSpectrumL(double theta, double minE, Bool_t generateP)
◆ ReadEvent()
Bool_t CosmicsGenerator::ReadEvent |
( |
FairPrimaryGenerator * |
cpg | ) |
|
public method ReadEvent
Definition at line 130 of file CosmicsGenerator.cxx.
130 {
131
133
135
141
142 cpg->AddTrack(
PID,
px,
py,
pz,
x,
y,
z,-1,
true,TMath::Sqrt(
P*
P+
mass*
mass),0,
weight);
143 if (!
nInside%10000){cout<<
nInside/10000<<
"10k events have been simulated"<<endl;}
144 return kTRUE;
145}
◆ FluxIntegral
double CosmicsGenerator::FluxIntegral |
|
protected |
◆ fRandomEngine
Co3Rng* CosmicsGenerator::fRandomEngine |
|
private |
◆ high
Bool_t CosmicsGenerator::high |
|
protected |
◆ mass
double CosmicsGenerator::mass |
|
protected |
◆ minE
double CosmicsGenerator::minE |
◆ n_EVENTS
int CosmicsGenerator::n_EVENTS |
◆ nInside
int CosmicsGenerator::nInside |
|
protected |
◆ nTest
int CosmicsGenerator::nTest |
|
protected |
double CosmicsGenerator::P |
|
protected |
◆ PID
int CosmicsGenerator::PID |
|
protected |
◆ px
double CosmicsGenerator::px |
|
protected |
◆ py
double CosmicsGenerator::py |
|
protected |
◆ pz
double CosmicsGenerator::pz |
|
protected |
◆ theta
double CosmicsGenerator::theta |
|
protected |
◆ weight
double CosmicsGenerator::weight |
|
protected |
◆ weighttest
double CosmicsGenerator::weighttest |
|
protected |
double CosmicsGenerator::x |
|
protected |
◆ xBox
double CosmicsGenerator::xBox |
◆ xdist
double CosmicsGenerator::xdist |
double CosmicsGenerator::y |
|
protected |
◆ yBox
double CosmicsGenerator::yBox |
double CosmicsGenerator::z |
|
protected |
◆ z0
double CosmicsGenerator::z0 |
◆ zBox
double CosmicsGenerator::zBox |
◆ zdist
double CosmicsGenerator::zdist |
The documentation for this class was generated from the following files: