Skip to content
ocolegro edited this page Jun 23, 2016 · 9 revisions

INSTRUCTIONS

Setting up:

  • The code needs to be run on SLC6 machines!

Git setup:

  • Developers, please create your personal fork of the repository before proceeding! See instructions below.
  • Keep in mind the following:
    1. You should setup an ssh key on any computer that you are running on:
      https://github.com/settings/ssh

Git stuff for developers:

  1. Setting up the repository in your area

    • If you at any point plan to upload code to the repository, create your own fork of the HGCAL_LDMX package. To do this, go to https://github.com/HGCAL_LDMX and click on the "Fork" button on the upper right. You'll find your fork at https://github.com/<username>/HGCAL_LDMX. You should already have a github account and have git set up correctly.
    • Check your git configuration:
      git config --list
    • Checkout your fork of the HGCAL_LDMX package:
      git clone https://github.com/<username>/HGCAL_LDMX.git .
    • Add alias for "remote" repository url and check:
      git remote add upstream https://github.com/ocolegro/HGCAL_LDMX
      git remote -v
      (Note, you don't have to name the remote repository "upstream", it's just a convention. You can give it whatever alias you want. However we'll always use "upstream" in this wiki.)
    • At any time, to checkout the "master" ("HEAD") branch of your fork, you can use:
      git checkout origin/master
  2. In order to sync your fork with the remote repository, run:

    • For the master branch of the upstream repository:
      git pull upstream master
    • Then, push any changes to your fork:
      • If you're working with your master branch:
        git push origin master
  3. Making and committing changes to the code

    • If you make any changes to files and want to commit them to your fork, you can first check the status of your local files using:
      git status
    • This will give you a list of modified files, which you can first "add" using:
      git add <modified_file_name>
      or, to add all modified tracked and untracked files:
      git add -A
    • Then commit the changes using:
      git commit -m "some commit message" <modified_file_name>
      or, to commit all changes:
      git commit -m "some commit message"
    • To check if you are in sync with the remote repository and get in sync if not:
      • Long version:

        • First "fetch" info from the remote repository:
          git fetch upstream
        • If you want to see the available branches (both local and remote):
          git branch -a
        • If you want to see the log of commits to say the "upstream/master" branch:
          git log upstream/master
        • If you want to check the differences between "upstream/master" and your local version:
          git diff upstream/master
        • Merge changes in the remote branch into your local version:
          git merge upstream/master
      • If you want to skip the intermediate steps:

        • For the master branch, you can do git fetch upstream and git merge upstream/master together using
          git pull upstream master
      • Having merged changes in the central remote repository with your local repository, you can upload your local changes to your fork's master branch:
        git push origin master

  4. Propagating your changes to the central repository

    • You can now generate a "pull" request to have your changes merged into the central remote repository by going to the url of your fork, looking for the "Pull Requests" button, and generating a "New Pull Request". Describe what you've changed and add any comments you'd like.

Set up your release area:

  • For the master branch :
    chmod 777 compile.sh
    ./compile.sh

Event Generation:

To run a N jobs on a lxplus machine with output to a local directory, one may simply call:

for i in 'seq 0 N'; do python submitProd.py -r ${i} -o 'YOUR_OUTPUT_DIR' -n 'N_EVENTS' ; done

To submit to an eos space one needs to replace -o by -e '/store/YOUR_EOS_DIR'

The boolean -s defines a signal or background event. By default this is set to 0 and generates 4 GeV electron background events. Setting -s to 1 requires that the user provides a correct path to a formatted data file via the -d option. The format of this file is [total energy, dir_x,dir_y,dir_z] of the recoiling electrons. Four sample points have been provided in the PFCALEE/data folder.

The default option for the -m is 1. This constructs a .1 radiation length W target at a distance of 20 cm from an HGCAL with a fixed 30 degree coverage.

Analysis :

Analysis scripts are currently ran out of the folders userlib and analysis. I originally had some issues making scripts in the analysis folder, so I have temporarily been making my analysis scripts in the userlib folder. To digitize generated events, one simply needs to cd into userlib and call:

for i in 'seq 0 N'; do python submitDigi.py -r ${i} -o 'YOUR_OUTPUT_DIR' -n 'N_EVENTS' -m 6 ; done

I have also written a script that allows one to call out to any general analysis script that has been compiled in the userlib. The caveat here is that the provided macro only requires a generated event file as input. These jobs may be submitted via:

for i in 'seq 0 N'; do python submitAnalyze.py -r ${i} -o 'YOUR_OUTPUT_DIR' -n 'N_EVENTS' -m 'YOUR_COMPILED_MACRO'; done