The PicoDst format

"For many years, the data flow model in HEP has been
Raw Data Types
Data Summary Tapes Mini/Micro DSTs"
R. Brun, F. Rademakers /  Nucl. Instr. and Meth. in Phys. Res. A 389 (1997) 81-86



The page is organized in the following way:
Introduction
Format description
PicoDst production
Installation on local machine
Analysis
Miscellaneous
Tutorials


Introduction:

This page describes the basics of the PicoDst format that will be used in STAR starting 2018 as replacement
for the larger data format called MuDst (MicroDST). The infrastructure of the data format was split into two parts:
1) StPicoDstMaker/
2) StPicoEvent/
The first one is responsible for making PicoDst files out of MuDst. The second one represents the pure ROOT-based
data structure.There are two main advantages: smaller files size, as compared to MuDst, and possibility to run analysis
in a standalone mode (with only ROOT 5/6 installed).

Format description:

Lets briefly go through the StPicoEvent/ structure. The whole structure is called StPicoDst and stores pointers
to various TClonesArray (via StPicoArrays) that describe basic elements, namely:
1)   StPicoEvent
2)   StPicoTrack
3)   StPicoBTofPidTraits
4)   StPicoBTofHit
5)   StPicoBTowHit
6)   StPicoBEmcPidTraits
7)   StPicoEmcTrigger
8)   StPicoBbcHit
9)   StPicoEpdHit
10) StPicoFmsHit
11) StPicoMtdHit
12) StPicoMtdPidTraits
13) StPicoMtdTrigger
14) StPicoTrackCovMatrix
15) StPicoBEmcSmdEHit
16) StPicoBEmcSmdPHit

StPicoEvent:
Stores information about event, i.e. reference multiplicity, ZDC and BBC ADC values, number
of TOF matched tracks, value of the magnetic field, number of tracks matched BEMC, list of
trigger ids, primary vertex position (x,y,z), etc...
There can be only one StPicoEvent (as well as only one primary vertex) per event!

StPicoTrack:
Keeps track related information, such as 3-momentum of the primary track (if the track is not primary
it will keep 0,0,0 values), origin and 3-momentum of the global track at distance of closest approach (DCA)
to primary vertex (PV or pVtx), nsigma(e,pi,K,p), measured via dE/dx, dE/dx and its error, number of hits,
possible number of hits, topology map, etc...

If track had signal (matched) other detectors except TPC then it will have index to the corresponding structure.
For example, lets assume that track left a hit in TOF and event had N hits in TOF.

/// Loop over tracks, where iTrack is an index of i-th track
StPicoTrack *track = picoDst->track(iTrack);
Int_t idx = track->bTofPidTraitsIndex(iTrack);
/// Retrieve TOF PID traits
StPicoBTofPidTraits *traits = picoDst->btofPidTraits(idx);
/// Retrieve beta of the track
Float_t trackBeta = traits->btofBeta();

StPicoBTofPidTraits:
Stores time of flight and beta of the track, y and z local of the hit, etc..., for TOF-matched tracks

StPicoBTofHit:
Keeps tray#, cell# and module#.

StPicoBTowHit:
Keeps ADC and energy for each BEMC tower. Also returns the softId value of the tower.

StPicoBEmcPidTraits:

For BEMC-matched tracks this class stores next BEMC information:
energy, id, phi and distance of the highest tower and 2 neighboring ones.

StPicoEmcTrigger:
Stores the information returned from StTriggerSimuMaker. The latter uses
online data base at the picoDst production time for the calibration values.

StPicoBbcHit:
Stores the encoded TAC, ADC and TDC  information

StPicoEpdHit:
Store
s the encoded TAC, ADC and TDC, tile number information

StPicoFmsHit:
For each hit in FMS it encodes ADC and channel ID.

StPicoMtdHit:
Encodes backleg, module, cell leading-edge and trailing-edge times of the hit.

StPicoMtdPidTraits:
Keeps the information about the hit for the MTD-matched track: hit #, time-of-flight, beta
positions and so on.

StPicoMtdTrigger:
MTD trigger information: VpdTacSum, QTTacSum, etc...

StPicoTrackCovMatrix:
Stores covariance matrix of global tracks (original fitted track). The parameters
are determined for (0,0,z) point and packed in Float16_t.
There is a general switcher in StPicoDstMaker (PicoCovMtxSkip/PicoCovMtxWrite)
that should be specified at the production level.
If matrices are saved, then there is 1 to 1 correspondence between track index
in the TClonesArray and covariance matrix index. If track did not have covariance
matrix at MuDst level, then matrix is filled with 0. One can check it
using Bool_t isBadCovMatrix() method.

StPicoBEmcSmdEHit:
Holds softId, ADC and energy of the $\eta$ strip.

StPicoBEmcSmdPHit:
Holds softId, ADC and energy of the $\phi$ strip.

Producing PicoDst:

PicoDst must be produced by S&C. The general scheme is the following.
One needs to have a directory with StRoot/ subdirectory where StPicoEvent/ and
StPicoDstMaker/ are packages are downloaded from CVS via:
cvs co StRoot/StPicoDstMaker
cvs co StRoot/StPicoEvent
Macroses that can be used to produce picoDst from MuDst are stored in StRoot/StPicoDstMaker/macros
To run the production analyzer has to make directory where he/she wants to
perform the action. Go there and copy genDst.C and producePicoDst.xml macroses to the directory.
Change pathes and data set access parameters in producePicoDst.xml accordingly to the needs,
and then submit jobs using condor:
star-submit producePicoDst.xml
At the current stage picoDst can be produced by converting MuDst or via BigFullChain (BFC) macro directly
from .daq files.

