Presentation is loading. Please wait.

Presentation is loading. Please wait.

Code&Semantic Observations

Similar presentations


Presentation on theme: "Code&Semantic Observations"— Presentation transcript:

1 Code&Semantic Observations
P.Hristov Off-line Week March 10, 2004 CERN

2 STEER Simulation classes Reconstruction classes IO classes
Generation of particles Hits Track references Summable digits Digits AliSimulation Reconstruction classes Clusters/RecPoints Tracks Vertex PID ESD AliReconstruction IO classes Loaders AliStream Classes, related to “conditions” Geometry Magnetic field Configuration Event headers General/service classes AliRun Obsolete classes?

3 STEER I AliRun: delete gAlice->GetRunLoader(); delete gAlice; AliRunLoader rl = AliRunLoader::Open(“galice.root”); gAlice = rl->GetAliRun(); => Something is wrong, we should instantiate AliRun only when it is needed, and can be initiated correctly. Do we need the global pointer gAlice? Many shortcut methods can be removed Obsolete parts of the code (Tree2Tree, etc.) What should be the main function of AliRun?

4 STEER II AliModule & AliDetector AliMC & AliStack
Used in simulation & reconstruction => could we separate the two main use cases? Do we need both? What would be the relation with AliReconstructor class (see the talk of Thomas)? AliMC & AliStack Could AliMC be singleton which is not accessed via AliRun? Could we make more clean distinction of responsibilities between AliMC and AliStack? Could we avoid the mapping in AliStack?

5 STEER III: AliStream AliRunDigitizer AliRunDigitizer AliStream
galice.root with sdigits galice.root AliRunLoader galice.root with sdigits galice.root with sdigits sdigits sdigits sdigits Do we really need this functionality?

6 STEER IV Could we fix the interfaces using pure virtual classes?
Missing base classes: Calibration Alignment What else? Could we revise the “dependences” (inheritance, usage, composition, aggregation, etc.)?

7 Tasks Features: Main issues: Conversion to tasks: only partially done
Recursive call of subtask tree via ExecuteTask/Exec/TTask::ExecuteTasks Browsing & debugging Main issues: Access by name should be avoided Object ownership: strict discipline in Add/CleanTasks/Clear needed Conversion to tasks: only partially done

8 Tasks II Advantages Concerns How should we continue?
Uniform implementation of methods Recursive behavior Dynamic creation of task trees Possibility to present/browse/debug Concerns More suitable for interactive jobs Needs fully implemented task chains Gives easy access by name => possible misusage Simplicity: do we need this functionality? How should we continue?

9 Pointers Usage of pointers as data members: question of composition vs aggregation. If the object- data member has to be deleted in the destructor, one better uses it directly Exceptions: if the size of (simple) container is variable or too big, use “new” Root containers: set correctly object ownership If you use pointers as data members, you must initialize them Do not delete objects if you are not the owner New/delete: avoid memory leaks

10 Pointers II f->GetA()->GetB()->GetC()->Do(); usually occurs if the class responsibilities are not well defined Could we improve such cases? Transient pointers: do not forget to indicate by exclamation mark “//!” that given pointer should not be stored


Download ppt "Code&Semantic Observations"

Similar presentations


Ads by Google