Back to home page

EIC code displayed by LXR

 
 

    


Warning, /jana2/docs/index.md is written in an unsupported language. File is not indexed.

0001 
0002 # JANA2
0003 
0004 ### C++ Reconstruction framework in Nuclear and High Energy Physics
0005 
0006 ## Welcome to JANA2!
0007 
0008 JANA2 is a C++ framework for multi-threaded HENP (High Energy and Nuclear Physics)  event reconstruction.
0009 It is very efficient at multi-threading with a design that makes it easy for less experienced programmers
0010 to contribute pieces to the larger reconstruction project. The same JANA2 program can be used to easily
0011 do partial or full reconstruction, fully maximizing the available cores for the current job.
0012 
0013 Its design strives to be extremely easy to setup when first getting started, yet have a depth of customization
0014 options that allow for more complicated reconstruction as your project grows. The intent is to make it easy to
0015 run on a laptop for local code development, but to also be highly efficent when deploying to large computing
0016 sites like [NERSC](http://www.nersc.gov/ ":target=_blank").
0017 
0018 The project is [hosted on GitHub](https://github.com/JeffersonLab/JANA2)
0019 
0020 ```cpp
0021 auto tracks = event->Get<DTrack>();
0022 
0023 for(auto t : tracks){
0024   // ... do something with a track
0025 }
0026 ```
0027 
0028 
0029 ## Design philosophy
0030 
0031 JANA2's design philosophy can be boiled down to five values, ordered by importance:
0032 
0033 ### Simple to use
0034 
0035 JANA2 focuses on making parallel computations over event-based\* data simple. 
0036 Unlike the aforementioned, JANA2's vocabulary of abstractions is designed around the needs of physicists rather than 
0037 general programmers. However, JANA2 does not attempt to meet _all_ of the needs of physicists.
0038 
0039 JANA2 recognizes that some tasks, like data persistence, should be handled separately. 
0040 As example, instead of providing its own persistence layer or requiring specific dependencies like ROOT, Numpy, or Apache Arrow, 
0041 JANA2 allows users to choose their preferred tools. 
0042 This flexibility ensures that if a team wants to switch from one tool to another (e.g., from ROOT to Arrow), 
0043 the core analysis code remains largely unaffected.
0044 
0045 To keep things simple, JANA minimizes the complexity of its build system and orchestration. 
0046 Using JANA should be straightforward: implement a several key interfaces, add an include path, and link against a single library.
0047 
0048 ?> **Tip** The term `event-based` in JANA2 doesn't strictly refer to _physics_ or _trigger_ events. 
0049 In JANA2, `event` is used in a broader computer science context, aligning with the streaming readout paradigm 
0050 and supporting concepts like event nesting and sub-event parallelization.
0051 
0052 
0053 ### Well-organized
0054 
0055 While JANA's primary goal is running code in parallel, its secondary goal is imposing an organizing principle on the users' codebase. 
0056 This can be invaluable in a large collaboration where members vary in programming skill. Specifically, 
0057 JANA organizes processing logic into decoupled units. JFactories are agnostic of how and when their prerequisites are 
0058 computed, are only run when actually needed, and cache their results for reuse. Different analyses can coexist in separate
0059 JEventProcessors. Components can be compiled into independent plugins, to be mixed and matched at runtime. All together, 
0060 JANA enforces an organizing principle that enables groups to develop and test their code with both freedom and discipline.
0061 
0062 
0063 ### Safe
0064 
0065 JANA recognizes that not all of its users are proficient parallel programmers, and it steers users towards patterns which
0066 mitigate some of the pitfalls. Specifically, it provides:
0067 
0068 - **Modern C++ features** such as smart pointers and judicious templating, to discourage common classes of bugs. JANA seeks to
0069 make its memory ownership semantics explicit in the type system as much as possible.
0070 
0071 - **Internally managed locks** to reduce the learning curve and discourage tricky parallelism bugs.
0072 
0073 - **A stable API** with an effort towards backwards-compatibility, so that everybody can benefit from new features
0074 and performance/stability improvements.
0075 
0076 
0077 ### Fast
0078 
0079 JANA uses low-level optimizations wherever it can in order to boost performance. 
0080 
0081 ### Flexible
0082 
0083 The simplest use case for JANA is to read a file of batched events, process each event independently, and aggregate 
0084 the results into a new file. However, it can be used in more sophisticated ways. 
0085 
0086 - Disentangling: Input data is bundled into blocks (each containing an array of entangled events) and we want to 
0087 parse each block in order to emit a stream of events (_flatmap_)
0088 
0089 - Software triggers: With streaming data readout, we may want to accept a stream of raw hit data and let JANA 
0090 determine the event boundaries. Arbitrary triggers can be created using existing JFactories. (_windowed join_)
0091 
0092 - Subevent-level parallelism: This is necessary if individual events are very large. It may also play a role in 
0093 effectively utilizing a GPU, particularly as machine learning is adopted in reconstruction (_flatmap+merge_)
0094 
0095 JANA is also flexible enough to be compiled and run different ways. Users may compile their code into a standalone 
0096 executable, into one or more plugins which can be run by a generic executable, or run from a Jupyter notebook. 
0097 
0098 
0099 ## Comparison to other frameworks
0100 
0101 Many different event reconstruction frameworks exist. The following are frequently compared and contrasted with JANA:
0102 
0103 - [Clara](https://claraweb.jlab.org/clara/) While JANA specializes in thread-level parallelism, Clara
0104  uses node-level parallelism via a message-passing interface. This higher level of abstraction comes with some performance
0105  overhead and significant orchestration requirements. On the other hand, it can scale to larger problem sizes and 
0106  support more general stream topologies. JANA is to OpenMP as Clara is to MPI.
0107  
0108 
0109 ## History
0110 
0111 [JANA](https://halldweb.jlab.org/DocDB/0011/001133/002/Multithreading_lawrence.pdf) (**J**Lab **ANA**lysis framework) 
0112 was one of the earliest implementations of a multi-threaded, event processing framework designed to run on commercial
0113 CPU hardware. The framework, which was developed since 2005, has been used for many aspects of [the GlueX experiment](https://arxiv.org/abs/1911.11239)
0114 at Jefferson Lab which was commissioned in 2016. In addition to the reconstruction of both
0115 acquired and simulated data, JANA is used for the online monitoring system and was also used
0116 to develop a L3 trigger (also known as a high level software trigger). With over a decade of
0117 experience in developing and using JANA, an effort has begun to develop a next-generation
0118 framework, JANA2. JANA2 leverages language features introduced in the modern C++11 standards
0119 to produce a framework that can help carry the next generation of Nuclear Physics experiments
0120 in the coming decade. Currently JANA2 is used as a backbone for the 
0121 [reconstruction framework at Electron Ion Collider](https://github.com/eic/EICrecon), 
0122 [TriDAS Streaming Readout DAQ](https://arxiv.org/abs/2104.11388),
0123 GluEx and other experiments. 
0124 
0125 
0126 ## Publications
0127 
0128 - [JANA2: Multithreaded Event Reconstruction](https://indico.cern.ch/event/708041/papers/3276151/files/9134-JANA2___ACAT2019_Proceedings.pdf)
0129 - [Running AI in JANA2](https://indico.cern.ch/event/1238718/contributions/5431992/attachments/2691231/4670186/2023-07-27_Running-AI-in-JANA2.pdf)
0130 - [Electron Ion Collider Software Overview](https://www.epj-conferences.org/articles/epjconf/pdf/2024/05/epjconf_chep2024_03011.pdf)
0131 - [JANA2 Framework for Event Based and Triggerless Data Processing](https://doi.org/10.1051/epjconf/202024501022)
0132 - [Streaming readout for next generation electron scattering experiments](https://arxiv.org/abs/2202.03085)
0133 - [Streaming Readout of the CLAS12 Forward Tagger Using TriDAS and JANA2](https://arxiv.org/abs/2104.11388)
0134 - [Offsite Data Processing for the GlueX Experiment](https://doi.org/10.1051/epjconf/202024507037)
0135 
0136 Curated publications list on [EPSCI Wiki](https://wiki.jlab.org/epsciwiki/index.php/EPSCI_publications_page)