]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Added first draft of CCE-Simulation. Few updates for Plotgraph.C
authorStefan Strohauer <sstrohauer@jspc31.x-matter.uni-frankfurt.de>
Mon, 17 Feb 2014 14:50:47 +0000 (15:50 +0100)
committerStefan Strohauer <sstrohauer@jspc31.x-matter.uni-frankfurt.de>
Mon, 17 Feb 2014 14:50:47 +0000 (15:50 +0100)
CCESimulation/build_cce_distribution.m [new file with mode: 0644]
CCESimulation/main.m [new file with mode: 0644]
CCESimulation/octave-core [new file with mode: 0644]
PlotGraph/PlotGraph.C
ProcessMeasurements/LaborbuchMi29.csv
ProcessMeasurements/LaborbuchMi29.xls
ProcessMeasurements/analyzeRun.C

diff --git a/CCESimulation/build_cce_distribution.m b/CCESimulation/build_cce_distribution.m
new file mode 100644 (file)
index 0000000..5f96ef5
--- /dev/null
@@ -0,0 +1,28 @@
+function cce_distribution = build_cce_distribution(selected_matrix, x_coord, y_coord, delta_x, delta_y, X, Y)
+a = 1/20;
+c = 0.9;
+
+if selected_matrix == "quadratic"
+  cce_distribution = 0.5*exp(-1/10*sqrt((X-x_coord).^2 + (Y-y_coord).^2) );
+elseif selected_matrix == "Mi29a0"
+  cce_distribution = c*exp(-a*sqrt((X-x_coord).^2 + (Y-y_coord).^2) );
+#   cce_distribution(sqrt((X-x_coord).^2 + (Y-y_coord).^2) < 2) = 1;   % CCE of the diode
+  
+#   cce_distribution = 1./(exp(1/10*(sqrt((X-x_coord).^2 + (Y-y_coord).^2)-15) ) + 1); % Fermi-Dirac CCE
+  
+  # cce_distribution = c*exp(-1/200*((X-x_coord).^2 + (Y-y_coord).^2) );
+  # cce_distribution = sqrt((X-x_coord).^2 + (Y-y_coord).^2);
+elseif (selected_matrix == "Mi29a1")
+  cce_distribution = c*exp(-a*sqrt((X-x_coord).^2 + (Y-y_coord).^2) ) + c*exp(-a*sqrt((X-(x_coord-delta_x/2)).^2 + (Y-y_coord).^2) );
+elseif (selected_matrix == "Mi29a2")
+  cce_distribution = c*exp(-a*sqrt((X-x_coord).^2 + (Y-y_coord).^2) ) + c*exp(-a*sqrt((X-(x_coord-delta_x/2)).^2 + (Y-y_coord).^2) );
+elseif (selected_matrix == "Mi29a3")
+  cce_distribution = c*exp(-a*sqrt((X-x_coord).^2 + (Y-y_coord).^2) ) + c*exp(-a*sqrt((X-(x_coord-delta_x/2)).^2 + (Y-y_coord).^2) );
+elseif (selected_matrix == "Mi29a4")
+  cce_distribution = c*exp(-a*sqrt((X-x_coord).^2 + (Y-y_coord).^2) ) + c*exp(-a*sqrt((X-(x_coord-delta_x/2)).^2 + (Y-(y_coord+delta_y/2)).^2) );
+elseif (selected_matrix == "Mi29a5")
+  cce_distribution =   c*exp(-a*sqrt((X-x_coord).^2 + (Y-y_coord).^2) ) ...
+                     + c*exp(-a*sqrt((X-x_coord).^2 + (Y-(y_coord+delta_y/2)).^2) ) ...
+                     + c*exp(-a*sqrt((X-(x_coord-delta_x/2)).^2 + (Y-y_coord).^2)) ...
+                     + c*exp(-a*sqrt((X-(x_coord-delta_x/2)).^2 + (Y-(y_coord+delta_y/2)).^2) );
+end
\ No newline at end of file
diff --git a/CCESimulation/main.m b/CCESimulation/main.m
new file mode 100644 (file)
index 0000000..fc1e37a
--- /dev/null
@@ -0,0 +1,104 @@
+%% main script
+
+%  selected_matrix = "Mi29a0";
+selected_matrix = "quadratic";
+granularity = 500;
+numPixel = 6;  % number of pixels in one row and one column
+
+if selected_matrix == "quadratic"
+  delta_x = 32;
+  delta_y = 32;
+  staggered_factor = 0;
+elseif selected_matrix == "Mi29a0"
+  delta_x = 64;
+  delta_y = 16;
+  staggered_factor = 1/2;
+elseif selected_matrix == "Mi29a1"
+  delta_x = 64;
+  delta_y = 16;
+  staggered_factor = 1/4;
+elseif selected_matrix == "Mi29a2"
+  delta_x = 64;
+  delta_y = 32;
+  staggered_factor = 0;
+elseif selected_matrix == "Mi29a3"
+  delta_x = 64;
+  delta_y = 32;
+  staggered_factor = 1/4;
+elseif selected_matrix == "Mi29a4"
+  delta_x = 64;
+  delta_y = 64;
+  staggered_factor = 0;
+elseif selected_matrix == "Mi29a5"
+  delta_x = 64;
+  delta_y = 64;
+  staggered_factor = 0;
+end
+
+[X, Y] = meshgrid( linspace(0, (numPixel-1)*delta_x, granularity), linspace(0, (numPixel-1)*delta_y, granularity));
+pixelCCE = zeros(granularity, granularity, numPixel, numPixel);        %% second 2 arguments: x and y coordinate of the pixel; first 2 arguments: matrix with CCE entries
+
+% create CCE matrix for each pixel
+for i = 1:numPixel
+  for j = 1:numPixel
+    x_coord = (j-1)*delta_x + mod(i+1,2)*delta_x*staggered_factor;     % every second row is shifted by delta_x/2 to the right
+    y_coord = (i-1)*delta_y;
+    
+    pixelCCE(:, :, j, i) = build_cce_distribution(selected_matrix, x_coord, y_coord, delta_x, delta_y, X, Y);
+  end
+end
+
+
+maxCCE = zeros(size(pixelCCE(:,:,1,1)));
+sumCCE = zeros(size(pixelCCE(:,:,1,1)));
+for i = 1:numPixel
+  for j = 1:numPixel
+    maxCCE = max(maxCCE, pixelCCE(:, :, j, i));
+    sumCCE = sumCCE + pixelCCE(:, :, j, i);
+  end
+end
+
+
+combined_CCE = maxCCE./sumCCE;
+# selection = (X>delta_x*floor(numPixel/2)) & (X<delta_x*(floor(numPixel/2)+1)) & (Y>delta_y*floor(numPixel/2)) & (Y<delta_y*(floor(numPixel/2)+1));
+start_element = round(granularity/numPixel*floor(numPixel/2-1/2));
+end_element = round(granularity/numPixel*floor(numPixel/2+1/2));
+combined_CCE_central_pixel = combined_CCE(start_element:end_element, start_element:end_element);
+X_selection = X(start_element:end_element, start_element:end_element);
+Y_selection = Y(start_element:end_element, start_element:end_element);
+
+% plot single pixel CCE
+figure;
+imagesc(X,Y,pixelCCE(:, :, 3, 3));
+set(gca,'YDir','normal');
+axis equal;
+colorbar;
+
+% plot matrix CCE
+figure;
+pcolor(X,Y,combined_CCE);
+# imagesc(X,Y,combined_CCE);
+caxis([0, 1]);
+axis equal;
+shading flat;
+colorbar;
+
+% plot central pixel CCE
+figure;
+imagesc(X_selection,Y_selection,combined_CCE_central_pixel);
+set(gca,'YDir','normal');
+caxis([0, 1]);
+axis equal;
+shading flat;
+colorbar;
+
+% histogran for whole matrix
+figure;
+hist(combined_CCE(:), 50);
+axis([0, 1]);
+
+% histogran for central pixel
+figure;
+hist(combined_CCE_central_pixel(:), 50);
+axis([0, 1]);
+
diff --git a/CCESimulation/octave-core b/CCESimulation/octave-core
new file mode 100644 (file)
index 0000000..e8bf7ca
Binary files /dev/null and b/CCESimulation/octave-core differ
index 9b92fb6497df23ba843deed54615cfc8121eb33f..bbbb258c6f3b5a81f28a47074e91a4b66348d821 100644 (file)
@@ -34,7 +34,7 @@
 
 #define NUMPIXELS 25
 // #define RIGHT_BOUNDARY 350
