@@ -57,16 +57,18 @@ RooSecondMoment::RooSecondMoment(const char* name, const char* title, RooAbsReal
57
57
std::unique_ptr<RooAbsReal> XF;
58
58
if (centr) {
59
59
60
- string m1name= Form ( " %s_moment1 " , GetName ()) ;
60
+ std:: string m1name = std::string{ GetName ()} + " _moment1 " ;
61
61
_mean.putOwnedArg (std::unique_ptr<RooAbsMoment>{func.mean (x)}) ;
62
62
63
- string pname= Form ( " %s_product " , name) ;
63
+ std:: string pname = std::string{ name} + " _product " ;
64
64
_xfOffset = _mean->getVal () ;
65
- XF = std::make_unique<RooFormulaVar>(pname.c_str (),Form (" pow((@0-%f),2)*@1" ,_xfOffset),RooArgList (x,func)) ;
65
+ std::stringstream formula;
66
+ formula << " std::pow((@0-" << _xfOffset << " ),2) * @1" ;
67
+ XF = std::make_unique<RooFormulaVar>(pname.c_str (),formula.str ().c_str (),RooArgList (x,func)) ;
66
68
67
69
} else {
68
70
69
- string pname= Form ( " %s_product " , name) ;
71
+ std:: string pname = std::string{ name} + " _product " ;
70
72
XF = std::make_unique<RooProduct>(pname.c_str (),pname.c_str (),RooArgList (x,x,func)) ;
71
73
}
72
74
@@ -106,17 +108,19 @@ RooSecondMoment::RooSecondMoment(const char* name, const char* title, RooAbsReal
106
108
std::unique_ptr<RooAbsReal> XF;
107
109
if (centr) {
108
110
109
- string m1name= Form ( " %s_moment1 " , GetName ()) ;
111
+ std:: string m1name = std::string{ GetName ()} + " _moment1 " ;
110
112
_mean.putOwnedArg (std::unique_ptr<RooAbsMoment>{func.mean (x,nset)}) ;
111
113
112
- string pname= Form ( " %s_product " , name) ;
114
+ std:: string pname = std::string{ name} + " _product " ;
113
115
_xfOffset = _mean->getVal () ;
114
- XF = std::make_unique<RooFormulaVar>(pname.c_str (),Form (" pow((@0-%f),2)*@1" ,_xfOffset),RooArgList (x,func)) ;
116
+ std::stringstream formula;
117
+ formula << " std::pow((@0-" << _xfOffset << " ),2) * @1" ;
118
+ XF = std::make_unique<RooFormulaVar>(pname.c_str (),formula.str ().c_str (),RooArgList (x,func)) ;
115
119
116
120
117
121
} else {
118
122
119
- string pname= Form ( " %s_product " , name) ;
123
+ std:: string pname = std::string{ name} + " _product " ;
120
124
XF = std::make_unique<RooProduct>(pname.c_str (),pname.c_str (),RooArgList (x,x,func)) ;
121
125
122
126
}
0 commit comments