Developing With LArSoft » History » Version 89

« Previous - Version 89/103 (diff) - Next » - Current version
Robert Hatcher, 02/07/2018 03:33 PM

Developing With LArSoft

Quick links for Developing with LArSoft


To design LArSoft code, it's important to understand the core LArSoft suite and all the components used by it. Reference the items below when designing new software.

LArSoft architecture and design principles

LArSoft packages and repositories

The art framework


gallery provides lightweight access to event data in art/ROOT files outside the art event processing framework executable. It is not an alternative framework; rather, it provides a library that can be used to write programs that need to read (but not write) art/ROOT files. Information is available at:

External packages

These are package written and maintained by the general physics and computing communities for

Package Namespace Short description Location of headers
C++ std:: Extensions to base C++ that are part of the standard language
ROOT See below Data-analysis tools $ROOT_INC
CLHEP CLHEP:: Class Library for High-Energy Physics $CLHEP_INC/CLHEP
Geant4 See below Detector simulations $G4INCLUDE
GENIE genie:: Neutrino Monte-Carlo Generator $GENIE_INC/GENIE
boost boost:: General programming tools for C++ $BOOST_INC/boost
Message Facility wiki documentation mf:: Service for console messages $MESSAGEFACILITY_INC
FHiCL Configuration fhicl:: Configuration language and parsing tools $FHICLCPP_INC
nutools and LArSoft simb:: ... Neutrino platform tools $NUTOOLS_INC

ROOT and Geant4 do not use namespaces. In general, ROOT classes begin with "T" (e.g., TTree, TH1) while Geant4 classes begin with "G4" (e.g., G4Track, G4Step). Exception: Some of the newer ROOT sub-packages have namespaces (such as ROOT::Math::, ROOT::Fit::, ROOT::Minuit2::, Reflex::, TMVA::).

Some of these packages duplicate functionality; e.g., 4-vectors are implemented in both ROOT and CLHEP. Given a choice, use a package that's higher in the above tables over one that's lower; e.g., choose ROOT classes over their CLHEP equivalents.

Writing code

Whether you are writing new code or modifying existing code, please follow the guidelines listed below. There are also development tools and techniques available that can make coding easier.


  1. Coding guidelines
  2. Code documentation requirements and guidelines
  3. Process for contributing code to LArSoft
  4. Guidelines on writing (and using) services in LArSoft (in general)
  5. Guidelines on writing (and using) algorithms in LArSoft (not specific to any algorithm)
  6. Guidelines on using the geometry
  7. Examples!
  8. some C++ suggestions

How to...

Tips on updating your code after LArSoft release

Tools and techniques

Documenting and browsing code

  • LArSoft Doxygen - comments in the code are incorporated into documentation using the Doxygen tool.
  • LXR Cross Referencer - general purpose source code indexer and cross-referencer that provides web-based browsing of source code with links to the definition and usage of any identifier. Supports multiple languages. Includes LArSoft code. Note, pages may take several seconds to load.

git and git flow




Using the build system

To get write access to the repositories, speak to the offline coordinator for your experiment. If you have a question, send email to .

Understanding CMakeLists.txt and product_deps files

mrb (multi-repository build) tool



High-level description of testing is available at

LArSoft Continuous Integration (CI) system

Submitting for next release

After designing, coding, building and testing a piece of software, submit it to the LArSoft development branch so it is included in a new release.

Also look at Process for contributing code to LArSoft.