3D Graphics & tools for HEP

Slides:



Advertisements
Similar presentations
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
Advertisements

3D on-line representations Jan Valcik → introduction, main idea → VRML 97 → building of virtual worlds → VRML 97 at work → X3D → MUDVR → animations, navigation.
Russell Taylor Lecturer in Computing & Business Studies.
4.01B Authoring Languages and Web Authoring Software 4.01 Examine webpage development and design.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
COGEVITO Complex Geometry Visualization Tool. Motivation Exploit the potential of Three,js for the visualization of complex geometries related to HEP.
Updating JUPITER framework using XML interface Kobe University Susumu Kishimoto.
Event Data History David Adams BNL Atlas Software Week December 2001.
The european ITM Task Force data structure F. Imbeaux.
XML in Atlas: from generic to parametric detector description Stan Bentvelsen NIKHEF Amsterdam XML workshop, CERN, May 22.
1 Software tools for GLC studies Akiya Miyamoto KEK 20 April, 2004 Representing ACFA-Sim Group
Jump to first page The new ROOT geometry package Andrei Gheata - ALICE Institute of Space Sciences, Bucharest.
ROOT I/O in JavaScript Browsing ROOT Files on the Web For more information see: For any questions please use following address:
IT / API 1 CERN 1-Feb-16 GBLIB: classes to deal with geometrical data Evgueni Tcherniaev IT / API CLHEP workshop, January.
GDML “Geometry Description Markup Language” by Daniele Francesco Kruse University of Rome “Tor Vergata” European Organization for Nuclear Research.
1 SLAC simulation workshop, May 2003 Ties Behnke Mokka and LCDG4 Ties Behnke, DESY and SLAC MOKKA: european (france) developed GEANT4 based simulation.
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
Logical Architecture and UML Package Diagrams. The logical architecture is the large-scale organization of the software classes into packages, subsystems,
The Cockroft Institute
X3DOM : Integrating 3D content seamlessly into webpage
DHTML.
JUNO Offline Geometry Management
Jacek Otwinowski (Data Preparation Group)
Project 1 Introduction to HTML.
Objective % Select and utilize tools to design and develop websites.
EVE as the base of AliEve and Fireworks event-displays Matevž Tadel.
PC-DMIS Introduction to GD&T Selection
Matlab.
3D on the Web : Understanding the basics
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
WSP quality assurance tool
4.01B Authoring Languages and Web Authoring Software
Learning to Program D is for Digital.
ICG Syllabus 1. Introduction 2. Viewing in 3D and Graphics Programming
Complex Geometry Visualization TOol
The Basics: HTML5, Drawing, and Source Code Organization
MANAGEMENT OF DASHBOARD MODELS
European Organization for Nuclear Research
A C++ generic model for the GLAST Geometric Description
Software for scientific calculations
Project 1 Introduction to HTML.
Process of Converting “PSD to HTML”
Geant4 Geometry Objects Persistency using ROOT
Markus Frank CERN/LHCb CHEP2013, Amsterdam, October 14th–18th 2013
HEP detector description supporting the full experiment life cycle
Implementation of Simulation
Objective % Select and utilize tools to design and develop websites.
3D graphics in JavaScript ROOT
CMPE419 Mobile Application Development
Searching Business Data with MOSS 2007 Enterprise Search
4.01B Authoring Languages and Web Authoring Software
Chapter 27 WWW and HTTP.
Linear Collider Simulation Tools
Intermountain West Data Warehouse
COMPUTER SOFT WARE Software is a set of electronic instructions that tells the computer how to do certain tasks. A set of instructions is often called.
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
GENERAL VIEW OF KRATOS MULTIPHYSICS
Chapter III Modeling.
Geant4 Workshop 02 October 2002, CERN Hajime Yoshida
Entering the production phase
Simulation and Physics
CS 4722 Computer Graphics and Multimedia Spring 2018
Use Cases Simple Machine Translation (using Rainbow)
CMPE419 Mobile Application Development
Introduction to JavaScript
Planning next release of GAUDI
Functions, Procedures, and Abstraction
4.00 Apply procedures to add content by using Dreamweaver. (22%)
Web Application Development Using PHP
Presentation transcript:

3D Graphics & tools for HEP HSF meeting - 7th of April 2017 3D Graphics & tools for HEP 3D Detector interactive display Event data animation

Scope and Requirements Provide a suitable tool that may be used in HEP to display complex geometries and also particle and event data with animation based on the time information generated by MC simulation software (eg GeantV) or experimental data. Initial requirements Web based application Use of public domain 3D graphics library “ThreeJS” In SFT there are being developed powerful tools that can display 3D geometries and much more. They are part of the ROOT functionalities. Latest developments also use Three.js for web developments. Swan is the latest web-oriented development. So far there are not yet published developments related to particle and event animations in SFT Follows the web development philosophy Friendly User interface Light files Standard formats (JSON) Ilias Goulas, CERN-EP/SFT

Web tools and terminology three.js JSON Web tools and terminology Three.JS Json format Ilias Goulas, CERN-EP/SFT

JSON Format for non experts http://www.json.org/ JSON (JavaScript Object Notation) Is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. Why use JSON kind of standard like XML Everyone can read and interpret its contents with no additional efforts … In JavaScript, with just one command you get the full definition of objects defined in your JSON file. loadJSON(filename, function(content) { var JsonGeom = JSON.parse(content)}); JsonGeom will contain all objects defined in the file In the case of Atlas Geometry I read a file of 100.500 lines and create the related object structure in memory with just one line of code { "metadata": { "version": 1.0,"type": "Object", "generator": "CogevitoExporter","File":"Atlas-all.json"}, "Geometry":[ {"fn":"START"}, {"fn":"csg","gid":2,"dz":345,"rmin1":3.5,"rmin2":3.5,"rmax1":115,"rmax2":115,"phs":0,"phl":6.28319}, {"fn":"mesh","gid":2,"cdf":0,"nv":5730051,"lv":1,"m":"root","cl":"#6666ff","cn":"kBlue-7","vs":0,"n":"INNE","v":[]}, {"fn":"csg","gid":172,"dz":100,"rmin1":25,"rmin2":25,"rmax1":61.5,"rmax2":61.5,"phs":0,"phl":6.28319}, {"fn":"mesh","gid":172,"cdf":0,"nv":5087,"lv":2,"m":"INNE","cl":"#6666ff","cn":"kBlue-7","vs":1,"n":"ZEND","v":[1,0,0,0,0,1,0,0,0,0,1,181,0,0,0,1]}, … {"fn":"trd","gid":175,"dx1":2,"dx2":3.85,"dy1":0.1272,"dy2":0.1272,"dz":1.75}, {"fn":"mesh","gid":175,"cdf":0,"nv":1,"lv":6,"m":"ZMOD","cl":"#ff6600","cn":"kOrange+7","vs":1,"n":"ZELE","v":[0,0,1,41.5815,1,0,0,0,0,1,0,0,0,0,0,1]}, {"fn":"clone","cdf":0,"nv":5,"lv":5,"m":"ZRII","ovn":"ZMOD","gid":6709,"cn":2,"v":[0.935016,-0.354605,0,0,0.354605,0.935016,0,0,0,0,1,0,0,0,0,1]}, {"fn":"clone","cdf":0,"nv":5,"lv":5,"m":"ZRII","ovn":"ZMOD","gid":6709,"cn":3,"v":[0.822984,-0.568065,0,0,0.568065,0.822984,0,0,0,0,1,0,0,0,0,1]}, {"fn":"csg","gid":27,"dz":211.7,"rmin1":0,"rmin2":0,"rmax1":6,"rmax2":6,"phs":0,"phl":6.28319}, {"fn":"mesh","gid":27,"cdf":0,"nv":1,"lv":2,"m":"PIPE","cl":"#cccccc","cn":"kGray","vs":1,"n":"POUk","v":[1,0,0,0,0,1,0,0,0,0,1,1653.3,0,0,0,1]}, {"fn":"clone","cdf":0,"nv":1,"lv":2,"m":"PIPE","ovn":"POUk","gid":27,"cn":44,"v":[1,0,0,0,0,1,0,0,0,0,-1,-1653.3,0,0,0,1]}, {"fn":"END"} ]} defining the Atlas Geometry A few lines of the JSON file Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT About three.js https://threejs.org Three.js is a cross-browser JavaScript library used to create and display animated 3D computer graphics in a web browser. Three.js uses WebGL. The source code is hosted in a repository on GitHub Three.js allows the creation of GPU-accelerated 3D animations using the JavaScript language as part of a website without relying on proprietary browser plugins. This is possible thanks to the advent of WebGL Using Three.js it is possible to author complex 3D computer animations in a browser with minimal efforts Ilias Goulas, CERN-EP/SFT