Production options:

There are several production options. The main options are listed below.
1) Vertex selection (PicoVtxMode):
  • Default - select the first primary vertex (with index = 0)
  • VpdOrDefault - uses the  Default option at first, and then if BTof info
    is available checks for the Vpd option.
  • Vpd - checks if BTof info is available then loops over primary vertices
    and checks if |Vz - VpdVz|<mTpcVpdVzDiffCut. The first vertex that
    satisfies the cut is selected.
Default is NotSet. In this case the program execution will be terminated.
Has to be explicitly set.

2) Vertex position |VpdVz - TpcVz|<mTpcVpdVzDiffCut cut. Can be set
via TpcVpdVzDiffCut:value. Default value is 6 cm.

3) Saving covariance matrix (PicoCovMtxMode):
  • PicoCovMtxSkip - skip and not write covariance matrix (default)
  • PicoCovMtxWrite - store covariance matrices. If covariance matrix does not
    exist, then it is filled with zeros
4) Saving BEMC SMD information (PicoBEmcSmdMode):
  • PicoBEmcSmdSkip - skip and not write BEMC SMD information (default)
  • PicoBEmcSmdWrite - store SMD information in StPicoBEmcSmdEHit and StPicoBEmcSmdPHit
    classes. The amount of hits is stored in the StPicoEmcTriggerInfo class.

Installing on local machine:

Download StPicoEvent/ directory with all files to your laptop. Go into the directory.
Check that you have ROOT installed and set into your environment.
Then simply call: make

The installation was checked on: Linux, MacOS and Windows with ROOT versions 5.34 and 6.12
Supported compilers: g++-4.7, 4.8, 5.3, 5.4 and clang version 3.8

Running the analysis:

If you are or RACF then you can either make your own maker or macros that simply
uses StPicoDstMaker.h(cxx) or StPicoEvent/StPico...h(cxx) classes by including
the specific headers. For instance:
#include "StPicoDstMaker/StPicoDstMaker.h"
#include "StPicoEvent/StPicoEvent.h"
#include "StPicoEvent/StPicoTrack.h"
This will automatically pick up the latest version of the picoDst that WILL read all
picoDst files produced since year 2018.

On RACF one needs to download StPicoDstMaker or StPicoEvent ONLY if any modification
of the data format is planned.
On local computer farm (not RACF) or the personal laptop the StPicoEvent/ directory
with the included classes is needed to run the processing.

The examples of how to read picoDst via macro are stored a subdirectory StPicoEvent/macros.
contains two files:
1) PicoDstAnalyzer.C
2) RunAnalyzer.C
The files are written to work on the standalone mode, but can be easily adopted to RACF
by adding specific includes (as written at the beginning of this section).

PicoDstAnalyzer.C is an example of the simple QA analysis, which takes either filename.picoDst.root
or listOfFiles.list(lis) as an input. It also shows how to access not just track or event information,
but also hit information.

RunAnalyzer.C is a code that allows one to run PicoDstAnalyzer.C in automatic mode
(it loads library = libStPicoDst.so), and passes filename.picoDst.root or listOfFiles.list(lis)
to PicoDstAnalyzer.C, and cleans ROOT compilation products after the processing finished.
One does not really need it RunAnalyzer.C (especially when using ROOT 6), but it does
simple stuff for you.

StPicoEvent/ also contains README file that briefly describes how to compile and run
the simple analysis (aforementioned steps).


Other details/questions/suggestions/proposals:

Which library should be used for the picoDst processing:
Please do not specify library or any STAR software release. This is needed ONLY if (re)reconstruction
or simulation (GEANT or embedding) is planned. In all other cases for physics analysis the library
version specification IS NOT needed. The latest version will be used and it will automatically
know how to read old data sets.

Choose the right version:
Since there is a transition period to the standalone ("vanilla" ROOT) version of the code, to process
old data sets (till they will be reproduced) one may need to use the old versions of the code.
In order to get the correct version, one needs to know the version of the library with which the data set
was produced (for simplicity, in the current example I will use SL18c).
Then go to the directory where the codes will be stored (dir), make StRoot directory (if absent),
and then checkout the correct version of the picoDst. Use cons to compile the code.
cd /path/to/dir
mkdir StRoot   (if needed)
cvs co -r SL18c StRoot/StPicoDstMaker
cvs co -r SL18c StRoot/StPicoEvent
cons
ATTENTION: When the old version is downloaded, one may need to modify the processing codes
(class(es) or macros(es)) depending on the version.

Compiling with cons:
In order to compile the codes, one should use the correct version of the STAR software, namely DEV.
As a remark, this is needed for StPicoDstMaker classes only due to the fact that not all detectors
and related to them codes exist in PRO (default) or EVAL versions.
stardev
cd /path/to/dir/with/codes
cons
In the later versions, in order to process the data, one can use StPicoDstReader instead of the StPicoDstMaker.

Tutorials:
Some tutorials on how to use picoDst can be found following the link.
 
Other questions:
For more details please look at the codes or email to the picoDst mailing list.