NEXT Analysis Quickstart Guide
NEXT Analysis Quickstart Guide
NEXT Analysis Quickstart Guide
6) Build it
- cd into the IC directory
- source manage.sh work_in_python_version 3.7
-
Setting yerself up for nexus analysis:
Warning: nexus and IC don’t play well together. If you have set up your environment for one of
them, you will need to open a new terminal to set it up for the other one. Don’t try to cofigure
both in one terminal.
To build nexus:
Execute your new alias:
(This presumes you’ve got Geant4 available to you, as is true on the ific
nodes. However, on yer laptop download G4, build using
cmake -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_OPENGL_X11=ON
-DCMAKE_INSTALL_PREFIX=$GEANT4_DIR $GEANT4_DIR;
make; … get a sandwich, make install, then set it up, then proceed...)
> nexus_setup
Go to the directory nexus is in, then run scons to build it
> scons
Watch the compiler output fly!
hitpositions=[]
for h in data[eventNumber][particleNumber].hits:
hitpositions.append(h.pos)
hitpositions=np.array(hitpositions)
pylab.figure(figsize=(5,5),dpi=200)
pylab.plot(hitpositions[:,0],hitpositions[:,2],'o--')
pylab.xlabel("X position / mm")
pylab.ylabel("Z position / mm")
Running Invisible Cities to look at Waveforms
Make sure IC is built (see above), and that city is in your path:
> cd IC/bin
> export PATH=$PATH:$PWD
Now you have access to the “city” executable. Run a city, for example,
diomira, like this:
> city [cityname] [configfile]
In this case:
> cd invisible_cities/config
> city diomira diomira.conf
To look at the city output, open a python notebook using one of the
methods described. Use these imports:
import numpy as np
import pylab
import tables as tb
%matplotlib inline
Check out pytables tutorials and docs online to understand the details of
its functionality. But as a quick tour, we can see what tables are in the file
like this:
Dat.root
… Outputs this:
children := ['Filters' (Group), 'MC' (Group), 'RD' (Group), 'Run' (Group)]
The Raw Data waveforms are in table RD:
dat.root.RD
… Outputs this:
children := ['pmtblr' (EArray), 'pmtrwf' (EArray), 'sipmrwf' (EArray)]
Make a plot!
M=1
N=1
waveform=dat.root.RD.pmtrwf[M][N]
pylab.figure(figsize=(5,3),dpi=200)
pylab.plot(waveform)
pylab.xlabel("Tick")
pylab.ylabel("PMT Pulse Height (ADC)")
Try these Life-Hacks to make your world lazier:
Passwordless login
To log in without having to type your password every time, you can set up an ssh RSA
key. On a Mac, that involves typing these commands from your home directory:
ssh-keygen -t rsa
ssh [username]@neutrinos1.ific.uv.es mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh [username]@neutrinos1.ific.uv.es 'cat >>
.ssh/authorized_keys'
You can run jupyter notebooks on neutrinos1 and forward the output to your local
browser like this:
For [port] pick a 4 digit number, and pick a unique one from all your friends.
Paste it into your browser, and you should be forwarding the notebook.
Aliases Commented [1]: This is a good document
If you are too lazy to type out the full ssh command, add these to your ~/.bash_profile on
your local computer: