# Presentation: 839155

## Event Displaywith D0Scan

- F. Chandez
*LPC  Clermont -  Univ. B. Pascal – IN2P3*** **

**D0scan Status with p16.04.00**

- D0scan status

- Event Display meeting  Dec, 7/04

## Outline

- 2D Views
- CFT Hits
- Tracks
- Pattern representation
- Picking and fitting
- 3D view
- Drawing calorimeter cells in forward region
- Track synchronization
- Future plans

- D0scan status

- Event Display meeting  Dec, 7/04

## Deconnection CFT twig in 2Dyz view

- Z Hits display modenot significant
- Radial / stereo coord. don’t give easily  the Z coord.

*Already discussed in September.*
*Work on that area is postponed for the time being.*

** ****z = 0**

-  2Dyz view temporarily deconnected

- D0scan status

- Event Display meeting  Dec, 7/04

## Global tracks in 2Dyz view

- IgSoSplineTrack class substitute by a model of plane curves
- OpenInventor SoNurbsCurve class is a node for representing Parametric CurvesData points to fit the curves
- Control points are specified by the **GTrackStates** points (c.f. tracking algorithm)

**NURBS (Non Uniform Rational Basic Splines) for approximating tracks**

-  Work suspended until we’ll have information from Raw data

**No kink**

- D0scan status

- Event Display meeting  Dec, 7/04

## Picking restitution

_**Solution**_
- Picking in 2D views uses a special map, **mapSoNurbsCurve,** to store the “**trackID**”

- chunkID

-  trackID

_**Problem**_**SoNurbsCurve** is not a « smart object » compare to  Iguana **IgSoSplineTrack** class** **

**Linking the new model with picking**

- D0scan status

- Event Display meeting  Dec, 7/04

## Calorimeter cells in forward region

**Previous representation was a too simplistic modeling **
**New graphical representation **
- A more realistic 3D object replaces the cube cell shape
- A better volume reproduces the cell occupation in the detector
- Provides the complete representation of cell shapes

- D0scan status

- Event Display meeting  Dec, 7/04

## Inner classes used
CellCorners class calculates the corners and edges of a cell
SoIndexedFaceSet class constructs a 3D shape from an indexed list of corners
CalDisplayCell program builds now any shapes evolution

An algorithm transforms cells in shapes for graphic use
The new representation can manage a large set of objects based on the facet primitive
This flexibility allows to build any cell and provides code re-use

**CellCorners **class calculates the corners and edges of a cell
**SoIndexedFaceSet **class** **constructs a 3D shape from an indexed list of corners
**CalDisplayCell** program builds now any shapes evolution
- An algorithm transforms cells in shapes for graphic use
- The new representation can manage a large set of objects based on the facet primitive
- This flexibility allows to build any cell and provides code re-use

**Shapes transformation**

- D0scan status

- Event Display meeting  Dec, 7/04

## CellCorners information

- Region:** ECEM  **
- Shape:** TUBS **
- nCorners:** 8**
- nEdges:** 12 **
- nFaces:** 6**

**1**

**7**

**6**

**0**

**5**

**2**

**3**

**	****0 1 ****	****0 2 **
**	****0 4**
**	****1 3 **
**	****1 5 **
**	****2 3**
**	****2 6**
**	****3 7 **
**	****4 5 **
**	****4 6 **
**	****5 7 **
**	****6 7**

**Edges list=**

**CellCorners** class  organizes faces
- with couples of vertices

**CellCorners provides information to construct the volumes **

- structure to display**:**
- Wire-frame polygonal model

**Corners ****(Vertices)**

**Facets**

**All cells are composed with polygonal flat facets**

**4**

- D0scan status

- Event Display meeting  Dec, 7/04

## From CellCorners to OpenInventor

- _Parallelepiped__ __type1__: Corners=6, Edges=9, Faces=5_
**Edges list:**
- 	0 1 (64.9183,-214.007,-254.522) (85.5821,-206.613,-254.522)
- 	0 2 (64.9183,-214.007,-254.522) (59.1291,-194.923,-266.037)
- 	0 4 (64.9183,-214.007,-254.522) (64.9183,-214.007,-292.674)
- 	1 3 (85.5821,-206.613,-254.522) (77.9501,-188.188,-266.037)
- 	1 5 (85.5821,-206.613,-254.522) (85.5821,-206.613,-292.674)
- 	2 3 (59.1291,-194.923,-266.037) (77.9501,-188.188,-266.037)
- 	2 4 (59.1291,-194.923,-266.037) (64.9183,-214.007,-292.674)
- 	3 5 (77.9501,-188.188,-266.037) (85.5821,-206.613,-292.674)
- 	4 5 (64.9183,-214.007,-292.674) (85.5821,-206.613,-292.674)

_**SoIndexedFaceSet**_** object filled with indexes that describe the faces**(model more comprehensive than those used by classes : IgSoG4Trap, IgSoG4Tubs...)

**5 faces with corners indexes:**
- 	0, 1, 3, 2,	SO_END_FACE_INDEX
- 	0, 1, 5, 4,	SO_END_FACE_INDEX
- 	0, 2, 4, 		SO_END_FACE_INDEX
- 	1, 3, 5, 		SO_END_FACE_INDEX
- 	2, 3, 5, 4, 	SO_END_FACE_INDEX

**Classes : circuits & graph**

- D0scan status

- Event Display meeting  Dec, 7/04

## Shape of the volume is represented by a graph as a system of cycles

- The adjacency list consists in a list of all corners in the graph

**[ 0 ]  --> 1 -> 2 -> 4**
**[ 1 ]  --> 0 -> 3 -> 5**
**[ 2 ]  --> 0 -> 3 -> 6**
**[ 3 ]  --> 1 -> 2 -> 7**
**[ 4 ]  --> 0 -> 5 -> 6**
**[ 5 ]  --> 1 -> 4 -> 7**
**[ 6 ]  --> 2 -> 4 -> 7**
**[ 7 ]  --> 3 -> 5 -> 6**

**0 1**
**0 2 **
**0 4 **
**1 3 **
**1 5**
**2 3**
**2 6 **
**3 7 **
**4 5 **
**4 6**
**5 7**
**6 7**

- Undirected graph
- 8 corners

- Underlying structure representation: an undirected graph

- _Adjacency list description_

- G

- Edges
- list

- How to generate a shape from a edges list?

- Each corner is linked to its own list containing the indexes of all corner that are adjacent to itself

- D0scan status

- Event Display meeting  Dec, 7/04

## Path: 		a list of vertices where each vertex                                  has an edge from it to the next vertex

Elementary path: 	a path in which all the vertices are                                  distinct 

Cycle (or circuit): 	a path that starts and ends at the                                   same vertex                                  end(Path) = origin(Path)

Elementary cycle: 	an elementary path for which only                                  the origin vertex is repeated

_**Elementary path:**_ 	a path in which all the vertices are                                  distinct
_**Cycle (or circuit)**_**:** 	a path that starts and ends at the                                   same vertex                                  *end(Path) = origin(Path)*
_**Elementary cycle:**_ 	an elementary path for which only                                  the origin vertex is repeated

**Path / Cycle ******** ****undirected graph**

**Definitions**

- D0scan status

- Event Display meeting  Dec, 7/04

## A search strategy for the elementary cycles of a undirected graph 

**	**

**A**** search strategy for the elementary cycles of a undirected graph **

**Find all the elementary cycles that do not contain another cycle**

- Unfortunately, this problem of finding the set of independent cycles will likely be NP-complete
- The **BFS** (Breath-First Search)** **algorithm has been modified to  solve this problem.

- Implementation: a recursive cycle finding
- This package can construct cell in all its forms

- Variation on the **BFS **algorithm** **uses 2 classes:

- D0scan status

- Event Display meeting  Dec, 7/04

## Combinatory exploration

**Stop recursive path as soon as possible**

**Cycle(0-4-6-2-0)**

**No end  (return)**

**Minimize **
**computation**

**Nodes of the graph recursively explored**

- D0scan status

- Event Display meeting  Dec, 7/04

## “Strong” criteria can speed up the exploration of the tree

**“****Strong” criteria can speed up the exploration of the tree**

**Constraints to minimize combinatory**
**Independent Cycle:**
-   	a cycle that do not contain another cycle
**Planarity rule:**
- a new point is append in the cycle if it belong to the plan built by the first points
**Total number faces to build:**_ _      Cyclomatic number (Circuit Rank) of the _undirected_ graph

- Where *C**num* denotes the cyclomatic number of graph *G*, *n* is the number of vertices, *e* is the number of edges

**1**

**2**

**5**

**4**

**3**

**6**

**G**

**e = 8 **

**n = 6 **

**C*****num*****(G) = 8 – 6 + 2   =  4**

- D0scan status

- Event Display meeting  Dec, 7/04

## Results : Parallelepipeds

**OpenInventor solid objects rendering **

**type1:**** 5 facets**

**type2:**** 6 facets**

**type3:**** 7 facets**

- D0scan status

- Event Display meeting  Dec, 7/04

## Drawing test (1)

**Inner**
**Coarse**
**Had**

**EndCap**
**Outer**
**Had**

**Inner **
**Fine**
**Had**

**EndCap**
**EM**

**Regions with colors**

- D0scan status

- Event Display meeting  Dec, 7/04

## Drawing test (2)

**Inner Fine / Coarse Had**

**Middle Fine / Coarse Had**

**Cells orientation**

- D0scan status

- Event Display meeting  Dec, 7/04

## Calorimeter cells - overall view

- No cell overlap

- D0scan status

- Event Display meeting  Dec, 7/04

## Wireframe polygonal drawstyle

- D0scan status

- Event Display meeting  Dec, 7/04

## Final drawing 3D view   

- Calorimeter cells on forward region are completely implemented

- D0scan status

- Event Display meeting  Dec, 7/04

## Tracks synchronization for understanding reconstructed tracks

- Track selection
- track can be controlled by three controllers:
- 	   Event_tree, GTrack2DXY_tree, GTrack2DYZ_tree
- Integration with the IGUANA tool
- track selection** **directly on viewers (picking or track number)
- all the information on track still kept (info box)
**	**

- So by selecting a given track in 2Dxy view,
- we already have the ability to show this track in 3D view

***  ******Currently, this action is designed to be simple to use (a menu).      Improvements in progress...***

- D0scan status

- Event Display meeting  Dec, 7/04

## Picking improvement

**Picking improvement**

**Track information**

**Interactivity**

**Track number**

- D0scan status

- Event Display meeting  Dec, 7/04

## Synchronization between 3D and  2D XY

**Synchronization between 3D and  2D XY**

**Following a track between views**

- Track monitoring

- Step 1

- Step 2

- Synchronization

- D0scan status

- Event Display meeting  Dec, 7/04

## Short term and future plans  

- Short term
- Check and clean present work
- Integration via CVS
- Future plans
- L3 level items
- Goal : Visualize the detector as seen by the L3 trigger
- Begin with L3 electron and muon objects
- Improve and implementation of the “trigger list display”
- Context restitution
- Load different “context” already defined in advance

- D0scan status

- Event Display meeting  Dec, 7/04