-
Notifications
You must be signed in to change notification settings - Fork 37
/
SBSAnalyzer.cxx
58 lines (49 loc) · 1.47 KB
/
SBSAnalyzer.cxx
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
#include "SBSAnalyzer.h"
// Pointer to single instance of this object
SBSAnalyzer* SBSAnalyzer::fgAnalyzer = nullptr;
//_____________________________________________________________________________
SBSAnalyzer::SBSAnalyzer() : THaAnalyzer()
{
}
//_____________________________________________________________________________
SBSAnalyzer::~SBSAnalyzer()
{
// Destructor.
SBSAnalyzer::Close();
DeleteContainer(fPostProcess);
DeleteContainer(fEvtHandlers);
DeleteContainer(fInterStage);
delete fExtra; fExtra = nullptr;
delete fBench;
if( fgAnalyzer == this )
fgAnalyzer = nullptr;
}
//_____________________________________________________________________________
void SBSAnalyzer::PrintCutSummary() const
{
// Print summary of cuts etc.
// Only print to screen if fVerbose>1, but always print to
// the summary file if a summary file is requested.
if( gHaCuts->GetSize() > 0 ) {
cout << "Cut summary:" << endl;
if( fVerbose>1 )
gHaCuts->Print("STATS");
if( fSummaryFileName.Length() > 0 ) {
ofstream ostr(fSummaryFileName);
if( ostr ) {
// Write to file via cout
streambuf* cout_buf = cout.rdbuf();
cout.rdbuf(ostr.rdbuf());
TDatime now;
cout << "Cut Summary for run " << fRun->GetNumber()
<< " completed " << now.AsString()
<< endl << endl;
gHaCuts->Print("STATS");
cout.rdbuf(cout_buf);
ostr.close();
}
}
}
}
//_____________________________________________________________________________
ClassImp(THaAnalyzer)