30 #include "PrimaryGeneratorAction.hh"
31 #include "PrimaryGeneratorMessenger.hh"
57 beamMatrix = CLHEP::HepMatrix(32,32);
75 G4double x0,y0,z0,theta,phi,xMom0,yMom0,zMom0,e0,de;
78 x0=0; y0=0; z0=0; theta=0; phi=0; e0=0;
88 if (numEvent== 1) {theta = -0.00500; phi = -0.00500; de = -0.0050; }
89 if (numEvent== 2) {theta = -0.005/3; phi = -0.00500; de = -0.0050; }
90 if (numEvent== 3) {theta = 0.005/3; phi = -0.00500; de = -0.0050; }
91 if (numEvent== 4) {theta = 0.00500; phi = -0.00500; de = -0.0050; }
92 if (numEvent== 5) {theta = -0.00500; phi = -0.005/3; de = -0.0050; }
93 if (numEvent== 6) {theta = -0.005/3; phi = -0.005/3; de = -0.0050; }
94 if (numEvent== 7) {theta = 0.005/3; phi = -0.005/3; de = -0.0050; }
95 if (numEvent== 8) {theta = 0.00500; phi = -0.005/3; de = -0.0050; }
96 if (numEvent== 9) {theta = -0.00500; phi = 0.005/3; de = -0.0050; }
97 if (numEvent== 10) {theta = -0.005/3; phi = 0.005/3; de = -0.0050; }
98 if (numEvent== 11) {theta = 0.005/3; phi = 0.005/3; de = -0.0050; }
99 if (numEvent== 12) {theta = 0.00500; phi = 0.005/3; de = -0.0050; }
100 if (numEvent== 13) {theta = -0.00500; phi = 0.00500; de = -0.0050; }
101 if (numEvent== 14) {theta = -0.005/3; phi = 0.00500; de = -0.0050; }
102 if (numEvent== 15) {theta = 0.005/3; phi = 0.00500; de = -0.0050; }
103 if (numEvent== 16) {theta = 0.00500; phi = 0.00500; de = -0.0050; }
104 if (numEvent== 17) {theta = -0.00500; phi = -0.00500; de = 0.0050; }
105 if (numEvent== 18) {theta = -0.005/3; phi = -0.00500; de = 0.0050; }
106 if (numEvent== 19) {theta = 0.005/3; phi = -0.00500; de = 0.0050; }
107 if (numEvent== 20) {theta = 0.00500; phi = -0.00500; de = 0.0050; }
108 if (numEvent== 21) {theta = -0.00500; phi = -0.005/3; de = 0.0050; }
109 if (numEvent== 22) {theta = -0.005/3; phi = -0.005/3; de = 0.0050; }
110 if (numEvent== 23) {theta = 0.005/3; phi = -0.005/3; de = 0.0050; }
111 if (numEvent== 24) {theta = 0.00500; phi = -0.005/3; de = 0.0050; }
112 if (numEvent== 25) {theta = -0.00500; phi = 0.005/3; de = 0.0050; }
113 if (numEvent== 26) {theta = -0.005/3; phi = 0.005/3; de = 0.0050; }
114 if (numEvent== 27) {theta = 0.005/3; phi = 0.005/3; de = 0.0050; }
115 if (numEvent== 28) {theta = 0.00500; phi = 0.005/3; de = 0.0050; }
116 if (numEvent== 29) {theta = -0.00500; phi = 0.00500; de = 0.0050; }
117 if (numEvent== 30) {theta = -0.005/3; phi = 0.00500; de = 0.0050; }
118 if (numEvent== 31) {theta = 0.005/3; phi = 0.00500; de = 0.0050; }
119 if (numEvent== 32) {theta = 0.00500; phi = 0.00500; de = 0.0050; }
121 theta=theta*200*angleMax*1
e-3;
122 phi=phi*200*angleMax*1e-3;
138 theta = theta * 1000;
142 beamMatrix(numEvent,1) = cte;
144 beamMatrix(numEvent,2) = theta;
145 beamMatrix(numEvent,3) = phi;
146 beamMatrix(numEvent,4) = DE;
148 beamMatrix(numEvent,5) = theta * theta;
149 beamMatrix(numEvent,6) = theta * phi;
150 beamMatrix(numEvent,7) = phi * phi;
151 beamMatrix(numEvent,8) = theta * DE;
152 beamMatrix(numEvent,9) = phi * DE;
154 beamMatrix(numEvent,10) = theta * theta * theta;
155 beamMatrix(numEvent,11) = theta * theta * phi;
156 beamMatrix(numEvent,12) = theta * phi * phi;
157 beamMatrix(numEvent,13) = phi * phi * phi;
158 beamMatrix(numEvent,14) = theta * theta * DE;
159 beamMatrix(numEvent,15) = theta * phi * DE;
160 beamMatrix(numEvent,16) = phi * phi * DE;
162 beamMatrix(numEvent,17) = theta * theta * theta * phi;
163 beamMatrix(numEvent,18) = theta * theta * phi * phi;
164 beamMatrix(numEvent,19) = theta * phi * phi * phi;
165 beamMatrix(numEvent,20) = theta * theta * theta * DE;
166 beamMatrix(numEvent,21) = theta * theta * phi * DE;
167 beamMatrix(numEvent,22) = theta * phi * phi * DE;
168 beamMatrix(numEvent,23) = phi * phi * phi * DE;
170 beamMatrix(numEvent,24) = theta * theta * theta * phi * phi;
171 beamMatrix(numEvent,25) = theta * theta * phi * phi * phi;
172 beamMatrix(numEvent,26) = theta * theta * theta * phi * DE;
173 beamMatrix(numEvent,27) = theta * theta * phi * phi * DE;
174 beamMatrix(numEvent,28) = theta * phi * phi * phi * DE;
176 beamMatrix(numEvent,29) = theta * theta * theta * phi * phi * phi;
177 beamMatrix(numEvent,30) = theta * theta * theta * phi * phi * DE;
178 beamMatrix(numEvent,31) = theta * theta * phi * phi * phi * DE;
180 beamMatrix(numEvent,32) = theta * theta * theta * phi * phi * phi * DE;
185 theta = theta / 1000;
196 e0= G4RandGauss::shoot(3*
MeV,5.0955
e-5*
MeV);
197 while (aR < 0) aR = G4RandGauss::shoot(0.10
e-3 , 0.06
e-3/2.35) *
rad;
199 theta = aR * std::cos(angle);
200 phi = aR * std::sin(angle);
202 x0 = rR*std::cos(angle);
203 y0 = rR*std::sin(angle);
204 x0 = G4RandGauss::shoot(x0,220/2.35) *
micrometer;
205 theta = G4RandGauss::shoot(theta,0.03
e-3/2.35);
206 y0 = G4RandGauss::shoot(y0,220/2.35) *
micrometer;
207 phi = G4RandGauss::shoot(phi,0.03
e-3/2.35);
209 if (std::sqrt(x0*x0+y0*y0)/
micrometer<2000) shoot=
true;
224 G4cout <<
"-> Event= " << numEvent<<
": X0(mm)= " << x0/
mm <<
" X0(mm) = " << y0/
mm <<
" Z0(m) = " << z0/
m
225 <<
" THETA(mrad)= " << theta/
mrad <<
" PHI(mrad)= " << phi/
mrad <<
" E0(MeV)= " << e0/
MeV <<
G4endl;
227 xMom0 = std::sin(theta);
228 yMom0 = std::sin(phi);
229 zMom0 = std::sqrt(1.-xMom0*xMom0-yMom0*yMom0);
260 return std::pow(20000*angle, 13);