Joshuha Thomas-Wilsker's Homepage

Hello and welcome to my homepage. I am currently a PHD student in the particle physics group at Royal Holloway College, University Of London. My current research is in the search for the Higgs Boson at the ATLAS experiment at CERN. There are many working groups in the collaboration currently working towards the common goal of finding the Higgs Boson.

When looking for the Higgs lifetime, like most massive particles, it decays almost instantly and so cannot be observed directly. Instead we observe the particle through it's decay products which can be predicted accurately by the standard model. Each working group concentrates on an analysis based in one of these decay channels. The group I currently work in is called HSG5 which is the group responsible for the analysis which utilises the decay of the Higgs to a b-quark with an anti b-quark.

Until recently the aim was to uncover significant evidence for this particle but recent results with the ATLAS Detector at the LHC from both ATLAS and CMS have shown the observation of a new particle in the search for the standard model Higgs Boson. So the game has changed slightly and now it is less to do with finding out if it exists and more to do with the phenomenology of the particle.

I hope to update this page regularly as a log book of my work in HSG5 along with helpful hints and tips for both author and audience.

Useful coding tricks :


This page is mostly used as a place to put useful tid-bits but hopefully others may find something useful here as well.

Useful lxplus aliases:


This allows you to see all aliases for ATLAS software:

Source ROOT : localSetupROOT

RHUL Faraday Cluster:

To check on jobs (only accessible at RHUL):

To kill a job on the Faraday cluster use the command:
$> qdel $job_number

To kill all jobs :
$> qselect -u $USER | xargs qdel

Subversion (SVN)

The central SVN is only accessible to CERN registered computer users i.e. you need a CERN account. If you have not already got an account, contact your group leader at your institute.
All repositories will also have a set of permissions. Unless these permissions give you read/write access to the repository you will not be able to access it. To gain access, you must get in contact with the owner/librarian of the repository.
ATLAS has moved to a user based repository system. Your repository can be found at:<cern_username>

A handy web interface allows you to see the structure of your repository:

When you go to this page, log in at the top right of the page with your CERN username and password and you should be able to click on the "personal repository" tab on your home page.

SVN works on the basis that you have a repository kept on the central server and you can check out a version of it, edit it and commit the changes. This means that if you edit something locally and make a mistake, even when you commit your changes, you can still look back through the older versions of your code on the server, check out the old version and try editing again, starting from the last version where you know there were no mistakes.

On lxplus (SLC6) / linappserv (SLC5):

$>setupATLAS (If you haven't got setupATLAS alias see setupATLAS section)

Setup your chosen athena release:

$>asetup [works on linapserv0]

Setting up SVN:

$>export SVN_EDITOR="emacs -nw"

You can setup the variable SVNUSR to make life easier:

$>export SVNUSR="svn+ssh://"

Check out a Fresh Repository
You can check out a fresh version of your repository. Change into a directory you want to be associated with the svn repository. Once inside that directory you can get a fresh version of the repository by doing:

$>svn co svn+ssh://'username''username'

This version is now your local repository. Once you have this version, anything you do to the files in this directory will change their counterparts on the svn central server ONCE you do a commit but not before.

One important thing to note is that when you are manipulating files in the local repository, you should use the svn equivalent of bash commands as they handle all the hidden files that svn places about the place. These commands can only be used on files that are already under version control. Copying a regular file to a local svn repository version you should just use regular bash commands and the 'svn add and commit' to put them under version control.

Example of svn bash equivalents:

$>svn rm 'filename'
$>svn mv 'filename'
$>svn cp 'filename'

Performing these actions will prompt svn to show you an update of the status of the files you have changed in your local repository. This will look like a list of the changed files with a 'D' (deleted) or 'A' (added). (There can be others, if so consult the handbook linked at the bottom of the page)

Commiting one file
If you only want to commit one file from the local directory to svn, the best way to do it is to add a new directory to your svn repository like:

$>svn mkdir svn+ssh://

Once comfortable with your changes you can double check everything you have done by doing:

$>svn status

Which will give you the list of all New or deleted files. When you are ready to commit do:

$>svn commit -m "Here you should say what you have changed for this commit"

SVN will then check for conflicts.

If you have conflicts svn will let you know.

When merging branches, or just updating a working copy, you will probably experience conflicts at some point, where the same text has been modified both in the local uncommited working copy and the updates that you just checked out. The SVN merging algorithm will try to handle these situations, but when it can't you will have to apply some intelligence to resolving the deadlock. This is a conflict, just as in CVS.
Unlike CVS, which celebrated conflicts by putting both options into the local files, surrounded by lots of <<<< and >>>> stuff, SVN tries to be helpful. It will do the CVS thing, but also creates several new files in the directory for each conflicted one: a conflict in myfile will result in myfile.mine (containing what was in the working copy before your failed update/merge), and versions corresponding to the revisions surrounding the conflict, e.g. myfile.r123. If you know that one particular version is the one that should be used, just copy it into place, e.g.
cp myfile.mine myfile
Otherwise, manually hack the myfile with all the <<<< stuff in it until you are happy: some code editors like emacs and Eclipse can help with this.
However, you're not quite in a state where you can commit again, though: CVS allowed files with those <<<< sections to be committed back into the repository, which sometimes caused problems. To protect against accidental commits of this kind (maybe you just didn't spot that there was a "C" for "conflict" in the svn update log), SVN requires that you declare the conflict to have been resolved:
svn resolved myfile
And you're done.
if the commit was successful you should have an output like:

Deleting ttH
Adding ttH_Dilepton_analysis_2014
Deleting ttH_Dilepton_analysis_2014/truth_tagger/trunk/backup

Committed revision 152840.

and that's it.

You can do the following command inside the directory of interest:

$> svn info

which will give you more information about that directory.

Adding a new folder to existing repository

Check out a working copy of the directory in question. Then:

1. svn up to get your working copy up to date
2. svn delete <directory> to get rid of the current directory
3. svn commit -m 'Deleted old module'
4. Copy in the new directory to the working copy
5. svn add <directory> to add your new directory structure
6. svn commit -m 'Added new module'

To add a new folder to your repository without the hassle of checking out you can use the import command. Change into the directory you want to import to svn and do:

svn import . svn+ssh://'username''username'/'nameoffile' -m "Here you say what you imported"

If you imported something accidently and want to delete it:

svn delete svn+ssh://'username''username'/'fileToBeDeleted' -m "here you say what you deleted"

More Helpful commands
When using subversion (SVN) you will find these commands very useful:

SVN tags are a snapshot in time. If you are working from a tag, you will have a set collections of package revisions. Doing svn update won’t (or at least shouldn’t) make any changes to the revision you’re using (although svn might say now at revision xxxxx the file won’t change).

To override this you can force that directory to look at the trunk instead of the tagged version by doing for example:

svn switch svn+ssh:// .

This will now look at the trunk and when you do svn info you should see the updated revision in the output to screen.

If you just want to update to a particular release of a package, you can change into the uppermost directory of the pack you want to update and do for example:

$>svn switch svn+ssh:// ./


$>svn update

Inside you local repository will update it to the most up-to-date release in the central repository.

Web Interface

You can access your repository via the web interface :

RHUL SVN Directory
More info:

Pathena and Panda client

1.) source /afs/

2.) export PATHENA_GRID_SETUP_SH=/afs/

3.) source /afs/

4.) voms-proxy-init -voms atlas

Making MC12 Ntuples

The following steps are used for RHUL servers running SLC5/6.

Once the grid environment has been established and you have setup the ATLAS env. setup athena:

Used the following for the truth matching study:

$>export AtlasSetup=/afs/
$>alias asetup='source $AtlasSetup/scripts/'
$>asetup,MCProd,64,here --cmtconfig=x86_64-slc5-gcc43-opt

(also tried >asetup,slc5,here --testarea=/home/username/ATLAS/testarea)

