diff --git a/DDCore/src/plugins/Compact2Objects.cpp b/DDCore/src/plugins/Compact2Objects.cpp index 2996f421093dfbf5477a203843fe272ccce147c6..1c5e1fbd4a928961d82b2361bea882b45eb3f854 100644 --- a/DDCore/src/plugins/Compact2Objects.cpp +++ b/DDCore/src/plugins/Compact2Objects.cpp @@ -33,7 +33,9 @@ // Root/TGeo include files #include "TGeoManager.h" #include "TGeoMaterial.h" +#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) #include "TGDMLMatrix.h" +#endif // C/C++ include files #include <climits> diff --git a/DDCore/src/plugins/StandardPlugins.cpp b/DDCore/src/plugins/StandardPlugins.cpp index 8495b3701045765c1c3c5bae034cc40ed1f6c62f..c383d75564ddd7323ce4ac7160393af7a7c762a0 100644 --- a/DDCore/src/plugins/StandardPlugins.cpp +++ b/DDCore/src/plugins/StandardPlugins.cpp @@ -517,6 +517,7 @@ static long root_materials(Detector& description, int argc, char** argv) { ::printf(" %-6s Fraction: %7.3f Z=%3d A=%6.2f N=%3d Neff=%6.2f\n", elt->GetName(), frac, elt->Z(), elt->A(), elt->N(), elt->Neff()); } +#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) virtual void printProperty(elt_h, TNamed* prop, TGDMLMatrix* matrix) { if ( matrix ) ::printf(" Property: %-20s [%ld x %ld] --> %s\n", @@ -525,6 +526,7 @@ static long root_materials(Detector& description, int argc, char** argv) { ::printf(" Property: %-20s [ERROR: NO TABLE!] --> %s\n", prop->GetName(), prop->GetTitle()); } +#endif virtual void operator()(TGeoMaterial* mat) { Double_t* mix = mat->IsMixture() ? ((TGeoMixture*)mat)->GetWmixt() : 0; elt_h mh = print(mat); @@ -532,10 +534,12 @@ static long root_materials(Detector& description, int argc, char** argv) { TGeoElement* elt = mat->GetElement(i); print(mh, elt, mix ? mix[i] : 1); } +#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) TListIter mat_iter(&mat->GetProperties()); for(TObject* i = mat_iter.Next(); i; i=mat_iter.Next()) { printProperty(mh, (TNamed*)i, description.manager().GetGDMLMatrix(i->GetTitle())); } +#endif } }; struct MaterialPrintXML : public MaterialPrint { @@ -562,11 +566,13 @@ static long root_materials(Detector& description, int argc, char** argv) { elt.setAttr(_U(n),frac); elt.setAttr(_U(ref),element->GetName()); } +#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) virtual void printProperty(elt_h mat, TNamed* prop, TGDMLMatrix* /* matrix */) { elt_h elt = mat.addChild(_U(property)); elt.setAttr(_U(name),prop->GetName()); elt.setAttr(_U(ref), prop->GetTitle()); } +#endif }; string type = "text", output = "", name = ""; diff --git a/examples/OpticalSurfaces/src/OpNovice_geo.cpp b/examples/OpticalSurfaces/src/OpNovice_geo.cpp index 6d892175829d6a0fa9a356873134d7af1d403861..a54b16ba64a080e1e456714d58f488b2eb26d31e 100644 --- a/examples/OpticalSurfaces/src/OpNovice_geo.cpp +++ b/examples/OpticalSurfaces/src/OpNovice_geo.cpp @@ -44,6 +44,7 @@ static Ref_t create_detector(Detector &description, xml_h e, SensitiveDetector / PlacedVolume tankPlace = description.pickMotherVolume(sdet).placeVolume(tank_vol); sdet.setPlacement(tankPlace); +#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) // Now attach the surface OpticalSurfaceManager surfMgr = description.surfaceManager(); PlacedVolume hallPlace(description.manager().GetTopNode()); @@ -53,6 +54,9 @@ static Ref_t create_detector(Detector &description, xml_h e, SensitiveDetector / BorderSurface bubbleSurf = BorderSurface(description, sdet, "TankBubble", airSurf, bubblePlace, tankPlace); bubbleSurf.isValid(); tankSurf.isValid(); +#else + bubblePlace.isValid(); +#endif return sdet; } DECLARE_DETELEMENT(DD4hep_OpNovice,create_detector)