Crombie Tools
FormulaCorrector.cc
Go to the documentation of this file.
1
/**
2
@file FormulaCorrector.cc
3
Describes the FormulaCorrector class.
4
@author Daniel Abercrombie <dabercro@mit.edu>
5
*/
6
7
#include "
FormulaCorrector.h
"
8
9
ClassImp
(
FormulaCorrector
)
10
11
//--------------------------------------------------------------------
12
FormulaCorrector
::
FormulaCorrector
(TString name, TString formula)
13
:
Corrector
(name),
14
fFormulaString{formula}
15
{}
16
17
//--------------------------------------------------------------------
18
FormulaCorrector::~FormulaCorrector
()
19
{
20
if
(
fFormula
)
21
delete
fFormula
;
22
}
23
24
//--------------------------------------------------------------------
25
void
FormulaCorrector::SetInTree
(TTree* tree)
26
{
27
Corrector::SetInTree
(tree);
28
if
(
fFormula
)
29
delete
fFormula
;
30
31
fFormula
=
new
TTreeFormula(
fFormulaString
,
fFormulaString
,
fInTree
);
32
}
33
34
//--------------------------------------------------------------------
35
36
Float_t
FormulaCorrector::DoEval
()
37
{
38
return
fFormula
->EvalInstance();
39
}
40
41
//--------------------------------------------------------------------
42
FormulaCorrector
*
FormulaCorrector::Copy
()
43
{
44
FormulaCorrector
*
newFormulaCorrector
=
new
FormulaCorrector
();
45
*newFormulaCorrector = *
this
;
46
newFormulaCorrector->
fIsCopy
=
true
;
47
return
newFormulaCorrector
;
48
}
49
50
std::vector<TString>
FormulaCorrector::GetFormulas
() {
51
std::vector<TString> all_formulas {
Corrector::GetFormulas
()};
52
all_formulas.push_back(
fFormulaString
);
53
return
all_formulas;
54
}
old
SkimmingTools
src
FormulaCorrector.cc
Generated on Tue Nov 3 2020 04:04:03 for Crombie Tools by
1.8.12