Warning, /tutorial-analysis/episodes/01-introduction.md is written in an unsupported language. File is not indexed.
0001 ---
0002 title: "Introduction"
0003 teaching: 5
0004 exercises: 5
0005 ---
0006
0007 ::::::::::::::::::::::::::::::::::::::::::::: questions
0008
0009 - How do I locate and access the simulation output?
0010
0011 :::::::::::::::::::::::::::::::::::::::::::::
0012
0013 ::::::::::::::::::::::::::::::::::::::::::::: objectives
0014
0015 - Understand how the simulation output is organised.
0016 - Download a file for the next step of the tutorial.
0017
0018 :::::::::::::::::::::::::::::::::::::::::::::
0019
0020 More detailed information on the simulation productions, including the information presented below, can be found on the [Simulation Production Campaign Website](https://eic.github.io/epic-prod/).
0021
0022 **Note that as of March 2026, Rucio will soon become the default and preferred method to browse and find files and datasets. A tutorial on using Rucio for this purpose will be presented soon, please see the [File Access Tutorial](https://eic.github.io/tutorial-file-access/) for the latest version of this tutorial.**
0023
0024 ## Simulation Files Organization
0025
0026 There are three broad classes of files stored on xrootd, each in their own directory:
0027
0028 - EVGEN: The input hepmc3 datasets
0029 - E.g. some files that have been supplied by a physics event generator
0030 - FULL: The full GEANT4 output root files (usually only saved for a fraction of runs)
0031 - If running a simulation yourself, this would be your output from processing npsim
0032 - RECO: The output root files from the reconstruction
0033 - And again, if running yourself, this would be your output from EICrecon (after you've used your awesome new reconstruction algorithm from the [Reconstruction algorithms tutorial](https://eic.github.io/tutorial-reconstruction-algorithms/) of course)
0034
0035 Most users will interact with the files in the RECO directory and that is what we will focus on in this tutorial. Within the RECO directory, files are organized by campaign (26.02.0 for the February 2026 campaign, for example), detector configuration and then physics process. Each physics process will have different sub directories, for example generator version, energy, or Q2. The directory structure and number of reconstructed files for each campaign can be found on the [Simulation Website reconstruction campaigns page](https://eic.github.io/epic-prod/campaigns/campaigns_reco.html).
0036
0037 ::::::::::::::::::::::::::::::::::::::::::::: callout
0038
0039 **Note that campaigns more than ~6 months old will not directly be accessible.**
0040 **If you are running this tutorial and encounter a file access error, check the campaign you are trying to access.**
0041 **Where possible, use the latest campaign available.**
0042
0043 :::::::::::::::::::::::::::::::::::::::::::::
0044
0045 ## Download a file for the next step!
0046
0047 We will need a file to analyse going forward, if you have not done so, download a file now!
0048
0049 Grab a file from -
0050
0051 ```bash
0052 epic:/RECO/26.02.0/epic_craterlake/DIS/BeAGLE1.03.02-1.2/eHe3/10x110/q2_2to10/
0053 ```
0054
0055 ::::::::::::::::::::::::::::::::::::::::::::: callout
0056
0057 Reminder, you can check the *content* of files within this dataset via:
0058
0059 ```bash
0060 rucio did content list --short epic:/RECO/26.02.0/epic_craterlake/DIS/BeAGLE1.03.02-1.2/eHe3/10x110/q2_2to10
0061 ```
0062
0063 and check the location of files in the dataset via:
0064
0065 ```bash
0066 rucio replica list file --protocols root --pfns --rses isopenaccess epic:/RECO/26.02.0/epic_craterlake/DIS/BeAGLE1.03.02-1.2/eHe3/10x110/q2_2to10
0067 ```
0068
0069 :::::::::::::::::::::::::::::::::::::::::::::
0070
0071 For example -
0072
0073 ```bash
0074 xrdcp root://dtn-eic.jlab.org:1094//volatile/eic/EPIC//RECO/26.02.0/epic_craterlake/DIS/BeAGLE1.03.02-1.2/eHe3/10x110/q2_2to10/BeAGLE1.03.02-1.2_DIS_eHe3_10x110_q2_2to10_ab.0001.eicrecon.edm4eic.root
0075 ```
0076 Note that the ./ at the end is the target location to copy to. Change this as desired.
0077
0078 ::::::::::::::::::::::::::::::::::::::::::::: callout
0079
0080 Note that we can also specify a different filename to copy to as we could with a normal cp command. You might want to do this as the filename is a little cumbersome.
0081 I called mine `3He_10x110_Feb26Campaign.root`, just replace ./ with your file name of choice.
0082
0083 :::::::::::::::::::::::::::::::::::::::::::::
0084
0085 You can also stream the file if you prefer, just copy the path of the file above. You will need to modify the scripts later in the tutorial accordingly to account for this. Check the [File Access Tutorial](https://eic.github.io/tutorial-file-access/) for information and examples on how to do this.
0086
0087 ::::::::::::::::::::::::::::::::::::::::::::: callout
0088
0089 Typically, if you are processing more than a handful of files, it is probably best to stream files from the server rather than downloading a local copy of all files.
0090
0091 :::::::::::::::::::::::::::::::::::::::::::::
0092
0093 <!---
0094 ## Advanced Use Case - Grabbing a whole bunch of files
0095
0096 I won't go through this in the tutorial, but this may be something you want to come back to as you get deeper into writing and using your own analysis code. This advanced use case involves copying/using a large number of processed files. Something you might want to do once your analysis is out of the testing phase and onto the "Let's process ALL of the data!" stage.
0097
0098 If you're moving a lot of files around, you might normally resort to using a wildcard -
0099
0100 ```bash
0101 cp File* My_Folder/
0102 ```
0103
0104 or similar. However, with xrdcp, this isn't so trivial. Some methods to test and try are include below.
0105
0106 where here we're finding things in the given path that match the name pattern provided, and copying them to our current directory.
0107
0108 Alternatively, you could grab a list of the files you want and pipe them to a file -
0109
0110 ```bash
0111 xrdfs root://dtn-eic.jlab.org ls /volatile/eic/EPIC/RECO/26.02.0/epic_craterlake/DIS/NC/18x275/minQ2=10 | sed 's|^|root://dtn-eic.jlab.org/|g' > list.txt
0112 ```
0113
0114 In this case, we're listing all files on the server in that path, piping them to sed and inserting "root://dtn-eic.jlab.org/" at the front and then feeding the output to the file "list.txt".
0115
0116 ```bash
0117 more list.txt
0118 root://dtn-eic.jlab.org//volatile/eic/EPIC/RECO/26.02.0/epic_craterlake/DIS/NC/18x275/minQ2=10/pythia8NCDIS_18x275_minQ2=10_beamEffects_xAngle=-0.025_hiDiv_1.0000.eicrecon.tree.edm4eic.root
0119 root://dtn-eic.jlab.org//volatile/eic/EPIC/RECO/26.02.0/epic_craterlake/DIS/NC/18x275/minQ2=10/pythia8NCDIS_18x275_minQ2=10_beamEffects_xAngle=-0.025_hiDiv_1.0001.eicrecon.tree.edm4eic.root
0120 ...
0121 ```
0122 We could then, for example, feed this list to a TChain -
0123
0124 ```c++
0125 TChain events("events")
0126 std::ifstream in("list.txt")
0127 std::string file("")
0128 while (in >> file) events.Add(file.data())
0129 events.Scan("@MCParticles.size()","","",10)
0130 ```
0131 Where in the final line we're only going to skim over the first 10 events.
0132
0133 It should be noted that the best solution may just be to run the files from the server, rather than copying them to somewhere else and running them there.
0134 -->
0135
0136 ::::::::::::::::::::::::::::::::::::::::::::: keypoints
0137
0138 - Use `xrdcp` from within eic-shell to copy files to your local environment.
0139
0140 :::::::::::::::::::::::::::::::::::::::::::::