Scripts to provide access to data on S3 and interface with this SIDIS analysis repository
NOTE: before anything, be sure to set the environment:
source environ.sh
First you must obtain access to S3. Set the environment variables $S3_ACCESS_KEY
and $S3_SECRET_KEY
with the login and password beforehand:
export S3_ACCESS_KEY=*****
export S3_SECRET_KEY=*****
- It is useful to add these variables to your shell configuration (such as
~/.bashrc
), but do not expose the username and password to the outside world - For more details on S3, see S3 file storage documentation
Then add our S3 endpoint:
s3tools/add-host.sh
- This only needs to be done once, since it will write your configuration
locally (most likely to
~/.mc/config.json
)
Now you can run our S3 automation script, s3tools/s3tool.rb
; run without any arguments to print the usage guide:
s3tools/s3tool.rb
- This script can:
- Download files from S3, given your choice of campaign production version, beam energy, detector configuration, radiative corrections, and more
- Automatically generate a
config
file, with file names, Q2 minima, and cross sections; this is used as input to the analysis macros (see doc/example.config for a sample config file) - Alternative to downloading files from S3, you can generate a
config
file for streaming from S3
- This script supports both fast and full simulations from ePIC, ECCE, and ATHENA
- For fast simulations, event-generated
hepmc
files are obtained and passed throughDelphes
locally - This script uses MinIO client
(included in
eic-shell
).
For full simulation files from S3, run:
s3tools/s3tool.rb -o tutorial.epic -c tutorial/epic.config -e 18x275 -l 3
- By default, the
config
file will be filled with S3 URLs for streaming data from S3; if you would rather download the files locally, add the option-m d
to download them todatarec/tutorial.epic/
- This is for the latest ePIC data, with the specified beam energy, and
writes the config file to
tutorial/epic.config
- Run
s3tools/s3tool.rb -v PRODUCTION_VERSION
for a different production, such as one from ECCE or ATHENA (runs3tools/s3tool.rb
with no arguments to see availablePRODUCTION_VERSION
s).
- Run
For fast simulation, download sample HEPMC files from S3 and run them through Delphes using:
s3tools/s3tool.rb -v hepmc.pythia8 -o tutorial.fastsim -c tutorial/delphes.config -e 10x100 -l 3
- Note: Delphes must be fully compiled before doing this
- Delphes output files will be written to
datarec/tutorial.fastsim
, and the HEPMC files will be stored indatagen/tutorial.fastsim
- The
config
file will be written totutorial/delphes.config
If you would rather do things yourself, you can use MinIO client directly using the
mc
command to browse data on S3
- Example S3 navigation commands:
- top-level ePIC directory list:
mc ls S3/eictest/EPIC
- show directory tree:
mc tree S3/eictest/EPIC/RECO/
- download a file:
mc cp /S3/path/to/some/file path/to/local/target/directory/
- more documentation:
mc -h
- top-level ePIC directory list:
- Once you have some files, you will need to write your own
config
file- Follow doc/example.config as a template
- Cross sections are available in
datarec/xsec/xsec.dat
For convenience, s3tools/src/loop_run_delphes.sh
can run Delphes on a list of files
in a list of directories
- Takes a list of directories as the arguments; they must be in the
datagen/
directory, since the Delphes output files will be to the same path, but withdatagen/
replaced withdatarec/
- Runs multi-threaded: one thread per directory
In case you want to update the cross section table xsec.dat
:
- the script
s3tools/src/get-cross-section.sh
will read the cross section fromGenCrossSection
in ahepmc
file; uses3tools/src/get-cross-section-ALL.sh
to automate runningget-cross-section.sh
over allhepmc
files in a specific directory tree; this will populatedatarec/xsec/*.xsec
files, one for eachhepmc
file - next use
s3tools/src/tabulate-cross-section.py
to read the tree of.xsec
files into a table of cross sections, output todatarec/xsec/xsec.dat
- given the time it takes to run
get-cross-section.sh
, we try to store the most up-to-date version ofxsec.dat
in this repository