Coherent WaveBurst
Reference Guide
CWB Documentation
Main Page
Namespaces
All Classes
Files
gitlab
ROOT
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
SOFT
cWB
library
master_0bc430d
tools
history
tutorials
GetCmdLineHistory.C
Go to the documentation of this file.
1
//
2
// Get Command Line infos from the OUTPUT CWB ROOT FILES contained in the 'idir' directory
3
// Author : Gabriele Vedovato
4
//
5
// Example : root 'GetCmdLineHistory.C("output")'
6
// Output : /home/waveburst/soft/root/root-v5-32-04.patched/bin/root.exe -splash -n -l -b ...
7
//
8
9
void
GetCmdLineHistory
(
TString
idir) {
10
11
TString
data_label
=
""
;
12
13
vector<TString>
fileList
=
CWB::Toolbox::getFileListFromDir
(idir,
".root"
,
""
,data_label,
true
);
14
for
(
int
n
=0;
n
<fileList.size();
n
++) {
15
16
// Get STOP JOB info from history
17
TFile *
ifile
= TFile::Open(fileList[
n
]);
18
if
(ifile==NULL) {cout <<
"Failed to open "
<< fileList[
n
].Data() << endl;
exit
(-1);}
19
CWB::History
*
ihistory
= (
CWB::History
*)ifile->Get(
"history"
);
20
if
(ihistory==NULL) { cout <<
"Error : history is not present!!!"
<< endl;
exit
(1); }
21
22
TString
cmd_line
;
23
int
nStages
=
cwb::GetStageSize
();
24
if
(ihistory) {
25
TList* stageList = ihistory->
GetStageNames
();
// get stage list
26
for
(
int
i
=0;
i
<stageList->GetSize();
i
++) {
// loop over the stage list
27
TObjString* stageObjString = (TObjString*)stageList->At(
i
);
28
TString
stageName = stageObjString->GetString();
29
char
* stage =
const_cast<
char
*
>
(stageName.Data());
30
TString
info = ihistory->
GetHistory
(stage,
const_cast<char*>
(
"CMDLINE"
));
31
if
(info!=
""
) cmd_line=info;
32
}
33
}
34
cout << cmd_line << endl;
35
ifile->Close();
36
}
37
38
exit
(0);
39
}
40
CWB::Toolbox::getFileListFromDir
static vector< TString > getFileListFromDir(TString dir_name, TString endString="", TString beginString="", TString containString="", bool fast=false)
Definition:
Toolbox.cc:4333
n
int n
Definition:
cwb_net.C:10
const_cast< char * >
cout<< "skymap size : "<< L<< endl;for(int l=0;l< L;l++) sm.set(l, l);sm > const_cast< char * >("skymap.dat")
TString
TString("c")
Definition:
cwb_report_skymap.C:111
i
i drho i
Definition:
cwb_epparameters.C:85
CWB::History
Definition:
History.hh:38
data_label
char data_label[512]
Definition:
test_config1.C:160
CWB::History::GetStageNames
TList * GetStageNames()
Definition:
History.cc:409
nStages
int nStages
Definition:
cwb_dump_config.C:33
cwb::GetStageSize
static int GetStageSize()
Definition:
cwb.hh:150
ifile
TFile * ifile
Definition:
cwb_dump_config.C:23
cmd_line
char cmd_line[512]
Definition:
cwb_net.C:136
fileList
cout<< "Starting reading output directory ..."<< endl;vector< TString > fileList
Definition:
cwb_condor_check.C:59
GetCmdLineHistory
void GetCmdLineHistory(TString idir)
Definition:
GetCmdLineHistory.C:9
CWB::History::GetHistory
char * GetHistory(char *StageName, char *Type)
Definition:
History.cc:255
ihistory
CWB::History * ihistory
Definition:
cwb_dump_config.C:26
exit
exit(0)