1 / 10

Code&Semantic Observations

P.Hristov Off-line Week March 10, 2004 CERN. Code&Semantic Observations. Simulation classes Generation of particles Hits Track references Summable digits Digits AliSimulation Reconstruction classes Clusters/RecPoints Tracks Vertex PID ESD AliReconstruction. IO classes Loaders

eshana
Download Presentation

Code&Semantic Observations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Simulation 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? STEER

  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 • 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 AliStream AliStream AliStream galice.root AliRunLoader galice.root with sdigits 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: • 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 • 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

More Related