diff --git a/MakeVertex.C b/MakeVertex.C index 2a1578b..47acd58 100755 --- a/MakeVertex.C +++ b/MakeVertex.C @@ -125,7 +125,7 @@ void MakeVertex::Begin(TTree * /*tree*/) } // Load PC Calibrations - std::ifstream inputFile("slope_intercept_results.dat"); + std::ifstream inputFile("slope_intercept_results_27Al.dat"); if (inputFile.is_open()) { std::string line; diff --git a/MatchAndPlotCentroids.C b/MatchAndPlotCentroids.C index 333675d..c4bac8c 100644 --- a/MatchAndPlotCentroids.C +++ b/MatchAndPlotCentroids.C @@ -12,7 +12,8 @@ void MatchAndPlotCentroids() { // Open the centroid data file - std::ifstream inputFile("centroids.txt"); + std::ifstream inputFile("centroids_27Al.txt"); + // std::ifstream inputFile("centroids_17F.txt"); if (!inputFile.is_open()) { std::cerr << "Error: Could not open Centroids.txt" << std::endl; return; @@ -42,13 +43,17 @@ void MatchAndPlotCentroids() { // Reference centroids from histogram 24 const auto& referenceCentroids = centroidData[1]; - std::ofstream outputFile("slope_intercept_results.txt"); + std::ofstream outputFile("slope_intercept_results.dat"); if (!outputFile.is_open()) { std::cerr << "Error: Could not open the output file for writing!" << std::endl; return; } outputFile << "Histogram Number\tSlope\tIntercept\n"; // Loop through histograms 25 to 47 + + // 1. Create a SINGLE canvas BEFORE the loop + TCanvas *c1 = new TCanvas("c1", "Centroid Fit Viewer", 800, 600); + for (int targetHist = 0; targetHist <= 23; targetHist++) { // Ensure the target histogram exists and matches in peak numbers if (centroidData.find(targetHist) == centroidData.end() || centroidData[targetHist].size() != referenceCentroids.size()) { @@ -74,14 +79,15 @@ void MatchAndPlotCentroids() { } // Create a TGraph - TCanvas *c1 = new TCanvas(Form("c_centroid_1_vs_%d", targetHist), Form("Centroid 1 vs %d", targetHist), 800, 600); - TGraph *graph = new TGraph(xValues.size(), &xValues[0], &yValues[0]); - graph->SetTitle(Form("Centroid of Histogram %d vs 1", targetHist)); + TGraph *graph = new TGraph(xValues.size(), &xValues[0], &yValues[0]); + graph->SetTitle(Form("Centroid of Histogram %d vs 1", targetHist)); graph->GetYaxis()->SetTitle("Centroid of Histogram 1"); graph->GetXaxis()->SetTitle(Form("Centroid of Histogram %d", targetHist)); - graph->SetMarkerStyle(20); // Full circle marker + graph->SetMarkerStyle(20); graph->SetMarkerSize(1.0); graph->SetMarkerColor(kBlue); + + graph->Draw("AP"); // Draw the graph graph->Draw("AP"); double minX = *std::min_element(xValues.begin(), xValues.end()); diff --git a/anasen_fem/scalars.dat.names b/anasen_fem/scalars.dat.names index 947f957..d1fd517 100755 --- a/anasen_fem/scalars.dat.names +++ b/anasen_fem/scalars.dat.names @@ -2,7 +2,7 @@ Metadata for SaveScalars file: ./scalars.dat Elmer version: 26.1 Elmer compilation date: 2026-03-15 Solver input file: wires2d.sif -File started at: 2026/03/23 17:44:06 +File started at: 2026/03/23 20:55:05 Variables in columns of matrix: 1: res: potential difference diff --git a/centroids.txt b/centroids.txt deleted file mode 100644 index 1544379..0000000 --- a/centroids.txt +++ /dev/null @@ -1,97 +0,0 @@ -HistogramIndex PeakNumber Centroid Amplitude Sigma -0 1 991.118 -0 2 2026.83 -0 3 3060.26 -0 4 4092.45 -1 1 922.213 -1 2 1885.55 -1 3 2845.53 -1 4 3810.32 -2 1 955.591 -2 2 1953.17 -2 3 2949.37 -2 4 3950.79 -3 1 995.787 -3 2 2036.58 -3 3 3076.91 -3 4 4112.05 -4 1 1017.48 -4 2 2080.19 -4 3 3142.24 -4 4 4206.1 -5 1 1022.78 -5 2 2091.21 -5 3 3158.28 -5 4 4226.97 -6 1 1076.22 -6 2 2203.37 -6 3 3329.53 -6 4 4457.69 -7 1 977.46 -7 2 1998.02 -7 3 3017.36 -7 4 4040.47 -8 1 1049.74 -8 2 2144.38 -8 3 3238.2 -8 4 4335.25 -9 1 1000.59 -9 2 2046.42 -9 3 3090.29 -9 4 4129.63 -10 1 1014.92 -10 2 2076.16 -10 3 3134.59 -10 4 4213.42 -11 1 1004.85 -11 2 2052.88 -11 3 3100.3 -11 4 4164.75 -12 1 945.861 -12 2 1932.49 -12 3 2917.95 -12 4 3955.15 -13 1 998.307 -13 2 2040.38 -13 3 3078.76 -13 4 4135.51 -14 1 966.429 -14 2 1972.15 -14 3 2974.84 -14 4 4056.41 -15 1 958.352 -15 2 1958.64 -15 3 2957.7 -15 4 3970.41 -16 1 970.732 -16 2 1977.63 -16 3 2984.97 -16 4 4002.56 -17 1 1013.65 -17 2 2064.9 -17 3 3114.19 -17 4 4190.98 -18 1 975.538 -18 2 1990.64 -18 3 3005.46 -18 4 4048.99 -19 1 1082.91 -19 2 2194.08 -19 3 3303.65 -19 4 4411.32 -20 1 912.778 -20 2 1866.83 -20 3 2819.21 -20 4 3781.63 -21 1 1002.36 -21 2 1989.95 -21 3 2975.53 -21 4 3986.71 -22 1 1075.38 -22 2 2144.25 -22 3 3210.17 -22 4 4312.84 -23 1 988.828 -23 2 2016.35 -23 3 3044.19 -23 4 4082.41 diff --git a/slope_intercept_cathode.dat b/slope_intercept_cathode_27Al.dat similarity index 100% rename from slope_intercept_cathode.dat rename to slope_intercept_cathode_27Al.dat diff --git a/slope_intercept_results.dat b/slope_intercept_results_27Al.dat similarity index 100% rename from slope_intercept_results.dat rename to slope_intercept_results_27Al.dat diff --git a/slope_intercept_results_anode.dat b/slope_intercept_results_anode_27Al.dat similarity index 100% rename from slope_intercept_results_anode.dat rename to slope_intercept_results_anode_27Al.dat