-
Notifications
You must be signed in to change notification settings - Fork 0
/
Analysis.cc
94 lines (82 loc) · 2.9 KB
/
Analysis.cc
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "Analysis.hh"
using std::string;
#include <vector>
using std::vector;
#include <iostream>
using std::cout;
using std::endl;
#include <stdexcept>
#include <boost/algorithm/string.hpp>
Analysis::Analysis( const string & src,
const string & rec,
const string & cts,
const string & mcc,
const string & r2,
const string & bkgsts,
const string & unfsrc,
const string & unfm ) :
source(src), reco(rec), cuts(cts), mccuts(mcc), reco2(r2),
bkgstatus(bkgsts), unfoldsource(unfsrc), unfoldmethod(unfm) {}
Analysis::Analysis( const string & options ) :
source(), reco(), cuts(), mccuts( "none" ), reco2( "none" ),
bkgstatus( "none" ), unfoldsource( "none" ), unfoldmethod( "none" ) {
vector<string> tokens;
boost::split( tokens, options, boost::is_any_of( " " ), boost::token_compress_on );
size_t ntoken= tokens.size();
if( ntoken < 3 ) throw std::runtime_error( "Analysis::Analysis: options wrong" );
source= tokens[0];
reco= tokens[1];
cuts= tokens[2];
if( ntoken > 3 ) mccuts= tokens[3];
if( ntoken > 4 ) reco2= tokens[4];
if( ntoken > 5 ) bkgstatus= tokens[5];
if( ntoken > 6 ) unfoldsource= tokens[6];
if( ntoken > 7 ) unfoldmethod= tokens[7];
}
Analysis::Analysis() {}
Analysis::~Analysis() {}
string Analysis::getSource() const { return source; }
string Analysis::getReco() const { return reco; }
string Analysis::getCuts() const { return cuts; }
string Analysis::getMccuts() const { return mccuts; }
string Analysis::getReco2() const { return reco2; }
string Analysis::getBkgStatus() const { return bkgstatus; }
string Analysis::getUnfoldSource() const { return unfoldsource; }
string Analysis::getUnfoldMethod() const { return unfoldmethod; }
void Analysis::setSource( const string & src ) { source= src; }
void Analysis::setReco( const string & rec ) { reco= rec; }
void Analysis::setCuts( const string & cts ) { cuts= cts; }
void Analysis::setMccuts( const string & mcc ) { mccuts= mcc; }
void Analysis::setReco2( const string & r2 ) { reco2= r2; }
void Analysis::setBkgStatus( const string & bkgsts ) { bkgstatus= bkgsts; }
void Analysis::setUnfoldSource( const string & unfsrc ) { unfoldsource= unfsrc; }
void Analysis::setUnfoldMethod( const string & unfm ) { unfoldmethod= unfm; }
string Analysis::getTag() const {
string result= source + " " + reco + " " + cuts;
if( mccuts != "none" ) {
result+= " ";
result+= mccuts;
}
if( reco2 != "none" ) {
result+= " ";
result+= reco2;
}
if( bkgstatus != "none" ) {
result+= " ";
result+= bkgstatus;
}
if( unfoldsource != "none" ) {
result+= " ";
result+= unfoldsource;
}
if( unfoldmethod != "none" ) {
result+= " ";
result+= unfoldmethod;
}
return result;
}
void Analysis::Print() const {
cout << source << " " << reco << " " << cuts << " " << mccuts << " "
<< reco2 << " " << bkgstatus << " "
<< unfoldsource << " " << unfoldmethod << endl;
}