Status of developments C++ code using root Clang interpreter 1 Root “plugin” Web home page: Default.htm Import all JavaScript libraries for Three.Js and Cogevitolib.js and Creates the interface 2 Cogevitolib.js contains all functions to create Three.Js volumes and functionalities Web “tools” Starting point Geometry definition in TGEO (Root, Geant4 etc) The Root “plugin” will create an output file with the definition of the Geometry in JSON format OutputFile.js Calls to GoGeviTo library for the creation of logical and physical volumes ParticleData.js Data related to events and particles in time Particle and events data are generated by MC software or experiments Other applications (eg GeantV) The files will be imported using the interface on the web home page of the application Ilias Goulas, CERN-EP/SFT

Some Technical details OutputFile.js Calls to GoGeviTo library for the creation of logical and physical volumes ParticleData.js Data related to events and particles in time Web home page: Default.htm Import all JavaScript libraries for Three.Js and Cogevitolib.js and Creates the interface Cogevitolib.js contains all functions to create Three.Js volumes and functionalities Contents of the file with calls to Cogevito.js library Contents of the file related to events and particles Home Web Page Cogevito library +Live demo Ilias Goulas, CERN-EP/SFT

Contents of the file with calls to Cogevito.js library (plugin output) TGEO function Plugin function creates  JSON function def in Cogevitolib TGeoShapeAssembly TGeoBBox TGeoParaboloid TGeoSphere TGeoConeSeg TGeoCone TGeoTubeSeg TGeoTube TGeoPcon TGeoTorus TGeoPgon TGeoHype TGeoScaledShape TGeoArb8 TGeoPara TGeoTrap TGeoGtra TGeoTrd1 TGeoTrd2 TGeoCtub TGeoXtru ExportGeomAssembly fn= grp ExportGeomBBox fn= box ExportGeomParabloid fn= prb ExportGeomSphere fn= sph ExportGeomConeSeg fn= csg ExportGeomTub fn= tub ExportGeomConeSeg1 fn= lth ExportGeomTorus fn= tor ExportGeomConeSeg2 fn= pgn ExportGeomHype fn= hpb ExportGeomQuad fn= tra ExportGeomPara fn= par ExportGeomTrap fn= trp ExportGeomGTra fn= gtr ExportGeomTrd fn= trd ExportGeomTub fn= csg ExportGeomEltub fn= elc ExportGeomExtrude fn= exr The output file is a collection of those functions defined in cogevitolib.js that define the geometry of each volume. An additional function “mesh” will define the relative position, material and matrix Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT Each volume is defined in JSON format as follows (example) Function Geometry ID Parameters {"fn":"csg", "gid":2, "dz":345,"rmin1":3.5,"rmin2":3.5,"rmax1":115,"rmax2":115,"phs":0,"phl":6.28319}, Number of Volumes Flag (clones) Mother Level { "fn":"mesh", "gid":2, "cdf":0, ”nv":5730051, "lv":1, "m":"root", "cl":"#6666ff","cn":"kBlue-7”, "vs":0, "n":"INNE", "v":[] }, Visible Name Matrix Color Particular cases for Composite volumes not shown here. Clones are defined as follows: Original Vol. Name { "fn":"clone", "cdf":0, "nv":5, "lv":5, "m":"ZRII", "ovn":"ZMOD", "gid":6709, "cn":2, "v":[0.935016,-0.354605,0,0,0.354605,0.935016,0,0,0,0,1,0,0,0,0,1]}, Ilias Goulas, CERN-EP/SFT

Dynamic particles & tracks Dynamic event animation in time Ilias Goulas, CERN-EP/SFT

Contents of the file related to events and particles Syntax of JSON file: Each event is an Array of the structure: “time stamp” and the Array of particles &their position at “time stamp” { "Event":[ {"time":0, "pset":[ {"id":0,"kind":4,"type":"a","pos":[0,0,0],"e":0.028}, {"id":1,"kind":4,"type":"a","pos":[0,0,0],"e":0.129}, …. {"id":19,"kind":9,"type":"a","pos":[0.000,0.000,0.000],"e":0.170} ] }, … {"time":17160, "pset":[ … ] } Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT TimeSlot: 10*10-9 seconds T,E, x0,y0,z0 TimeSlot: 20*10-9 seconds T,E ,x1,y1,z1 T,E, x1,y1,z1 n steps… TimeSlot: n*20*10-9 seconds T,E, xn,yn,zn T,E, xn,yn,zn T,E, xn,yn,zn m=n+j steps… TimeSlot: m*20*10-9 seconds T,E, xm,ym,zm TimeSlot: k*20*10-9 seconds T,E, xk,yk,zk T,E, xk,yk,zk Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT Home Web Page Written in JavaScript Load Three.js, Cogevitolib.js and other libraries. Defines the main menu Load Geometry files and creates the internal Three.js structure Defines the user interface and all functionalities Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT Cogevitolib.js It is a collection of functions in JavaScript Most of the functions are related to creation of the geometry of each volume using native three.js graphic functions Geometries are associated to meshes (physical volumes) created in memory. Composite volumes are obtained using external Constructive Solid Geometry (CSG) package. It is a kind of problematic because creates a big number of additional vertices and faces. For this reason we use CSG package only for Intersections while for Union we merge the geometries using native Three.js functionality. Clones are copies of physical volumes including all the sub-tree of volumes. There are available three implementations of cloned volumes The sub-tree is copied as it is (mesh+Geometries+materials) The geometries of cloned volumes are merged in a single mesh Geometry and Material are shared between the clones Ilias Goulas, CERN-EP/SFT

Just a note … A mesh in three.js allocates space for: Matrixes (local and global transformations) Other information (name, children, parent etc) Geometry Vertexes (eg a cube is defined with 8 vertexes) Faces which are triangles composing the surface of the volume by interconnecting the vertices (eg a cube is defined with 12 faces, 2 for each face) face and vertex normals and colors Array of face UV layers Other information Material All parameters of the material (name, transparency, color etc) A lot of space is allocated for Geometry and Material Ilias Goulas, CERN-EP/SFT

Two Clones implementation A copy-1 A copy-3 A A Using the native clone function in three.js “A” geometry merged 3 times A copy-2 A Four different objects 4 meshes 4 geometries 4 materials Only one object 1 mesh 1 geometry 1 material Ilias Goulas, CERN-EP/SFT

THIRD Clones implementation The mesh is cloned (together with the full sub-tree of volumes) but the Geometry and the Material are shared between the cloned volumes in order to save memory G+M G+M G+M G+M Using the modified clone function in three.js A copy-3 A copy-1 Four different objects 4 meshes 1 geometries 1 materials A copy-2 Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT Roadmap What is next Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT Discuss with potential users in the experiments, HSF etc The roadmap of developments Please suggest … Optimize / consolidate the functionality. Interact with Geant/GeantV Create simple geometries and watch Particles animation on line. Ilias Goulas, CERN-EP/SFT

Ilias Goulas, CERN-EP/SFT Going Live The Atlas detector Ilias Goulas, CERN-EP/SFT