Rev 70 | Rev 73 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 70 | Rev 72 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | 10 | ||
11 | // Set the simulation parameters |
11 | // Set the simulation parameters |
12 | void showVisual(int b) {show_3d = b;} |
12 | void showVisual(int b) {show_3d = b;} |
13 | void showData(int b) {show_data = b;} |
13 | void showData(int b) {show_data = b;} |
14 | 14 | ||
15 | // Set the initial detector parameters (a, b, d, activeDetector, n1, n2, n3, |
15 | // Set the initial detector parameters (a, b, d, activeDetector, n1, n2, n3, gap, badCoupling) |
16 | DetectorParameters parameters(3.0, 5.0, 3.0, 3.0, 1, 1.53, 1.46, TVector3(0.3, 0, 0)); |
16 | DetectorParameters parameters(3.0, 5.0, 3.0, 3.0, 1, 1.53, 1.46, TVector3(0.3, 0, 0), false); |
17 | // Print the detector parameters |
17 | // Print the detector parameters |
18 | void getParameters(); |
18 | void getParameters(); |
19 | 19 | ||
20 | //void SetLGType(int in = 1, int side = 1, int out = 0) |
20 | //void SetLGType(int in = 1, int side = 1, int out = 0) |
21 | //{detector->SetLGType(in, side, out);} |
21 | //{detector->SetLGType(in, side, out);} |
Line 191... | Line 191... | ||
191 | PrintGuideStat(izkoristek); |
191 | PrintGuideStat(izkoristek); |
192 | DrawData(detector, parameters, theta, izkoristek); |
192 | DrawData(detector, parameters, theta, izkoristek); |
193 | } |
193 | } |
194 | //------------------------------------------------------------------------------------------ |
194 | //------------------------------------------------------------------------------------------ |
195 | // Propagate NN rays generated as grid and show the statistics |
195 | // Propagate NN rays generated as grid and show the statistics |
196 | void LGG(int NN |
196 | void LGG(int NN=10, double theta=0.0, bool coupling=false) |
197 | { |
197 | { |
- | 198 | parameters.setCoupling(coupling); |
|
198 |
|
199 | CDetector *detector = new CDetector(CENTER, parameters); |
199 | Init(); |
200 | Init(); |
200 | double izkoristek = Grid(detector, parameters, NN, theta); |
201 | double izkoristek = Grid(detector, parameters, NN, theta); |
201 | //printf("izkoristek = %.3lf\n", izkoristek); |
202 | //printf("izkoristek = %.3lf\n", izkoristek); |
202 | PrintGuideHead(); |
203 | PrintGuideHead(); |
203 | PrintGuideStat(izkoristek); |
204 | PrintGuideStat(izkoristek); |
Line 205... | Line 206... | ||
205 | } |
206 | } |
206 | //------------------------------------------------------------------------------------------ |
207 | //------------------------------------------------------------------------------------------ |
207 | // Propagate NN rays genarated under the same angle theta, phi with random spacing and statistics |
208 | // Propagate NN rays genarated under the same angle theta, phi with random spacing and statistics |
208 | void LGR(int NN = 1e4, double theta = 0.0, double phi = 0.0) |
209 | void LGR(int NN = 1e4, double theta = 0.0, double phi = 0.0) |
209 | { |
210 | { |
210 | CDetector *detector = new CDetector( |
211 | CDetector *detector = new CDetector(CENTER, parameters); |
211 | Init(); |
212 | Init(); |
212 | double izkoristek = RandYZ(detector, parameters, NN, theta, phi, 30); |
213 | double izkoristek = RandYZ(detector, parameters, NN, theta, phi, 30); |
213 | //printf("izkoristek = %.3lf\n", izkoristek); |
214 | //printf("izkoristek = %.3lf\n", izkoristek); |
214 | PrintGuideHead(); PrintGuideStat(izkoristek); |
215 | PrintGuideHead(); PrintGuideStat(izkoristek); |
215 | DrawData(detector, parameters, theta, izkoristek); |
216 | DrawData(detector, parameters, theta, izkoristek); |
216 | } |
217 | } |
217 | //------------------------------------------------------------------------------------------ |
218 | //------------------------------------------------------------------------------------------ |
218 | // Propagate NN rays isotropically generated in solid angle theta and show the statistics |
219 | // Propagate NN rays isotropically generated in solid angle theta and show the statistics |
219 | void LGI(int NN = 1e4, double theta = 30.0, int nnrays = 30, int showr = 0) |
220 | void LGI(int NN = 1e4, double theta = 30.0, int nnrays = 30, int showr = 0) |
220 | { |
221 | { |
221 | Init(); |
222 | Init(); |
222 | CDetector *detector = new CDetector(CENTER, parameters); |
223 | CDetector *detector = new CDetector(CENTER, parameters); |
223 | //CDetector detector = new CDetector(); |
224 | //CDetector detector = new CDetector(); |
224 | double izkoristek = RandIso(detector, parameters, NN, 0.0, theta, nnrays, showr); |
225 | double izkoristek = RandIso(detector, parameters, NN, 0.0, theta, nnrays, showr); |
225 | //printf("izkoristek = %.3lf\n", izkoristek); |
- | |
226 | PrintGuideHead(); |
- | |
227 | PrintGuideStat(izkoristek); |
- | |
228 | DrawData(detector, parameters, theta, izkoristek); |
- | |
229 | //TCanvas *canvasDetector = new TCanvas("canvasDetector","canvasDetector",500,500); |
- | |
230 | //canvasDetector->cd(); |
- | |
231 | //detector->Draw(); |
- | |
232 | } |
- | |
233 | - | ||
234 | void LGB(int NN = 1e4, double phiMin=-19.4, double phiMax=19.4, int nnrays = 30, int showr = 0) |
- | |
235 | { |
- | |
236 | Init(); |
- | |
237 | CDetector *detector = new CDetector(CENTER, parameters); |
- | |
238 | //CDetector detector = new CDetector(); |
- | |
239 | double izkoristek = beamtest(detector, parameters, NN, 18.5, phiMin, phiMax, nnrays, showr); |
- | |
240 | //printf("izkoristek = %.3lf\n", izkoristek); |
226 | //printf("izkoristek = %.3lf\n", izkoristek); |
241 | PrintGuideHead(); |
227 | PrintGuideHead(); |
242 | PrintGuideStat(izkoristek); |
228 | PrintGuideStat(izkoristek); |
243 | DrawData(detector, parameters, |
229 | DrawData(detector, parameters, theta, izkoristek); |
244 | //TCanvas *canvasDetector = new TCanvas("canvasDetector","canvasDetector",500,500); |
230 | //TCanvas *canvasDetector = new TCanvas("canvasDetector","canvasDetector",500,500); |
245 | //canvasDetector->cd(); |
231 | //canvasDetector->cd(); |
246 | //detector->Draw(); |
232 | //detector->Draw(); |
- | 233 | } |
|
- | 234 | ||
- | 235 | void LGB(int NN = 1e4, double phiMin=-19.4, double phiMax=19.4, bool coupling=true, int nnrays = 30, int showr = 0) |
|
- | 236 | { |
|
- | 237 | Init(); |
|
- | 238 | parameters.setCoupling(coupling); |
|
- | 239 | CDetector *detector = new CDetector(CENTER, parameters); |
|
- | 240 | ||
- | 241 | const double theta = 18.5; |
|
- | 242 | double izkoristek = beamtest(detector, parameters, NN, theta, phiMin, phiMax, nnrays, showr); |
|
- | 243 | ||
- | 244 | PrintGuideHead(); |
|
- | 245 | PrintGuideStat(izkoristek); |
|
- | 246 | DrawData(detector, parameters, 18.5, izkoristek); |
|
- | 247 | ||
- | 248 | //TCanvas *canvasDetector = new TCanvas("canvasDetector","canvasDetector",500,500); |
|
- | 249 | //canvasDetector->cd(); |
|
- | 250 | //detector->Draw(); |
|
247 | } |
251 | } |
248 | 252 | ||
249 | 253 | ||
250 | //------------------------------------------------------------------------------------------ |
254 | //------------------------------------------------------------------------------------------ |
251 | void LGI_gap(int NN = 1e4, double min = 0.0, double max = 2.0, const int steps = 10, double theta = 30.0) |
255 | void LGI_gap(int NN = 1e4, double min = 0.0, double max = 2.0, const int steps = 10, double theta = 30.0) |