BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
run_mon_reco.C
Go to the documentation of this file.
1
void
run_mon_reco
(
TString
inputFileName =
"tcp://localhost:6666"
,
2
TString
bmndstFileName =
"bmndst.root"
,
3
Int_t
nStartEvent = 0,
4
Int_t
nEvents = 0,
5
bool
isOnline =
true
)
6
{
7
gDebug
= 0;
// Debug option
8
// Verbosity level (0 = quiet (progress bar), 1 = event-level, 2 = track-level, 3 = full debug)
9
Int_t
iVerbose = 0;
10
Int_t
period = 9;
11
12
// ----- Timer ---------------------------------------------------------
13
TStopwatch
timer;
14
timer.
Start
();
15
16
FairRunOnline* fRunAna =
new
FairRunOnline();
17
18
FairSource
* source =
nullptr
;
19
if
(isOnline)
20
source =
new
BmnMQSource
(
string
(inputFileName),
kFALSE
);
21
else
{
22
if
(!
BmnFunctionSet::CheckFileExist
(inputFileName, 1))
23
exit(-1);
24
source =
new
BmnFileSource
(inputFileName);
25
}
26
fRunAna->SetSource(source);
27
// if nEvents is equal 0 then all events of the given file starting with "nStartEvent" should be processed
28
if
(source->GetSourceType() == kFILE) {
29
if
(nEvents == 0)
30
nEvents =
MpdGetNumEvents::GetNumROOTEvents
((
char
*)inputFileName.Data()) - nStartEvent;
31
}
else
{
32
nStartEvent = -1;
33
nEvents = -1;
34
}
35
36
// if directory for the output file does not exist, then create
37
if
(
BmnFunctionSet::CreateDirectoryTree
(bmndstFileName, 1) < 0)
38
exit(-2);
39
// fRunAna->SetSink(new FairRootFileSink(bmndstFileName));
40
// fRunAna->SetSink(new BmnMQSink());
41
// fRunAna->SetGenerateRunInfo(false);
42
BmnTrackingQaExp
* trQaAll =
new
BmnTrackingQaExp
(
"TrackingQa"
, period);
43
44
trQaAll->
SetDetectorPresence
(
kSILICON
,
kTRUE
);
45
trQaAll->
SetDetectorPresence
(
kCSC
,
kTRUE
);
46
trQaAll->
SetDetectorPresence
(
kSSD
,
kFALSE
);
47
trQaAll->
SetDetectorPresence
(
kGEM
,
kTRUE
);
48
trQaAll->
SetDetectorPresence
(
kVSP
,
kTRUE
);
49
THttpServer
* fServer =
nullptr
;
50
if
(isOnline) {
51
trQaAll->
SetMonitorMode
(
kTRUE
);
52
fServer =
new
THttpServer
(
"http:8081;noglobal;cors"
);
53
fServer->
SetTimer
(50,
kTRUE
);
54
trQaAll->
SetObjServer
(fServer);
55
}
56
TString
innerTrackBranchName;
// use different track container
57
#ifdef L1Tracking
58
innerTrackBranchName =
"StsTrack"
;
59
#else
60
innerTrackBranchName =
"StsVector"
;
61
#endif
62
trQaAll->
SetInnerTracksBranchName
(innerTrackBranchName);
63
fRunAna->AddTask(trQaAll);
64
// -------------------------------------------------------------------------
65
// ----- Initialize and run --------------------------------------------
66
fRunAna->GetMainTask()->SetVerbose(iVerbose);
67
fRunAna->Init();
68
cout <<
"Starting run"
<< endl;
69
if
(isOnline) {
70
fRunAna->Run(-1, -1);
71
fServer->
SetTimer
(50,
kFALSE
);
72
}
else
73
fRunAna->Run(nStartEvent, nStartEvent + nEvents);
74
// -------------------------------------------------------------------------
75
// ----- Finish --------------------------------------------------------
76
timer.
Stop
();
77
Double_t
rtime = timer.
RealTime
();
78
Double_t
ctime = timer.
CpuTime
();
79
cout << endl << endl;
80
cout <<
"Macro finished successfully."
<< endl;
// marker of successful execution for CDASH
81
cout <<
"Input file is "
+ inputFileName << endl;
82
cout <<
"Output file is "
+ bmndstFileName << endl;
83
cout <<
"Real time "
<< rtime <<
" s, CPU time "
<< ctime <<
" s"
<< endl;
84
cout << endl;
85
// ------------------------------------------------------------------------
86
getchar();
87
}
Int_t
int Int_t
gDebug
Int_t gDebug
kFALSE
constexpr Bool_t kFALSE
Double_t
double Double_t
kTRUE
constexpr Bool_t kTRUE
kSILICON
@ kSILICON
Definition
BmnDetectorList.h:25
kGEM
@ kGEM
Definition
BmnDetectorList.h:15
kVSP
@ kVSP
Definition
BmnDetectorList.h:21
kSSD
@ kSSD
Definition
BmnDetectorList.h:37
kCSC
@ kCSC
Definition
BmnDetectorList.h:24
BmnFileSource
BmnFileSource.h.
Definition
BmnFileSource.h:30
BmnFunctionSet::CreateDirectoryTree
static int CreateDirectoryTree(TString &fileName, int iVerbose=0, EAccessMode mode=kWritePermission)
Definition
BmnFunctionSet.cxx:65
BmnFunctionSet::CheckFileExist
static int CheckFileExist(TString &fileName, int iVerbose=0, EAccessMode mode=kFileExists)
Definition
BmnFunctionSet.cxx:25
BmnMQSource
Definition
BmnMQSource.h:27
BmnQaBase::SetMonitorMode
void SetMonitorMode(const Bool_t mm)
Definition
BmnQaBase.h:68
BmnQaBase::SetObjServer
void SetObjServer(THttpServer *s)
Definition
BmnQaBase.h:71
BmnTrackingQaExp
Definition
BmnTrackingQaExp.h:34
BmnTrackingQaExp::SetDetectorPresence
void SetDetectorPresence(DetectorId det, Bool_t use=true)
Definition
BmnTrackingQaExp.h:72
BmnTrackingQaExp::SetInnerTracksBranchName
void SetInnerTracksBranchName(TString name)
Definition
BmnTrackingQaExp.h:74
FairSource
MpdGetNumEvents::GetNumROOTEvents
static Int_t GetNumROOTEvents(const char *filename, const char *treename="", int iVerbose=2)
Definition
MpdGetNumEvents.cxx:511
THttpServer
THttpServer::SetTimer
void SetTimer(Long_t milliSec=100, Bool_t mode=kTRUE)
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_mon_reco
void run_mon_reco(TString inputFileName="tcp://localhost:6666", TString bmndstFileName="bmndst.root", Int_t nStartEvent=0, Int_t nEvents=0, bool isOnline=true)
Definition
run_mon_reco.C:1
install
macro
monitor
run_mon_reco.C
Generated on
for BmnRoot by
1.17.0