You should also export the variable:


This will allow you to access the most recent MC12JobOptions files on cvfms.

The first example here shows how to go from an LHE (Les Houches) file to an EVGEN file.

Les Houches files are the result of an accord made in 2001 which standardised the interface between matrix element and event generator software. Seeing as there are several commonly used programs (e.g. Madgraph, Powheg etc) that are capable of performing the matrix element calculation, it is important to ensure uniformity amongst their output files so that physicist may pick and choose the best calculation for the process they want to look at. Hence, LHE files are the output of the matrix element software and come before the implementation of parton showering tools such as Herwig and Pythia.

The following Python script takes LHE files as the input and transforms them into EVGEN files. ecmEnergy='8000' runNumber='195848' firstEvent='1' maxEvents='5000' randomSeed='1234' jobConfig='/scratch5/jwilsker/ttH_files/LHE_PowHegPythia8_ttH125_8TeV_AZNLO_main31_mc12/' outputEVNTFile='/scratch5/jwilsker/ttH_files/EVGEN_PowHegPythia8_ttH125_8TeV_AZNLO_main31_mc12/user.jthomasw.mc12.8TeV.EVGEN_PowHegPythia8_ttH125_AZNLO_main31.pool.root' inputGeneratorFile='/scratch5/jwilsker/ttH_files/LHE_PowHegPythia8_ttH125_8TeV_AZNLO_main31_mc12/group.phys-gener.Powheg_CT10.169887.PowHel-ttH_125_8TeV.TXT.mc12_v1_i11/group.phys-gener.Powheg_CT10.169887.PowHel-ttH_125_8TeV.TXT.mc12_v1._00050.tar.gz'

Notes on options (these can be seen by doing $> -h ) :

1 ecmEnergy (float) # Center of mass energy parameter in GeV e.g. 8000.
2 runNumber (int) # each run number corresponds to one physics process. If this is already defined for the process, then use the assigned number. Otherwise make one up.
3 firstEvent (int) # number of the first event in the output data file.
4 maxEvents (int) default=-1 # Maximum number of events to process.
5 randomSeed (int) # random seed for physics generators.
6 jobConfig (list) # jobOptions fragment containing the physics and the configuration settings which is passed to the generators. If the process is already cached, you can probably find the Job options file by listing the files in this directory:

$>ls /cvmfs/

7 outputEvgenFile (str) # Output file that contains generated events
[ 8 histogramFile] (str) default='NONE' # Output file that contains histograms.
[ 9 ntupleFile] (str) default='NONE' # Output file that contains ntuples.
[10 inputGeneratorFile] (str) default='NONE' # Input file used by the particle generator to generate events
[11 EvgenJobOpts] (str) default='NONE' # Tarball containing the MC09JobOptions to use

The maximum number of events that can be generated is 5000. If you exceed this number, the event generation will fail. When this happenms it will retry 9 times before returning an error which will be fatal for the job.

The following is output by the python script and can be found in (inputDictionary.pickle):

Py:Generate INFO .maxeventsstrategy = 'INPUTEVENTS' # (String) what to do if number of input events is less than maxEvents. Possible values: ['IGNORE', 'INPUTEVENTS', 'ABORT']

This tells you that if you give as an argument, a number that is more than the number of input events, the maxeventstrategy will be employed. In this case, the max events will be set to INPUTEVENTS.

Going from LHE to EVGEN using the grid:

pathena --trf " ecmEnergy=8000 runNumber=195848 firstEvent=1 maxEvents=1000 randomSeed=%RNDM:1234 outputEVNTFile=%OUT.pool.root inputGeneratorFile=%IN" --inDS inputDS.TXT.v1/ --outDS user.jthomasw.outputdataset --nFiles 3 --nFilesPerJob 1

One can then use the script which is a tool based on D3PDMaker classes. It converts between Ntuple types applying the basic skimming/trimming/slimming procedures set out by the ATLAS MC group.


