38 void AddSubStrings( vector<std::string> & vs, std::string s){
39 const std::string delims(
"\\ ");
40 std::string::size_type begIdx, endIdx;
41 begIdx=s.find_first_not_of(delims);
42 while(begIdx!=string::npos){
43 endIdx=s.find_first_of(delims, begIdx);
44 if(endIdx==string::npos) endIdx=s.length();
45 vs.push_back(s.substr(begIdx,endIdx-begIdx));
46 begIdx=s.find_first_not_of(delims, endIdx);
52 std::vector<std::string> GetChildrenFromString( std::string str ) {
54 std::vector<std::string> child_vec;
56 const std::string delims(
"\\ ");
57 std::string::size_type begIdx, endIdx;
58 begIdx=str.find_first_not_of(delims);
59 while(begIdx!=string::npos){
60 endIdx=str.find_first_of(delims, begIdx);
61 if(endIdx==string::npos) endIdx=str.length();
62 std::string child_name = str.substr(begIdx,endIdx-begIdx);
63 child_vec.push_back(child_name);
64 begIdx=str.find_first_not_of(delims, endIdx);
76 std::vector<std::string> string_list = GetChildrenFromString( str );
81 std::map<std::string, double> param_map;
83 for(
unsigned int i=0; i < string_list.size(); ++i) {
85 std::string param = string_list.at(i);
87 size_t eql_location = param.find(
'=');
91 if( eql_location==string::npos ) {
96 std::string param_name = param.substr(0,eql_location);
97 double param_val = atof( param.substr(eql_location+1, param.size()).c_str() );
99 std::cout <<
"ASIMOV - Param Name: " << param_name
100 <<
" Param Val: " << param_val << std::endl;
123 std::vector< HistFactory::Measurement > measurement_list;
129 std::cerr <<
"Loading of xml document \"" <<
input
130 <<
"\" failed" << std::endl;
143 cxcoutEHF <<
"Error: Driver DOCTYPE not equal to 'Combination'" << std::endl;
148 std::string OutputFilePrefix;
152 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
156 std::string attrVal = curAttr->
GetValue();
158 if( attrName ==
TString(
"" ) ) {
159 cxcoutEHF <<
" Error: Attribute for 'Combination' with no name found" << std::endl;
163 else if( attrName ==
TString(
"OutputFilePrefix" ) ) {
164 OutputFilePrefix = string(curAttr->
GetValue());
165 cxcoutIHF <<
"output file prefix is : " << OutputFilePrefix << endl;
175 cxcoutEHF <<
" Error: Unknown attribute for 'Combination' encountered: "
176 << attrName << std::endl;
189 std::vector< std::string > xml_channel_files;
191 while( node !=
nullptr ) {
193 if( node->
GetText() ==
nullptr ) {
195 <<
" has no text." << std::endl;
198 xml_channel_files.push_back(node->
GetText());
204 if(xml_channel_files.empty()){
205 cerr <<
"no input channels found" << endl;
210 std::ostringstream msg;
211 msg <<
"Found Channels: ";
212 for(
unsigned int i=0; i < xml_channel_files.size(); ++i ) msg <<
" " << xml_channel_files.at(i);
225 std::vector< RooStats::HistFactory::PreprocessFunction > functionObjects;
228 while( node !=
nullptr ) {
235 functionObjects.push_back( Func );
240 std::cout << std::endl;
245 while( node !=
nullptr ) {
248 cxcoutEHF <<
"Error: Node found in Measurement Driver XML with no name" << std::endl;
256 measurement_list.push_back( measurement );
272 cxcoutEHF <<
"Error: Unknown node found in Measurement Driver XML: "
280 cxcoutIHF <<
"Done Processing Measurements" << std::endl;
282 if( measurement_list.empty() ) {
283 cxcoutEHF <<
"Error: No Measurements found in XML Driver File" << std::endl;
287 std::ostringstream msg;
288 msg <<
"Found Measurements: ";
289 for(
unsigned int i=0; i < measurement_list.size(); ++i ) msg <<
" " << measurement_list.at(i).GetName();
299 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
300 measurement_list.at(i).SetFunctionObjects( functionObjects );
310 std::vector< HistFactory::Channel > channel_list;
313 for(
unsigned int i = 0; i < xml_channel_files.size(); ++i ) {
314 std::string channel_xml = xml_channel_files.at(i);
315 cxcoutIHF <<
"Parsing Channel: " << channel_xml << std::endl;
321 channel_list.push_back( channel );
325 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
329 for(
unsigned int j = 0; j < channel_list.size(); ++j ) {
330 measurement.
GetChannels().push_back( channel_list.at(j) );
334 return measurement_list;
344 if (node ==
nullptr) {
345 cxcoutWHF <<
"Input driver node is undefined, ignoring\n";
356 cxcoutIHF <<
"Creating new measurement:\n";
361 while (( curAttr =
dynamic_cast<TXMLAttr *
>(attribIt()) ) !=
nullptr) {
363 const std::string curAttrName(curAttr->
GetName() ? curAttr->
GetName() :
""),
365 if (curAttrName.empty()) {
366 cxcoutEHF <<
"Found XML attribute in Measurement with no name.\n";
369 }
else if (curAttrName ==
"Name") {
370 measurement.
SetName(curAttrValue.c_str());
371 }
else if (curAttrName ==
"Lumi") {
372 measurement.
SetLumi(std::stof(curAttrValue));
373 }
else if (curAttrName ==
"LumiRelErr") {
375 }
else if (curAttrName ==
"BinLow") {
376 measurement.
SetBinLow(std::stoi(curAttrValue));
377 }
else if (curAttrName ==
"BinHigh") {
378 measurement.
SetBinHigh(std::stoi(curAttrValue));
379 }
else if (curAttrName ==
"Mode") {
380 cout <<
"\n INFO: Mode attribute is deprecated and no longer supported, will ignore\n";
381 }
else if (curAttrName ==
"ExportOnly") {
384 cxcoutEHF <<
"Found unknown XML attribute in Measurement: " << curAttrName <<
"\n";
391 while (
child !=
nullptr) {
392 const std::string childName(
child->GetName() ?
child->GetName() :
""),
393 childNodeName(
child->GetNodeName() ?
child->GetNodeName() :
""),
394 childText(
child->GetText() ?
child->GetText() :
"");
395 if (childNodeName.empty()) {
396 cxcoutEHF <<
"Found XML child node of Measurement with no name\n";
398 }
else if (childNodeName ==
"POI") {
399 if (childText.empty()) {
400 cxcoutEHF <<
"Error: node: " << childName <<
" has no text.\n";
404 AddSubStrings(measurement.
GetPOIList(), childText);
405 }
else if (childNodeName ==
"ParamSetting") {
408 while (( curParam =
dynamic_cast<TXMLAttr *
>(paramIt()) ) !=
nullptr) {
410 const std::string curParamName(curParam->
GetName() ? curParam->
GetName() :
"");
411 if (curParamName.empty()) {
412 cxcoutEHF <<
"Error: Found tag attribute with no name in ParamSetting\n";
414 }
else if (curParamName ==
"Const") {
417 if (childText.empty()) {
418 cxcoutEHF <<
"Error: node: " << childName <<
" has no text.\n";
423 }
else if (curParamName ==
"Val") {
424 double val = atof(curParam->
GetValue());
425 if (childText.empty()) {
426 cxcoutEHF <<
"Error: node: " << childName <<
" has no text.\n";
429 std::vector<std::string> child_nodes = GetChildrenFromString(childText);
430 for (
size_t i = 0; i < child_nodes.size(); ++i) {
434 cxcoutEHF <<
"Found tag attribute with unknown name in ParamSetting: " << curParamName <<
"\n";
438 }
else if (childNodeName ==
"Asimov") {
442 std::string ParamFixString;
445 attribIt =
child->GetAttributes();
447 while (( curAttr =
dynamic_cast<TXMLAttr *
>(attribIt()) ) !=
nullptr) {
448 const std::string curAttrName(curAttr->
GetName() ? curAttr->
GetName() :
""),
450 if (curAttrName.empty()) {
451 cxcoutEHF <<
"Error: Found tag attribute with no name in ConstraintTerm\n";
453 }
else if (curAttrName ==
"Name") {
455 }
else if (curAttrName ==
"FixParams") {
456 ParamFixString = curAttrValue;
458 cxcoutEHF <<
"Found tag attribute with unknown name in ConstraintTerm: " << curAttrName <<
"\n";
465 if (ParamFixString.empty()) {
467 <<
" added, but no parameters are set to be fixed\n";
469 AddParamsToAsimov(asimov, ParamFixString);
472 }
else if (childNodeName ==
"ConstraintTerm") {
473 std::vector<string> syst;
474 std::string
type =
"";
478 if (childText.empty()) {
479 cxcoutEHF <<
"Error: node: " << childName <<
" has no text\n";
482 AddSubStrings(syst, childText);
485 attribIt =
child->GetAttributes();
487 while (( curAttr =
dynamic_cast<TXMLAttr *
>(attribIt()) ) !=
nullptr) {
488 const std::string curAttrName(curAttr->
GetName() ? curAttr->
GetName() :
""),
490 if (curAttrName.empty()) {
491 cxcoutEHF <<
"Error: Found tag attribute with no name in ConstraintTerm\n";
493 }
else if (curAttrName ==
"Type") {
495 }
else if (curAttrName ==
"RelativeUncertainty") {
496 rel = std::stof(curAttrValue);
498 cxcoutEHF <<
"Found tag attribute with unknown name in ConstraintTerm: " << curAttrName <<
"\n";
505 if (
type ==
"Gamma") {
506 for (
const auto &isyst : syst) {
510 }
else if (
type ==
"Uniform") {
511 for (
const auto &isyst : syst) {
515 }
else if (
type ==
"LogNormal") {
516 for (
const auto &isyst : syst) {
521 }
else if (
type ==
"NoConstraint") {
522 for (
const auto &isyst : syst) {
528 cxcoutEHF <<
"Error: Encountered unknown type for ConstraintTerm: " <<
type <<
"\n";
535 cxcoutEHF <<
"Found XML child of Measurement with unknown name: " << childNodeName <<
"\n";
554 cxcoutIHF <<
"Parsing file: " << filen << std::endl;
561 cxcoutEHF <<
"Loading of xml document \"" << filen
562 <<
"\" failed" << std::endl;
572 cxcoutEHF <<
"Error: In parsing a Channel XML, "
573 <<
"Encountered XML with DOCTYPE: " << rootNode->
GetNodeName()
575 cxcoutEHF <<
" DOCTYPE for channels must be 'Channel' "
576 <<
" Check that your XML is properly written" << std::endl;
594 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
598 std::string attrVal = curAttr->
GetValue();
600 if( attrName ==
TString(
"" ) ) {
601 cxcoutEHF <<
" Error: Attribute for 'Channel' with no name found" << std::endl;
605 else if( attrName ==
TString(
"Name" ) ) {
607 cxcoutIHF <<
" : creating a channel named " << channel.
GetName() << std::endl;
610 else if( attrName ==
TString(
"InputFile" ) ) {
611 cxcoutIHF <<
"Setting InputFile for this channel: " << attrVal << std::endl;
618 cxcoutIHF <<
"Setting HistoPath for this channel: " << attrVal << std::endl;
626 cxcoutEHF <<
"Use of HistoName in Channel is deprecated" << std::endl;
627 cxcoutEHF <<
"This will be ignored" << std::endl;
631 cxcoutEHF <<
" Error: Unknown attribute for 'Channel' encountered: "
632 << attrName << std::endl;
640 if( channel.
GetName().empty() ) {
641 cxcoutEHF <<
"Error: Channel created with no name" << std::endl;
654 while( node !=
nullptr ) {
661 cxcoutEHF <<
"Error: Encountered node in Channel with no name" << std::endl;
668 if( !
data.GetName().empty() ) {
669 cxcoutEHF <<
"Error: You can only rename the datasets of additional data sets. "
670 <<
" Remove the 'Name=" <<
data.GetName() <<
"' tag"
671 <<
" from channel: " << channel.
GetName() << std::endl;
693 cxcoutEHF <<
"Error: Encountered node in Channel with unknown name: " << node->
GetNodeName() << std::endl;
701 cxcoutIHF <<
"Created Channel: " << std::endl;
712 cxcoutIHF <<
"Creating Data Element" << std::endl;
724 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
728 std::string attrVal = curAttr->
GetValue();
730 if( attrName ==
TString(
"" ) ) {
731 cxcoutEHF <<
" Error: Attribute for 'Data' with no name found" << std::endl;
735 else if( attrName ==
TString(
"Name" ) ) {
736 data.SetName( attrVal );
739 else if( attrName ==
TString(
"InputFile" ) ) {
740 data.SetInputFile( attrVal );
743 else if( attrName ==
TString(
"HistoName" ) ) {
744 data.SetHistoName( attrVal );
747 else if( attrName ==
TString(
"HistoPath" ) ) {
748 data.SetHistoPath( attrVal );
754 cxcoutEHF <<
" Error: Unknown attribute for 'Data' encountered: " << attrName << std::endl;
761 if(
data.GetInputFile().empty() ) {
762 cxcoutEHF <<
"Error: Data Node has no InputFile" << std::endl;
765 if(
data.GetHistoName().empty() ) {
766 cxcoutEHF <<
"Error: Data Node has no HistoName" << std::endl;
771 <<
" InputFile: " <<
data.GetInputFile()
772 <<
" HistoName: " <<
data.GetHistoName()
773 <<
" HistoPath: " <<
data.GetHistoPath()
774 << (!
data.GetName().empty() ?
" Name: " :
"") <<
data.GetName() << std::endl;
785 cxcoutIHF <<
"Creating StatErrorConfig Element" << std::endl;
796 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
800 std::string attrVal = curAttr->
GetValue();
802 if( attrName ==
TString(
"RelErrorThreshold" ) ) {
806 if( attrName ==
TString(
"ConstraintType" ) ) {
809 if( attrVal.empty() ) {
810 cxcoutEHF <<
"Error: Bad Value for StatErrorConfig Constraint Type Found" << std::endl;
814 else if( attrVal==
"Gaussian" || attrVal==
"Gauss" ) {
818 else if( attrVal==
"Poisson" || attrVal==
"Pois" ) {
825 cout <<
"Invalid Stat Constraint Type: " << curAttr->
GetValue() << endl;
831 cxcoutIHF <<
"Created StatErrorConfig Element with"
843 cxcoutIHF <<
"Creating Sample Element" << std::endl;
858 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
862 std::string attrVal = curAttr->
GetValue();
864 if( attrName ==
TString(
"" ) ) {
865 cxcoutEHF <<
" Error: Attribute for 'Sample' with no name found" << std::endl;
869 else if( attrName ==
TString(
"Name" ) ) {
873 else if( attrName ==
TString(
"InputFile" ) ) {
878 else if( attrName ==
TString(
"HistoName" ) ) {
882 else if( attrName ==
TString(
"HistoPath" ) ) {
887 else if( attrName ==
TString(
"NormalizeByTheory" ) ) {
905 cxcoutEHF <<
" Error: Unknown attribute for 'Sample' encountered: " << attrName << std::endl;
911 if( sample.
GetName().empty() ) {
912 cxcoutEHF <<
"Error: Sample Node has no Name" << std::endl;
916 cxcoutEHF <<
"Error: Sample Node has no InputFile" << std::endl;
920 cxcoutEHF <<
"Error: Sample Node has no HistoName" << std::endl;
929 while(
child !=
nullptr ) {
932 cxcoutEHF <<
"Error: Encountered node in Sample with no name" << std::endl;
936 else if(
child->GetNodeName() ==
TString(
"NormFactor" ) ) {
940 else if(
child->GetNodeName() ==
TString(
"OverallSys" ) ) {
944 else if(
child->GetNodeName() ==
TString(
"HistoSys" ) ) {
948 else if(
child->GetNodeName() ==
TString(
"HistoFactor" ) ) {
949 cxcoutEHF <<
"WARNING: HistoFactor not yet supported" << std::endl;
953 else if(
child->GetNodeName() ==
TString(
"ShapeSys" ) ) {
957 else if(
child->GetNodeName() ==
TString(
"ShapeFactor" ) ) {
961 else if(
child->GetNodeName() ==
TString(
"StatError" ) ) {
968 cxcoutEHF <<
"Error: Encountered node in Sample with unknown name: " <<
child->GetNodeName() << std::endl;
976 <<
" Name: " << sample.
GetName()
990 cxcoutIHF <<
"Making NormFactor:" << std::endl;
996 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1000 std::string attrVal = curAttr->
GetValue();
1002 if( attrName ==
TString(
"" ) ){
1003 cxcoutEHF <<
"Error: Encountered Element in NormFactor with no name" << std::endl;
1011 norm.
SetVal( atof(attrVal.c_str()) );
1014 norm.
SetLow( atof(attrVal.c_str()) );
1017 norm.
SetHigh( atof(attrVal.c_str()) );
1021 cxcoutEHF <<
"Error: Encountered Element in NormFactor with unknown name: "
1022 << attrName << std::endl;
1028 if( norm.
GetName().empty() ) {
1029 cxcoutEHF <<
"Error: NormFactor Node has no Name" << std::endl;
1035 <<
" has lower limit >= its upper limit: "
1036 <<
" Lower: " << norm.
GetLow()
1037 <<
" Upper: " << norm.
GetHigh()
1038 <<
". Please Fix" << std::endl;
1043 <<
" has initial value not within its range: "
1044 <<
" Val: " << norm.
GetVal()
1045 <<
" Lower: " << norm.
GetLow()
1046 <<
" Upper: " << norm.
GetHigh()
1047 <<
". Please Fix" << std::endl;
1059 cxcoutIHF <<
"Making HistoFactor" << std::endl;
1069 cxcoutIHF <<
"Made HistoFactor" << std::endl;
1078 cxcoutIHF <<
"Making HistoSys:" << std::endl;
1099 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1103 std::string attrVal = curAttr->
GetValue();
1105 if( attrName ==
TString(
"" ) ){
1106 cxcoutEHF <<
"Error: Encountered Element in HistoSys with no name" << std::endl;
1135 cxcoutEHF <<
"Error: Encountered Element in HistoSys with unknown name: "
1136 << attrName << std::endl;
1143 if( histoSys.
GetName().empty() ) {
1144 cxcoutEHF <<
"Error: HistoSys Node has no Name" << std::endl;
1148 cxcoutEHF <<
"Error: HistoSysSample Node has no InputFileHigh" << std::endl;
1152 cxcoutEHF <<
"Error: HistoSysSample Node has no InputFileLow" << std::endl;
1156 cxcoutEHF <<
"Error: HistoSysSample Node has no HistoNameHigh" << std::endl;
1160 cxcoutEHF <<
"Error: HistoSysSample Node has no HistoNameLow" << std::endl;
1174 cxcoutIHF <<
"Making OverallSys:" << std::endl;
1180 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1184 std::string attrVal = curAttr->
GetValue();
1186 if( attrName ==
TString(
"" ) ){
1187 cxcoutEHF <<
"Error: Encountered Element in OverallSys with no name" << std::endl;
1191 else if( attrName ==
TString(
"Name" ) ) {
1192 overallSys.
SetName( attrVal );
1194 else if( attrName ==
TString(
"High" ) ) {
1195 overallSys.
SetHigh( atof(attrVal.c_str()) );
1197 else if( attrName ==
TString(
"Low" ) ) {
1198 overallSys.
SetLow( atof(attrVal.c_str()) );
1202 cxcoutEHF <<
"Error: Encountered Element in OverallSys with unknown name: "
1203 << attrName << std::endl;
1209 if( overallSys.
GetName().empty() ) {
1210 cxcoutEHF <<
"Error: Encountered OverallSys with no name" << std::endl;
1224 cxcoutIHF <<
"Making ShapeFactor" << std::endl;
1238 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1242 std::string attrVal = curAttr->
GetValue();
1244 if( attrName ==
TString(
"" ) ){
1245 cxcoutEHF <<
"Error: Encountered Element in ShapeFactor with no name" << std::endl;
1249 else if( attrName ==
TString(
"Name" ) ) {
1250 shapeFactor.
SetName( attrVal );
1252 else if( attrName ==
TString(
"Const" ) ) {
1256 else if( attrName ==
TString(
"HistoName" ) ) {
1260 else if( attrName ==
TString(
"InputFile" ) ) {
1261 ShapeInputFile = attrVal;
1264 else if( attrName ==
TString(
"HistoPath" ) ) {
1265 ShapeInputPath = attrVal;
1269 cxcoutEHF <<
"Error: Encountered Element in ShapeFactor with unknown name: "
1270 << attrName << std::endl;
1276 if( shapeFactor.
GetName().empty() ) {
1277 cxcoutEHF <<
"Error: Encountered ShapeFactor with no name" << std::endl;
1286 <<
" is configured to have an initial shape, but "
1287 <<
"its histogram doesn't have a name"
1304 cxcoutIHF <<
"Making ShapeSys" << std::endl;
1318 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1323 std::string attrVal = curAttr->
GetValue();
1325 if( attrName ==
TString(
"" ) ){
1326 cxcoutEHF <<
"Error: Encountered Element in ShapeSys with no name" << std::endl;
1330 else if( attrName ==
TString(
"Name" ) ) {
1334 else if( attrName ==
TString(
"HistoName" ) ) {
1338 else if( attrName ==
TString(
"HistoPath" ) ) {
1342 else if( attrName ==
TString(
"InputFile" ) ) {
1346 else if( attrName ==
TString(
"ConstraintType" ) ) {
1347 if( attrVal.empty() ) {
1348 cxcoutEHF <<
"Error: ShapeSys Constraint type is empty" << std::endl;
1351 else if( attrVal==
"Gaussian" || attrVal==
"Gauss" ) {
1354 else if( attrVal==
"Poisson" || attrVal==
"Pois" ) {
1358 cout <<
"Error: Encountered unknown ShapeSys Constraint type: " << attrVal << endl;
1364 cxcoutEHF <<
"Error: Encountered Element in ShapeSys with unknown name: "
1365 << attrName << std::endl;
1372 if( shapeSys.
GetName().empty() ) {
1373 cxcoutEHF <<
"Error: Encountered ShapeSys with no Name" << std::endl;
1377 cxcoutEHF <<
"Error: Encountered ShapeSys with no InputFile" << std::endl;
1381 cxcoutEHF <<
"Error: Encountered ShapeSys with no HistoName" << std::endl;
1394 cxcoutIHF <<
"Activating StatError" << std::endl;
1405 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1409 std::string attrVal = curAttr->
GetValue();
1411 if( attrName ==
TString(
"" ) ){
1412 cxcoutEHF <<
"Error: Encountered Element in ActivateStatError with no name" << std::endl;
1416 else if( attrName ==
TString(
"Activate" ) ) {
1420 else if( attrName ==
TString(
"HistoName" ) ) {
1424 else if( attrName ==
TString(
"HistoPath" ) ) {
1428 else if( attrName ==
TString(
"InputFile" ) ) {
1433 cxcoutEHF <<
"Error: Encountered Element in ActivateStatError with unknown name: "
1434 << attrName << std::endl;
1482 cxcoutIHF <<
"Parsing FunctionConfig" << std::endl;
1488 std::string Name =
"";
1489 std::string Expression =
"";
1490 std::string Dependents =
"";
1493 while( ( curAttr =
dynamic_cast< TXMLAttr*
>( attribIt() ) ) !=
nullptr ) {
1510 cxcoutEHF <<
"Error processing PreprocessFunction: Name attribute is empty" << std::endl;
1513 if( Expression.empty() ){
1514 cxcoutEHF <<
"Error processing PreprocessFunction: Expression attribute is empty" << std::endl;
1517 if( Dependents.empty() ){
1518 cxcoutEHF <<
"Error processing PreprocessFunction: Dependents attribute is empty" << std::endl;
1551 if( attrVal.empty() ) {
1553 <<
" Expected either 'True' or 'False' but found empty" << std::endl;
1556 else if ( attrVal ==
"True" || attrVal ==
"true" )
return true;
1557 else if ( attrVal ==
"False" || attrVal ==
"false" )
return false;
1560 <<
" Expected either 'True' or 'False' but found: " << attrVal << std::endl;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
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()
void SetExportOnly(bool ExportOnly)
do not produce any plots or tables, just save the model
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.