36using std::string, std::vector;
40 void AddSubStrings( vector<std::string> & vs, std::string s){
41 const std::string delims(
"\\ ");
42 std::string::size_type begIdx;
43 std::string::size_type endIdx;
44 begIdx=s.find_first_not_of(delims);
45 while(begIdx!=string::npos){
46 endIdx=s.find_first_of(delims, begIdx);
47 if(endIdx==string::npos) endIdx=s.length();
48 vs.push_back(s.substr(begIdx,endIdx-begIdx));
49 begIdx=s.find_first_not_of(delims, endIdx);
55 std::vector<std::string> GetChildrenFromString( std::string str ) {
57 std::vector<std::string> child_vec;
59 const std::string delims(
"\\ ");
60 std::string::size_type begIdx;
61 std::string::size_type endIdx;
62 begIdx=str.find_first_not_of(delims);
63 while(begIdx!=string::npos){
64 endIdx=str.find_first_of(delims, begIdx);
65 if(endIdx==string::npos) endIdx=str.length();
66 std::string child_name = str.substr(begIdx,endIdx-begIdx);
67 child_vec.push_back(child_name);
68 begIdx=str.find_first_not_of(delims, endIdx);
80 std::vector<std::string> string_list = GetChildrenFromString( str );
85 std::map<std::string, double> param_map;
87 for(
unsigned int i=0; i < string_list.size(); ++i) {
89 std::string param = string_list.at(i);
91 size_t eql_location = param.find(
'=');
95 if( eql_location==string::npos ) {
100 std::string param_name = param.substr(0,eql_location);
101 double param_val =
toDouble(param.substr(eql_location + 1, param.size()));
103 std::cout <<
"ASIMOV - Param Name: " << param_name
104 <<
" Param Val: " << param_val << std::endl;
127 std::vector< HistFactory::Measurement > measurement_list;
133 std::cerr <<
"Loading of xml document \"" << input
134 <<
"\" failed" << std::endl;
140 cxcoutIHF <<
"reading input : " << input << std::endl;
147 cxcoutEHF <<
"Error: Driver DOCTYPE not equal to 'Combination'" << std::endl;
152 std::string OutputFilePrefix;
156 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
160 std::string attrVal = curAttr->
GetValue();
162 if( attrName ==
TString(
"" ) ) {
163 cxcoutEHF <<
" Error: Attribute for 'Combination' with no name found" << std::endl;
167 else if( attrName ==
TString(
"OutputFilePrefix" ) ) {
168 OutputFilePrefix = string(curAttr->
GetValue());
169 cxcoutIHF <<
"output file prefix is : " << OutputFilePrefix << std::endl;
179 cxcoutEHF <<
" Error: Unknown attribute for 'Combination' encountered: "
180 << attrName << std::endl;
193 std::vector< std::string > xml_channel_files;
195 while( node !=
nullptr ) {
197 if( node->
GetText() ==
nullptr ) {
199 <<
" has no text." << std::endl;
202 xml_channel_files.push_back(node->
GetText());
208 if(xml_channel_files.empty()){
209 std::cerr <<
"no input channels found" << std::endl;
214 std::ostringstream msg;
215 msg <<
"Found Channels: ";
216 for(
unsigned int i=0; i < xml_channel_files.size(); ++i ) msg <<
" " << xml_channel_files.at(i);
229 std::vector< RooStats::HistFactory::PreprocessFunction > functionObjects;
232 while( node !=
nullptr ) {
239 functionObjects.push_back( Func );
244 std::cout << std::endl;
249 while( node !=
nullptr ) {
252 cxcoutEHF <<
"Error: Node found in Measurement Driver XML with no name" << std::endl;
260 measurement_list.push_back( measurement );
276 cxcoutEHF <<
"Error: Unknown node found in Measurement Driver XML: "
284 cxcoutIHF <<
"Done Processing Measurements" << std::endl;
286 if( measurement_list.empty() ) {
287 cxcoutEHF <<
"Error: No Measurements found in XML Driver File" << std::endl;
291 std::ostringstream msg;
292 msg <<
"Found Measurements: ";
293 for(
unsigned int i=0; i < measurement_list.size(); ++i ) msg <<
" " << measurement_list.at(i).GetName();
303 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
304 measurement_list.at(i).SetFunctionObjects( functionObjects );
314 std::vector< HistFactory::Channel > channel_list;
317 for(
unsigned int i = 0; i < xml_channel_files.size(); ++i ) {
318 std::string channel_xml = xml_channel_files.at(i);
319 cxcoutIHF <<
"Parsing Channel: " << channel_xml << std::endl;
325 channel_list.push_back( channel );
329 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
333 for(
unsigned int j = 0; j < channel_list.size(); ++j ) {
334 measurement.
GetChannels().push_back( channel_list.at(j) );
338 return measurement_list;
348 if (node ==
nullptr) {
349 cxcoutWHF <<
"Input driver node is undefined, ignoring\n";
359 cxcoutIHF <<
"Creating new measurement:\n";
364 while (( curAttr =
dynamic_cast<TXMLAttr *
>(attribIt()) ) !=
nullptr) {
366 const std::string curAttrName(curAttr->
GetName() ? curAttr->
GetName() :
"");
367 const std::string curAttrValue(curAttr->
GetValue() ? curAttr->
GetValue() :
"");
368 if (curAttrName.empty()) {
369 cxcoutEHF <<
"Found XML attribute in Measurement with no name.\n";
372 }
else if (curAttrName ==
"Name") {
373 measurement.
SetName(curAttrValue.c_str());
374 }
else if (curAttrName ==
"Lumi") {
376 }
else if (curAttrName ==
"LumiRelErr") {
378 }
else if (curAttrName ==
"BinLow") {
379 measurement.
SetBinLow(std::stoi(curAttrValue));
380 }
else if (curAttrName ==
"BinHigh") {
381 measurement.
SetBinHigh(std::stoi(curAttrValue));
382 }
else if (curAttrName ==
"Mode") {
383 std::cout <<
"\n INFO: Mode attribute is deprecated and no longer supported, will ignore\n";
384 }
else if (curAttrName ==
"ExportOnly") {
386 cxcoutIHF <<
"The \"ExportOnly\" attribute is ignored it is always \"true\" for any Measurement." << std::endl;
388 cxcoutEHF <<
"Found unknown XML attribute in Measurement: " << curAttrName <<
"\n";
395 while (child !=
nullptr) {
396 const std::string childName(child->
GetName() ? child->
GetName() :
"");
398 const std::string childText(child->
GetText() ? child->
GetText() :
"");
399 if (childNodeName.empty()) {
400 cxcoutEHF <<
"Found XML child node of Measurement with no name\n";
402 }
else if (childNodeName ==
"POI") {
403 if (childText.empty()) {
404 cxcoutEHF <<
"Error: node: " << childName <<
" has no text.\n";
408 AddSubStrings(measurement.
GetPOIList(), childText);
409 }
else if (childNodeName ==
"ParamSetting") {
412 while (( curParam =
dynamic_cast<TXMLAttr *
>(paramIt()) ) !=
nullptr) {
414 const std::string curParamName(curParam->
GetName() ? curParam->
GetName() :
"");
415 if (curParamName.empty()) {
416 cxcoutEHF <<
"Error: Found tag attribute with no name in ParamSetting\n";
418 }
else if (curParamName ==
"Const") {
421 if (childText.empty()) {
422 cxcoutEHF <<
"Error: node: " << childName <<
" has no text.\n";
427 }
else if (curParamName ==
"Val") {
429 if (childText.empty()) {
430 cxcoutEHF <<
"Error: node: " << childName <<
" has no text.\n";
433 std::vector<std::string> child_nodes = GetChildrenFromString(childText);
434 for (
size_t i = 0; i < child_nodes.size(); ++i) {
438 cxcoutEHF <<
"Found tag attribute with unknown name in ParamSetting: " << curParamName <<
"\n";
442 }
else if (childNodeName ==
"Asimov") {
446 std::string ParamFixString;
451 while (( curAttr =
dynamic_cast<TXMLAttr *
>(attribIt()) ) !=
nullptr) {
452 const std::string curAttrName(curAttr->
GetName() ? curAttr->
GetName() :
"");
453 const std::string curAttrValue(curAttr->
GetValue() ? curAttr->
GetValue() :
"");
454 if (curAttrName.empty()) {
455 cxcoutEHF <<
"Error: Found tag attribute with no name in ConstraintTerm\n";
457 }
else if (curAttrName ==
"Name") {
459 }
else if (curAttrName ==
"FixParams") {
460 ParamFixString = curAttrValue;
462 cxcoutEHF <<
"Found tag attribute with unknown name in ConstraintTerm: " << curAttrName <<
"\n";
469 if (ParamFixString.empty()) {
471 <<
" added, but no parameters are set to be fixed\n";
473 AddParamsToAsimov(asimov, ParamFixString);
476 }
else if (childNodeName ==
"ConstraintTerm") {
477 std::vector<string> syst;
482 if (childText.empty()) {
483 cxcoutEHF <<
"Error: node: " << childName <<
" has no text\n";
486 AddSubStrings(syst, childText);
491 while (( curAttr =
dynamic_cast<TXMLAttr *
>(attribIt()) ) !=
nullptr) {
492 const std::string curAttrName(curAttr->
GetName() ? curAttr->
GetName() :
"");
493 const std::string curAttrValue(curAttr->
GetValue() ? curAttr->
GetValue() :
"");
494 if (curAttrName.empty()) {
495 cxcoutEHF <<
"Error: Found tag attribute with no name in ConstraintTerm\n";
497 }
else if (curAttrName ==
"Type") {
499 }
else if (curAttrName ==
"RelativeUncertainty") {
502 cxcoutEHF <<
"Found tag attribute with unknown name in ConstraintTerm: " << curAttrName <<
"\n";
509 if (type ==
"Gamma") {
510 for (
const auto &isyst : syst) {
514 }
else if (type ==
"Uniform") {
515 for (
const auto &isyst : syst) {
519 }
else if (type ==
"LogNormal") {
520 for (
const auto &isyst : syst) {
525 }
else if (type ==
"NoConstraint") {
526 for (
const auto &isyst : syst) {
532 cxcoutEHF <<
"Error: Encountered unknown type for ConstraintTerm: " << type <<
"\n";
539 cxcoutEHF <<
"Found XML child of Measurement with unknown name: " << childNodeName <<
"\n";
558 cxcoutIHF <<
"Parsing file: " << filen << std::endl;
565 cxcoutEHF <<
"Loading of xml document \"" << filen
566 <<
"\" failed" << std::endl;
576 cxcoutEHF <<
"Error: In parsing a Channel XML, "
577 <<
"Encountered XML with DOCTYPE: " << rootNode->
GetNodeName()
579 cxcoutEHF <<
" DOCTYPE for channels must be 'Channel' "
580 <<
" Check that your XML is properly written" << std::endl;
598 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
602 std::string attrVal = curAttr->
GetValue();
604 if( attrName ==
TString(
"" ) ) {
605 cxcoutEHF <<
" Error: Attribute for 'Channel' with no name found" << std::endl;
609 else if( attrName ==
TString(
"Name" ) ) {
611 cxcoutIHF <<
" : creating a channel named " << channel.
GetName() << std::endl;
614 else if( attrName ==
TString(
"InputFile" ) ) {
615 cxcoutIHF <<
"Setting InputFile for this channel: " << attrVal << std::endl;
622 cxcoutIHF <<
"Setting HistoPath for this channel: " << attrVal << std::endl;
630 cxcoutEHF <<
"Use of HistoName in Channel is deprecated" << std::endl;
631 cxcoutEHF <<
"This will be ignored" << std::endl;
635 cxcoutEHF <<
" Error: Unknown attribute for 'Channel' encountered: "
636 << attrName << std::endl;
644 if( channel.
GetName().empty() ) {
645 cxcoutEHF <<
"Error: Channel created with no name" << std::endl;
658 while( node !=
nullptr ) {
665 cxcoutEHF <<
"Error: Encountered node in Channel with no name" << std::endl;
672 if( !data.GetName().empty() ) {
673 cxcoutEHF <<
"Error: You can only rename the datasets of additional data sets. "
674 <<
" Remove the 'Name=" << data.GetName() <<
"' tag"
675 <<
" from channel: " << channel.
GetName() << std::endl;
697 cxcoutEHF <<
"Error: Encountered node in Channel with unknown name: " << node->
GetNodeName() << std::endl;
705 cxcoutIHF <<
"Created Channel: " << std::endl;
716 cxcoutIHF <<
"Creating Data Element" << std::endl;
728 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
732 std::string attrVal = curAttr->
GetValue();
734 if( attrName ==
TString(
"" ) ) {
735 cxcoutEHF <<
" Error: Attribute for 'Data' with no name found" << std::endl;
739 else if( attrName ==
TString(
"Name" ) ) {
740 data.SetName( attrVal );
743 else if( attrName ==
TString(
"InputFile" ) ) {
744 data.SetInputFile( attrVal );
747 else if( attrName ==
TString(
"HistoName" ) ) {
748 data.SetHistoName( attrVal );
751 else if( attrName ==
TString(
"HistoPath" ) ) {
752 data.SetHistoPath( attrVal );
758 cxcoutEHF <<
" Error: Unknown attribute for 'Data' encountered: " << attrName << std::endl;
765 if( data.GetInputFile().empty() ) {
766 cxcoutEHF <<
"Error: Data Node has no InputFile" << std::endl;
769 if( data.GetHistoName().empty() ) {
770 cxcoutEHF <<
"Error: Data Node has no HistoName" << std::endl;
775 <<
" InputFile: " << data.GetInputFile()
776 <<
" HistoName: " << data.GetHistoName()
777 <<
" HistoPath: " << data.GetHistoPath()
778 << (!data.GetName().empty() ?
" Name: " :
"") << data.GetName() << std::endl;
789 cxcoutIHF <<
"Creating StatErrorConfig Element" << std::endl;
800 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
804 std::string attrVal = curAttr->
GetValue();
806 if( attrName ==
TString(
"RelErrorThreshold" ) ) {
810 if( attrName ==
TString(
"ConstraintType" ) ) {
813 if( attrVal.empty() ) {
814 cxcoutEHF <<
"Error: Bad Value for StatErrorConfig Constraint Type Found" << std::endl;
818 else if( attrVal==
"Gaussian" || attrVal==
"Gauss" ) {
822 else if( attrVal==
"Poisson" || attrVal==
"Pois" ) {
829 std::cout <<
"Invalid Stat Constraint Type: " << curAttr->
GetValue() << std::endl;
835 cxcoutIHF <<
"Created StatErrorConfig Element with"
847 cxcoutIHF <<
"Creating Sample Element" << std::endl;
862 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
866 std::string attrVal = curAttr->
GetValue();
868 if( attrName ==
TString(
"" ) ) {
869 cxcoutEHF <<
" Error: Attribute for 'Sample' with no name found" << std::endl;
873 else if( attrName ==
TString(
"Name" ) ) {
877 else if( attrName ==
TString(
"InputFile" ) ) {
882 else if( attrName ==
TString(
"HistoName" ) ) {
886 else if( attrName ==
TString(
"HistoPath" ) ) {
891 else if( attrName ==
TString(
"NormalizeByTheory" ) ) {
909 cxcoutEHF <<
" Error: Unknown attribute for 'Sample' encountered: " << attrName << std::endl;
915 if( sample.
GetName().empty() ) {
916 cxcoutEHF <<
"Error: Sample Node has no Name" << std::endl;
920 cxcoutEHF <<
"Error: Sample Node has no InputFile" << std::endl;
924 cxcoutEHF <<
"Error: Sample Node has no HistoName" << std::endl;
933 while( child !=
nullptr ) {
936 cxcoutEHF <<
"Error: Encountered node in Sample with no name" << std::endl;
953 cxcoutEHF <<
"WARNING: HistoFactor not yet supported" << std::endl;
972 cxcoutEHF <<
"Error: Encountered node in Sample with unknown name: " << child->
GetNodeName() << std::endl;
980 <<
" Name: " << sample.
GetName()
994 cxcoutIHF <<
"Making NormFactor:" << std::endl;
1000 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1004 std::string attrVal = curAttr->
GetValue();
1006 if( attrName ==
TString(
"" ) ){
1007 cxcoutEHF <<
"Error: Encountered Element in NormFactor with no name" << std::endl;
1025 cxcoutEHF <<
"Error: Encountered Element in NormFactor with unknown name: "
1026 << attrName << std::endl;
1032 if( norm.
GetName().empty() ) {
1033 cxcoutEHF <<
"Error: NormFactor Node has no Name" << std::endl;
1039 <<
" has lower limit >= its upper limit: "
1040 <<
" Lower: " << norm.
GetLow()
1041 <<
" Upper: " << norm.
GetHigh()
1042 <<
". Please Fix" << std::endl;
1047 <<
" has initial value not within its range: "
1048 <<
" Val: " << norm.
GetVal()
1049 <<
" Lower: " << norm.
GetLow()
1050 <<
" Upper: " << norm.
GetHigh()
1051 <<
". Please Fix" << std::endl;
1063 cxcoutIHF <<
"Making HistoFactor" << std::endl;
1073 cxcoutIHF <<
"Made HistoFactor" << std::endl;
1082 cxcoutIHF <<
"Making HistoSys:" << std::endl;
1103 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1107 std::string attrVal = curAttr->
GetValue();
1109 if( attrName ==
TString(
"" ) ){
1110 cxcoutEHF <<
"Error: Encountered Element in HistoSys with no name" << std::endl;
1139 cxcoutEHF <<
"Error: Encountered Element in HistoSys with unknown name: "
1140 << attrName << std::endl;
1147 if( histoSys.
GetName().empty() ) {
1148 cxcoutEHF <<
"Error: HistoSys Node has no Name" << std::endl;
1152 cxcoutEHF <<
"Error: HistoSysSample Node has no InputFileHigh" << std::endl;
1156 cxcoutEHF <<
"Error: HistoSysSample Node has no InputFileLow" << std::endl;
1160 cxcoutEHF <<
"Error: HistoSysSample Node has no HistoNameHigh" << std::endl;
1164 cxcoutEHF <<
"Error: HistoSysSample Node has no HistoNameLow" << std::endl;
1178 cxcoutIHF <<
"Making OverallSys:" << std::endl;
1184 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1188 std::string attrVal = curAttr->
GetValue();
1190 if( attrName ==
TString(
"" ) ){
1191 cxcoutEHF <<
"Error: Encountered Element in OverallSys with no name" << std::endl;
1195 else if( attrName ==
TString(
"Name" ) ) {
1196 overallSys.
SetName( attrVal );
1198 else if( attrName ==
TString(
"High" ) ) {
1201 else if( attrName ==
TString(
"Low" ) ) {
1206 cxcoutEHF <<
"Error: Encountered Element in OverallSys with unknown name: "
1207 << attrName << std::endl;
1213 if( overallSys.
GetName().empty() ) {
1214 cxcoutEHF <<
"Error: Encountered OverallSys with no name" << std::endl;
1228 cxcoutIHF <<
"Making ShapeFactor" << std::endl;
1242 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1246 std::string attrVal = curAttr->
GetValue();
1248 if( attrName ==
TString(
"" ) ){
1249 cxcoutEHF <<
"Error: Encountered Element in ShapeFactor with no name" << std::endl;
1253 else if( attrName ==
TString(
"Name" ) ) {
1254 shapeFactor.
SetName( attrVal );
1256 else if( attrName ==
TString(
"Const" ) ) {
1260 else if( attrName ==
TString(
"HistoName" ) ) {
1264 else if( attrName ==
TString(
"InputFile" ) ) {
1265 ShapeInputFile = attrVal;
1268 else if( attrName ==
TString(
"HistoPath" ) ) {
1269 ShapeInputPath = attrVal;
1273 cxcoutEHF <<
"Error: Encountered Element in ShapeFactor with unknown name: "
1274 << attrName << std::endl;
1280 if( shapeFactor.
GetName().empty() ) {
1281 cxcoutEHF <<
"Error: Encountered ShapeFactor with no name" << std::endl;
1290 <<
" is configured to have an initial shape, but "
1291 <<
"its histogram doesn't have a name"
1308 cxcoutIHF <<
"Making ShapeSys" << std::endl;
1322 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1327 std::string attrVal = curAttr->
GetValue();
1329 if( attrName ==
TString(
"" ) ){
1330 cxcoutEHF <<
"Error: Encountered Element in ShapeSys with no name" << std::endl;
1334 else if( attrName ==
TString(
"Name" ) ) {
1338 else if( attrName ==
TString(
"HistoName" ) ) {
1342 else if( attrName ==
TString(
"HistoPath" ) ) {
1346 else if( attrName ==
TString(
"InputFile" ) ) {
1350 else if( attrName ==
TString(
"ConstraintType" ) ) {
1351 if( attrVal.empty() ) {
1352 cxcoutEHF <<
"Error: ShapeSys Constraint type is empty" << std::endl;
1355 else if( attrVal==
"Gaussian" || attrVal==
"Gauss" ) {
1358 else if( attrVal==
"Poisson" || attrVal==
"Pois" ) {
1362 std::cout <<
"Error: Encountered unknown ShapeSys Constraint type: " << attrVal << std::endl;
1368 cxcoutEHF <<
"Error: Encountered Element in ShapeSys with unknown name: "
1369 << attrName << std::endl;
1376 if( shapeSys.
GetName().empty() ) {
1377 cxcoutEHF <<
"Error: Encountered ShapeSys with no Name" << std::endl;
1381 cxcoutEHF <<
"Error: Encountered ShapeSys with no InputFile" << std::endl;
1385 cxcoutEHF <<
"Error: Encountered ShapeSys with no HistoName" << std::endl;
1398 cxcoutIHF <<
"Activating StatError" << std::endl;
1409 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1413 std::string attrVal = curAttr->
GetValue();
1415 if( attrName ==
TString(
"" ) ){
1416 cxcoutEHF <<
"Error: Encountered Element in ActivateStatError with no name" << std::endl;
1420 else if( attrName ==
TString(
"Activate" ) ) {
1424 else if( attrName ==
TString(
"HistoName" ) ) {
1428 else if( attrName ==
TString(
"HistoPath" ) ) {
1432 else if( attrName ==
TString(
"InputFile" ) ) {
1437 cxcoutEHF <<
"Error: Encountered Element in ActivateStatError with unknown name: "
1438 << attrName << std::endl;
1486 cxcoutIHF <<
"Parsing FunctionConfig" << std::endl;
1493 std::string Expression;
1494 std::string Dependents;
1497 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1514 cxcoutEHF <<
"Error processing PreprocessFunction: Name attribute is empty" << std::endl;
1517 if( Expression.empty() ){
1518 cxcoutEHF <<
"Error processing PreprocessFunction: Expression attribute is empty" << std::endl;
1521 if( Dependents.empty() ){
1522 cxcoutEHF <<
"Error processing PreprocessFunction: Dependents attribute is empty" << std::endl;
1555 if( attrVal.empty() ) {
1557 <<
" Expected either 'True' or 'False' but found empty" << std::endl;
1560 else if ( attrVal ==
"True" || attrVal ==
"true" )
return true;
1561 else if ( attrVal ==
"False" || attrVal ==
"false" )
return false;
1564 <<
" Expected either 'True' or 'False' but found: " << attrVal << std::endl;
double toDouble(const char *s)
int Int_t
Signed integer 4 bytes (int).
TODO Here, we are missing some documentation.
void SetName(const std::string &name)
void SetParamValue(const std::string ¶m, double value)
void SetFixedParam(const std::string ¶m, bool constant=true)
This class encapsulates all information for the statistical interpretation of one experiment.
void SetName(const std::string &Name)
set name of channel
void Print(std::ostream &=std::cout)
void AddAdditionalData(const RooStats::HistFactory::Data &data)
add additional data object
std::string GetInputFile() const
get name of input file
std::string GetHistoPath() const
get path to histograms in input file
void SetData(const RooStats::HistFactory::Data &data)
set data object
void SetInputFile(const std::string &file)
set name of input file containing histograms
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
std::vector< RooStats::HistFactory::Sample > & GetSamples()
get vector of samples for this channel
void SetHistoPath(const std::string &file)
set path for histograms in input file
std::string GetName() const
get name of channel
bool IsAcceptableNode(TXMLNode *functionNode)
std::vector< RooStats::HistFactory::Measurement > GetMeasurementsFromXML(std::string input)
The "main" method.
HistFactory::StatErrorConfig CreateStatErrorConfigElement(TXMLNode *node)
HistFactory::StatError ActivateStatError(TXMLNode *node)
HistFactory::OverallSys MakeOverallSys(TXMLNode *node)
HistFactory::Sample CreateSampleElement(TXMLNode *node)
HistFactory::HistoSys MakeHistoSys(TXMLNode *node)
std::string m_currentInputFile
To facilitate writing xml, when not specified, files and paths default to these cached values.
HistFactory::ShapeFactor MakeShapeFactor(TXMLNode *node)
std::string m_currentChannel
bool CheckTrueFalse(std::string val, std::string Name)
RooStats::HistFactory::Measurement CreateMeasurementFromDriverNode(TXMLNode *node)
HistFactory::PreprocessFunction ParseFunctionConfig(TXMLNode *functionNode)
HistFactory::Data CreateDataElement(TXMLNode *node)
Helpers used to process a channel.
HistFactory::HistoFactor MakeHistoFactor(TXMLNode *node)
std::string m_currentHistoPath
RooStats::HistFactory::Channel ParseChannelXMLFile(std::string filen)
HistFactory::ShapeSys MakeShapeSys(TXMLNode *node)
HistFactory::NormFactor MakeNormFactor(TXMLNode *node)
Helpers used when processing a Sample.
Configuration for an *un*constrained, coherent shape variation of affected samples.
Configuration for a constrained, coherent shape variation of affected samples.
void SetInputFileHigh(const std::string &InputFileHigh)
void SetName(const std::string &Name)
void SetHistoPathHigh(const std::string &HistoPathHigh)
const std::string & GetName() const
void SetInputFileLow(const std::string &InputFileLow)
const std::string & GetHistoNameHigh() const
const std::string & GetHistoNameLow() const
void SetHistoNameHigh(const std::string &HistoNameHigh)
void SetHistoNameLow(const std::string &HistoNameLow)
virtual void Print(std::ostream &=std::cout) const
const std::string & GetInputFileHigh() const
const std::string & GetInputFileLow() const
void SetHistoPathLow(const std::string &HistoPathLow)
The RooStats::HistFactory::Measurement class can be used to construct a model by combining multiple R...
std::map< std::string, double > & GetGammaSyst()
std::map< std::string, double > & GetLogNormSyst()
std::map< std::string, double > & GetNoSyst()
std::vector< std::string > & GetPOIList()
get vector of PoI names
void SetLumi(double Lumi)
set integrated luminosity used to normalise histograms (if NormalizeByTheory is true for this sample)
void SetParamValue(const std::string ¶m, double value)
Set a parameter to a specific value (And optionally fix it).
std::map< std::string, double > & GetUniformSyst()
std::vector< std::string > & GetConstantParams()
get vector of all constant parameters
void SetOutputFilePrefix(const std::string &prefix)
set output prefix
void PrintTree(std::ostream &=std::cout)
Print information about measurement object in tree-like structure to given stream.
void SetBinLow(int BinLow)
std::vector< RooStats::HistFactory::Channel > & GetChannels()
void SetBinHigh(int BinHigh)
void SetLumiRelErr(double RelErr)
set relative uncertainty on luminosity
void AddAsimovDataset(RooStats::HistFactory::Asimov dataset)
add an Asimov Dataset
Configuration for an un- constrained overall systematic to scale sample normalisations.
std::string GetName() const
void Print(std::ostream &=std::cout) const
void SetHigh(double High)
void SetName(const std::string &Name)
Configuration for a constrained overall systematic to scale sample normalisations.
void SetName(const std::string &Name)
const std::string & GetName() const
void SetHigh(double High)
void Print(std::ostream &=std::cout) const
std::string GetCommand() const
std::vector< RooStats::HistFactory::OverallSys > & GetOverallSysList()
std::string GetHistoName() const
get histogram name
void SetStatError(RooStats::HistFactory::StatError Error)
std::string GetName() const
get name of sample
void SetInputFile(const std::string &InputFile)
set input ROOT file
void SetChannelName(const std::string &ChannelName)
set name of associated channel
void SetHistoName(const std::string &HistoName)
set histogram name
std::string GetHistoPath() const
get histogram path
void SetNormalizeByTheory(bool norm)
defines whether the normalization scale with luminosity
std::vector< RooStats::HistFactory::ShapeFactor > & GetShapeFactorList()
void SetName(const std::string &Name)
set name of sample
void SetHistoPath(const std::string &HistoPath)
set histogram path
std::vector< RooStats::HistFactory::NormFactor > & GetNormFactorList()
std::string GetInputFile() const
get input ROOT file
std::vector< RooStats::HistFactory::HistoSys > & GetHistoSysList()
std::vector< RooStats::HistFactory::ShapeSys > & GetShapeSysList()
*Un*constrained bin-by-bin variation of affected histogram.
void SetInputFile(const std::string &InputFile)
void SetHistoName(const std::string &HistoName)
void Print(std::ostream &=std::cout) const override
void SetConstant(bool constant)
bool HasInitialShape() const
void SetHistoPath(const std::string &HistoPath)
const std::string & GetHistoName() const
Constrained bin-by-bin variation of affected histogram.
std::string GetHistoName() const
void SetInputFile(const std::string &InputFile)
void Print(std::ostream &=std::cout) const override
void SetHistoName(const std::string &HistoName)
void SetConstraintType(Constraint::Type ConstrType)
std::string GetInputFile() const
void SetHistoPath(const std::string &HistoPath)
Configuration to automatically assign nuisance parameters for the statistical error of the Monte Carl...
void SetConstraintType(Constraint::Type ConstrType)
double GetRelErrorThreshold() const
void SetRelErrorThreshold(double Threshold)
Constraint::Type GetConstraintType() const
Statistical error of Monte Carlo predictions.
const std::string & GetHistoPath() const
void Activate(bool IsActive=true)
void SetHistoPath(const std::string &HistoPath)
void SetInputFile(const std::string &InputFile)
const std::string & GetInputFile() const
void SetHistoName(const std::string &HistoName)
const std::string & GetHistoName() const
void SetUseHisto(bool UseHisto=true)
void Print(std::ostream &=std::cout) const override
virtual TXMLDocument * GetXMLDocument() const
Returns the TXMLDocument.
Int_t ParseFile(const char *filename) override
Parse the XML file where filename is the XML file name.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetName() const
Returns name of object.
TXMLAttribute is the attribute of an Element.
const char * GetValue() const
const char * GetName() const override
Returns name of object.
TXMLDocument contains a pointer to an xmlDoc structure, after the parser returns a tree built during ...
TXMLNode * GetRootNode() const
Returns the root element node.
TXMLNode contains a pointer to xmlNode, which is a node under the DOM tree.
TList * GetAttributes()
Returns a list of node's attribute if any, returns 0 if no attribute.
const char * GetText() const
Returns the content of a Text node if node is a TextNode, 0 otherwise.
TXMLNode * GetNextNode()
Returns the next sibling XMLNode in the DOM tree, if any return 0 if no next node.
TXMLNode * GetChildren()
Returns the node's child if any, returns 0 if no child.
const char * GetNodeName() const
Returns the node's name.
Namespace for the RooStats classes.