BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnFunctionAna.h
Go to the documentation of this file.
1#ifndef BMNFUNCTIONANA_H
2#define BMNFUNCTIONANA_H 1
3
4#include "FairField.h"
5#include "TString.h"
6
7/** Class with static common functions to simplify experiment code **/
9{
10 public:
11 // get magnetic field and run information from a specified DST file
12 // fileName: DST file path [in]
13 // fieldScale: magnetic field scale [out]; fieldType: magnetic field type [out]
14 // beam, target: names of the beam and target, e.g. 'Xe' and 'CsI (2%)' [out, optional]
15 // beam_energy: beam kinetic energy per nucleon in AGeV [out, optional]
16 // beam_a, beam_z, target_a, target_z: mass and charge numbers of the beam and target nuclei [out, optional]
17 // NB: the names are empty and A and Z are equal to -1 if the nucleus was not defined at the reconstruction stage,
18 // target A is equal to 0 if the empty target
19 // returns magnetic field, nullptr - if some errors occured
20 static FairField* GetDSTField(TString fileName,
21 Double_t& fieldScale,
22 Int_t& fieldType,
23 TString* beam = nullptr,
24 TString* target = nullptr,
25 Double_t* beam_energy = nullptr,
26 Int_t* beam_a = nullptr,
27 Int_t* beam_z = nullptr,
28 Int_t* target_a = nullptr,
29 Int_t* target_z = nullptr);
30
31 // write the reconstructed global tracks from the simulated DST files to a text file, one track per line: the event
32 // number, the parameters and the covariance matrices of the track at its first and last points, chi2, NDF, length,
33 // number of hits, velocities measured by ToF-400 and ToF-700, DCA to the primary vertex and the PDG code of the
34 // matched MC particle. Only the tracks with a velocity measured by ToF and matched to an MC track are written, and
35 // only from the events with a primary vertex reconstructed from more than one track
36 // input_list_file: text file with the paths of the DST files, one per line [in]
37 // output_file: path of the text file to be written [in]
38 // configFileName: JSON file with the selection settings, not used yet [in]
39 // returns 0 (also if the list of the input files is empty)
40 static int ConvertRecoToTxt(TString input_list_file,
41 TString output_file = "reco_tracks.txt",
42 TString configFileName = "recotxt_config.json");
43
44 private:
47
49};
50
51#endif
int Int_t
double Double_t
#define ClassDef(name, id)
Class with static common functions to simplify experiment code.
static int ConvertRecoToTxt(TString input_list_file, TString output_file="reco_tracks.txt", TString configFileName="recotxt_config.json")
static FairField * GetDSTField(TString fileName, Double_t &fieldScale, Int_t &fieldType, TString *beam=nullptr, TString *target=nullptr, Double_t *beam_energy=nullptr, Int_t *beam_a=nullptr, Int_t *beam_z=nullptr, Int_t *target_a=nullptr, Int_t *target_z=nullptr)