Skip to content

Enable dev3#857

Merged
andresailer merged 2 commits intoAIDASoft:masterfrom
andresailer:enableDev3
Sep 1, 2021
Merged

Enable dev3#857
andresailer merged 2 commits intoAIDASoft:masterfrom
andresailer:enableDev3

Conversation

@andresailer
Copy link
Copy Markdown
Member

CI: Enable Dev3 Again

@andresailer
Copy link
Copy Markdown
Member Author

The tests are failing because creating the Material Mixtures no longer works as before

Here AddElement is called,

TGeoMaterial* frac_mat = mgr.GetMaterial(fracname.c_str());
if ( frac_mat ) {
mix->AddElement(frac_mat, fraction);
continue;
}
printout(WARNING,"DDCMS","+++ Composite material \"%s\" not present!",
fracname.c_str());
}
mix->SetRadLen(0e0);
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,12,0)
mix->ComputeDerivedQuantities();

(which ends up calling other AddElement functions)

Then this !fElements changes the behaviour from before and making the tests fail.
Patching this change out makes the test pass again.

https://github.com/root-project/root/blob/999bfc991631e0894c9cf09e2c2caecea17d0fc5/geom/geom/src/TGeoMaterial.cxx#L796-L807

void TGeoMixture::AddElement(Double_t a, Double_t z, Double_t weight)
{
   TGeoElementTable *table = gGeoManager->GetElementTable();
   if (z<1 || z>table->GetNelements()-1)
      Fatal("AddElement", "Cannot add element having Z=%d to mixture %s", (Int_t)z, GetName());
   Int_t i;
   for (i=0; i<fNelements; i++) {
      if (!fElements && TMath::Abs(z-fZmixture[i])<1.e-6  && TMath::Abs(a-fAmixture[i])<1.e-6) {
         fWeights[i] += weight;
         AverageProperties();
         return;
      }
   }

introduced recently in this PR root-project/root#8556

And then when ComputeDerivedQuantities is called the At(i) returns a nullptr.

stacktrace excerpt from one of the tests

204: #8  0x00007fb01e65b97e in TGeoElement::A (this=0x0) at /build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/geom/geom/inc/TGeoElement.h:76
204: #9  0x00007fb01e65b480 in TGeoMixture::ComputeDerivedQuantities (this=0x37fbb90) at /build/jenkins/workspace/lcg_nightly_pipeline/build/projects/ROOT-HEAD/src/ROOT/HEAD/geom/geom/src/TGeoMaterial.cxx:1221
204: #10 0x00007faffe5851d1 in dd4hep::Converter<dd4hep::(anonymous namespace)::compositematerial, dd4hep::xml::Handle_t>::operator() (this=0x7fff82f96be0, element=...) at ../examples/DDCMS/src/plugins/DDDefinitions2Objects.cpp:520

@andresailer andresailer merged commit 6d9c383 into AIDASoft:master Sep 1, 2021
@andresailer andresailer deleted the enableDev3 branch September 1, 2021 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant