[arch-commits] Commit in root/trunk (9271.patch PKGBUILD thisroot.fail)
Konstantin Gizdov
kgizdov at gemini.archlinux.org
Fri Nov 12 01:03:59 UTC 2021
Date: Friday, November 12, 2021 @ 01:03:59
Author: kgizdov
Revision: 1042822
upgpkg: root 6.24.06-5: non-null patch and thisroot.fail update
Added:
root/trunk/9271.patch
Modified:
root/trunk/PKGBUILD
root/trunk/thisroot.fail
---------------+
9271.patch | 726 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 6
thisroot.fail | 41 +++
3 files changed, 769 insertions(+), 4 deletions(-)
Added: 9271.patch
===================================================================
--- 9271.patch (rev 0)
+++ 9271.patch 2021-11-12 01:03:59 UTC (rev 1042822)
@@ -0,0 +1,726 @@
+diff --git a/roofit/histfactory/src/ConfigParser.cxx b/roofit/histfactory/src/ConfigParser.cxx
+index 227a16b6a0..f1d7eba4f4 100644
+--- a/roofit/histfactory/src/ConfigParser.cxx
++++ b/roofit/histfactory/src/ConfigParser.cxx
+@@ -260,280 +260,210 @@ std::vector< RooStats::HistFactory::Measurement > ConfigParser::GetMeasurementsF
+ return measurement_list;
+
+ }
+-
+
+-HistFactory::Measurement ConfigParser::CreateMeasurementFromDriverNode( TXMLNode* node ) {
+-
+-
+- HistFactory::Measurement measurement;
+-
+- // Set the default values:
+- measurement.SetLumi( 1.0 );
+- measurement.SetLumiRelErr( .10 );
+- measurement.SetBinLow( 0 );
+- measurement.SetBinHigh( 1 );
+- measurement.SetExportOnly( false );
+-
+- cxcoutIHF << "Creating new measurement: " << std::endl;
+-
+- // First, get the attributes of the node
+- TListIter attribIt = node->GetAttributes();
+- TXMLAttr* curAttr = 0;
+- while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
+-
+- if( curAttr->GetName() == TString( "" ) ) {
+- cxcoutEHF << "Found XML attribute in Measurement with no name" << std::endl;
+- // ADD Output Here
+- throw hf_exc();
+- }
+- else if( curAttr->GetName() == TString( "Name" ) ) {
+- //rowTitle=curAttr->GetValue();
+- measurement.SetName( curAttr->GetValue() );
+- //measurement.OutputFileName = outputFileNamePrefix+"_"+rowTitle+".root";
+- }
+- else if( curAttr->GetName() == TString( "Lumi" ) ) {
+- measurement.SetLumi( atof(curAttr->GetValue()) );
+- }
+- else if( curAttr->GetName() == TString( "LumiRelErr" ) ) {
+- measurement.SetLumiRelErr( atof(curAttr->GetValue()) );
+- }
+- else if( curAttr->GetName() == TString( "BinLow" ) ) {
+- measurement.SetBinLow( atoi(curAttr->GetValue()) );
+- }
+- else if( curAttr->GetName() == TString( "BinHigh" ) ) {
+- measurement.SetBinHigh( atoi(curAttr->GetValue()) );
+- }
+- else if( curAttr->GetName() == TString( "Mode" ) ) {
+- cout <<"\n INFO: Mode attribute is deprecated, will ignore\n"<<endl;
+- }
+- else if( curAttr->GetName() == TString( "ExportOnly" ) ) {
+- measurement.SetExportOnly( CheckTrueFalse(curAttr->GetValue(),"Measurement") );
+- }
+-
+- else {
+- cxcoutEHF << "Found unknown XML attribute in Measurement: " << curAttr->GetName()
+- << std::endl;
+- throw hf_exc();
+- }
+-
+- } // End Loop over attributes
+-
+-
+- // Then, get the properties of the children nodes
+- TXMLNode* child = node->GetChildren();
+- while( child != 0 ) {
+-
+- if( child->GetNodeName() == TString( "" ) ) {
+- cxcoutEHF << "Found XML child node of Measurement with no name" << std::endl;
+- throw hf_exc();
+- }
+-
+- else if( child->GetNodeName() == TString( "POI" ) ) {
+- if( child->GetText() == NULL ) {
+- cxcoutEHF << "Error: node: " << child->GetName()
+- << " has no text." << std::endl;
+- throw hf_exc();
++HistFactory::Measurement ConfigParser::CreateMeasurementFromDriverNode(TXMLNode *node)
++{
++ // construct and return at bottom
++ HistFactory::Measurement measurement;
++
++ // safety for public functions
++ if (node == nullptr) {
++ cxcoutWHF << "Input driver node is undefined, ignoring\n";
++ return measurement;
++ }
++
++ // Set the default values:
++ measurement.SetLumi(1.0);
++ measurement.SetLumiRelErr(.10);
++ measurement.SetBinLow(0);
++ measurement.SetBinHigh(1);
++ measurement.SetExportOnly(false);
++
++ cxcoutIHF << "Creating new measurement:\n";
++
++ // First, get the attributes of the node
++ TListIter attribIt = node->GetAttributes();
++ TXMLAttr *curAttr = nullptr;
++ while ((/**/ curAttr = dynamic_cast<TXMLAttr *>(attribIt()) /**/) != nullptr) {
++ // curAttr is guaranteed non-null above
++ const std::string curAttrName(curAttr->GetName()), curAttrValue(curAttr->GetValue());
++ if (curAttrName == "") {
++ cxcoutEHF << "Found XML attribute in Measurement with no name.\n";
++ // ADD Output Here
++ throw hf_exc();
++ } else if (curAttrName == "Name") {
++ measurement.SetName(curAttrValue.c_str());
++ } else if (curAttrName == "Lumi") {
++ measurement.SetLumi(std::stof(curAttrValue));
++ } else if (curAttrName == "LumiRelErr") {
++ measurement.SetLumiRelErr(std::stof(curAttrValue));
++ } else if (curAttrName == "BinLow") {
++ measurement.SetBinLow(std::stoi(curAttrValue));
++ } else if (curAttrName == "BinHigh") {
++ measurement.SetBinHigh(std::stoi(curAttrValue));
++ } else if (curAttrName == "Mode") {
++ cout << "\n INFO: Mode attribute is deprecated and no longer supported, will ignore\n";
++ } else if (curAttrName == "ExportOnly") {
++ measurement.SetExportOnly(CheckTrueFalse(curAttrValue, "Measurement"));
++ } else {
++ cxcoutEHF << "Found unknown XML attribute in Measurement: " << curAttrName << "\n";
++ throw hf_exc();
+ }
+- //poi// measurement.SetPOI( child->GetText() );
+- AddSubStrings( measurement.GetPOIList(), child->GetText() );
+- }
+-
+- else if( child->GetNodeName() == TString( "ParamSetting" ) ) {
+- TListIter paramIt = child->GetAttributes();
+- TXMLAttr* curParam = 0;
+- while( ( curParam = dynamic_cast< TXMLAttr* >( paramIt() ) ) != 0 ) {
+-
+- if( curParam->GetName() == TString( "" ) ) {
+- cxcoutEHF << "Error: Found tag attribute with no name in ParamSetting" << std::endl;
+- throw hf_exc();
+- }
+- else if( curParam->GetName() == TString( "Const" ) ) {
+- if(curParam->GetValue()==TString("True")){
+- // Fix here...?
+- if( child->GetText() == NULL ) {
+- cxcoutEHF << "Error: node: " << child->GetName()
+- << " has no text." << std::endl;
+- throw hf_exc();
+- }
+- AddSubStrings( measurement.GetConstantParams(), child->GetText() );
+- }
+- }
+- else if( curParam->GetName() == TString( "Val" ) ) {
+- double val = atof(curParam->GetValue());
+- if( child->GetText() == NULL ) {
+- cxcoutEHF << "Error: node: " << child->GetName()
+- << " has no text." << std::endl;
+- throw hf_exc();
+- }
+- std::vector<std::string> child_nodes = GetChildrenFromString(child->GetText());
+- for(unsigned int i = 0; i < child_nodes.size(); ++i) {
+- measurement.SetParamValue( child_nodes.at(i), val);
+- }
+- // AddStringValPairToMap( measurement.GetParamValues(), val, child->GetText() );
+- }
+- else {
+- cxcoutEHF << "Found tag attribute with unknown name in ParamSetting: "
+- << curAttr->GetName() << std::endl;
+- throw hf_exc();
+- }
++ } // End Loop over attributes
++
++ // Then, get the properties of the children nodes
++ TXMLNode *child = node->GetChildren();
++ while (child != nullptr) {
++ const std::string childName(child->GetName()), childNodeName(child->GetNodeName()), childText(child->GetText());
++ if (childNodeName.empty()) {
++ cxcoutEHF << "Found XML child node of Measurement with no name\n";
++ throw hf_exc();
++ } else if (childNodeName == "POI") {
++ if (childText == "") {
++ cxcoutEHF << "Error: node: " << childName << " has no text.\n";
++ throw hf_exc();
++ }
++ // poi // measurement.SetPOI(childText);
++ AddSubStrings(measurement.GetPOIList(), childText);
++ } else if (childNodeName == "ParamSetting") {
++ TListIter paramIt = child->GetAttributes();
++ TXMLAttr *curParam = nullptr;
++ while ((/**/ curParam = dynamic_cast<TXMLAttr *>(paramIt()) /**/) != nullptr) {
++ // curParam is guaranteed non-null above
++ const std::string curParamName(curParam->GetName());
++ if (curParamName.empty()) {
++ cxcoutEHF << "Error: Found tag attribute with no name in ParamSetting\n";
++ throw hf_exc();
++ } else if (curParamName == "Const") {
++ if (curParam->GetValue() == TString("True")) {
++ // Fix here...?
++ if (childText.empty()) {
++ cxcoutEHF << "Error: node: " << childName << " has no text.\n";
++ throw hf_exc();
++ }
++ AddSubStrings(measurement.GetConstantParams(), childText);
++ }
++ } else if (curParamName == "Val") {
++ double val = atof(curParam->GetValue());
++ if (childText.empty()) {
++ cxcoutEHF << "Error: node: " << childName << " has no text.\n";
++ throw hf_exc();
++ }
++ std::vector<std::string> child_nodes = GetChildrenFromString(childText);
++ for (size_t i = 0; i < child_nodes.size(); ++i) {
++ measurement.SetParamValue(child_nodes.at(i), val);
++ }
++ } else {
++ cxcoutEHF << "Found tag attribute with unknown name in ParamSetting: " << curParamName << "\n";
++ throw hf_exc();
++ }
++ }
++ } else if (childNodeName == "Asimov") {
++ // Now, create and configure an asimov object
++ // and add it to the measurement
++ RooStats::HistFactory::Asimov asimov;
++ std::string ParamFixString;
++
++ // Loop over attributes
++ attribIt = child->GetAttributes();
++ curAttr = nullptr;
++ while ((/**/ curAttr = dynamic_cast<TXMLAttr *>(attribIt()) /**/) != nullptr) {
++ const std::string curAttrName(curAttr->GetName()), curAttrValue(curAttr->GetValue());
++ if (curAttrName.empty()) {
++ cxcoutEHF << "Error: Found tag attribute with no name in ConstraintTerm\n";
++ throw hf_exc();
++ } else if (curAttrName == "Name") {
++ asimov.SetName(curAttrValue);
++ } else if (curAttrName == "FixParams") {
++ ParamFixString = curAttrValue;
++ } else {
++ cxcoutEHF << "Found tag attribute with unknown name in ConstraintTerm: " << curAttrName << "\n";
++ throw hf_exc();
++ }
++ }
++
++ // Add any parameters to the asimov dataset
++ // to be fixed during the fitting and dataset generation
++ if (ParamFixString.empty()) {
++ cxcoutWHF << "Warning: Asimov Dataset with name: " << asimov.GetName()
++ << " added, but no parameters are set to be fixed\n";
++ } else {
++ AddParamsToAsimov(asimov, ParamFixString);
++ }
++ measurement.AddAsimovDataset(asimov);
++ } else if (childNodeName == "ConstraintTerm") {
++ std::vector<string> syst;
++ std::string type = "";
++ double rel = 0;
++
++ // Get the list of parameters in this tag:
++ if (childText.empty()) {
++ cxcoutEHF << "Error: node: " << childName << " has no text\n";
++ throw hf_exc();
++ }
++ AddSubStrings(syst, childText);
++
++ // Now, loop over this tag's attributes
++ attribIt = child->GetAttributes();
++ curAttr = nullptr;
++ while ((/**/ curAttr = dynamic_cast<TXMLAttr *>(attribIt()) /**/) != nullptr) {
++ const std::string curAttrName(curAttr->GetName()), curAttrValue(curAttr->GetValue());
++ if (curAttrName.empty()) {
++ cxcoutEHF << "Error: Found tag attribute with no name in ConstraintTerm\n";
++ throw hf_exc();
++ } else if (curAttrName == "Type") {
++ type = curAttrValue;
++ } else if (curAttrName == "RelativeUncertainty") {
++ rel = std::stof(curAttrValue);
++ } else {
++ cxcoutEHF << "Found tag attribute with unknown name in ConstraintTerm: " << curAttrName << "\n";
++ throw hf_exc();
++ }
++ } // End Loop over tag attributes
++
++ // Now, fill the maps, depending on the type:
++ if (rel != 0) {
++ if (type == "Gamma") {
++ for (const auto &isyst : syst) {
++ // Fix Here...?
++ measurement.GetGammaSyst()[isyst] = rel;
++ }
++ } else if (type == "Uniform") {
++ for (const auto &isyst : syst) {
++ // Fix Here...?
++ measurement.GetUniformSyst()[isyst] = rel;
++ }
++ } else if (type == "LogNormal") {
++ for (const auto &isyst : syst) {
++ // Fix Here...?
++ measurement.GetLogNormSyst()[isyst] = rel;
++ }
++ }
++ } else if (type == "NoConstraint") {
++ for (const auto &isyst : syst) {
++ // Fix Here...?
++ measurement.GetNoSyst()[isyst] = 1.0; // MB : dummy value
++ }
++ } else {
++ // only Gamma, Uniform, LogNormal and NoConstraint are valid types
++ cxcoutEHF << "Error: Encountered unknown type for ConstraintTerm: " << type << "\n";
++ throw hf_exc();
++ }
++ // End adding of Constraint terms
++ } else if (IsAcceptableNode(child)) {
++ /* do nothing */
++ } else {
++ cxcoutEHF << "Found XML child of Measurement with unknown name: " << childNodeName << "\n";
++ throw hf_exc();
+ }
+- }
+-
+- else if( child->GetNodeName() == TString( "Asimov" ) ) {
+-
+- //std::string name;
+- //std::map<string, double> fixedParams;
++ child = child->GetNextNode();
++ }
+
+- // Now, create and configure an asimov object
+- // and add it to the measurement
+- RooStats::HistFactory::Asimov asimov;
+- std::string ParamFixString;
+-
+- // Loop over attributes
+- attribIt = child->GetAttributes();
+- curAttr = 0;
+- while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
+-
+- if( curAttr->GetName() == TString( "" ) ) {
+- cxcoutEHF << "Error: Found tag attribute with no name in ConstraintTerm" << std::endl;
+- throw hf_exc();
+- }
+-
+- else if( curAttr->GetName() == TString( "Name" ) ) {
+- std::string name = curAttr->GetValue();
+- asimov.SetName( name );
+- }
+-
+- else if( curAttr->GetName() == TString( "FixParams" ) ) {
+- ParamFixString = curAttr->GetValue();
+- //std::map<std::string, double> fixedParams = ExtractParamMapFromString(FixParamList);
+- //asimov.GetFixedParams() = fixedParams;
+- }
+-
+- else {
+- cxcoutEHF << "Found tag attribute with unknown name in ConstraintTerm: "
+- << curAttr->GetName() << std::endl;
+- throw hf_exc();
+- }
+-
+- }
+-
+- // Add any parameters to the asimov dataset
+- // to be fixed during the fitting and dataset generation
+- if( ParamFixString=="" ) {
+- cxcoutWHF << "Warning: Asimov Dataset with name: " << asimov.GetName()
+- << " added, but no parameters are set to be fixed" << std::endl;
+- }
+- else {
+- AddParamsToAsimov( asimov, ParamFixString );
+- }
+-
+- measurement.AddAsimovDataset( asimov );
+-
+- }
+-
+- else if( child->GetNodeName() == TString( "ConstraintTerm" ) ) {
+- vector<string> syst;
+- string type = "";
+- double rel = 0;
+-
+- map<string,double> gammaSyst;
+- map<string,double> uniformSyst;
+- map<string,double> logNormSyst;
+-
+- // Get the list of parameters in this tag:
+- if( child->GetText() == NULL ) {
+- cxcoutEHF << "Error: node: " << child->GetName()
+- << " has no text." << std::endl;
+- throw hf_exc();
+- }
+- AddSubStrings(syst, child->GetText());
+-
+- // Now, loop over this tag's attributes
+- attribIt = child->GetAttributes();
+- curAttr = 0;
+- while( ( curAttr = dynamic_cast< TXMLAttr* >( attribIt() ) ) != 0 ) {
+-
+- if( curAttr->GetName() == TString( "" ) ) {
+- cxcoutEHF << "Error: Found tag attribute with no name in ConstraintTerm" << std::endl;
+- throw hf_exc();
+- }
+-
+- else if( curAttr->GetName() == TString( "Type" ) ) {
+- type = curAttr->GetValue();
+- }
+-
+- else if( curAttr->GetName() == TString( "RelativeUncertainty" ) ) {
+- rel = atof(curAttr->GetValue());
+- }
+-
+- else {
+- cxcoutEHF << "Found tag attribute with unknown name in ConstraintTerm: "
+- << curAttr->GetName() << std::endl;
+- throw hf_exc();
+- }
+-
+- } // End Loop over tag attributes
+-
+-
+- // Now, fill the maps, depending on the type:
+-
+- // Check that the type is in the correct form:
+- if( ! (type=="Gamma" || type=="Uniform" ||
+- type=="LogNormal" || type=="NoConstraint") ) {
+- cxcoutEHF << "Error: Encountered unknown type for ConstraintTerm: " << type << std::endl;
+- throw hf_exc();
+- }
+-
+- if (type=="Gamma" && rel!=0) {
+- for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
+- // Fix Here...?
+- measurement.GetGammaSyst()[(*it).c_str()] = rel;
+- }
+- }
+-
+- if (type=="Uniform" && rel!=0) {
+- for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
+- // Fix Here...?
+- measurement.GetUniformSyst()[(*it).c_str()] = rel;
+- }
+- }
+-
+- if (type=="LogNormal" && rel!=0) {
+- for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
+- // Fix Here...?
+- measurement.GetLogNormSyst()[(*it).c_str()] = rel;
+- }
+- }
+-
+- if (type=="NoConstraint") {
+- for (vector<string>::const_iterator it=syst.begin(); it!=syst.end(); ++it) {
+- // Fix Here...?
+- measurement.GetNoSyst()[(*it).c_str()] = 1.0; // MB : dummy value
+- }
+- }
+- } // End adding of Constraint terms
+-
+-
+- else if( IsAcceptableNode( child ) ) { ; }
+-
+- else {
+- cxcoutEHF << "Found XML child of Measurement with unknown name: " << child->GetNodeName()
+- << std::endl;
+- throw hf_exc();
+- }
+-
+- child = child->GetNextNode();
+- }
+-
+- measurement.PrintTree(oocoutI(static_cast<TObject*>(nullptr), HistFactory));
+-
+- return measurement;
++ measurement.PrintTree(oocoutI(static_cast<TObject *>(nullptr), HistFactory));
+
++ return measurement;
+ }
+
+-
+-
+ HistFactory::Channel ConfigParser::ParseChannelXMLFile( string filen ) {
+
+ /*
+diff --git a/roofit/roofitcore/inc/RooAbsCollection.h b/roofit/roofitcore/inc/RooAbsCollection.h
+index 5c2d733a06..0ea54abd33 100644
+--- a/roofit/roofitcore/inc/RooAbsCollection.h
++++ b/roofit/roofitcore/inc/RooAbsCollection.h
+@@ -179,14 +179,17 @@ public:
+ removeAll();
+ }
+
+- inline Int_t getSize() const {
+- // Return the number of elements in the collection
+- return _list.size();
++ inline Int_t getSize() const R__SUGGEST_ALTERNATIVE("size() returns true size.")
++ {
++ // Return the number of elements in the collection
++ return _list.size();
+ }
+-
+- inline RooAbsArg *first() const {
+- // Return the first element in this collection
+- return _list.front();
++
++ inline RooAbsArg *first() const
++ {
++ // Return the first element in this collection
++ // calling front on an empty container is undefined
++ return _list.empty() ? nullptr : _list.front();
+ }
+
+ RooAbsArg * operator[](Storage_t::size_type i) const {
+diff --git a/roofit/roofitcore/src/RooAddModel.cxx b/roofit/roofitcore/src/RooAddModel.cxx
+index cc72e8e55a..ce072f9eb7 100644
+--- a/roofit/roofitcore/src/RooAddModel.cxx
++++ b/roofit/roofitcore/src/RooAddModel.cxx
+@@ -97,63 +97,71 @@ RooAddModel::RooAddModel(const char *name, const char *title, const RooArgList&
+ _coefList("!coefficients","List of coefficients",this),
+ _haveLastCoef(kFALSE),
+ _allExtendable(kFALSE)
+-{
+- if (inPdfList.getSize()>inCoefList.getSize()+1) {
+- coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName()
+- << ") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1" << endl ;
+- assert(0) ;
+- }
+-
+- // Constructor with N PDFs and N or N-1 coefs
+- TIterator* pdfIter = inPdfList.createIterator() ;
+- TIterator* coefIter = inCoefList.createIterator() ;
+- RooAbsPdf* pdf ;
+- RooAbsReal* coef ;
+-
+- while((coef = (RooAbsPdf*)coefIter->Next())) {
+- pdf = (RooAbsPdf*) pdfIter->Next() ;
+- if (!pdf) {
+- coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName()
+- << ") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1" << endl ;
+- assert(0) ;
+- }
+- if (!dynamic_cast<RooAbsReal*>(coef)) {
+- coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName() << ") coefficient " << coef->GetName() << " is not of type RooAbsReal, ignored" << endl ;
+- continue ;
+- }
+- if (!dynamic_cast<RooAbsReal*>(pdf)) {
+- coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName() << ") pdf " << pdf->GetName() << " is not of type RooAbsPdf, ignored" << endl ;
+- continue ;
+- }
+- _pdfList.add(*pdf) ;
+- _coefList.add(*coef) ;
+- }
+-
+- pdf = (RooAbsPdf*) pdfIter->Next() ;
+- if (pdf) {
+- if (!dynamic_cast<RooAbsReal*>(pdf)) {
+- coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName() << ") last pdf " << coef->GetName() << " is not of type RooAbsPdf, fatal error" << endl ;
+- assert(0) ;
+- }
+- _pdfList.add(*pdf) ;
+- } else {
+- _haveLastCoef=kTRUE ;
+- }
+-
+- delete pdfIter ;
+- delete coefIter ;
+-
+- _coefCache = new Double_t[_pdfList.getSize()] ;
+- _coefErrCount = _errorCount ;
++{
++ if (inPdfList.size() > inCoefList.size() + 1 || inPdfList.size() < inCoefList.size()) {
++ std::stringstream msgSs;
++ msgSs << "RooAddModel::RooAddModel(" << GetName()
++ << ") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1";
++ const std::string msgStr = msgSs.str();
++ coutE(InputArguments) << msgStr << "\n";
++ throw std::runtime_error(msgStr);
++ }
++
++ // Constructor with N PDFs and N or N-1 coefs
++ auto pdfIter = inPdfList.fwdIterator();
++
++ for (auto const &coef : inCoefList) {
++ auto pdf = pdfIter.next();
++ if (!pdf) {
++ std::stringstream msgSs;
++ msgSs << "RooAddModel::RooAddModel(" << GetName()
++ << ") number of pdfs and coefficients inconsistent, must have Npdf=Ncoef or Npdf=Ncoef+1";
++ const std::string msgStr = msgSs.str();
++ coutE(InputArguments) << msgStr << "\n";
++ throw std::runtime_error(msgStr);
++ }
++ if (!coef) {
++ coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName()
++ << ") encountered and undefined coefficient, ignored\n";
++ continue;
++ }
++ if (!dynamic_cast<RooAbsReal *>(coef)) {
++ auto coefName = coef->GetName();
++ coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName() << ") coefficient "
++ << (coefName != nullptr ? coefName : "") << " is not of type RooAbsReal, ignored\n";
++ continue;
++ }
++ if (!dynamic_cast<RooAbsPdf *>(pdf)) {
++ coutE(InputArguments) << "RooAddModel::RooAddModel(" << GetName() << ") pdf " << pdf->GetName()
++ << " is not of type RooAbsPdf, ignored\n";
++ continue;
++ }
++ _pdfList.add(*pdf);
++ _coefList.add(*coef);
++ }
++
++ if (auto pdf = pdfIter.next()) {
++ if (!dynamic_cast<RooAbsPdf *>(pdf)) {
++ std::stringstream msgSs;
++ msgSs << "RooAddModel::RooAddModel(" << GetName() << ") last pdf " << pdf->GetName()
++ << " is not of type RooAbsPdf, fatal error";
++ const std::string msgStr = msgSs.str();
++ coutE(InputArguments) << msgStr << "\n";
++ throw std::runtime_error(msgStr);
++ }
++ _pdfList.add(*pdf);
++ } else {
++ _haveLastCoef = kTRUE;
++ }
+
+- if (ownPdfList) {
+- _ownedComps.addOwned(_pdfList) ;
+- }
++ _coefCache = new Double_t[_pdfList.getSize()];
++ _coefErrCount = _errorCount;
+
++ if (ownPdfList) {
++ _ownedComps.addOwned(_pdfList);
++ }
+ }
+
+-
+-
+ ////////////////////////////////////////////////////////////////////////////////
+ /// Copy constructor
+
+diff --git a/roofit/roofitcore/src/RooDataHist.cxx b/roofit/roofitcore/src/RooDataHist.cxx
+index 5bd49acdbe..3b132c7766 100644
+--- a/roofit/roofitcore/src/RooDataHist.cxx
++++ b/roofit/roofitcore/src/RooDataHist.cxx
+@@ -573,10 +573,17 @@ void RooDataHist::importDHistSet(const RooArgList& /*vars*/, RooCategory& indexC
+ void RooDataHist::_adjustBinning(RooRealVar &theirVar, const TAxis &axis,
+ RooRealVar *ourVar, Int_t *offset)
+ {
+- if (!dynamic_cast<RooRealVar*>(ourVar)) {
+- coutE(InputArguments) << "RooDataHist::adjustBinning(" << GetName() << ") ERROR: dimension " << ourVar->GetName() << " must be real" << endl ;
+- assert(0) ;
+- }
++ // RooRealVar is derived from RooAbsRealLValue which is itself
++ // derived from RooAbsReal and a virtual class RooAbsLValue
++ // supplying setter fuctions, check if ourVar is indeed derived
++ // as real
++ if (!dynamic_cast<RooAbsReal *>(ourVar)) {
++ std::string ourVarName(ourVar->GetName());
++ coutE(InputArguments) << "RooDataHist::adjustBinning(" << GetName() << ") ERROR: dimension " << ourVarName
++ << " must be real\n";
++ throw std::logic_error("Incorrect type object (" + ourVarName +
++ ") passed as argument to RooDataHist::_adjustBinning. Please report this issue.");
++ }
+
+ const double xlo = theirVar.getMin();
+ const double xhi = theirVar.getMax();
+diff --git a/roofit/roofitcore/src/RooRealSumFunc.cxx b/roofit/roofitcore/src/RooRealSumFunc.cxx
+index cbff7435b6..6e9fa40f5d 100644
+--- a/roofit/roofitcore/src/RooRealSumFunc.cxx
++++ b/roofit/roofitcore/src/RooRealSumFunc.cxx
+@@ -152,8 +152,9 @@ RooRealSumFunc::RooRealSumFunc(const char *name, const char *title, const RooArg
+ func = (RooAbsReal *)funcIter->Next();
+ if (func) {
+ if (!dynamic_cast<RooAbsReal *>(func)) {
+- coutE(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName() << ") last func " << coef->GetName()
+- << " is not of type RooAbsReal, fatal error" << endl;
++ auto funcName = func->GetName();
++ coutE(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName() << ") last func "
++ << (funcName != nullptr ? funcName : "") << " is not of type RooAbsReal, fatal error\n";
+ assert(0);
+ }
+ _funcList.add(*func);
+diff --git a/tmva/tmva/src/DNN/Architectures/Reference/DataLoader.cxx b/tmva/tmva/src/DNN/Architectures/Reference/DataLoader.cxx
+index 2465abf308..1724805382 100644
+--- a/tmva/tmva/src/DNN/Architectures/Reference/DataLoader.cxx
++++ b/tmva/tmva/src/DNN/Architectures/Reference/DataLoader.cxx
+@@ -145,6 +145,9 @@ void TDataLoader<TMVAInput_t, TReference<Real_t>>::CopyInput(TMatrixT<Real_t> &m
+ template <>
+ void TDataLoader<TMVAInput_t, TReference<Real_t>>::CopyOutput(TMatrixT<Real_t> &matrix, IndexIterator_t sampleIterator)
+ {
++ // calling front on an empty container is undfined
++ if (std::get<0>(fData).empty())
++ return;
+ Event *event = std::get<0>(fData).front();
+ const DataSetInfo &info = std::get<1>(fData);
+ Int_t m = matrix.GetNrows();
+@@ -177,6 +180,9 @@ void TDataLoader<TMVAInput_t, TReference<Real_t>>::CopyOutput(TMatrixT<Real_t> &
+ template <>
+ void TDataLoader<TMVAInput_t, TReference<Real_t>>::CopyWeights(TMatrixT<Real_t> &matrix, IndexIterator_t sampleIterator)
+ {
++ // calling front on an empty container is undfined
++ if (std::get<0>(fData).empty())
++ return;
+ Event *event = std::get<0>(fData).front();
+ for (Int_t i = 0; i < matrix.GetNrows(); i++) {
+ Int_t sampleIndex = *sampleIterator++;
+@@ -190,6 +196,9 @@ template <>
+ void TDataLoader<TMVAInput_t, TReference<Double_t>>::CopyInput(TMatrixT<Double_t> &matrix,
+ IndexIterator_t sampleIterator)
+ {
++ // calling front on an empty container is undfined
++ if (std::get<0>(fData).empty())
++ return;
+ Event *event = std::get<0>(fData).front();
+ Int_t m = matrix.GetNrows();
+ Int_t n = event->GetNVariables();
+@@ -210,6 +219,9 @@ template <>
+ void TDataLoader<TMVAInput_t, TReference<Double_t>>::CopyOutput(TMatrixT<Double_t> &matrix,
+ IndexIterator_t sampleIterator)
+ {
++ // calling front on an empty container is undfined
++ if (std::get<0>(fData).empty())
++ return;
+ Event *event = std::get<0>(fData).front();
+ const DataSetInfo &info = std::get<1>(fData);
+ Int_t m = matrix.GetNrows();
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-11-12 01:03:31 UTC (rev 1042821)
+++ PKGBUILD 2021-11-12 01:03:59 UTC (rev 1042822)
@@ -7,7 +7,7 @@
pkgbase=root
pkgname=('root' 'root-cuda')
pkgver=6.24.06
-pkgrel=4
+pkgrel=5
pkgdesc='C++ data analysis framework and interpreter from CERN'
arch=('x86_64')
url='https://root.cern'
@@ -96,6 +96,7 @@
'jupyter_notebook_config.py'
'nbman-for-arch.patch'
'8351.patch'
+ '9271.patch'
'thisroot.fail'
)
sha512sums=('356d6287df2900de9e831347d9513f444bf7cbd29c39fbb5841051ae877dac1e22dc255c64166cd3925b82aac860ae67ef6ce171732c16fd23d7919a47e7cb5a'
@@ -107,7 +108,8 @@
'1c905ee7a3f8f5f3f567d957f9be6b503a8631565d4d9b9bfea5e496ef86865c5a8be1a1f8c7842754029879cf0afd2465249f532a116cc43660aa2e460ae682'
'12814f50b7016bd86d3f91e0e31c052783a0c0fa72b7d6a072d3ae6f86c2437323d585e531235377ebbfdd9cb76abd7da84d9631de821151547f1d4b13417e69'
'870740fbbd678056dd71b275c5d96f9b0db503ca8e0e9e84f784c3115aae66bb28a1eb531f665c1c8306a52686e5ce484ef65b3194bef6cb0d631664ccb1e3f9'
- 'ff555ac4db568affe139701907f86d919a2206f3e304f69dd317b756ea0904b5934d9364a524060778aa507809ce78448621619bb34039ba34c5a71af71a4a8c')
+ 'c31ac51da9acbde068dea230e30445e0428a082c56f2e899ffc1113ed4c391a165cbe54c5d6d0fe9858bfd2ed177075349ab749d0c5b8c68413dd852a398da2d'
+ '3b9e382480b28f60af0b096ac9a42e6ba611b899717988bdebffd5aeabab054e37a28a7421f4a0f39198638c31f56a657a8a9ccc3db54a87daf50d43d35b1ca9')
get_pyver () {
python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
Modified: thisroot.fail
===================================================================
--- thisroot.fail 2021-11-12 01:03:31 UTC (rev 1042821)
+++ thisroot.fail 2021-11-12 01:03:59 UTC (rev 1042822)
@@ -4,9 +4,46 @@
# configure ROOT on Arch. Notify user and
# return an error
+# default behaviour
+__THIS_ROOT_ERROR_AS_WARNING__=0
+__THIS_ROOT_RETURNCODE__=1
+__THIS_ROOT_MESSAGE__='ERROR'
+__THIS_ROOT_REGEX_TEST__='^(no|n|0|off)$'
+
+
function fail {
printf '%s\n' "$1" >&2
- exit "${2:-$1}"
+ return "${2:-$1}"
}
-fail "ERROR: $(basename $0) should never be used!" 1
+# [FS#71639](https://bugs.archlinux.org/task/71639)
+if [[ ! -z "${THIS_ROOT_ERROR_AS_WARNING}" ]]; then
+ THIS_ROOT_ERROR_AS_WARNING=$(echo "${THIS_ROOT_ERROR_AS_WARNING}" | tr '[:upper:]' '[:lower:]')
+ if [[ ! ${THIS_ROOT_ERROR_AS_WARNING} =~ ${__THIS_ROOT_REGEX_TEST__} ]]; then
+ __THIS_ROOT_ERROR_AS_WARNING__=1
+ fi
+fi
+
+if [[ ${__THIS_ROOT_ERROR_AS_WARNING__} -eq 1 ]]; then
+ __THIS_ROOT_RETURNCODE__=0
+ __THIS_ROOT_MESSAGE__='WARNING'
+fi
+
+__THIS_ROOT_CORE_MESSAGE__="""${__THIS_ROOT_MESSAGE__}: thisroot.sh type scripts are no longer supported.
+They should never be used! This includes their other forms: thisroot.csh, thisroot.fish, etc."""
+
+__THIS_ROOT_ERROR_EXTRA_MESSAGE__="""If you would prefer to see this error as a warning, please use the
+environment variable 'THIS_ROOT_ERROR_AS_WARNING'.
+For example, you may run your original command like so:
+ THIS_ROOT_ERROR_AS_WARNING=1 mycommand
+or even:
+ THIS_ROOT_ERROR_AS_WARNING=ON mycommand"""
+
+if [[ ${__THIS_ROOT_ERROR_AS_WARNING__} -eq 1 ]]; then
+ __THIS_ROOT_FINAL_MESSAGE__="${__THIS_ROOT_CORE_MESSAGE__}"
+else
+ __THIS_ROOT_FINAL_MESSAGE__="""${__THIS_ROOT_CORE_MESSAGE__}
+${__THIS_ROOT_ERROR_EXTRA_MESSAGE__=}"""
+fi
+
+fail "${__THIS_ROOT_FINAL_MESSAGE__}" ${__THIS_ROOT_RETURNCODE__}
More information about the arch-commits
mailing list