-#define RIGHT_BOUNDARY 384     // 2**8*3 = 384
+#define RIGHT_BOUNDARY 1000    // 2**8*3 = 384
 // #define SEED_AND_SUM_BINS 200
 #define SEED_AND_SUM_BINS RIGHT_BOUNDARY/2
 #define VETO_BINS RIGHT_BOUNDARY/2
index 9a7261bb98246104cc01edb3c1d4b13bff386be8..c5d15fddb972285f4f3134151a9a99a1afadd5d8 100644 (file)
@@ -163,3 +163,24 @@ Runnr.     Date    Temperature     T-sensor        Events  Chip    Source  64/80   Radiation dose  Vbo     Don
 29134  1/22/2014       -30     -21.5   50000   5       Sr90    80      3.00E+12        1.55    y                               
 29135          -70             50000   5       Sr90    64      3.00E+12        1.57                                    
 29136          -70             50000   5       Sr90    80      3.00E+12        1.55                                    
+                                                                                                               
+                                                                                                               
+                                                                                                               
+29137          20              50000   1       none    64      0.00E+00        3.20                    The noise of the unirradiated chip seems to be corrupted. Therefore we make this measurement again.             
+29138          20              50000   1       none    80      0.00E+00        3.12                                    
+29139  2/13/2014       -20     -17.5   50000   1       none    64      0.00E+00        3.19    y                               
+29140  2/13/2014       -20     -18.0   50000   1       none    80      0.00E+00        3.12    y                               
+29141          -70             50000   1       none    64      0.00E+00        3.18                                    
+29142          -70             50000   1       none    80      0.00E+00        3.10                                    
+                                                                                                               
+29143          20              50000   6       none    64      1.00E+13        1.54                                    
+29144          20              50000   6       none    80      1.00E+13        1.53                                    
+29145          -20             50000   6       none    64      1.00E+13        1.54                                    
+29146          -20             50000   6       none    80      1.00E+13        1.53                                    
+29147          -70             50000   6       none    64      1.00E+13        1.54                                    
+29148          -70             50000   6       none    80      1.00E+13        1.53                                    
+                                                                                                               
+29149  2/13/2014       -20             1000    1       none    64      0.00E+00        3.20    y                               
+29150  2/13/2014       -20             1000    6       none    64      1.00E+13        1.54    y                               
+29151  2/13/2014       -20             1000    6       none    64      1.00E+13        1.54    y                               
+29152  2/13/2014       -20             1000    6       none    64      1.00E+13        1.54    y                               
index d4f56f168b2c7e0e68e445d9898cfa32ed224844..f94d3772c3f46a36076c81e7f029b676706606f4 100755 (executable)
Binary files a/ProcessMeasurements/LaborbuchMi29.xls and b/ProcessMeasurements/LaborbuchMi29.xls differ
index 98e3bea25689944a92510011a1ae5c6a1b2ecc3b..8868737735bbe27a6c724b7759c8f4082fd59a75 100644 (file)
 
 #include "MAPS.h"
 
-#define NUMEVENTSFORNOISE 1000
-#define OFFSET 1
+#define NUMEVENTSFORNOISE 25000
+#define OFFSET 0
+// #define NUMEVENTSFORNOISE 1000
+// #define OFFSET 1
 
 void analyzeRun(const char *const inputDataPath, const char *const outputDataPath, Int_t runNo, std::string matrixAB, Bool_t useSeperateNoiseRun, Bool_t runIsNoise, Int_t noiseRunNo, Bool_t overwrite, std::string logfileName)
 {