To go from an EVTGEN file to a NTUP_TRUTH you can use the general reconstruction job transform , using following command: inputEVNTFile='<pathtoinput>.EVGEN.pool.root' outputNTUP_TRUTHFile='<pathtooutput>NTUP_TRUTH_test.root'

Note , one can use the preExec option with D3PD maker flags to alter your output file. To include ALL truth information, you could use something like:

preExec='from D3PDMakerFlags import D3PDMakerFlags;D3PDMakerFlags.TruthWriteEverything.set_Value_and_Lock(True)'

Along with the rest of the command line.

You can submit these jobs to the grid like:

pathena --trf " inputEVNTFile=%IN outputNTUP_TRUTHFile=%OUT.NTUP_TRUTH.root" --outDS user.jthomasw.mc12_8TeV.189628.PowhegJimmy_AUET2CT10_PowhelttH125inc_ljets_NTUP_TRUTH --inDS mc12_8TeV.189628.PowhegJimmy_AUET2CT10_PowHelttH125inc_ljets.evgen.EVNT.e2833/

This will run your job on the grid. For other types of file, you can change the job options.

For more information go to the D3PD Data Reduction section of the ATLAS Software Tutorial.

(2014 tutorial link here: )

Using the Cluster (Faraday Farm RHUL)

54 SLC5 (12 SLC6) nodes each with 8Gb (16GB) of memory and ~50GB temporary disk space (in /data).

Can run one job per cpu core.

Batch system using Torque & Maui software to manage farm of worker nodes.

You can log onto a node directly from pbs1 or pbs2 by simply using the command:

$>ssh nodeX

Where X is a valid worker node number. You can check which nodes are running on pbs webmon (if you are on campus).

Some useful commands:

$>qsub <script> : submits job by script.
$>qsub -N <name> -1 long <script> Submit job to long queue with specified name.
$>qsub -v VARIABLE=value <script> submit job script to be run with env var set to value. can comma separate variable list (VAR1=v1, VAR2=v2,…)

$>qstat -Q : show status of all queues, including no. of jobs queued and running.
$>qstat -u $USER : lists only users jobs.

$>qdel <jobid> : deletes job.

$>showq lists jobs in order they are scheduled to run.

$>qstat -n1 : lists extra stat info (including node your job is running on)

Running jobs in parallel

You may want to run jobs in parallel.

Torque sets some environment variables when your job script is run:

PBS_JOBNAME : name of job.
PBS_JOBID : job id
hostname : node on which job is running

For job output, your script should create a unique output dir on /data using jobid.

mkdir -p $JOBDIR
# Run some program, which writes output to the current directory
# NB It is good practice to make your own log file, not rely on the batch system to return stdout.
$HOME/bin/myprog > log 2>&1

Now one must copt he files you need back to the directory you want them in at the end of your job:

# copy output and check it worked
cp $JOBDIR/output.txt /home/$USER/joboutput/output_${PBS_JOBID}.txt
if [ $? = 0 ]; then
echo "copy failed"
exit 1
cp $JOBDIR/log /home/$USER/joboutput/log_${PBS_JOBID}
# etc.
# if copy succeeded, tidy up
rm -fr $JOBDIR

This could be a recursive copy if you want to save multiple files.

Monitoring Jobs
The following command can be used in the terminal to monitor your jobs:


Using the -n option allows you to see which node you are running on.

While your jobs are running you can check the error / output files in the following directories:

SLC5 machine:

$>less /var/spool/pbs/spool/<PBS_ID>.ER
$>less /var/spool/pbs/spool/<PBS_ID>.OU

SLC_6 machine:

$>less /var/lib/torque/spool/<PBS_ID>.OU
$>less /var/lib/torque/spool/<PBS_ID>.ER


One can obtain a set of aliases which can be used to setup a bunch of useful atlas tools.
source $ATLAS_LOCAL_ROOT_BASE/user/;

Setup ATLAS Environment on Linappserv
alias setupATLAS='source $ATLAS_LOCAL_ROOT_BASE/user/'
export ATLAS_LOCAL_ROOT_BASE="/cvmfs/"

DQ2 is now deprecated and is especially not maintained code on SLC6 machines. You should use Rucio!

Setup Rucio

source /afs/
voms-proxy-init -voms atlas

Use “setupATLAS” alias. You can then use these to source the most up-to-date versions of common tools.

“localSetupDQ2Wrappers” is the one you want which sets up Rucio.

Rucio is then used in the same way as DQ2 Tool was:

rucio-get <your output Dataset name> : Downloads your job output.
rucio-ls <pattern> : lists your datasets with name <pattern>

Log on to a slc6 machine @ RHUL e.g. linappserv2 then using this ordering ONLY perform the following commands:

After which you can use rucio?!)

Using DQ2

If you have a large dataset you want to store on the grid you can use the dq2-put command:

$> dq2-put -L <DQ2_LOCAL_SITE_ID> -f <path_to_file_for_transfer> <dataset_container_name>

To find the location of your local institute site where files will be accessible on the grid do (i.e. <DQ2_LOCAL_SITE_ID>):

$> dq2-sources


pbook : Grid job management
“pbook” can be used to manage your grid jobs. Type pbook to open the program and pbook will automatically sync, getting all your current jobs and the relevant information.

Inside the pbook environment you can use the commands:

retry(jobID) : Retries any failed tasks inside the job.
kill(jobID) : Kills the job.
help(<command>) : gives you options on a <command> in pbook.

and much more.


Got a leaky memory? Call valgrind on:

>$ valgrind --tool=memcheck --leak-check=full --show-reachable=yes -v ./ttH_Dilepton.exe /scratch5/connelly/ttHFiles/ProductionML_14_00_20/Simulation/Combined/181087_AFII.ML_7B.root subChan 2 2 0 10000

by adding a "-g" option into the GNUMakefile CFlags when compiling, all line numbers will get passed to to objects as well so Valgrind will also see said line numbers.

MemChack will also report errors like "Conditional jump or move depends on uninitialised value(s)". These are hard to solve, but for additional help (and sacrificing a bit more CPU time) you can run with the option


To help you resolve the issue.


In root directory (pathname >$ROOTSYS if root is sourced), one can use "root-config --<option>" to find out various pieces of information about the root packages you are using.
If one types the command:

root-config --help

You can find out more.

TKey : Root files
Root files are structured in directories. Each directory has a list of keys and objects in the memory. A key is an object which describes the type and location of a persistent object in a file.

You can get a list of keys for a particular file using the TFile function GetListOfKeys().

Keys have a function GetName() which returns the name of a given key.


Diff. between two files (bash)
grep -Fxvf file1 file2

Size of directory:
$> du -s directory/

size of partition:
df -h /dev/hda*

To find a file in a directory:
> find ../TopRootCore -name 'WhichPeriodSvc.cxx'

This takes wildcards as arguments.

If you want to find out if a particular variable/function in a file you can do the following:
> find ../TopRootCore -name 'WhichPeriodSvc.cxx' -exec grep -H which {} \;

This also takes wildcards so you could effectively search a directory for a variable/function.

Want to DELETE all files withOUT for example, files with name beginning with “a” (WARNING: as this removes files recursively!!!!!):

find . -type f -not -name "a*" | xargs rm

To just find a file “filename” anywhere just do:

which ‘filename’Find “fastjet” in all .cxx” directories

find ./ -name '
.cxx' -exec grep -H fastjet {} \;

or find a file:

find ../. -name "*WhichPeriodSvc*"

To find a file in a directory:
> find ../TopRootCore -name 'WhichPeriodSvc.cxx'

This takes wildcards as arguments.

If you want to find out if a particular variable/function in a file you can do the following:
> find ../TopRootCore -name 'WhichPeriodSvc.cxx' -exec grep -H which {} \;

This also takes wildcards so you could effectively search a directory for a variable/function.

Want to DELETE all files withOUT for example, files with name beginning with “a” (WARNING: as this removes files recursively!!!!!):

