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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/stim_pixe_tomography/GPSPointLoop.C (Version 11.3.0) and /examples/advanced/stim_pixe_tomography/GPSPointLoop.C (Version ReleaseNotes)


** Warning: Cannot open xref database.

  1 //********************************************      1 
  2 // GPSPointLoop.C                                 
  3 // Root command file                              
  4 // Type: root GPSPointLoop.C                      
  5 //                                                
  6 // It generates a macro file to run the simula    
  7 //                                                
  8 // More information is available in UserGuide     
  9 // Created by Z.LI LP2i Bordeaux 2022             
 10 //********************************************    
 11                                                   
 12 // include <stdio.h>                              
 13 // include <string.h>                             
 14 // include <stdint.h>                             
 15 // include <vector>                               
 16 // include <math.h>                               
 17 // using namespace std;                           
 18                                                   
 19 void GPSPointLoop()                               
 20 {                                                 
 21   gSystem->CopyFile("pixe3d_initial.mac", "pix    
 22   FILE* pfile = fopen("pixe3d.mac", "a+");        
 23                                                   
 24   //    gSystem->CopyFile("pixe3d_initial.mac"    
 25   //    FILE* pfile = fopen("pixe3d_stim.mac",    
 26                                                   
 27   //******************************************    
 28   //***(begin)** Define scan parameters*******    
 29   //******************************************    
 30   //******************************************    
 31   int NumberOfProjections = 10;  // Define the    
 32                                  // (last valu    
 33   int NumberOfSlices = 1;  // Define the numbe    
 34   int NumberOfPixels = 20;  // Define the numb    
 35   double TotalAngleSpan = 180;  // scan angula    
 36   double ScanSize = 40 * 1.8;  // unit um, sca    
 37   //  double ScanSize   = 42.48*1.8;       //     
 38   //  double ScanSize   = 500;       // unit u    
 39   double ScanHeight = ScanSize;  // Height of     
 40   // double ScanHeight = 201.127;   //Height o    
 41   // slices                                       
 42   int NbParticles = 1000000;                      
 43   double energy = 1.5;  // MeV                    
 44   char typeParticle[10] = "proton";               
 45                                                   
 46   double PixelWidth = 1. * ScanSize / NumberOf    
 47   double SliceHeight = 1. * ScanHeight / Numbe    
 48                                                   
 49   double AngleStep =                              
 50     1. * TotalAngleSpan / NumberOfProjections;    
 51                                                   
 52   //                                              
 53   // The beam position is at the center of eac    
 54   // Starting position of the beam = StartScan    
 55   // The scan starts from the bottom left of t    
 56   //                                              
 57   double StartScanXY = -0.5 * ScanSize;           
 58   double StartScanZ = -0.5 * ScanHeight;          
 59   // double StartScanZ = 0;                       
 60                                                   
 61   bool isInterrupted = false;                     
 62   int P_interrupt = 0;  // the start of projec    
 63                                                   
 64   //******************************************    
 65   //***(end)** Define scan parameters*********    
 66   //******************************************    
 67                                                   
 68   //************************************          
 69   //***(begin)** SCAN IMPLEMENTATION ***          
 70   //************************************          
 71   fprintf(pfile, "/tomography/run/scanParamete    
 72           NumberOfPixels);                        
 73   fprintf(pfile, "#\n");                          
 74                                                   
 75   if (isInterrupted) {                            
 76     fprintf(pfile, "/tomography/run/resumeSimu    
 77     fprintf(pfile, "/tomography/run/resumeProj    
 78     fprintf(pfile, "#\n");                        
 79   }                                               
 80   fprintf(pfile, "/run/initialize\n");            
 81   fprintf(pfile, "#\n");                          
 82 //  fprintf(pfile, "/run/printProgress 500000\    
 83 //  fprintf(pfile, "#\n");                        
 84   fprintf(pfile, "# Source definition : energy    
 85   fprintf(pfile, "#\n");                          
 86   fprintf(pfile, "/gps/energy %.2f MeV\n", ene    
 87   fprintf(pfile, "/gps/particle %s\n", typePar    
 88   fprintf(pfile, "#\n");                          
 89   fprintf(pfile, "# SOURCE POSITION AND DIRECT    
 90   fprintf(pfile, "#\n");                          
 91   for (int projectionIndex = 0; projectionInde    
 92        ++projectionIndex)  // projections         
 93   {                                               
 94     if (isInterrupted) {                          
 95       if (projectionIndex < P_interrupt) conti    
 96     }                                             
 97                                                   
 98     for (int sliceIndex = 0; sliceIndex < Numb    
 99     {                                             
100       // if(sliceIndex<15) continue;              
101       for (int pixelIndex = 0; pixelIndex < Nu    
102       {                                           
103         double px = cos(projectionIndex * Angl    
104         double py = sin(projectionIndex * Angl    
105         double pz = 0.0;                          
106         double x =                                
107           StartScanXY * px - (StartScanXY + (p    
108         double y = StartScanXY * py + (StartSc    
109         double z = StartScanZ + (sliceIndex +     
110         // z = 18.07;  //if z is fixed            
111         //  z = z + 1.953125;                     
112         //  z = z + 3.90625;                      
113         fprintf(pfile, "/gps/direction %f %f %    
114         // fprintf(pfile, "/gps/pos/centre %.6    
115         fprintf(pfile, "/gps/pos/centre %f %f     
116         fprintf(pfile, "/run/beamOn %d\n", NbP    
117         fprintf(pfile, "#\n");                    
118       }                                           
119     }                                             
120   }                                               
121   fclose(pfile);                                  
122                                                   
123   //************************************          
124   //***(end)** SCAN IMPLEMENTATION ***            
125   //************************************          
126 }                                                 
127