Back to home page

EIC code displayed by LXR

 
 

    


Warning, /east/docs/_content/examples.md is written in an unsupported language. File is not indexed.

0001 ---
0002 title: "Examples"
0003 layout: base
0004 name: examples
0005 ---
0006 
0007 <h1>Examples</h1>
0008 
0009 ---
0010 
0011 * TOC
0012 {:toc}
0013 
0014 ---
0015 
0016 
0017 ## ECCE geometry import
0018 
0019 1. Prepare the ECCE environment. Detailed instructions are
0020 [here](https://github.com/eic/Singularity/blob/master/README.md), but both on
0021 BNL and JLAB farms you should only need, for csh,
0022 ```sh
0023 source /cvmfs/eic.opensciencegrid.org/ecce/gcc-8.3/opt/fun4all/core/bin/ecce_setup.csh -n
0024 ```
0025 or, for bash,
0026 ```sh
0027 source /cvmfs/eic.opensciencegrid.org/ecce/gcc-8.3/opt/fun4all/core/bin/ecce_setup.sh -n
0028 ```
0029 
0030 2. Obtain the latest detector Implementation:
0031 ```sh
0032 mkdir ecce
0033 cd ecce
0034 git clone https://github.com/ECCE-EIC/macros.git
0035 ```
0036 3. Copy (or soft-link) the script included in eAST to extract individual components.
0037 For this example, we will assume that eAST is installed in `/home/eicuser/east/`,
0038 please adjust accordingly.
0039 ```sh
0040 cd macros/detectors/EICDetector
0041 cp /home/eicuser/east/Components/ECCE/Extract_ECCE_gdml.C .
0042 ```
0043 Optional: If you know or suspect that subsystems have been added or significantly
0044 changed recently, compare this macro to `Fun4All_G4_EICDetector.C`.
0045 `Extract_ECCE_gdml.C` is largely a copy of that segment, just grouped with
0046 sensible names, e.g.
0047 
0048 ```c++
0049 if ( subsys=="tracking" || subsys=="all" ) {
0050   if (outname=="") outname = "ecce_" + subsys + ".gdml";
0051   Enable::RWELL = true;
0052   // barrel tracker
0053   Enable::TrackingService = true;
0054   // Enable::TrackingService_VERBOSITY = INT_MAX - 10;
0055   Enable::BARREL = true;
0056   // fst
0057   Enable::FST = true;
0058 }
0059 ```
0060 
0061 4. Finally, extract the subsystem gdml descriptions. The script can be called with
0062 the name of a subsystem as argument:
0063 ```sh
0064 root Extract_ECCE_gdml.C\(\"tracker\"\)
0065 ```
0066 You can use a simple shell script to get them all at once. For `csh`, use
0067 ```sh
0068 foreach s ( all pipe magnet magfarfwd magfarbwd gems tracking tofs becal hcalin hcalout dirc femc drcalo lfhcal eemc ehcal )
0069     root -l -b -q Extract_ECCE_gdml.C\(\"$s\"\)
0070 end
0071 ```
0072 and for `bash` use
0073 ```sh
0074 for s in all pipe magnet magfarfwd magfarbwd gems tracking tofs becal hcalin hcalout dirc femc drcalo lfhcal eemc ehcal
0075 do
0076     root -l -b -q Extract_ECCE_gdml.C\(\"$s\"\)
0077 done
0078 ```
0079  
0080 5. The `ecce.mac` macro in eAST expects these gdml files in a specific location.
0081 You can adjust the paths in the macro, but we recommend moving the gdml files:
0082 ```sh
0083 mv *.gdml /home/eicuser/east/Components/ECCE/
0084 ```
0085 
0086 You can now run eAST in batch mode,
0087 ```sh
0088 cd /home/eicuser/east/build
0089 ./eAST ecce.mac
0090 ```
0091 or interactively:
0092 ```sh
0093 cd /home/eicuser/east/build
0094 ./eAST
0095 /control/execute ecce.mac
0096 /run/beamOn 10
0097 ```
0098 
0099 A closer look at `ecce.mac` shows that components are added via
0100 ```
0101 /eAST/component/GenericGDML1 1
0102 /eAST/component/GenericGDML1/gdmlFile Components/ECCE/ecce_becal.gdml
0103 /eAST/component/GenericGDML2 1
0104 /eAST/component/GenericGDML2/gdmlFile Components/ECCE/ecce_hcalin.gdml
0105 ...
0106 ```
0107 As of now, up to 5 generic components an be added this way. An arbitrary number,
0108 but in the near future we want to switch to less generic classes anyway.
0109 
0110 **WARNING**: An invocation of `make install` will overwrite any changes you make to the `*.mac`
0111 by automatically copying the originals from `Core/`, so rename them or copy them.
0112 
0113 ## Notes
0114 * If you want to regenerate the list of subsystems, you can use
0115 ```sh
0116 grep 'if ( subsys==' Extract_ECCE_gdml.C | cut -d'"' -f 2
0117 ```
0118 * Further reading for [ECCE software/fun4all](https://ecce-eic.github.io/)
0119 * If you ever need to regenerate the magnetic field map, the recipe is similar but easier:
0120 ```
0121 source /cvmfs/eic.opensciencegrid.org/ecce/gcc-8.3/opt/fun4all/core/bin/ecce_setup.csh -n
0122 # or source /cvmfs/eic.opensciencegrid.org/ecce/gcc-8.3/opt/fun4all/core/bin/ecce_setup.sh -n
0123 git clone git@github.com:ECCE-EIC/calibrations.git
0124 cd calibrations/Field/Map/
0125 cp /home/eicuser/east/Solenoid/macros/fieldconverter.C .
0126 root -l -b -q fieldconverter.C
0127 mv sPHENIX.2d.Bmap  /home/eicuser/east/Solenoid/data/
0128  ```
0129 
0130 ## ATHENA geometry import
0131 
0132 1. Follow the 
0133 [quickstart guide](https://eic.phy.anl.gov/tutorials/eic_tutorial/getting-started/quickstart)
0134 to install the ATHENA software.
0135 
0136 
0137 ```sh
0138 curl https://eicweb.phy.anl.gov/containers/eic_container/-/raw/master/install.sh | bash
0139 ./eic-shell
0140 source /opt/detector/setup.sh
0141 git clone https://eicweb.phy.anl.gov/EIC/detectors/athena.git
0142 git clone https://eicweb.phy.anl.gov/EIC/detectors/ip6.git
0143 ln -s ../ip6/ip6 athena/ip6
0144 cd athena
0145 mkdir build
0146 cd build
0147 cmake ..
0148 make -j 6 install
0149 ```
0150 
0151  
0152 2. Inside eic-shell and in the `build` directory, create a geometry ROOT file:
0153 ```sh
0154 dd_web_display --export ../athena.xml
0155 ```
0156 This will create `detector_geometry.root`, which we will transform to gdml in the next step.
0157  
0158 3. Copy (or soft-link) the script included in eAST to extract individual components.
0159 For this example, we will assume that eAST is installed in `/home/eicuser/east/`,
0160 please adjust accordingly.
0161 ```sh
0162 cd macros/detectors/EICDetector
0163 cp /home/eicuser/east/Components/ATHENA/Extract_ATHENA_gdml.C .
0164 root Extract_ATHENA_gdml.C
0165 ```
0166 This will create 43 gdml files for the respective sub-systems. 
0167 
0168 
0169 4. The `athena.mac` macro in eAST expects these gdml files in a specific location.
0170 You can adjust the paths in the macro, but we recommend moving the gdml files:
0171 ```sh
0172 mv *.gdml /home/eicuser/east/Components/ATHENA/
0173 ```
0174 
0175 You can now run eAST in batch mode,
0176 ```sh
0177 cd /home/eicuser/east/build
0178 ./eAST athena.mac
0179 ```
0180 or interactively:
0181 ```sh
0182 cd /home/eicuser/east/build
0183 ./eAST
0184 /control/execute athena.mac
0185 /run/beamOn 10
0186 ```
0187 
0188 A closer look at `athena.mac` shows that components are added via
0189 ```
0190 /eAST/component/GenericGDML1 1
0191 /eAST/component/GenericGDML1/gdmlFile Components/ATHENA/athena_EcalBarrelImaging_26.gdml
0192 ...
0193 ```
0194 As of now, up to 5 generic components an be added this way. An arbitrary number,
0195 but in the near future we want to switch to less generic classes anyway.
0196 
0197 **WARNING**: Due to clashing names, many components cannot be used at the same time. 
0198 This behavior should be fixed soon.
0199 
0200 
0201 **WARNING**: An invocation of `make install` will overwrite any changes you make to the `*.mac`
0202 by automatically copying the originals from `Core/`, so rename them or copy them.
0203 
0204 
0205 * Further reading for [ECCE software/fun4all](https://ecce-eic.github.io/)
0206 
0207