Commit 1f6bcd89 authored by Charlie Paxman's avatar 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
...@@ -41,18 +41,18 @@ double devE(const double * parameter) { ...@@ -41,18 +41,18 @@ double devE(const double * parameter) {
double Energy = energy[i]; double Energy = energy[i];
//Energy loss in Al //Energy loss in Al
Energy = Al.EvaluateInitialEnergy( // Energy = Al.EvaluateInitialEnergy(
Energy, //energy after Al // Energy, //energy after Al
0.4 * micrometer, //thickness of Al // 0.4 * micrometer, //thickness of Al
ThetaMugast //angle impinging on MUGAST // ThetaMugast //angle impinging on MUGAST
); // );
//Energy loss in target //Energy loss in target
Energy = CD2.EvaluateInitialEnergy( // Energy = CD2.EvaluateInitialEnergy(
Energy, //energy after leaving target // Energy, //energy after leaving target
0.5 * parameter[3] * micrometer, //pass through half target // 0.5 * parameter[3] * micrometer, //pass through half target
ThetaTarget //angle leaving target // ThetaTarget //angle leaving target
); // );
//Final value of Ex //Final value of Ex
double Ex = reaction.ReconstructRelativistic(Energy, ThetaTarget); double Ex = reaction.ReconstructRelativistic(Energy, ThetaTarget);
...@@ -71,7 +71,7 @@ double devE(const double * parameter) { ...@@ -71,7 +71,7 @@ double devE(const double * parameter) {
} }
//Adapt the metric as needed //Adapt the metric as needed
double multiplier = 0.07; //0.1; double multiplier = 0.10; //0.07;
double metric = sqrt(pow(FitResultMatrix[mgSelect][0] - refE, 2) double metric = sqrt(pow(FitResultMatrix[mgSelect][0] - refE, 2)
+ pow(multiplier * FitResultMatrix[mgSelect][2], 2)); + pow(multiplier * FitResultMatrix[mgSelect][2], 2));
...@@ -125,18 +125,18 @@ void MinimizeBeamSpot() { ...@@ -125,18 +125,18 @@ void MinimizeBeamSpot() {
auto start = high_resolution_clock::now(); auto start = high_resolution_clock::now();
//TESTING: Grid method of avoiding local minima //TESTING: Grid method of avoiding local minima
for (int x = 0; x < 2; x++) { // for (int x = 0; x < 3; x++) { //7; x++) {
for (int y = 0; y < 2; y++) { // for (int y = 0; y < 3; y++){ //7; y++) {
for (int z = 0; z < 2; z++) { for (int z = 0; z < 3; z++){ //7; z++) {
for (int t = 0; t < 5; t++) { for (int t = 0; t < 9; t++) {
//Start with beam (0,0,0) and 4.76um 0.5mg/c2 target //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] = {0.0, 0.0, 0.0, 4.76};
double parameter[4] = { double parameter[4] = {
9.0 - (9.0 * x), 0.0, //9.0 - (x * 9.0), //3.0),
9.0 - (9.0 * y), 0.0, //9.0 - (y * 9.0), //3.0),
9.0 - (9.0 * z), 9.0 - (z * 9.0), //3.0),
(1.5 - (0.25 * t)) * 4.75 (1.5 - (0.125 * t)) * 4.75
}; };
//Don't draw iterations of minimizer //Don't draw iterations of minimizer
...@@ -160,8 +160,11 @@ void MinimizeBeamSpot() { ...@@ -160,8 +160,11 @@ void MinimizeBeamSpot() {
minim -> SetFunction(func); minim -> SetFunction(func);
//Assign variable limits //Assign variable limits
minim -> SetLimitedVariable(0, "X", parameter[0], 0.01, -10, 10); minim -> SetLimitedVariable(0, "X", parameter[0], 0.01, -0.5, 0.5);
minim -> SetLimitedVariable(1, "Y", parameter[1], 0.01, -10, 10); 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(2, "Z", parameter[2], 0.01, -5, 5);
minim -> SetLimitedVariable(3, "T", parameter[3], 0.01, 4.76 * 0.5, 4.76 * 1.5); minim -> SetLimitedVariable(3, "T", parameter[3], 0.01, 4.76 * 0.5, 4.76 * 1.5);
...@@ -194,8 +197,8 @@ void MinimizeBeamSpot() { ...@@ -194,8 +197,8 @@ void MinimizeBeamSpot() {
cout << "==================================================" << endl; cout << "==================================================" << endl;
} }
} }
} // }
} // }
//Stop timer //Stop timer
auto stop = high_resolution_clock::now(); auto stop = high_resolution_clock::now();
......
...@@ -212,12 +212,17 @@ void InitiliseCanvas(double FitResultMatrix[7][5]){ ...@@ -212,12 +212,17 @@ void InitiliseCanvas(double FitResultMatrix[7][5]){
h1->GetYaxis()->SetTitle("Counts"); h1->GetYaxis()->SetTitle("Counts");
//Histogram draw - Individual //Histogram draw - Individual
DrawOneHistogram(h1, 1, 632, 3244, FitResultMatrix[1]); //DrawOneHistogram(h1, 1, 632, 3244, FitResultMatrix[1]);
DrawOneHistogram(h2, 2, 800, 3244, FitResultMatrix[2]); DrawOneHistogram(h1, 1, 632, 0, FitResultMatrix[1]);
DrawOneHistogram(h3, 3, 416, 3344, FitResultMatrix[3]); //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(h4, 4, 840, 3444, FitResultMatrix[4]);
DrawOneHistogram(h5, 5, 600, 3544, FitResultMatrix[5]); //DrawOneHistogram(h5, 5, 600, 3544, FitResultMatrix[5]);
DrawOneHistogram(h7, 6, 880, 3644, FitResultMatrix[6]); DrawOneHistogram(h5, 5, 600, 0, FitResultMatrix[5]);
//DrawOneHistogram(h7, 6, 880, 3644, FitResultMatrix[6]);
DrawOneHistogram(h7, 6, 880, 0, FitResultMatrix[6]);
canv->Update(); canv->Update();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment