The SHiP perspective on root
Oliver Lantwin on behalf of SHiP.
[oliver.lantwin@cern.ch]
root Users’ Workshop, Sarajevo 2018-09-13
The SHiP perspective on root Oliver Lantwin on behalf of SHiP. [ - - PowerPoint PPT Presentation
The SHiP perspective on root Oliver Lantwin on behalf of SHiP. [ oliver.lantwin@cern.ch ] root Users Workshop, Sarajevo 2018-09-13 What is SHiP? Future experiment designed to look for super-weakly interacting new particles at the intensity
Oliver Lantwin on behalf of SHiP.
[oliver.lantwin@cern.ch]
root Users’ Workshop, Sarajevo 2018-09-13
What is SHiP?
Future experiment designed to look for super-weakly interacting new particles at the intensity frontier with zero background.
115 m
› Future experiment → What is the future of ROOT now will be ROOT when we run! Need to stay on top of developments!
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
2
What is SHiP?
Future experiment designed to look for super-weakly interacting new particles at the intensity frontier with zero background.
115 m
› Young experiment → Little technical debt
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
2
What is SHiP?
Future experiment designed to look for super-weakly interacting new particles at the intensity frontier with zero background.
115 m
› Zero background → Simulation of background crucial for success!
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
2
What is SHiP?
Future experiment designed to look for super-weakly interacting new particles at the intensity frontier with zero background.
115 m
› Physically quite large → a lot of non-trivial structural, mechanical and civil engineering that we need to synchronise with ROOT
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
2
FairShip
Still fairly small collaboration → only few regular contributors to the software — mostly with lhcb background — and users from very different backgrounds › Can’t afford to re-invent the wheel! › Build on FairRoot, but wrap everything in Python! (for free, thanks to PyROOT!)
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
3
FairShip
pythia6 GCC-Toolchain lhapdf5 MySQL ZeroMQ FairLogger EvtGen HepMC pythia Tauolapp PHOTOSPP lhapdf boost ROOT generators log4cpp GEANT4 GEANT3 FreeType AliEn-Runtime GSL
Xdevel Xcode yaml-cpp Python-modules Python libpng googletest nanomsg FairRoot FairSoft msgpack simulation DDS flatbuffers protobuf FairMQ sqlite FairShip GENIE GEANT4_VMC zlib vgm
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
4
Caveat
ROOT and the hep ecosystem are currently very hard to separate: most of what I say applies to the combination of both. For context, I myself have recently used ROOT for the following: › Optimisation of detector geometry using simulation and Bayesian
› Online data conversion/processing + monitoring › Background studies Where we don’t (always) use ROOT: › Machine learning → sklearn &co., in particular scikit-optimize › Plotting (see later) › DAQ and early stages of online system for the muon fmux measurement
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
5
“Do we need the ROOT dependency?”
Frequent discussion with colleagues, especially with non-physicists ( e.g. engineers, software dev-ops, mathematicians), but also by old guard Example Muon shield optimisation: on dedicated cluster we use ROOT+Geant4 for simulation and our entire experiment stack only runs in Docker containers. Why can’t we just use numpy/ISO C99/FORTRAN… — anonymous colleagues
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
6
PyROOT
› Magic when it works: can use Geant, Pythia etc. through ROOT and PyROOT, generates bindings for all of our C++, e.g.: ROOT.TGeant4.GetMC()... › … but dependencies and C++ headers don’t always play nice › Need to keep in mind 3 different memory models: C++, ROOT & Python
› a lot of surprising behaviour › comprehensions etc. usually don’t (always) work › C++ singletons…
› What will happen with Python 3?
› PyROOT seems to be ready, but hep ecosystem is a mixed bag
› pyROOT hijacks --help
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
7
The dependency problem
› System package managers don’t work well for the hep software stack › The past: A collection of shell scripts to set up everything → Nightmare to maintain › Now: Using ALICE’s aliBuild → clever dependency resolution, state-less (mostly reproducible) builds, fmexible; most dependencies use CMake nowadays
› Git repos for all dependencies, fork if necessary › Building from source similar to what Chandler suggests works, but don’t have the manpower to live at head just yet › especially “uncloning” diffjcult
› Future: Some hep community standard? Updating ROOT unfortunately always diffjcult. Current example: Geant4 and ROOT have confmicting typedefs in the global namespace
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
8
The real world
Need to interface with many other tools: › Fluka › Opera › CAD (e.g. CATIA) › … Currently TGeo + TVMC is the canonical geometry for simulation, interface with e.g Fluka using GDML › does not work for persistence of magnetic fjelds, need to recreate geometry to have correct magnetic fjelds for reconstruction › moving to fjeld maps from fjnite elements simulation and measurement
DD4HEP part of the answer?
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
9
Plotting
Parts of the collaboration use: › PAW › ROOT › matplotlib &co. for plotting. [I personally use the last two +tikz.]
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
10
Plotting
Parts of the collaboration use: › PAW › ROOT › matplotlib &co. for plotting. [I personally use the last two +tikz.]
50 100 150 200 250 300 350 p/GeV 1 2 3 4 5 6 /GeV
T
p Simulation Entries 1.778627e+07 Mean x 15.15 Mean y 0.4382 Std Dev x 18.33 Std Dev y 0.2949 1 10
2
10
3
10
4
10
5
10 Simulation Entries 1.778627e+07 Mean x 15.15 Mean y 0.4382 Std Dev x 18.33 Std Dev y 0.2949
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
10
Plotting
Parts of the collaboration use: › PAW › ROOT › matplotlib &co. for plotting. [I personally use the last two +tikz.]
0.0 0.5 1.0 1.5 2.0 2.5
iteration
×103 100 101
loss function
cumulative minimum loss rf cumulative minimum loss gb baseline Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
10
Event display
‘Final’ muon flux geometry
Muon tagger (RPCs) 200x150x200 cm3 Hadron absorber 240x240x240 cm3 Target Ø 10cm 157.6 cm long T1 T2 50x100x54 cm3 60° stereo angle 270µ resolution T3 T4 200x160x16 cm3 Distance hadron absorber-Goliath 121 cm Distance T1-T2 (center) 63 cm Distance Goliath-muon tagger (RPCs) 199.5 cm Distance T3-T4 (center) 160 cm
x z y
Goliath 450x294x360 cm3 Beam counter 1.6x1.6x1.6 cm3
17.86 cm up (T3,T4 & RPCs)T3, T4 and RPCs centered with respect to Goliath center to maximise acceptance
› Building an event display (or just displaying geometry) with TEve/TGLViewer very cumbersome, extremely slow! Geometry hard to
→ Looking forward to web-based new graphics, VecGeom
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
11
Personal nit-picks
› <Ctrl-D> should quit root › Support for C++11 and idiomatic python loops for more structures? › Templates ≫ Pointer casting › RDataFrame error messages are completely unintelligible › TMultiGraph › TGeo/Geant4 units → Dream: dimensions/units could be enforced by type system!
› Once accidentally ran simulation with 500 T → very good muon shield performance
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
12
ROOT killer features
A non-exhaustive personal selection (that were not yet mentioned?): › Magical interface between C++ and Python › Interactive, proper C++with ROOT6 (and --strict) › EOS integration good enough to forget where fjles are (even for non-ROOT fjles!) › ROOT::MakeSeq() › PGF export › Starting to really like RDataFrame and VecOps › Open source! Caveat: Started working with ROOT when ROOT6 was just getting started › Very noticeable big and small improvements since then! › Always looking forward to being able to upgrade (i.e. to all problems with dependencies being fjxed)
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
13
ROOT team
Workshop dinner 7:00 PM
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
14
ROOT team
Workshop dinner 7:00 PM
Oliver Lantwin (Imperial College London) root Users’ Workshop, Sarajevo
14