Examples



ECCE geometry import

  1. Prepare the ECCE environment. Detailed instructions are here, but both on BNL and JLAB farms you should only need, for csh,
    source /cvmfs/eic.opensciencegrid.org/ecce/gcc-8.3/opt/fun4all/core/bin/ecce_setup.csh -n
    

    or, for bash,

    source /cvmfs/eic.opensciencegrid.org/ecce/gcc-8.3/opt/fun4all/core/bin/ecce_setup.sh -n
    
  2. Obtain the latest detector Implementation:
    mkdir ecce
    cd ecce
    git clone https://github.com/ECCE-EIC/macros.git
    
  3. Copy (or soft-link) the script included in eAST to extract individual components. For this example, we will assume that eAST is installed in /home/eicuser/east/, please adjust accordingly.
    cd macros/detectors/EICDetector
    cp /home/eicuser/east/Components/ECCE/Extract_ECCE_gdml.C .
    

    Optional: If you know or suspect that subsystems have been added or significantly changed recently, compare this macro to Fun4All_G4_EICDetector.C. Extract_ECCE_gdml.C is largely a copy of that segment, just grouped with sensible names, e.g.

if ( subsys=="tracking" || subsys=="all" ) {
  if (outname=="") outname = "ecce_" + subsys + ".gdml";
  Enable::RWELL = true;
  // barrel tracker
  Enable::TrackingService = true;
  // Enable::TrackingService_VERBOSITY = INT_MAX - 10;
  Enable::BARREL = true;
  // fst
  Enable::FST = true;
}
  1. Finally, extract the subsystem gdml descriptions. The script can be called with the name of a subsystem as argument:
    root Extract_ECCE_gdml.C\(\"tracker\"\)
    

    You can use a simple shell script to get them all at once. For csh, use

    foreach s ( all pipe magnet magfarfwd magfarbwd gems tracking tofs becal hcalin hcalout dirc femc drcalo lfhcal eemc ehcal )
     root -l -b -q Extract_ECCE_gdml.C\(\"$s\"\)
    end
    

    and for bash use

    for s in all pipe magnet magfarfwd magfarbwd gems tracking tofs becal hcalin hcalout dirc femc drcalo lfhcal eemc ehcal
    do
     root -l -b -q Extract_ECCE_gdml.C\(\"$s\"\)
    done
    
  2. The ecce.mac macro in eAST expects these gdml files in a specific location. You can adjust the paths in the macro, but we recommend moving the gdml files:
    mv *.gdml /home/eicuser/east/Components/ECCE/
    

You can now run eAST in batch mode,

cd /home/eicuser/east/build
./eAST ecce.mac

or interactively:

cd /home/eicuser/east/build
./eAST
/control/execute ecce.mac
/run/beamOn 10

A closer look at ecce.mac shows that components are added via

/eAST/component/GenericGDML1 1
/eAST/component/GenericGDML1/gdmlFile Components/ECCE/ecce_becal.gdml
/eAST/component/GenericGDML2 1
/eAST/component/GenericGDML2/gdmlFile Components/ECCE/ecce_hcalin.gdml
...

As of now, up to 5 generic components an be added this way. An arbitrary number, but in the near future we want to switch to less generic classes anyway.

WARNING: An invocation of make install will overwrite any changes you make to the *.mac by automatically copying the originals from Core/, so rename them or copy them.

Notes

ATHENA geometry import

  1. Follow the quickstart guide to install the ATHENA software.
curl https://eicweb.phy.anl.gov/containers/eic_container/-/raw/master/install.sh | bash
./eic-shell
source /opt/detector/setup.sh
git clone https://eicweb.phy.anl.gov/EIC/detectors/athena.git
git clone https://eicweb.phy.anl.gov/EIC/detectors/ip6.git
ln -s ../ip6/ip6 athena/ip6
cd athena
mkdir build
cd build
cmake ..
make -j 6 install
  1. Inside eic-shell and in the build directory, create a geometry ROOT file:
    dd_web_display --export ../athena.xml
    

    This will create detector_geometry.root, which we will transform to gdml in the next step.

  2. Copy (or soft-link) the script included in eAST to extract individual components. For this example, we will assume that eAST is installed in /home/eicuser/east/, please adjust accordingly.
    cd macros/detectors/EICDetector
    cp /home/eicuser/east/Components/ATHENA/Extract_ATHENA_gdml.C .
    root Extract_ATHENA_gdml.C
    

    This will create 43 gdml files for the respective sub-systems.

  3. The athena.mac macro in eAST expects these gdml files in a specific location. You can adjust the paths in the macro, but we recommend moving the gdml files:
    mv *.gdml /home/eicuser/east/Components/ATHENA/
    

You can now run eAST in batch mode,

cd /home/eicuser/east/build
./eAST athena.mac

or interactively:

cd /home/eicuser/east/build
./eAST
/control/execute athena.mac
/run/beamOn 10

A closer look at athena.mac shows that components are added via

/eAST/component/GenericGDML1 1
/eAST/component/GenericGDML1/gdmlFile Components/ATHENA/athena_EcalBarrelImaging_26.gdml
...

As of now, up to 5 generic components an be added this way. An arbitrary number, but in the near future we want to switch to less generic classes anyway.

WARNING: Due to clashing names, many components cannot be used at the same time. This behavior should be fixed soon.

WARNING: An invocation of make install will overwrite any changes you make to the *.mac by automatically copying the originals from Core/, so rename them or copy them.