find . -type f -not -name "a*" | xargs rm

To just find a file “filename” anywhere just do:

which ‘filename’

Disassociating running jobs with Shell:
1.) Send job to background subshell using ctrl+z
2.) Find the job id using top
3.) Use command : $> bg jobid to ensure all background jobs are actually running
4.) Use “disown” command to make sure any job associated with the shell will not quit if the shell is quit

Mailing list groups @ CERN

On lxplus you can find out which group you are a member of by typing:

$>pts membership jthomasw

Tricks to SED:
Useful command that will remove appendices from all lines in file "lhe_file_list.txt":

sed -e 's|.tar.gz||' lhe_file_list.txt > lhe_file_list_output.txt

Installing Programs from internet

If you have copied you .dmg (disk image file) to applications and it is still not opening you may have to do the following:


>Click “lock” to make changes

>Allow apps downloaded from “Anywhere”

>Open Double click App you want to install from Applications folder

>Once working ensure you Security settings are put back to normal


The libraries required to run your program need to be sent to the compiler. You need to tell the compiler where the shared objects can be found. The compilation will not crash so long as you tell the compiler where to find the objects and the object name. Although if you give it an inorrect path or object name, it will crash at run time when it comes to using that object. You can find out which libraries you need for a particular file by doing the following:

rc get_ldflags TopMiniNtuple

This will get the list of libraries needed. You can then copy this output into your makefile :

LIBS = -L/scratch3/jwilsker/TopRootCore/RootCore/lib -lTopMiniNtuple


To enable the use of EOS from external server (e.g. linappserv):

source /afs/
export EOS_MGM_URL=root://

My Links


Ananlysis 2012

Pythia Validation


Other Useful Pages

My Personal Data

Note: if personal data is being stored using a secret database, then it is only visible to the user and to administrators.


My Personal Preferences

Uncomment preferences variables to activate them (remove the #-sign). Help and details on preferences variables are available in TWikiPreferences.

Related Topics

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng bww.png r1 manage 106.6 K 31 Jul 2012 - 14:42 JoshuhaThomasWilsker  
PNGpng bwz.png r1 manage 111.6 K 31 Jul 2012 - 14:42 JoshuhaThomasWilsker  
PNGpng bzz.png r1 manage 95.8 K 31 Jul 2012 - 14:43 JoshuhaThomasWilsker  
PNGpng elww.png r1 manage 147.5 K 31 Jul 2012 - 14:43 JoshuhaThomasWilsker  
PNGpng elwz.png r1 manage 142.8 K 31 Jul 2012 - 14:43 JoshuhaThomasWilsker  
PNGpng elzz.png r1 manage 143.5 K 31 Jul 2012 - 14:43 JoshuhaThomasWilsker  
PNGpng jww.png r1 manage 145.2 K 31 Jul 2012 - 14:44 JoshuhaThomasWilsker  
PNGpng jwz.png r1 manage 139.0 K 31 Jul 2012 - 14:44 JoshuhaThomasWilsker  
PNGpng jzz.png r1 manage 150.9 K 31 Jul 2012 - 14:44 JoshuhaThomasWilsker  
PNGpng muww.png r1 manage 140.0 K 31 Jul 2012 - 14:44 JoshuhaThomasWilsker  
PNGpng muwz.png r1 manage 139.9 K 31 Jul 2012 - 14:44 JoshuhaThomasWilsker  
PNGpng muzz.png r1 manage 144.5 K 31 Jul 2012 - 14:45 JoshuhaThomasWilsker  
Edit | Attach | Watch | Print version | History: r16 < r15 < r14 < r13 < r12 | Backlinks | Raw View | Raw edit | More topic actions...

Physics WebpagesRHUL WebpagesCampus Connect • Royal Holloway, University of London, Egham, Surrey TW20 0EX; Tel/Fax +44 (0)1784 434455/437520

Topic revision: r15 - 10 Jul 2015 - JoshuhaThomasWilsker

  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback