LHCb Conventions

Home Computing DAQ E-mail Notes Meetings Subsystems Search

This page last edited by MC on June 29, 2009.

In this page we list coding and other conventions that should be used when developing code for LHCb.

Coding Conventions

  • C++ coding conventions are described in note LHCb-2001-054
  • An emacs customisation file has been developed by Olivier Callot to produce standard templates for source code files
  • A coding conventions checking tool was provided but has not been used for many years.

Data Model Conventions

LHCb applications conventions

  • Sub-detector job options
  • Rules for return status codes for algorithms and tools running in production applications
  • Rules for printout from algorithms and tools running in production applications
  • Algorithms must always create their output containers, even if empty. Algorithms not finding an expected input container must return StatusCode::FAILURE, this will stop the event processing.
  • Monitoring and Checking
    • Monitors are algorithms that monitor the performance of the code using real data only (no MC truth)
    • Checkers are algorithms that check the performance of the code by comparing to MC truth information, and therefore cannot run on real data.
    • Any monitoring or checking algorithms that produce histograms must inherit from the GaudiHistoAlg base class. This provides many shortcuts for booking and filling histograms, and also enforces the convention that the histograms should be stored in directories that have the name of the algorithm producing them. The HistoTopDir should be set to the sub-detector name. Within an algorithm, histogram identifiers can be freely chosen by the developer; any alphanumeric string is allowed.
    • Algorithms producing NTuples should inherit from the GaudiTupleAlg base class, which itself inherits from GaudiHistoAlg. Use such algorithms with care: NTuples grow with the number of events, they should be used only in end-user analysis, not in production applications.