oo implementation for the lhcb rich
DESCRIPTION
OO Implementation for the LHCb Rich. Niko Neufeld Dietrich Liko. Introduction. Study of OO Implementation of a Reconstruction program Based on Standalone Program by Roger Forty et al. Present a comparison Review Object Oriented features. Objective. Results of the FORTRAN Physics - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/1.jpg)
1
OO Implementationfor the LHCb Rich
Niko Neufeld
Dietrich Liko
![Page 2: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/2.jpg)
2
Introduction
Study of OO Implementation of a Reconstruction program
Based on Standalone Programby Roger Forty et al.
Present a comparison Review Object Oriented features
![Page 3: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/3.jpg)
3
Objective
Results of the FORTRAN Physics Resources
To be better then FORTRAN Object Orientation
Modularity Interfaces
![Page 4: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/4.jpg)
4
UML Process
Specification using UML Use cases
Development using UML case tool Rational Rose
Iterative Development Several internal iterations
UML
Unified Modeling
Language
by
Booch, Jacobson &
Rumbaugh
![Page 5: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/5.jpg)
5
Program Specification
Technical Proposal LHCb Note FORTRAN Program
Summary with all information Partial capture in use cases
![Page 6: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/6.jpg)
6
One page on physics
Cherenkov Effect Emission of Photons
Aerogel & Gas Radiator Reflection of Photons Observation of Photons
Quantum Efficiency Detector Geometry
![Page 7: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/7.jpg)
7
One page on algorithm
Local Likelihood Global Likelihood
Very effective CPU intensive
Other Algorithm possible Average emission angle
![Page 8: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/8.jpg)
8
Framework
OO Framework to implement reconstruction algorithms
Simulation also possible
Here the Global Likelihood will be implemented
Benchmark for usability
![Page 9: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/9.jpg)
9
Use Cases
Question a Physicist might ask ... to a particle ... to a pixel ...
Global Likelihood
ChanhLN
jjij
M
ii
N
jjj
111
lnln
![Page 10: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/10.jpg)
10
Use cases
MomentumTrue Particle Code
PhysicistEmitted Number of Photons
Expected Number Photons
Geometrical Efficiency
![Page 11: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/11.jpg)
11
Detector
![Page 12: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/12.jpg)
12
Detector
Rich
Radiator
Reflector
Detector
SimplifiedUML
Class Diagram
Static relations of Classes
![Page 13: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/13.jpg)
13
Event Event
TrackPixel
TrackExtrapolation
TrackSegment
Photon
I should be called DetectorElement !
![Page 14: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/14.jpg)
14
Other Entities
PhotonSpectrum
PixelID
GeneratedPhoton
![Page 15: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/15.jpg)
15
Lifetime
Present for all Events Rich, Radiator, Reflector, Detector
Present for one Event Tracks, TrackExtrapolations,
Pixel, Photons
Temporary Photon Spectrum, PixelID, Single Photon
![Page 16: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/16.jpg)
16
Pixelid
tube
RecPixelsignal
globalPositionlocalPosition
size
PhotonDetector
But I am smart!
• Example trivial
• expensive calculations
• context questions
The PhotonDetector does all the
work for me !
I am not so smart ...
![Page 17: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/17.jpg)
17
Architecture
Interface
DetectorEvent
StrategyAlgorithm
![Page 18: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/18.jpg)
18
Standalone Program
Minimal Environment Contains its own Transient Event
Model Parameter Files Histograms from CLHEP
Only for this test!
![Page 19: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/19.jpg)
19
![Page 20: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/20.jpg)
20
![Page 21: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/21.jpg)
21
![Page 22: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/22.jpg)
22
Optimisations
Since last presentation two weeks ago Program about a factor 2 slower
Profiling and Debugging Allocation of STL container operator[] Algorithmic improvements
![Page 23: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/23.jpg)
23
Technical Proposal
Rec True Pe K p X
e 6233 7 328 0.95 8 224 554 31 0.27 5 10 13114 1 8 0.99K 1 39 1083 11 0.96p 1 4 1 427 1 0.98X 3 8 197 27 3990 0.94 0.99 0.90 0.92 0.97 1.00 0.99
500 Events
B
background
“Clean”
![Page 24: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/24.jpg)
24
Results
Rec True Pe K p X
e 8848 7 426 3 51 0.95 20 230 1163 3 57 0.16 8 13 10891 9 29 0.99K 2 1 39 1083 11 0.97p 1 4 1 427 1 0.98X 154 2 67 12 9700 0.98 0.98 0.91 0.87 0.97 1.00 0.99
Difference in particle population, in particular for X particles:
Different sample, small differences in the modeling of the inner edges
Migration to Reduced Efficiency
Reduced Purity
500 Events
B
background
“Clean”
![Page 25: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/25.jpg)
25
CPU Comparison
500 MhzPentium III
G77 7.52
G++ 8.32
Sec/E
vent
7 8 9
100 Events
B
Background
“Clean”
![Page 26: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/26.jpg)
26
Kuck & Associates, Inc.
Commercial C++ compiler Standard compliant Templates Patented optimization techniques Precompiled headers http://www.kai.com
Time-locked trial version for RH6.1
![Page 27: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/27.jpg)
27
CPU Comparison
500 MhzPentium III
G77 7.52
G++ 8.32
Sec/E
vent
7 8 9
KCC 7.32
100 Events
B
Background
“Clean”
![Page 28: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/28.jpg)
28
Summary
Outlined the development process Show physics results Show CPU comparisons
Why an OO program should be better ?
![Page 29: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/29.jpg)
29
Track Segment Length
length
Aerogel Radiator
Track
![Page 30: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/30.jpg)
30
FORTRAN
REAL FUNCTION DIST(POS,DIR)
C A line is given by POS and DIS
REAL POS(3), DIR(3)
C Radiator wall is described by its z position
REAL ZPOS(2)
COMMON /RADIATOR/ ZPOS
DIST = ACOS(DIR(3),VMOD(DIR,3))*(ZPOS(2)-ZPOS(1))
END
![Page 31: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/31.jpg)
31
FORTRAN
Does what it should Math is simple Probably more complicated in praxis
walls not normal to z more then one radiator
Some variables which are interpreted in the context
But your program works soon!
![Page 32: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/32.jpg)
32
Sometimes later ... … you want to improve the program
More realistic tracks More realistic radiators
But assumptions are not isolated There will be other places which depend
on these variables
You have to find all uses of the variables In your program at n places In other people programs at
unknown places
![Page 33: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/33.jpg)
33
Object Based
Assume two classes present Plane Ray (can intersect with plane)
My program has ... class Algorithm dist method
![Page 34: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/34.jpg)
34
Object Basedclass Algorithm {
Plane Radiator[2];
virtual double dist(const Ray & track) const;
}
double Algorithm::dist(const Ray & track) const {
return Radiator[1].intersect(track) - Radiator[0].intersect(track);
}
![Page 35: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/35.jpg)
35
Object Based
More compact Probably more general Math is done by somebody else
But main critic remains
If you want to improve the program,you have to find ...
n places in your own program unknown places in other programs
![Page 36: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/36.jpg)
36
Object Orientedclass Track {
public:
virtual double dist() const;
virtual double intersect(const Plane & plane) const;
virtual double intersect(……) const;
private:
Radiator * radiator_;
}
class Radiator {
public:
virtual double dist(const Track & track) const;
}
![Page 37: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/37.jpg)
37
Sequence DiagramRadiatorTrack
dist
dist
intersect
intersect
return dist
return dist
SimplifiedUML Sequence
Diagram
dynamic relation of classes
![Page 38: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/38.jpg)
38
Object Oriented
If one changes the Radiator ... One place to do the modifications
If one changes the Track ... Another single place to do the change
Implementation is hidden behind the interface
No dependency on the implementation details
Visitor Pattern
![Page 39: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/39.jpg)
39
Summarize
FORTRAN does the job difficult to maintain
Object Based C++ does the job probably better still difficult to maintain
Object Oriented C++ dependencies are reduced
![Page 40: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/40.jpg)
40
Our Program does not depend on ... Track implementation Pixel implementation General Detector Geometry Photon radiation process Mirror choice Type of Photon Detector Photon Detector Assembly Details Reconstruction Strategy …..
![Page 41: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/41.jpg)
41
Integration to GAUDI
Algorithm is interfaced Package is nearly ready Release next week
Detailed documentation from the Rose Model available
We plan to include some “hand written” documentation for the release
![Page 42: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/42.jpg)
42
Future in GAUDI
Next steps … Detector Description Other Algorithms Photon Detector Implementation
Not addressed
Structure of a general LHCb reconstruction program
![Page 43: OO Implementation for the LHCb Rich](https://reader035.vdocuments.net/reader035/viewer/2022062802/568144a2550346895db1633c/html5/thumbnails/43.jpg)
43
Final Summary
UML process for software development Standalone program has similar
performance as the TP Pleasant surprise: you can do a lot OO
for reconstruction applications There is the promise for a program that
will be easier to maintain You can try it yourself in GAUDI