Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /tutorials/materialscan/README.md is written in an unsupported language. File is not indexed.

0001 The Fun4All_G4_sPHENIX.C and  G4Setup_sPHENIX.C macros which used to be here were outdated and therefore removed. Use a standard Fun4All_G4_sPHENIX.C macro instead. For the up to date version fetch it from
0002 
0003 https://github.com/sPHENIX-Collaboration/macros/tree/master/detectors/sPHENIX
0004 
0005 you will need Fun4All_G4_sPHENIX.C and G4Setup_sPHENIX.C
0006 
0007 ***Be aware that the following instructions will run the material scan with our default world volume which is air and the default world is a cylinder with 5m radius. This can add significantly to the radiation length X0***
0008 
0009 The cylinder shape will ensure azimuthal symmetry of the world but the air can add significantly to the X0. If you do a material scan consider to replace the world material by G4_Galactic. To do this find where our G4 module is created in the macro and add SetWorldMaterial("G4_Galactic"):
0010 ```
0011 PHG4Reco* g4Reco = new PHG4Reco();
0012 g4Reco->SetWorldMaterial("G4_GALACTIC")
0013 ```
0014 
0015 The included copy of the Fun4All_G4_sPHENIX.C macro uses G4_Galactic via the setting
0016 ```
0017 G4WORLD::WorldMaterial = "G4_Galactic";
0018 ```
0019 all Fun4All macros should support this setting (using a commented out line, if not let us know)
0020 
0021 How to use:
0022 start root and
0023 run the Fun4All_G4_sPHENIX.C macro with -1 events
0024 (which just loads the G4 configuration).
0025 
0026 ```
0027 .x Fun4All_G4_sPHENIX.C(-1)
0028 ```
0029 
0030 Load the matscan.C macro
0031 
0032 ```
0033 .L matscan.C
0034 ```
0035 
0036 By default it scans 10 bins in phi at midrapidity (theta=0.1 deg to avoid the gap many detectors have at exactly midrapidity). You can set the theta/phi ranges and number of bins you want with
0037 
0038 ```
0039 set_phimin(float val) // in degrees
0040 set_phispan(float val) // in degrees, phi range is phimin to phimin+phispan
0041 set_phibins(float val) // number of bins in this phi range
0042 ```
0043 
0044 same for theta.
0045 ```
0046 set_thetamin(float val) // in degrees
0047 set_thetaspan(float val) // in degrees, theta range is thetamin to thetamin+thetaspan
0048 set_thetabins(float val) // number of bins in this theta range
0049 ```
0050 
0051 For scans in phi use theta_span = theta_min and theta_bins = 1, for midrapidity
0052 scans you can use
0053 
0054 ```
0055 setmidrap();
0056 ```
0057 
0058 to set this up. This scans 100 bins in phi between phi=0 and phi=5
0059 
0060 For a default theta scan use
0061 ```
0062 set_thetascan();
0063 ```
0064 This scans 60 bins in theta from -60 to 120 deg at phi = 1 deg to avoid
0065 possible gaps at phi=0. To set up your own theta scans, use phi_span = phi_min
0066 and phi_bins = 1
0067 
0068 
0069 if you are running the same ranges all the time, just adjust those values
0070 in the macro.
0071 Execute matscan() and store output in some file (here T.T). Root6
0072 uses an interesting scheme, you need to redirect all output (at which time
0073 you will not see any prompt anymore - pure genius)
0074 
0075 ```
0076 .> T.T
0077 matscan()
0078 .q
0079 ```
0080 
0081 Sadly this dumps more than just the x0/lamda values for each phi/theta bin.
0082 In order to extract those, quit root and run matscan_digest.pl to extract 
0083 x0/lamda0 for each phi/theta bin:
0084 
0085 ```
0086 perl matscan_digest.pl T.T
0087 ```
0088 
0089 This will create a file matscan.dat. 
0090 plot_matscan.C is a simple plotting macro which plots x0/lamda vs phi (leave
0091 theta constant by theta_span = theta_min and theta_bins = 1:
0092 
0093 ```
0094 .L plot_matscan.C
0095 plot_matscan("matscan.dat");
0096 ```
0097 
0098 If you want to plot theta (keeping phi constant when running matscan.C), use
0099 
0100 ```
0101 .L plot_matscan.C
0102 plot_matscan.C("matscan.dat",1);
0103 ```
0104 
0105 If you want to plot eta (keeping phi constant when running matscan.C), use
0106 
0107 ```
0108 .L plot_matscan.C
0109 plot_matscan.C("matscan.dat",2);
0110 ```