31 using namespace HistFactory;
45 std::vector< HistFactory::Measurement > measurement_list;
53 std::cerr <<
"Loading of xml document \"" << input
54 <<
"\" failed" << std::endl;
60 cout <<
"reading input : " << input << endl;
66 if( rootNode->
GetNodeName() != TString(
"Combination" ) ){
67 std::cout <<
"Error: Driver DOCTYPE not equal to 'Combination'" << std::endl;
72 std::string OutputFilePrefix;
76 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
79 TString attrName = curAttr->
GetName();
80 std::string attrVal = curAttr->
GetValue();
82 if( attrName == TString(
"" ) ) {
83 std::cout <<
" Error: Attribute for 'Combination' with no name found" << std::endl;
87 else if( attrName == TString(
"OutputFilePrefix" ) ) {
88 OutputFilePrefix = string(curAttr->
GetValue());
89 std::cout <<
"output file prefix is : " << OutputFilePrefix << endl;
99 std::cout <<
" Error: Unknown attribute for 'Combination' encountered: " 100 << attrName << std::endl;
113 std::vector< std::string > xml_channel_files;
117 if( node->
GetText() == NULL ) {
118 std::cout <<
"Error: node: " << node->
GetName()
119 <<
" has no text." << std::endl;
122 xml_channel_files.push_back(node->
GetText());
128 if(xml_channel_files.empty()){
129 cerr <<
"no input channels found" << endl;
134 std::cout <<
"Found Channels: ";
135 for(
unsigned int i=0; i < xml_channel_files.size(); ++i ) std::cout <<
" " << xml_channel_files.at(i);
136 std::cout << std::endl;
148 std::vector< RooStats::HistFactory::PreprocessFunction > functionObjects;
152 if( node->
GetNodeName() == TString(
"Function" ) ) {
158 functionObjects.push_back( Func );
163 std::cout << std::endl;
171 std::cout <<
"Error: Node found in Measurement Driver XML with no name" << std::endl;
175 else if( node->
GetNodeName() == TString(
"Measurement" ) ) {
179 measurement_list.push_back( measurement );
182 else if( node->
GetNodeName() == TString(
"Function" ) ) {
187 else if( node->
GetNodeName() == TString(
"Input" ) ) {
192 else if( IsAcceptableNode( node ) ) { ; }
195 std::cout <<
"Error: Unknown node found in Measurement Driver XML: " 203 std::cout <<
"Done Processing Measurements" << std::endl;
205 if( measurement_list.size() == 0 ) {
206 std::cout <<
"Error: No Measurements found in XML Driver File" << std::endl;
210 std::cout <<
"Found Measurements: ";
211 for(
unsigned int i=0; i < measurement_list.size(); ++i ) std::cout <<
" " << measurement_list.at(i).GetName();
212 std::cout << std::endl;
220 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
221 measurement_list.at(i).SetFunctionObjects( functionObjects );
231 std::vector< HistFactory::Channel > channel_list;
234 for(
unsigned int i = 0; i < xml_channel_files.size(); ++i ) {
235 std::string channel_xml = xml_channel_files.at(i);
236 std::cout <<
"Parsing Channel: " << channel_xml << std::endl;
242 channel_list.push_back( channel );
246 for(
unsigned int i = 0; i < measurement_list.size(); ++i) {
250 for(
unsigned int j = 0; j < channel_list.size(); ++j ) {
251 measurement.
GetChannels().push_back( channel_list.at(j) );
255 catch(std::exception&
e)
257 std::cout << e.what() << std::endl;
261 return measurement_list;
278 std::cout <<
"Creating new measurement: " << std::endl;
283 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
285 if( curAttr->
GetName() == TString(
"" ) ) {
286 std::cout <<
"Found XML attribute in Measurement with no name" << std::endl;
290 else if( curAttr->
GetName() == TString(
"Name" ) ) {
295 else if( curAttr->
GetName() == TString(
"Lumi" ) ) {
298 else if( curAttr->
GetName() == TString(
"LumiRelErr" ) ) {
301 else if( curAttr->
GetName() == TString(
"BinLow" ) ) {
304 else if( curAttr->
GetName() == TString(
"BinHigh" ) ) {
307 else if( curAttr->
GetName() == TString(
"Mode" ) ) {
308 cout <<
"\n INFO: Mode attribute is deprecated, will ignore\n"<<endl;
310 else if( curAttr->
GetName() == TString(
"ExportOnly" ) ) {
315 std::cout <<
"Found unknown XML attribute in Measurement: " << curAttr->
GetName()
325 while( child != 0 ) {
328 std::cout <<
"Found XML child node of Measurement with no name" << std::endl;
332 else if( child->
GetNodeName() == TString(
"POI" ) ) {
333 if( child->
GetText() == NULL ) {
334 std::cout <<
"Error: node: " << child->
GetName()
335 <<
" has no text." << std::endl;
342 else if( child->
GetNodeName() == TString(
"ParamSetting" ) ) {
345 while( ( curParam = dynamic_cast< TXMLAttr* >( paramIt() ) ) != 0 ) {
347 if( curParam->
GetName() == TString(
"" ) ) {
348 std::cout <<
"Error: Found tag attribute with no name in ParamSetting" << std::endl;
351 else if( curParam->
GetName() == TString(
"Const" ) ) {
352 if(curParam->
GetValue()==TString(
"True")){
354 if( child->
GetText() == NULL ) {
355 std::cout <<
"Error: node: " << child->
GetName()
356 <<
" has no text." << std::endl;
362 else if( curParam->
GetName() == TString(
"Val" ) ) {
363 double val = atof(curParam->
GetValue());
364 if( child->
GetText() == NULL ) {
365 std::cout <<
"Error: node: " << child->
GetName()
366 <<
" has no text." << std::endl;
370 for(
unsigned int i = 0; i < child_nodes.size(); ++i) {
376 std::cout <<
"Found tag attribute with unknown name in ParamSetting: " 377 << curAttr->
GetName() << std::endl;
383 else if( child->
GetNodeName() == TString(
"Asimov" ) ) {
391 std::string ParamFixString;
396 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
398 if( curAttr->
GetName() == TString(
"" ) ) {
399 std::cout <<
"Error: Found tag attribute with no name in ConstraintTerm" << std::endl;
403 else if( curAttr->
GetName() == TString(
"Name" ) ) {
408 else if( curAttr->
GetName() == TString(
"FixParams" ) ) {
409 ParamFixString = curAttr->
GetValue();
415 std::cout <<
"Found tag attribute with unknown name in ConstraintTerm: " 416 << curAttr->
GetName() << std::endl;
424 if( ParamFixString==
"" ) {
425 std::cout <<
"Warning: Asimov Dataset with name: " << asimov.
GetName()
426 <<
" added, but no parameters are set to be fixed" << std::endl;
436 else if( child->
GetNodeName() == TString(
"ConstraintTerm" ) ) {
441 map<string,double> gammaSyst;
442 map<string,double> uniformSyst;
443 map<string,double> logNormSyst;
446 if( child->
GetText() == NULL ) {
447 std::cout <<
"Error: node: " << child->
GetName()
448 <<
" has no text." << std::endl;
456 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
458 if( curAttr->
GetName() == TString(
"" ) ) {
459 std::cout <<
"Error: Found tag attribute with no name in ConstraintTerm" << std::endl;
463 else if( curAttr->
GetName() == TString(
"Type" ) ) {
467 else if( curAttr->
GetName() == TString(
"RelativeUncertainty" ) ) {
472 std::cout <<
"Found tag attribute with unknown name in ConstraintTerm: " 473 << curAttr->
GetName() << std::endl;
483 if( ! (type==
"Gamma" || type==
"Uniform" ||
484 type==
"LogNormal" || type==
"NoConstraint") ) {
485 std::cout <<
"Error: Encountered unknown type for ConstraintTerm: " << type << std::endl;
489 if (type==
"Gamma" && rel!=0) {
490 for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
496 if (type==
"Uniform" && rel!=0) {
497 for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
503 if (type==
"LogNormal" && rel!=0) {
504 for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
510 if (type==
"NoConstraint") {
511 for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
513 measurement.
GetNoSyst()[(*it).c_str()] = 1.0;
519 else if( IsAcceptableNode( child ) ) { ; }
522 std::cout <<
"Found XML child of Measurement with unknown name: " << child->
GetNodeName()
531 std::cout << std::endl;
547 std::cout <<
"Parsing file: " << filen ;
554 std::cout <<
"Loading of xml document \"" << filen
555 <<
"\" failed" << std::endl;
564 if( rootNode->
GetNodeName() != TString(
"Channel" ) ){
565 std::cout <<
"Error: In parsing a Channel XML, " 566 <<
"Encounterd XML with DOCTYPE: " << rootNode->
GetNodeName()
568 std::cout <<
" DOCTYPE for channels must be 'Channel' " 569 <<
" Check that your XML is properly written" << std::endl;
587 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
590 TString attrName = curAttr->
GetName();
591 std::string attrVal = curAttr->
GetValue();
593 if( attrName == TString(
"" ) ) {
594 std::cout <<
" Error: Attribute for 'Channel' with no name found" << std::endl;
598 else if( attrName == TString(
"Name" ) ) {
600 std::cout <<
" : creating a channel named " << channel.
GetName() << std::endl;
603 else if( attrName == TString(
"InputFile" ) ) {
604 std::cout <<
"Setting InputFile for this channel: " << attrVal << std::endl;
607 m_currentInputFile = attrVal;
610 else if( curAttr->
GetName() == TString(
"HistoPath" ) ) {
611 std::cout <<
"Setting HistoPath for this channel: " << attrVal << std::endl;
614 m_currentHistoPath = attrVal;
617 else if( curAttr->
GetName() == TString(
"HistoName" ) ) {
619 std::cout <<
"Use of HistoName in Channel is deprecated" << std::endl;
620 std::cout <<
"This will be ignored" << std::endl;
624 std::cout <<
" Error: Unknown attribute for 'Channel' encountered: " 625 << attrName << std::endl;
633 if( channel.
GetName() ==
"" ) {
634 std::cout <<
"Error: Channel created with no name" << std::endl;
638 m_currentChannel = channel.
GetName();
654 std::cout <<
"Error: Encountered node in Channel with no name" << std::endl;
658 else if( node->
GetNodeName() == TString(
"Data" ) ) {
662 std::cout <<
"Error: You can only rename the datasets of additional data sets. " 663 <<
" Remove the 'Name=" << data.
GetName() <<
"' tag" 664 <<
" from channel: " << channel.
GetName() << std::endl;
675 else if( node->
GetNodeName() == TString(
"StatErrorConfig" ) ) {
679 else if( node->
GetNodeName() == TString(
"Sample" ) ) {
680 channel.
GetSamples().push_back( CreateSampleElement(node) );
683 else if( IsAcceptableNode( node ) ) { ; }
686 std::cout <<
"Error: Encountered node in Channel with unknown name: " << node->
GetNodeName() << std::endl;
694 std::cout <<
"Created Channel: " << std::endl;
705 std::cout <<
"Creating Data Element" << std::endl;
717 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
720 TString attrName = curAttr->
GetName();
721 std::string attrVal = curAttr->
GetValue();
723 if( attrName == TString(
"" ) ) {
724 std::cout <<
" Error: Attribute for 'Data' with no name found" << std::endl;
728 else if( attrName == TString(
"Name" ) ) {
732 else if( attrName == TString(
"InputFile" ) ) {
736 else if( attrName == TString(
"HistoName" ) ) {
740 else if( attrName == TString(
"HistoPath" ) ) {
744 else if( IsAcceptableNode( node ) ) { ; }
747 std::cout <<
" Error: Unknown attribute for 'Data' encountered: " << attrName << std::endl;
755 std::cout <<
"Error: Data Node has no InputFile" << std::endl;
759 std::cout <<
"Error: Data Node has no HistoName" << std::endl;
763 std::cout <<
"Created Data Node with" 767 if( data.
GetName() !=
"") std::cout <<
" Name: " << data.
GetName();
768 std::cout << std::endl;
779 std::cout <<
"Creating StatErrorConfig Element" << std::endl;
790 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
793 TString attrName = curAttr->
GetName();
794 std::string attrVal = curAttr->
GetValue();
796 if( attrName == TString(
"RelErrorThreshold" ) ) {
800 if( attrName == TString(
"ConstraintType" ) ) {
803 if( attrVal ==
"" ) {
804 std::cout <<
"Error: Bad Value for StatErrorConfig Constraint Type Found" << std::endl;
808 else if( attrVal==
"Gaussian" || attrVal==
"Gauss" ) {
812 else if( attrVal==
"Poisson" || attrVal==
"Pois" ) {
816 else if( IsAcceptableNode( node ) ) { ; }
819 cout <<
"Invalid Stat Constraint Type: " << curAttr->
GetValue() << endl;
825 std::cout <<
"Created StatErrorConfig Element with" 837 std::cout <<
"Creating Sample Element" << std::endl;
852 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
855 TString attrName = curAttr->
GetName();
856 std::string attrVal = curAttr->
GetValue();
858 if( attrName == TString(
"" ) ) {
859 std::cout <<
" Error: Attribute for 'Sample' with no name found" << std::endl;
863 else if( attrName == TString(
"Name" ) ) {
867 else if( attrName == TString(
"InputFile" ) ) {
869 m_currentInputFile = attrVal;
872 else if( attrName == TString(
"HistoName" ) ) {
876 else if( attrName == TString(
"HistoPath" ) ) {
878 m_currentHistoPath = attrVal;
881 else if( attrName == TString(
"NormalizeByTheory" ) ) {
899 std::cout <<
" Error: Unknown attribute for 'Sample' encountered: " << attrName << std::endl;
906 std::cout <<
"Error: Sample Node has no Name" << std::endl;
910 std::cout <<
"Error: Sample Node has no InputFile" << std::endl;
914 std::cout <<
"Error: Sample Node has no HistoName" << std::endl;
923 while( child != 0 ) {
926 std::cout <<
"Error: Encountered node in Sample with no name" << std::endl;
930 else if( child->
GetNodeName() == TString(
"NormFactor" ) ) {
934 else if( child->
GetNodeName() == TString(
"OverallSys" ) ) {
938 else if( child->
GetNodeName() == TString(
"HistoSys" ) ) {
942 else if( child->
GetNodeName() == TString(
"HistoFactor" ) ) {
943 std::cout <<
"WARNING: HistoFactor not yet supported" << std::endl;
947 else if( child->
GetNodeName() == TString(
"ShapeSys" ) ) {
951 else if( child->
GetNodeName() == TString(
"ShapeFactor" ) ) {
955 else if( child->
GetNodeName() == TString(
"StatError" ) ) {
959 else if( IsAcceptableNode( child ) ) { ; }
962 std::cout <<
"Error: Encountered node in Sample with unknown name: " << child->
GetNodeName() << std::endl;
969 std::cout <<
"Created Sample Node with" 970 <<
" Name: " << sample.
GetName()
984 std::cout <<
"Making NormFactor:" << std::endl;
990 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
993 TString attrName = curAttr->
GetName();
994 std::string attrVal = curAttr->
GetValue();
996 if( attrName == TString(
"" ) ){
997 std::cout <<
"Error: Encountered Element in NormFactor with no name" << std::endl;
1001 else if( curAttr->
GetName() == TString(
"Name" ) ) {
1004 else if( curAttr->
GetName() == TString(
"Val" ) ) {
1005 norm.
SetVal( atof(attrVal.c_str()) );
1007 else if( curAttr->
GetName() == TString(
"Low" ) ) {
1008 norm.
SetLow( atof(attrVal.c_str()) );
1010 else if( curAttr->
GetName() == TString(
"High" ) ) {
1011 norm.
SetHigh( atof(attrVal.c_str()) );
1013 else if( curAttr->
GetName() == TString(
"Const" ) ) {
1014 norm.
SetConst( CheckTrueFalse(attrVal,
"NormFactor") );
1018 std::cout <<
"Error: Encountered Element in NormFactor with unknown name: " 1019 << attrName << std::endl;
1026 std::cout <<
"Error: NormFactor Node has no Name" << std::endl;
1031 std::cout <<
"Error: NormFactor: " << norm.
GetName()
1032 <<
" has lower limit >= its upper limit: " 1033 <<
" Lower: " << norm.
GetLow()
1034 <<
" Upper: " << norm.
GetHigh()
1035 <<
". Please Fix" << std::endl;
1039 std::cout <<
"Error: NormFactor: " << norm.
GetName()
1040 <<
" has initial value not within its range: " 1041 <<
" Val: " << norm.
GetVal()
1042 <<
" Lower: " << norm.
GetLow()
1043 <<
" Upper: " << norm.
GetHigh()
1044 <<
". Please Fix" << std::endl;
1056 std::cout <<
"Making HistoFactor" << std::endl;
1066 std::cout <<
"Made HistoFactor" << std::endl;
1075 std::cout <<
"Making HistoSys:" << std::endl;
1096 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
1099 TString attrName = curAttr->
GetName();
1100 std::string attrVal = curAttr->
GetValue();
1102 if( attrName == TString(
"" ) ){
1103 std::cout <<
"Error: Encountered Element in HistoSys with no name" << std::endl;
1107 else if( curAttr->
GetName() == TString(
"Name" ) ) {
1111 else if( curAttr->
GetName() == TString(
"HistoFileHigh" ) ) {
1114 else if( curAttr->
GetName() == TString(
"HistoPathHigh" ) ) {
1117 else if( curAttr->
GetName() == TString(
"HistoNameHigh" ) ) {
1121 else if( curAttr->
GetName() == TString(
"HistoFileLow" ) ) {
1124 else if( curAttr->
GetName() == TString(
"HistoPathLow" ) ) {
1127 else if( curAttr->
GetName() == TString(
"HistoNameLow" ) ) {
1132 std::cout <<
"Error: Encountered Element in HistoSys with unknown name: " 1133 << attrName << std::endl;
1140 if( histoSys.
GetName() ==
"" ) {
1141 std::cout <<
"Error: HistoSys Node has no Name" << std::endl;
1145 std::cout <<
"Error: HistoSysSample Node has no InputFileHigh" << std::endl;
1149 std::cout <<
"Error: HistoSysSample Node has no InputFileLow" << std::endl;
1153 std::cout <<
"Error: HistoSysSample Node has no HistoNameHigh" << std::endl;
1157 std::cout <<
"Error: HistoSysSample Node has no HistoNameLow" << std::endl;
1171 std::cout <<
"Making OverallSys:" << std::endl;
1177 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
1180 TString attrName = curAttr->
GetName();
1181 std::string attrVal = curAttr->
GetValue();
1183 if( attrName == TString(
"" ) ){
1184 std::cout <<
"Error: Encountered Element in OverallSys with no name" << std::endl;
1188 else if( attrName == TString(
"Name" ) ) {
1189 overallSys.
SetName( attrVal );
1191 else if( attrName == TString(
"High" ) ) {
1192 overallSys.
SetHigh( atof(attrVal.c_str()) );
1194 else if( attrName == TString(
"Low" ) ) {
1195 overallSys.
SetLow( atof(attrVal.c_str()) );
1199 std::cout <<
"Error: Encountered Element in OverallSys with unknown name: " 1200 << attrName << std::endl;
1206 if( overallSys.
GetName() ==
"" ) {
1207 std::cout <<
"Error: Encountered OverallSys with no name" << std::endl;
1221 std::cout <<
"Making ShapeFactor" << std::endl;
1232 std::string ShapeInputFile = m_currentInputFile;
1233 std::string ShapeInputPath = m_currentHistoPath;
1235 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
1238 TString attrName = curAttr->
GetName();
1239 std::string attrVal = curAttr->
GetValue();
1241 if( attrName == TString(
"" ) ){
1242 std::cout <<
"Error: Encountered Element in ShapeFactor with no name" << std::endl;
1246 else if( attrName == TString(
"Name" ) ) {
1247 shapeFactor.
SetName( attrVal );
1249 else if( attrName == TString(
"Const" ) ) {
1250 shapeFactor.
SetConstant( CheckTrueFalse(attrVal,
"ShapeFactor" ) );
1253 else if( attrName == TString(
"HistoName" ) ) {
1257 else if( attrName == TString(
"InputFile" ) ) {
1258 ShapeInputFile = attrVal;
1261 else if( attrName == TString(
"HistoPath" ) ) {
1262 ShapeInputPath = attrVal;
1266 std::cout <<
"Error: Encountered Element in ShapeFactor with unknown name: " 1267 << attrName << std::endl;
1273 if( shapeFactor.
GetName() ==
"" ) {
1274 std::cout <<
"Error: Encountered ShapeFactor with no name" << std::endl;
1282 std::cout <<
"Error: ShapeFactor: " << shapeFactor.
GetName()
1283 <<
" is configured to have an initial shape, but " 1284 <<
"its histogram doesn't have a name" 1292 shapeFactor.
Print();
1301 std::cout <<
"Making ShapeSys" << std::endl;
1315 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
1319 TString attrName = curAttr->
GetName();
1320 std::string attrVal = curAttr->
GetValue();
1322 if( attrName == TString(
"" ) ){
1323 std::cout <<
"Error: Encountered Element in ShapeSys with no name" << std::endl;
1327 else if( attrName == TString(
"Name" ) ) {
1331 else if( attrName == TString(
"HistoName" ) ) {
1335 else if( attrName == TString(
"HistoPath" ) ) {
1339 else if( attrName == TString(
"InputFile" ) ) {
1343 else if( attrName == TString(
"ConstraintType" ) ) {
1345 std::cout <<
"Error: ShapeSys Constraint type is empty" << std::endl;
1348 else if( attrVal==
"Gaussian" || attrVal==
"Gauss" ) {
1351 else if( attrVal==
"Poisson" || attrVal==
"Pois" ) {
1355 cout <<
"Error: Encountered unknown ShapeSys Constraint type: " << attrVal << endl;
1361 std::cout <<
"Error: Encountered Element in ShapeSys with unknown name: " 1362 << attrName << std::endl;
1369 if( shapeSys.
GetName() ==
"" ) {
1370 std::cout <<
"Error: Encountered ShapeSys with no Name" << std::endl;
1374 std::cout <<
"Error: Encountered ShapeSys with no InputFile" << std::endl;
1378 std::cout <<
"Error: Encountered ShapeSys with no HistoName" << std::endl;
1391 std::cout <<
"Activating StatError" << std::endl;
1402 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
1405 TString attrName = curAttr->
GetName();
1406 std::string attrVal = curAttr->
GetValue();
1408 if( attrName == TString(
"" ) ){
1409 std::cout <<
"Error: Encountered Element in ActivateStatError with no name" << std::endl;
1413 else if( attrName == TString(
"Activate" ) ) {
1414 statError.
Activate( CheckTrueFalse(attrVal,
"ActivateStatError") );
1417 else if( attrName == TString(
"HistoName" ) ) {
1421 else if( attrName == TString(
"HistoPath" ) ) {
1425 else if( attrName == TString(
"InputFile" ) ) {
1430 std::cout <<
"Error: Encountered Element in ActivateStatError with unknown name: " 1431 << attrName << std::endl;
1479 std::cout <<
"Parsing FunctionConfig" << std::endl;
1485 std::string
Name =
"";
1486 std::string Expression =
"";
1487 std::string Dependents =
"";
1490 while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
1491 if( curAttr->
GetName() == TString(
"Name" ) ) {
1496 if( curAttr->
GetName() == TString(
"Expression" ) ) {
1500 if( curAttr->
GetName() == TString(
"Dependents" ) ) {
1507 std::cout <<
"Error processing PreprocessFunction: Name attribute is empty" << std::endl;
1510 if( Expression==
"" ){
1511 std::cout <<
"Error processing PreprocessFunction: Expression attribute is empty" << std::endl;
1514 if( Dependents==
"" ){
1515 std::cout <<
"Error processing PreprocessFunction: Dependents attribute is empty" << std::endl;
1521 std::cout <<
"Created Preprocess Function: " << func.
GetCommand() << std::endl;
1537 if( node->
GetNodeName() == TString(
"comment" ) ) {
1548 if( attrVal ==
"" ) {
1549 std::cout <<
"Error: In " << NodeTitle
1550 <<
" Expected either 'True' or 'False' but found empty" << std::endl;
1553 else if ( attrVal ==
"True" || attrVal ==
"true" )
return true;
1554 else if ( attrVal ==
"False" || attrVal ==
"false" )
return false;
1556 std::cout <<
"Error: In " << NodeTitle
1557 <<
" Expected either 'True' or 'False' but found: " << attrVal << std::endl;
HistFactory::NormFactor MakeNormFactor(TXMLNode *node)
void SetName(const std::string &Name)
void SetData(const RooStats::HistFactory::Data &data)
void AddAdditionalData(const RooStats::HistFactory::Data &data)
void SetStatErrorConfig(double RelErrorThreshold, Constraint::Type ConstraintType)
void SetBinHigh(int BinHigh)
std::map< std::string, double > & GetNoSyst()
HistFactory::PreprocessFunction ParseFunctionConfig(TXMLNode *functionNode)
void SetConstraintType(Constraint::Type ConstrType)
void SetHistoNameHigh(const std::string &HistoNameHigh)
std::vector< RooStats::HistFactory::NormFactor > & GetNormFactorList()
void SetInputFile(const std::string &file)
std::string GetHistoName()
HistFactory::Sample CreateSampleElement(TXMLNode *node)
void Print(std::ostream &=std::cout)
void SetHistoPathLow(const std::string &HistoPathLow)
void SetHistoName(const std::string &HistoName)
void AddParamsToAsimov(RooStats::HistFactory::Asimov &asimov, std::string str)
virtual void SetName(const char *name)
Set the name of the TNamed.
RooStats::HistFactory::Channel ParseChannelXMLFile(std::string filen)
Constraint::Type GetConstraintType()
std::string GetCommand(std::string Name, std::string Expression, std::string Dependents)
void SetOutputFilePrefix(const std::string &prefix)
const char * GetValue() const
std::string GetHistoPath()
std::string GetHistoName()
void SetHistoPathHigh(const std::string &HistoPathHigh)
void SetHistoName(const std::string &HistoName)
HistFactory::HistoFactor MakeHistoFactor(TXMLNode *node)
std::vector< std::string > & GetPOIList()
std::string GetInputFile()
void Print(std::ostream &=std::cout)
void Print(std::ostream &=std::cout)
std::string GetHistoNameHigh()
void SetConstraintType(Constraint::Type ConstrType)
RooStats::HistFactory::Measurement CreateMeasurementFromDriverNode(TXMLNode *node)
void SetNormalizeByTheory(bool norm)
const char * GetText() const
Returns the content of a Text node if node is a TextNode, 0 otherwise.
void AddSubStrings(vector< std::string > &vs, std::string s)
void SetInputFile(const std::string &InputFile)
HistFactory::StatError ActivateStatError(TXMLNode *node)
void SetConstant(bool constant)
void SetExportOnly(bool ExportOnly)
void SetLumi(double Lumi)
std::vector< RooStats::HistFactory::HistoSys > & GetHistoSysList()
TXMLDocument contains a pointer to an xmlDoc structure, after the parser returns a tree built during ...
void SetStatError(RooStats::HistFactory::StatError Error)
HistFactory::OverallSys MakeOverallSys(TXMLNode *node)
void SetHistoPath(const std::string &HistoPath)
double GetRelErrorThreshold()
std::string GetHistoName()
std::vector< RooStats::HistFactory::Channel > & GetChannels()
void SetChannelName(const std::string &ChannelName)
std::string GetInputFile()
std::string GetInputFileHigh()
std::string GetInputFile()
HistFactory::HistoSys MakeHistoSys(TXMLNode *node)
void SetInputFileLow(const std::string &InputFileLow)
std::string GetInputFile()
std::map< std::string, double > & GetUniformSyst()
void SetName(const std::string &name)
void SetHistoPathLow(const std::string &HistoPathLow)
TXMLNode * GetNextNode()
Returns the next sibling XMLNode in the DOM tree, if any return 0 if no next node.
HistFactory::Data CreateDataElement(TXMLNode *node)
virtual Int_t ParseFile(const char *filename)
Parse the XML file where filename is the XML file name.
std::string GetHistoPath()
void SetName(const std::string &Name)
void SetHistoName(const std::string &HistoName)
void SetName(const std::string &Name)
void SetHistoPath(const std::string &HistoPath)
void SetName(const std::string &Name)
void SetHistoPath(const std::string &file)
std::vector< RooStats::HistFactory::Measurement > GetMeasurementsFromXML(std::string input)
HistFactory::ShapeSys MakeShapeSys(TXMLNode *node)
void SetConst(bool Const=true)
std::vector< RooStats::HistFactory::ShapeSys > & GetShapeSysList()
TList * GetAttributes()
Returns a list of node's attribute if any, returns 0 if no attribute.
std::string GetHistoPath()
void SetHistoName(const std::string &HistoName)
void SetHigh(double High)
void SetInputFileLow(const std::string &InputFileLow)
void SetHistoNameLow(const std::string &HistoNameLow)
TXMLAttribute is the attribute of an Element.
void Print(std::ostream &=std::cout)
void SetInputFile(const std::string &InputFile)
void SetHistoPathHigh(const std::string &HistoPathHigh)
void SetHistoPath(const std::string &HistoPath)
std::vector< RooStats::HistFactory::OverallSys > & GetOverallSysList()
void Activate(bool IsActive=true)
const char * GetName() const
Returns name of object.
std::string GetHistoPath()
void Print(std::ostream &=std::cout)
std::vector< std::string > & GetConstantParams()
std::string GetHistoName()
void SetHigh(double High)
Namespace for the RooStats classes.
void SetHistoPath(const std::string &HistoPath)
bool IsAcceptableNode(TXMLNode *functionNode)
TXMLNode * GetRootNode() const
Returns the root element node.
static RooMathCoreReg dummy
std::map< std::string, double > & GetLogNormSyst()
std::vector< RooStats::HistFactory::Sample > & GetSamples()
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void SetBinLow(int BinLow)
void SetParamValue(const std::string ¶m, double value)
HistFactory::StatErrorConfig CreateStatErrorConfigElement(TXMLNode *node)
virtual TXMLDocument * GetXMLDocument() const
Returns the TXMLDocument.
void SetName(const std::string &Name)
void SetName(const std::string &Name)
void SetHistoName(const std::string &HistoName)
void SetLumiRelErr(double RelErr)
void PrintTree(std::ostream &=std::cout)
HistFactory::ShapeFactor MakeShapeFactor(TXMLNode *node)
std::string GetHistoName()
void SetUseHisto(bool UseHisto=true)
bool CheckTrueFalse(std::string val, std::string Name)
void SetName(const std::string &name)
std::string GetInputFileLow()
void SetHistoPath(const std::string &HistoPath)
void Print(std::ostream &=std::cout)
void SetInputFile(const std::string &InputFile)
TXMLNode contains a pointer to xmlNode, which is a node under the DOM tree.
void SetName(const std::string &Name)
TXMLNode * GetChildren()
Returns the node's child if any, returns 0 if no child.
std::string GetHistoNameLow()
void SetRelErrorThreshold(double Threshold)
virtual const char * GetName() const
Returns name of object.
void AddAsimovDataset(RooStats::HistFactory::Asimov dataset)
void SetInputFile(const std::string &InputFile)
const char * GetNodeName() const
Returns the node's name.
std::vector< std::string > GetChildrenFromString(std::string str)
std::vector< RooStats::HistFactory::ShapeFactor > & GetShapeFactorList()
void SetInputFileHigh(const std::string &InputFileHigh)
void Print(std::ostream &=std::cout)
std::string GetInputFile()
std::map< std::string, double > & GetGammaSyst()
void SetInputFile(const std::string &InputFile)
void SetInputFileHigh(const std::string &InputFileHigh)