BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
offlineQA.C
Go to the documentation of this file.
1#include <Rtypes.h>
2#include <TFile.h>
3#include <TKey.h>
4#include <TStopwatch.h>
5#include <TString.h>
6
7R__ADD_INCLUDE_PATH($VMCWORKDIR)
8#include "macro/run/bmnloadlibs.C"
9
10void offlineQA(TString digiFile = "/nica/mpd22/batyuk/digi/run6/bmn_run1558_digi.root",
11 // TString dstBMN = "/nica/mpd22/batyuk/srcDST/srcdst_3387.root",
12 TString dstBMN = "",
13 Int_t periodId = 6,
14 Int_t runId = 1558,
15 TString out = "qa_1558.root",
16 Int_t nEvents = 1e6)
17{
18
19 bmnloadlibs(); // load libraries
20
21 // ----- Timer ---------------------------------------------------------
22 TStopwatch timer;
23 timer.Start();
24 FairRunAna* fRunAna = new FairRunAna();
25 fRunAna->SetEventHeaderPersistence(kFALSE);
26
27 FairSource* fFileSource = new BmnFileSource(digiFile.Data());
28 fRunAna->SetSource(fFileSource);
29
30 fRunAna->SetOutputFile(out.Data());
31
32 UniRun* pCurrentRun = UniRun::GetRun(periodId, runId); // FIXME
33 Double_t* field_voltage = pCurrentRun->GetFieldVoltage();
34
35 Double_t map_current = 55.87;
36 Double_t fieldScale = (*field_voltage < 10.) ? 0 : (*field_voltage) / map_current;
37
38 BmnFieldMap* magField = new BmnNewFieldMap("field_sp41v4_ascii_Extrap.root");
39 magField->SetScale(fieldScale);
40 magField->Init();
41 fRunAna->SetField(magField);
42
43 BmnQaOffline* qaSystem = new BmnQaOffline(dstBMN);
44 fRunAna->AddTask(qaSystem);
45
46 fRunAna->Init();
47 fRunAna->Run(0, nEvents);
48
49 delete qaSystem;
50}
int Int_t
constexpr Bool_t kFALSE
double Double_t
#define R__ADD_INCLUDE_PATH(PATH)
void SetScale(Double_t factor)
Set a global field scaling factor.
Definition BmnFieldMap.h:55
virtual void Init()
BmnFileSource.h.
Field Map does not have any symmetries w.r.t coordinate axises.
void Start(Bool_t reset=kTRUE)
UniRun.h Class for the table: run_.
Definition UniRun.h:21
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:161
double * GetFieldVoltage()
get field voltage of the current run
Definition UniRun.h:121
void offlineQA(TString digiFile="/nica/mpd22/batyuk/digi/run6/bmn_run1558_digi.root", TString dstBMN="", Int_t periodId=6, Int_t runId=1558, TString out="qa_1558.root", Int_t nEvents=1e6)
Definition offlineQA.C:10