Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
np
nptool
Commits
1f6bcd89
Commit
1f6bcd89
authored
Jun 14, 2021
by
Charlie Paxman
Browse files
* Testing e793s
-- Energy loss corrections may not be working -- Pushed with ELoss commented out
parent
f3a6d2b2
Pipeline
#124039
passed with stages
in 12 minutes and 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
28 deletions
+36
-28
Projects/e793s/macro/BeamSpot/MinimizeBeamSpot.cxx
Projects/e793s/macro/BeamSpot/MinimizeBeamSpot.cxx
+26
-23
Projects/e793s/macro/BeamSpot/MinimizeBeamSpot.h
Projects/e793s/macro/BeamSpot/MinimizeBeamSpot.h
+10
-5
No files found.
Projects/e793s/macro/BeamSpot/MinimizeBeamSpot.cxx
100644 → 100755
View file @
1f6bcd89
...
...
@@ -41,18 +41,18 @@ double devE(const double * parameter) {
double
Energy
=
energy
[
i
];
//Energy loss in Al
Energy
=
Al
.
EvaluateInitialEnergy
(
Energy
,
//energy after Al
0.4
*
micrometer
,
//thickness of Al
ThetaMugast
//angle impinging on MUGAST
);
//
Energy = Al.EvaluateInitialEnergy(
//
Energy, //energy after Al
//
0.4 * micrometer, //thickness of Al
//
ThetaMugast //angle impinging on MUGAST
//
);
//Energy loss in target
Energy
=
CD2
.
EvaluateInitialEnergy
(
Energy
,
//energy after leaving target
0.5
*
parameter
[
3
]
*
micrometer
,
//pass through half target
ThetaTarget
//angle leaving target
);
//
Energy = CD2.EvaluateInitialEnergy(
//
Energy, //energy after leaving target
//
0.5 * parameter[3] * micrometer, //pass through half target
//
ThetaTarget //angle leaving target
//
);
//Final value of Ex
double
Ex
=
reaction
.
ReconstructRelativistic
(
Energy
,
ThetaTarget
);
...
...
@@ -71,7 +71,7 @@ double devE(const double * parameter) {
}
//Adapt the metric as needed
double
multiplier
=
0.0
7
;
//0.
1
;
double
multiplier
=
0.
1
0
;
//0.
07
;
double
metric
=
sqrt
(
pow
(
FitResultMatrix
[
mgSelect
][
0
]
-
refE
,
2
)
+
pow
(
multiplier
*
FitResultMatrix
[
mgSelect
][
2
],
2
));
...
...
@@ -125,18 +125,18 @@ void MinimizeBeamSpot() {
auto
start
=
high_resolution_clock
::
now
();
//TESTING: Grid method of avoiding local minima
for
(
int
x
=
0
;
x
<
2
;
x
++
)
{
for
(
int
y
=
0
;
y
<
2
;
y
++
)
{
for
(
int
z
=
0
;
z
<
2
;
z
++
)
{
for
(
int
t
=
0
;
t
<
5
;
t
++
)
{
//
for (int x = 0; x <
3; x++) { //7
; x++) {
//
for (int y = 0; y <
3; y++){ //7
; y++) {
for
(
int
z
=
0
;
z
<
3
;
z
++
){
//7
; z++) {
for
(
int
t
=
0
;
t
<
9
;
t
++
)
{
//Start with beam (0,0,0) and 4.76um 0.5mg/c2 target
//double parameter[4] = {0.0, 0.0, 0.0, 4.76};
double
parameter
[
4
]
=
{
9.0
-
(
9.0
*
x
),
9.0
-
(
9.0
*
y
),
9.0
-
(
9.0
*
z
),
(
1.5
-
(
0.25
*
t
))
*
4.75
0.0
,
//9.0 - (x * 9.0), //3.0
),
0.0
,
//9.0 - (y * 9.0), //3.0
),
9.0
-
(
z
*
9.0
),
//3.0
),
(
1.5
-
(
0.
1
25
*
t
))
*
4.75
};
//Don't draw iterations of minimizer
...
...
@@ -160,8 +160,11 @@ void MinimizeBeamSpot() {
minim
->
SetFunction
(
func
);
//Assign variable limits
minim
->
SetLimitedVariable
(
0
,
"X"
,
parameter
[
0
],
0.01
,
-
10
,
10
);
minim
->
SetLimitedVariable
(
1
,
"Y"
,
parameter
[
1
],
0.01
,
-
10
,
10
);
minim
->
SetLimitedVariable
(
0
,
"X"
,
parameter
[
0
],
0.01
,
-
0.5
,
0.5
);
minim
->
SetLimitedVariable
(
1
,
"Y"
,
parameter
[
1
],
0.01
,
-
0.5
,
0.5
);
//minim -> SetLimitedVariable(2, "Z", parameter[2], 0.01, -0.5, 0.5);
//minim -> SetLimitedVariable(0, "X", parameter[0], 0.01, -10, 10);
//minim -> SetLimitedVariable(1, "Y", parameter[1], 0.01, -10, 10);
minim
->
SetLimitedVariable
(
2
,
"Z"
,
parameter
[
2
],
0.01
,
-
5
,
5
);
minim
->
SetLimitedVariable
(
3
,
"T"
,
parameter
[
3
],
0.01
,
4.76
*
0.5
,
4.76
*
1.5
);
...
...
@@ -194,8 +197,8 @@ void MinimizeBeamSpot() {
cout
<<
"=================================================="
<<
endl
;
}
}
}
}
//
}
//
}
//Stop timer
auto
stop
=
high_resolution_clock
::
now
();
...
...
Projects/e793s/macro/BeamSpot/MinimizeBeamSpot.h
View file @
1f6bcd89
...
...
@@ -212,12 +212,17 @@ void InitiliseCanvas(double FitResultMatrix[7][5]){
h1
->
GetYaxis
()
->
SetTitle
(
"Counts"
);
//Histogram draw - Individual
DrawOneHistogram
(
h1
,
1
,
632
,
3244
,
FitResultMatrix
[
1
]);
DrawOneHistogram
(
h2
,
2
,
800
,
3244
,
FitResultMatrix
[
2
]);
DrawOneHistogram
(
h3
,
3
,
416
,
3344
,
FitResultMatrix
[
3
]);
//DrawOneHistogram(h1, 1, 632, 3244, FitResultMatrix[1]);
DrawOneHistogram
(
h1
,
1
,
632
,
0
,
FitResultMatrix
[
1
]);
//DrawOneHistogram(h2, 2, 800, 3244, FitResultMatrix[2]);
DrawOneHistogram
(
h2
,
2
,
800
,
0
,
FitResultMatrix
[
2
]);
//DrawOneHistogram(h3, 3, 416, 3344, FitResultMatrix[3]);
DrawOneHistogram
(
h3
,
3
,
416
,
0
,
FitResultMatrix
[
3
]);
DrawOneHistogram
(
h4
,
4
,
840
,
3444
,
FitResultMatrix
[
4
]);
DrawOneHistogram
(
h5
,
5
,
600
,
3544
,
FitResultMatrix
[
5
]);
DrawOneHistogram
(
h7
,
6
,
880
,
3644
,
FitResultMatrix
[
6
]);
//DrawOneHistogram(h5, 5, 600, 3544, FitResultMatrix[5]);
DrawOneHistogram
(
h5
,
5
,
600
,
0
,
FitResultMatrix
[
5
]);
//DrawOneHistogram(h7, 6, 880, 3644, FitResultMatrix[6]);
DrawOneHistogram
(
h7
,
6
,
880
,
0
,
FitResultMatrix
[
6
]);
canv
->
Update
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment