Escolar Documentos
Profissional Documentos
Cultura Documentos
CMS has joined several R&D projects to test if and how Object Orientation can be
applied to its software. We describe here how a prototype of the reconstruction software
for the CMS inner tracker has been used to study Object Oriented Analysis and Design.
2 OO R&D in CMS
A R&D eort is being produced to test if and how Object Orientation can be applied
to CMS software. In particular we have launched a project, in the framework of
RD41 [2] (MOOSE), aimed at developing a prototype of the reconstruction software
for the CMS inner tracker using OO technologies.
presented at
a CHEP conference, September 1995, Rio de Janeiro, Brasil
1
2.1 The choice of the method and of the language
The analysis and design of complex software requires the use of well dened methods
to ensure consistency, traceability and uniformity.
We have evaluated several OO methods [3] to understand their applicability
to HEP software problems. We have found that a \Responsibility Driven Ap-
proach" [4], which permits to obtain a model with distributed responsibilities among
the various collaborating objects, is the most suited to the problem of HEP event
reconstruction.
Among the various methods which support such an approach, we have chosen
the Booch Method [5] to base our prototype upon because it:
is complete, from analysis to code maintenance;
supports both a distributed responsibility approach and a data driven ap-
proach;
does not impose a strict procedure in the use of its components;
Next Layer
r Vertex
z
Figure 1: A simplied r ? z view of the CMS inner tracker: A candidate track,
built from two hits and the vertex, is extrapolated from the current detector to
next layer where compatible hits are searched for in an interval dened by the
extrapolation error.
extrapolated into the \next layer" of detector units in the direction of the vertex
and hits lying inside an error interval around the crossing point are selected (see
gure 1). The candidate track is followed till the detector units closest to the vertex
and, if it passes some quality criteria (2, number of hits etc.), it is accepted. We
chose this reconstruction method because is well known and broadly used in HEP.
Therefore it does not require any \physics analysis" eort which would distract
from the software modeling.
3.1 Dynamic model
We started to build a model of the reconstruction software describing the set of
scenarios (use cases) that fully realize the system functionalities. Each scenario
depicts a task to be performed by the system. As we walked through each scenario,
we \identied the objects that participate in the scenario, the responsibility of each
object, and how those objects collaborate with other objects, in terms of operations
each invokes upon the other" [5].
3.2 The main scenario
The main scenario describes how to nd a hit on the following layer:
The next layer is built out of all neighbors of the current detector unit which
are reachable by the candidate track;
For each detector unit in next layer a set of compatible hits (clusters in our
model) is formed with all hits which lie in an error interval around the crossing
3
point between the candidate track and the detector unit itself;
the best hit (the one which minimize the track 2 ) is added to the candidate
track;
If no good hits are found, an ineciency is assumed and hits are searched for
on the next second layer;
If even the search for good hits on the next second layer fails, the pattern
recognition starts again from a new hit (if any) on the current detector unit.
This scenario is actually split in two primary scenarios which describe the main
path:
get next detector unit to process,
good hit found in current detector unit;
and three secondary scenarios describing the other alternatives:
good hit found on another detector unit of the current layer,
good hit found in the second next layer,
no good hit found.
theTracking
Region
2: NextLayer 6: Cross
(VTrajectory &) (VTrajectory &)
8: NextDetUn ( ) F
theCurrentDetector
P
Unit
theCurrent VSurface
Layer
Figure 2: Object Interaction Diagram describing the scenario \Get next detector
unit to process"
Figure 2 shows the Object Interaction Diagram for the \get next detector unit
to process" scenario.
4
TLayer
(from CMS Detector Model)
{n} VMainComponent
TTrackingRegion (from CMS Detector Model)
0..n AddLayer( )
Instance( )
1 RemoveLayer( ) Update 1
fCurrentDetUn : VDetectorUnit 1
fgInstance : TTrackingRegion
| Next2ndLayer( )
| NextDetUn( ) A
{1}
VFitStrategy
(from CSM Fit Strategies)
1 F
A
1 1
fAdoptedFitter 1
Fit TCandidateTrack
11 AddClusterDetUn( ) TCluster
AdoptFitStrategy( ) (from CMS Detector Model)
EvaluateTrack( ) {n}
Instance( ) 1 3..n
1 1 ProcessClusters( )
VTrajectory Reconstruct( )
{1}
(from CSM Fit Strategies)
Figure 3: Class Diagram for the \CMS Inner Tracker Pattern Recognition". For
the class and method names we followed the Taligent [7] convention: Classes
whose name starts with V (for Virtual) are abstract classes which can not be
instantiated. Classes whose name starts with T (for Type) are concrete classes
which can be instantiated.
1 fCompatibleClus
1 fPossibleDetUns
TInnerTracker
Instance( )
{1}
0 1
1
1
TListOfCluster TListOfDetUn
TODCDetUn {n} {n}
{n}
1
TITDetUn MadeOf 0
{n}
4 Conclusion
This project started only one year ago and a lot of time was spent understanding
what OO is about and, most important, what is not.
We have learned that encapsulation, distribution of responsibilities, localization
and isolation of the parts which are likely to change is what makes Object Oriented
code really less complex. We have also learned that inheritance has to be used with
caution: its early introduction in the model can produce too rigid structures which
are very dicult to change later.
We have found that following a method and using a CASE tool was very useful
and increased the productivity of well organized software. There are still areas where
more development is required, like how to use the dynamic model in the design phase
to specify in detail the behavior of the system. The current second generation OO
methods, like Booch and Fusion [9], have demonstrated their capability to evolve;
we believe that adopting an OO method can only be benecial to the development
of HEP software.
Acknowledgments
We wish to thanks all our colleagues of CMS and RD41 who have contributed
with discussions, criticisms and suggestions to the development of the prototype.
We are particularly indebted to W.Jank, R.Mount and M.Pimia - without their
encouragement and support this work would have never been started.
References
1. CMS Collaboration Technical Proposal, CERN/LHCC 94-38, (Geneva 1994)
2. RD41 Object Oriented Approach to Software Development for LHC Experi-
ment, CERN/DRDC 94-9, (Geneva 1994)
3. for a review of OO methods see:
OMG Object Analysis and Design, A.T.F.Hutt editor, (John Wiley & Sons,
New York, 1994).
4. R. Wirfs-Brock et al. Designing Object-Oriented Software, (Prentice Hall,
Englewood Clis, New Jersey, 1990).
7
5. G. Booch Object-Oriented Analysis and Design, (Benjamin-Cummings, Red-
wood City, California, 1994).
6. R.K. Bock et al. Data analysis techniques for high-energy physics experiment,
pag.175, (Cambridge University Press, Cambridge, UK, 1990).
7. Taligent Taligent's Guide to Designing Programs, (Addison-Wesley, Reading,
Massachusetts, 1994).
8. E. Gamma et al. Design Patterns, (Addison-Wesley, Reading, Massachusetts,
1994).
9. D. Coleman et al. Object-Oriented Development, The Fusion Method, (Pren-
tice Hall, Englewood Clis, New Jersey, 1994).