Skip to content

neiser/ant

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status master branch Codecov status master branch Coverity Scan build status Gitter

ant

A2 ant logo

Just another ANalysis Toolkit ant, which can read from many input sources with minimal user intervention and let's you create Physics analysis within minutes.

Please see also the automatically generated Doxygen pages.

Dependencies

  • C++11 (gcc >4.9.2 should work, but >6.0 recommended, clang is also supported)
  • cmake >3.0
  • libgsl-dev, liblzma-dev (before installing root)
  • CERN ROOT5 (ROOT6 support is WIP)
  • PLUTO
  • APLCONpp
  • doxygen (optional)

Installation

Please make sure that you fulfill the dependencies. Once you installed ROOT and PLUTO, preferably in /opt/root and /opt/pluto to ensure auto-detection by ant's cmake.

Next, you need to get the APLCON C++ wrapper. The easiest way is to clone the repository relative to your ant directory at ../APLCONpp, then create the build directory at ../APLCONpp/build. This way CMake will automatically detect it.

See also the detailed steps below!

APLCONpp

To build APLCONpp, clone the respository with

git clone https://github.com/A2-Collaboration-dev/APLCONpp.git

and cd to the created APLCONpp directory. Create a build directory and run cmake:

mkdir build && cd build && cmake ..

Finally run make to build the needed libraries.

ant

Now you should be able to compile the ant framework. Therefore clone this respository, either directly from https://github.com/A2-Collaboration-dev/ant.git or you may want to fork it. As mentioned above, the installation works best when the APLCONpp and ant folder reside in the same directory. Inside your ant directory create a build direcory:

mkdir build && cd build && cmake ..

Then start the parallel compilation for example on a QuadCore machine with make -j5. You may want to add your ant/build/bin directory to your $PATH variable.

Troubleshooting

  • In case CMake is not able to locate your Pluto installation, you can provide the environment variable $PLUTOSYS to tell CMake where to find it. If you installed Pluto inside your home directory, ~/pluto or ~/src/pluto, or placed it in /opt/pluto, the make process may have failed. Please make sure you ran make in your Pluto directory with a proper ROOT installation.
  • If you're using gcc version 5.x and experiencing build errors within ROOT generated dictionary files (i.e. redeclaration of struct __xfer_bufptrs), please update to a more recent ROOT version. As of November 2015, you need to clone the git branch which includes the patches. To do so:
    • get the source with git clone -b v5-34-00-patches https://github.com/root-mirror/root.git
    • cd in the cloned directory
    • create a new folder for the build process, e.g. mkdir build_dir
    • cd in it and run cmake .. && make -jN, replace N with the number of threads which should be used
    • set your $ROOTSYS accordingly
  • gdb version 7.7 crashes in combination with cereal, so use version 7.10
  • If using GCC 6.x (ArchLinux users), use the patched ROOTv5 version available here, which contains the patches from the bug report ROOT-8180. In the meantime, those patches have been merged upstream.
  • In case you encounter weird test errors (garbage output of corrupted TFiles TKey::ReadObjWithBuffer msg='Unknown class foDoubly linked listZL), make sure you recompiled Pluto properly with the identical $ROOTSYS as Ant (in particular pay attention to ROOT debug/release builds).

Contributing

Please read the following sections if you want to contribute to this project.

Coding Style

  • Indentation: 4 spaces, no tabs anywhere
  • Ant-Codesytle defined in doc/Ant-Codestyle.xml (import to QtCreator)
  • #include statements:
    • header file for this .cc file first
    • then grouped by ant, ROOT, STL, others
    • one line between groups
    • each group ordered alphabetically

Library organization

The calibration modules specify physics classes, usually below src/analysis/physics/calibration, which produce the histograms used in the GUI part of the module. The analysis classes can access all information organized in expconfig. The slowcontrol libraries are divided to ensure proper initialization order of static registries.

The solid arrows mean "links to", whereas the dashed arrows means "includes only".

Or, automatically generated with

cd build
cp ../doc/CMakeGraphVizOptions.cmake .
cmake --graphviz=CmakeGraphViz ..
dot -Tpng CmakeGraphViz.Ant -o ../doc/library-dependencies-autogenerated.png
rm CmakeGraphViz*

Development

The following items are still to-do:

  • Implement the wire chamber detector (hard), or the conventional tagger ladder including magnetic field energy calibration (easier)
  • Implement Mk1 unpacker (many things already provided) Done including GZ decompression. Scaler buffer decoding still WIP.
  • Implement EPICS reader, and some more slow control variables Done for tagging efficiency at least.

Parallel Processing

Ant is designed to run single threaded. This avoids a lot of programming problems and running it on the computation clusters is simpler and more efficient, since you only need to allocate one thread per job. For processing data we recommend to run an Ant process on each input file and then merge the results afterwards using Ant-hadd, Ant-chain, or ROOTs hadd tool.

There is also no builtin option to run over multiple input files in one go. This should be handled by external tools like GNU parallel, or AntSubmit on a cluster (see also --no_qsub option), or your shell. See below for an AntSubmit quick start guide.

Detector Type Mapping

Ant Reconstruct Ant Analysis Goat
Trigger - -
Tagger - -
TaggerMicroscope - -
EPT - -
Moeller - -
PairSpec - -
CB CB NaI
PID PID PID
MWPC0 MWPC0 MWPC
MWPC1 MWPC1
TAPS TAPS BaF2
PbWO4
TAPSVeto TAPSVeto Veto
Cherenkov Cherenkov -

Data flow

The physics classes analyse TEvents provided by different sources or amenders. The main source of events is the AntReader, which itself is either fed by some unpacker or by already unpacked and possibly reconstructed treeEvents. Additionally, the SlowControlManager needs to do proper buffering to make physics classes easy to implement.

External Components

Have a look at those very nice projects, which are used here:

Quick start guides

Ant MC tools

Ant comes with a few tools to generate MC data. It can generate photoproduction and decays with Ant-pluto, a frontend utilizing Pluto for A2 physics (includes the Tagger), shoot particles randomly in all directions using Ant-mcgun, or simulate a complete cocktail of various photoproduction and decay channels according to their cross sections with Ant-cocktail.

Example: Pluto Decay

To use Pluto to simulate, for example, the omega ---> pi0 gamma do:

Ant-pluto --reaction "p omega [ pi0 g ]" --Emin 1400 --Emax 1600 --numEvents 10000 --saveIntermediate --enableBulk -v 2 -o sim.root

This will generate 10k events in the incident photon energy range 1400 MeV to 1600 MeV, saving unstable particles. The pi0 will decay into different channels according to the Pluto database.

Example: Random Gun

Shoot 1000 protons into TAPS, 1 proton/Event, 0 to 1 GeV

Ant-mcgun --numEvents 1000 --particle p --theta-max 25 --Emax 1000

About

Just another analysis toolkit for A2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

  • C++ 94.3%
  • Python 2.4%
  • CMake 1.4%
  • Perl 1.2%
  • C 0.5%
  • Shell 0.2%