LArSoft

Logo

Software for Liquid Argon time projection chambers

View My GitHub Profile

Developing With LArSoft

Any collaborator can develop or modify code and contribute it to LArSoft. On this page, we describe the procedures for submitting code (via a GitHub pull request), coding guidelines and policies, and other information that might be of use to LArSoft code developers.

Platforms

LArSoft currently supports the platforms listed here. Users who wish to develop on an unsupported platform are encouraged to use this Docker container approach.

Designing

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 here

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.

Policy for including new external packages in LArSoft

To include new external software packages into the LArSoft distribution, or to create a new external dependency:

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.

Guidelines

  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
  5. Guidelines on writing (and using) algorithms in LArSoft
  6. Guidelines on using the geometry
  7. Error handling policy
  8. Examples!
  9. Using git repositories

Multi-threading in LArSoft

  1. Migration path for services
  2. Guidelines for LArSoft modules
  3. Thread-safety status

How to…


Tips on updating your code after LArSoft release


Tools and techniques

Documenting and browsing code

Working with GitHub and contributing code via LArSoft pull requests

Start by reviewing the information on the overview page for using LArSoft with GitHub. Contact your experiment offline management to identify acting Level 2 managers. Send any comments to The Scisoft Team, or via Redmine issues.

git and git flow

NOTE: These are instructions for working with the legacy Redmine-based git repositories, and are recommended for experiments that continue to use Redmine for their experiment code. All LArSoft repositories have been moved to GitHub. Please refer to the instructions on the Working with GitHub page for current instructions on using GitHib and contributing code to LArSoft.

Profiling

Debugging


Building

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 the SciSoft Team.

Understanding CMakeLists.txt and product_deps files

mrb (multi-repository build) tool

ups

Testing

High-level description of testing is available at larsoft.org

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.