Warning, /EICrecon/docs/tutorial/02-work-environment.md is written in an unsupported language. File is not indexed.
0001
0002 | title | teaching | exercises | questions | objectives | keypoints |
0003 |---------------------------------------------------|----------|-----------|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
0004 | Work Environment for EPIC Reconstruction Software | 10 | 10 | How to setup a work environment to use or develop EIC reconstruction software? | Clone EICrecon repository and build with eic-shell. <br/><br/>Obtain a simulated data file. | Use eicrecon executable to run reconstruction on a podio input file and to create podio output file. |
0005
0006
0007
0008 ## How do I setup a work environment for EICrecon?
0009
0010 A "work environment" includes a working directory and a full software stack that includes all dependencies for
0011 EICrecon. It also includes the EICrecon code itself. By far, the easiest way to set this up is using eic-shell
0012 as outlined in the first tutorial. Start with creating a work directory and then getting eic-shell up and running.
0013
0014
0015 A quick summary (please see first tutorial for details):
0016
0017 ```console
0018 mkdir ~/eic
0019 cd ~/eic
0020
0021 curl --location https://get.epic-eic.org | bash
0022 ./eic-shell
0023
0024 # or, if /cvmfs is available:
0025 # n.b. on JLab ifarm you may need to do 'module load singularity/3.9.5' first
0026
0027 singularity exec /cvmfs/singularity.opensciencegrid.org/eicweb/eic_xl:nightly eic-shell
0028
0029 ```
0030 Once inside the eic-shell, you should source the geometry setup script since this is not done by default.
0031
0032 ```
0033 source /opt/detector/epic-main/bin/thisepic.sh
0034 ```
0035
0036 Next, clone the EICrecon repository. In the future, you may want to work with a prebuilt EICrecon that comes
0037 with eic-shell. For now though, it is better to just clone the whole repository so you can modify it and
0038 submit changes back to GitHub.
0039
0040 ```console
0041 git clone https://github.com/eic/EICrecon
0042
0043 # or, if you have ssh keys set up on github
0044
0045 git clone git@github.com:eic/EICrecon
0046 ```
0047
0048 Check that you can build EICrecon using the packages in eic-shell:
0049
0050 ```console
0051 cd EICrecon
0052 cmake -S . -B build
0053 cmake --build build --target install -- -j8
0054 ```
0055
0056 If you are not familiar with cmake, the first command above (cmake -S . -B build) will create a directory "build"
0057 and place files there to drive the build of the project in the source directory "." (i.e. the current directory).
0058 The second cmake command (cmake --build build --target install -- -j8) actually performs the build and installs
0059 the compiled plugins, executables, etc. Note that the "-j8" option tells it to use 8 threads to compile. If you
0060 have more cores available, then set this number to an appropriate value.
0061
0062 ### Exercise 1:
0063
0064 Use the commands above to setup your working directory and build *EICrecon*.
0065
0066
0067 ## How do I run *eicrecon*?
0068
0069 *eicrecon* is the main reconstruction executable. To run it though, you should add it to your PATH and set up
0070 any other environment parameters needed. Do this by sourcing the "eicrecon-this.sh" file that should have been
0071 created and installed in the previous step. Once you have done that, run eicrecon with no arguments to see that
0072 it is found and prints the usage statement.
0073
0074 ```console
0075 source ~/eic/EICrecon/bin/eicrecon-this.sh
0076 eicrecon
0077
0078 Usage:
0079 eicrecon [options] source1 source2 ...
0080
0081 Description:
0082 Command-line interface for running JANA plugins. This can be used to
0083 read in events and process them. Command-line flags control configuration
0084 while additional arguments denote input files, which are to be loaded and
0085 processed by the appropriate EventSource plugin.
0086
0087 Options:
0088 -h --help Display this message
0089 -v --version Display version information
0090 -c --configs Display configuration parameters
0091 -l --loadconfigs <file> Load configuration parameters from file
0092 -d --dumpconfigs <file> Dump configuration parameters to file
0093 -b --benchmark Run in benchmark mode
0094 -Pkey=value Specify a configuration parameter
0095
0096 Example:
0097 jana -Pplugins=plugin1,plugin2,plugin3 -Pnthreads=8 inputfile1.txt
0098
0099
0100 -----------
0101 eicrecon parameters: (specify with -Pparam=value)
0102
0103 -Phistsfile=file.root Set name for histograms/trees produced by plugins
0104 ```
0105
0106 The usage statement gives several command line options. Two of the most important ones are the
0107 *"-l"* and *"-Pkey=value"* options. Both of these allow you to set *configuration parameters*
0108 in the job. These are how you can modify the behavior of the job. Configuration parameters
0109 will pretty much always have default values set by algorithm authors so it is often not necessary
0110 to set this yourself. If you need to though, these are how you do it. Use the "-Pkey=value"
0111 form if you want to set the value directly on the command line. You may pass multiple options like
0112 this. The "-l" option is used to specify a configuration file where you may set a large number
0113 of values. The file format is one parameter per line with one or more spaces separating the
0114 configuration parameter name and its value. Empty lines are OK and "#" can be used to specify
0115 comments.
0116
0117
0118 ## Get a simulated data file
0119 The third tutorial in this series described how to generate a simulated data file. If you
0120 followed the exercises in that tutorial you can use a file you generated there. If not, then
0121 you can grab an existing simulted data file for mthe web for the purposes of this tutorial.
0122 This will grab a 226MB file:
0123
0124 ```console
0125 wget https://eicaidata.s3.amazonaws.com/2022-09-26_ncdis10x100_minq2-1_100ev.edm4hep.root
0126 ```
0127
0128 ### Exercise 2:
0129
0130 Run `eicrecon` over your simulated data file by giving it as an argument to the program.
0131 e.g.
0132
0133 ```console
0134 eicrecon 2022-09-26_ncdis10x100_minq2-1_100ev.edm4hep.root
0135 ```
0136
0137
0138 ## Generating a podio output file
0139 To write reconstructed values to an output file, you need to tell *eicrecon* what to write.
0140 There are several options available, but the mosrt useful one is *podio:output_collections*.
0141 This is a comma separated list of colelctions to write to the output file. For example:
0142
0143 ```console
0144 eicrecon -Ppodio:output_collections=ReconstructedParticles 2022-09-26_ncdis10x100_minq2-1_100ev.edm4hep.root
0145 ```
0146
0147 To see a list of possible collections, run *eicrecon -L* .
0148
0149 ### Exercise 3
0150
0151 Use *eicrecon* to generate an output file with both *ReconstructedParticles* and *EcalEndcapNRawHits*
0152
0153
0154
0155 {% include links.md %}