cern summer students 2011 : project presentation cern – ph/sft – 05/09/2011
TRANSCRIPT
CERN Summer Students 2011 :Project presentation
A New Design for TGaxisby Vincent Reverdy
Supervisor : Olivier Couet
CERN – PH/SFT – 05/09/2011
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesIntroduction
Project PresentationCERN – PH/SFT group
Summer Students 2011
Presentation outline
IntroductionAxis paintingThe TGaxis class
Issues and requirements about TGaxisVery difficult to maintainSome display bugsCritical class : heavily used
New design of TGaxisPhilosophyStructure of painting functionsData members and optionsNew functionalities
PerspectivesWhat has been done ?To-do listConclusion
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesIntroduction
Project PresentationCERN – PH/SFT group
Summer Students 2011
Axis in ROOT
Axis definition and data : TAxis class
Axis painting : TGaxis class
TGaxis is used to paint axis in every plot/histogram with ROOT
Example of axis paint with TGaxis
Example of an histogram in ROOT
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesIntroduction
Project PresentationCERN – PH/SFT group
Summer Students 2011
The TGaxis class
Performance is a critical issue
Inherited from TLine (axis body, tickmarks) & TAttText (title, labels)Several components : body, title, tickmarks, labels, grid
Many optionsAxis type : linear, logarithmic, alphanumeric, time axis....Directions : horizontal, vertical, perpendicular or vertical tickmarks...Painting options : ticks on both sides, no labels, labels format...Flags : optimize limits...
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesIssues and requirements
Project PresentationCERN – PH/SFT group
Summer Students 2011
Issues
But ... translated from FORTRAN and then modified to add some options and to correct some odd behaviors
All in one single function : PaintAxis (~1600 lines)
Very complex structure and options management
Consequences : hard to maintain and to add new features
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesIssues and requirements
Project PresentationCERN – PH/SFT group
Summer Students 2011
What does PaintAxis look like ?
A small part of the current PaintAxis conditions flowchart
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesIssues and requirements
Project PresentationCERN – PH/SFT group
Summer Students 2011
Goals and requirements
Rewrite a clean and easier-to-maintain structure for TGaxis
Strict backward compatibility with the original class(Paints exactly the same result for the same options)
No performances lost (speed, memory usage)
Main ideas of the new structure :Separate the axis computation from the axis paintingOne painting function per axis typeEasy management of options
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesThe new design
Project PresentationCERN – PH/SFT group
Summer Students 2011
Structure of the new TGaxis
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesThe new design
Project PresentationCERN – PH/SFT group
Summer Students 2011
Painting the axis
label tickmark
position along the axis [0-1]given by the tick list
distance from the axis (ONC)
offset
length of the tickmark (ONC)angle of the tickmark (cos, sin)
axis
labe
l
tickm
ark
positi
on a
long
the
axis
[0-1
]
give
n by
the
tick
list
dist
ance
from
the
axis
(ONC
)
offse
t
leng
th o
f the
tick
mar
k (O
NC)
angl
e of
the
tickm
ark
(cos
, sin
) axis
rotation
All is now computed in OrthoNormal Coordinates
0 1
1
0 1
1Problem of tickmarks rotation because of the ROOT NDC coordinates
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesPerspectives
Project PresentationCERN – PH/SFT group
Summer Students 2011
Done and to-do list
Vincent Reverdy – Supervisor : Olivier Couet – 05/09/2011
A New Design for TGaxis
Introduction Issues and requirements The new design PerspectivesPerspectives
Project PresentationCERN – PH/SFT group
Summer Students 2011
Conclusion and perspectives
Work doneNew structure designData members reorganization to create a flexible classPaintAxis rewrite (unfolding the conditions flowchart was by far the more difficult task)Bypass the ROOT NDC coordinates to avoid tickmarks rendering problems
StatusLinear and logarithmic axis almost completedAlphanumeric and time axis are being implementedNo problem to complete the rewriting by an extra week of work
Many thanks to Olivier Couet and to all the Summer Students Team !
ImprovementsNew options easy to implement with the static data membersClean new function organisation for enhanced maintainability