-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
64 lines (47 loc) · 2.28 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include "source/classes/DataAnalyser/DataAnalyser.cpp"
using namespace std;
int main()
{
ConfigSampleChain();
ConfigCanvasPDF();
auto start = std::chrono::system_clock::now(); // Start counting running time
int Num_of_analysed_samples = 0;
cout << "\nLooping over sample chain...\n";
for (int i = 0; i < AnalyseFilePath_v.size(); i++)
{
std::string AnalyseFilePath0 = AnalyseFilePath_v.at(i);
std::string AnalyseFileSample0 = AnalyseFileSample_v.at(i);
std::string AnalyseFileDir0 = AnalyseFileDir_v.at(i);
std::string AnalyseFile0 = AnalyseFile_v.at(i);
std::string FileType = AnalyseFile_v.at(i).substr(AnalyseFile_v.at(i).find_last_of(".") + 1);
cout << "\nAnalyseFilePath:\t" << AnalyseFilePath0 << "\n";
cout << "AnalyseFileSample:\t" << AnalyseFileSample0 << "\n";
cout << "AnalyseFileDir:\t" << AnalyseFileDir0 << "\n";
cout << "AnalyseFile:\t" << AnalyseFile0 << "\n\n";
cout << "FileType:\t" << FileType << "\n";
DataAnalyser Analysis(FileType, AnalyseFilePath0, AnalyseFileSample0, AnalyseFile0);
std::string AnalyserMode = Analysis.ConfigureAnalyserMode(FileType);
cout << "Analyser mode:\t'" << AnalyserMode << "'\n";
cout << "\n---------------------------------------------------------------------------\n\n";
cout << "Analysis mode:\t'" << AnalyserMode << "'" << "\n";
cout << "Code version:\t" << Ver << "\n";
++Num_of_analysed_samples;
if (AnalyseFilePath_v.size() > 1)
{ // Delete all ROOT objects whose class names start with TH (to prevent a memory leak)
// gDirectory->Delete("TH*;*");
gDirectory->Clear();
}
}
cout << "#(analysed samples):\t" << Num_of_analysed_samples << "\n";
auto end = std::chrono::system_clock::now();
auto elapsed_time_seconds = std::chrono::duration_cast<std::chrono::seconds>(end - start);
double elapsed_time_minutes = elapsed_time_seconds.count() / 60;
if (elapsed_time_seconds.count() < 60)
{
std::cout << "Running time:\t" << elapsed_time_seconds.count() << " seconds\n\n";
}
else
{
std::cout << "Running time:\t" << to_string_with_precision(elapsed_time_minutes, 3) << " minutes\n\n";
}
}