BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
run_qa_exp.C
Go to the documentation of this file.
1
// #include <Rtypes.h>
2
#include <
TString.h
>
3
4
R__ADD_INCLUDE_PATH
($VMCWORKDIR)
5
6
void
run_qa_exp
(
TString
inFileName =
""
,
TString
outFileName =
""
,
Int_t
nStartEvent = 0,
Int_t
nEvents = 0)
7
{
8
9
TStopwatch
timer;
10
timer.
Start
();
11
12
// check input file exists
13
if
(!
BmnFunctionSet::CheckFileExist
(inFileName, 1))
14
exit(-1);
15
16
FairRunAna* fRunAna =
new
FairRunAna();
17
18
Int_t
fieldType = -1;
19
Double_t
fieldScale = 0.;
20
FairField
* magField =
BmnFunctionAna::GetDSTField
(inFileName, fieldScale, fieldType);
21
if
(magField !=
nullptr
)
22
fRunAna->SetField(magField);
23
24
// flag for FairRunAna tasks whether simulation or experimental data are used
25
Bool_t
isExp = (
BmnFunctionSet::isSimulationFile
(inFileName) == 0);
26
27
// Load geometry file
28
// GeoSetup gSetup;
29
// gSetup.LoadSetupToGeoManager(gSetup.GetLastApprovedSetupTag("run8"));
30
TGeoManager::Import
(
"current_geo_file.root"
);
31
32
// Declare input source as simulation file or experimental data
33
FairFileSource* fFileSource =
new
FairFileSource(inFileName);
34
fRunAna->SetSource(fFileSource);
35
36
// if directory for the output file does not exist, then create
37
if
(
BmnFunctionSet::CreateDirectoryTree
(outFileName, 1) < 0)
38
exit(-2);
39
fRunAna->SetSink(
new
FairRootFileSink(outFileName));
40
fRunAna->SetGenerateRunInfo(
false
);
41
42
FairTask
* pKF =
new
CbmKF
();
43
fRunAna->AddTask(pKF);
44
45
// BmnTof400Qa* tof400QaTask = new BmnTof400Qa();
46
// fRunAna->AddTask(tof400QaTask);
47
48
BmnTof700Qa
* tof700QaTask =
new
BmnTof700Qa
();
49
fRunAna->AddTask(tof700QaTask);
50
51
fRunAna->Init();
52
fRunAna->Run(0, nEvents);
53
54
// remove(geoFileName.Data());
55
56
timer.
Stop
();
57
Double_t
rtime = timer.
RealTime
();
58
Double_t
ctime = timer.
CpuTime
();
59
cout << endl << endl;
60
cout <<
"Real time "
<< rtime <<
" s, CPU time "
<< ctime <<
" s"
<< endl;
61
cout << endl;
62
}
Bool_t
bool Bool_t
Int_t
int Int_t
Double_t
double Double_t
R__ADD_INCLUDE_PATH
#define R__ADD_INCLUDE_PATH(PATH)
TString.h
BmnFunctionAna::GetDSTField
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)
Definition
BmnFunctionAna.cxx:37
BmnFunctionSet::CreateDirectoryTree
static int CreateDirectoryTree(TString &fileName, int iVerbose=0, EAccessMode mode=kWritePermission)
Definition
BmnFunctionSet.cxx:65
BmnFunctionSet::isSimulationFile
static int isSimulationFile(TString fileName="")
Definition
BmnFunctionSet.cxx:169
BmnFunctionSet::CheckFileExist
static int CheckFileExist(TString &fileName, int iVerbose=0, EAccessMode mode=kFileExists)
Definition
BmnFunctionSet.cxx:25
BmnTof700Qa
Definition
BmnTof700Qa.h:21
CbmKF
The CbmKF Kalman Filter algorithm.
Definition
CbmKF.h:28
FairField
FairTask
TGeoManager::Import
static TGeoManager * Import(const char *filename, const char *name="", Option_t *option="")
TStopwatch
TStopwatch::RealTime
Double_t RealTime()
TStopwatch::Start
void Start(Bool_t reset=kTRUE)
TStopwatch::CpuTime
Double_t CpuTime()
TStopwatch::Stop
void Stop()
TString
run_qa_exp
void run_qa_exp(TString inFileName="", TString outFileName="", Int_t nStartEvent=0, Int_t nEvents=0)
Definition
run_qa_exp.C:6
macro
physics
QA
run_qa_exp.C
Generated on
for BmnRoot by
1.17.0