diff --git a/DDCore/include/DD4hep/OpticalSurfaceManager.h b/DDCore/include/DD4hep/OpticalSurfaceManager.h index a5029c112c1f7ffc27886c35255bc695a86efa45..07d909ef95729e059d54aef2a31b4688f2c58f12 100644 --- a/DDCore/include/DD4hep/OpticalSurfaceManager.h +++ b/DDCore/include/DD4hep/OpticalSurfaceManager.h @@ -58,7 +58,7 @@ namespace dd4hep { /// static accessor calling DD4hepOpticalSurfaceManagerPlugin if necessary static OpticalSurfaceManager getOpticalSurfaceManager(Detector& description); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// Access skin surface by its full name SkinSurface skinSurface(const std::string& full_name) const; /// Access skin surface by its identifier tuple (DetElement, name) diff --git a/DDCore/include/DD4hep/OpticalSurfaces.h b/DDCore/include/DD4hep/OpticalSurfaces.h index 0cf4c754071ba0f9173096bf088fb1b547b08ebd..13773e525347affac5fcb42eff7b6b06d07e12df 100644 --- a/DDCore/include/DD4hep/OpticalSurfaces.h +++ b/DDCore/include/DD4hep/OpticalSurfaces.h @@ -17,7 +17,7 @@ #include "DD4hep/Volumes.h" #include "DD4hep/DetElement.h" -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) // ROOT include files #include "TGeoOpticalSurface.h" diff --git a/DDCore/include/DD4hep/PropertyTable.h b/DDCore/include/DD4hep/PropertyTable.h index 06f00209c5ca0bcf29af149ea5ca51c3d3923aa7..79f3cc0348b25d712d6ff06d18d89f2408351b23 100644 --- a/DDCore/include/DD4hep/PropertyTable.h +++ b/DDCore/include/DD4hep/PropertyTable.h @@ -14,7 +14,7 @@ #define DD4HEP_DDCORE_PROPERTYTABLE_H #include "RVersion.h" -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) // Framework include files #include "DD4hep/Handle.h" diff --git a/DDCore/include/DD4hep/detail/OpticalSurfaceManagerInterna.h b/DDCore/include/DD4hep/detail/OpticalSurfaceManagerInterna.h index 9d882653193b0d12f93d91a1499ad64494d47b6d..aba07e75ca00834e462af3b541ce5f37dd3e0ca3 100644 --- a/DDCore/include/DD4hep/detail/OpticalSurfaceManagerInterna.h +++ b/DDCore/include/DD4hep/detail/OpticalSurfaceManagerInterna.h @@ -46,7 +46,7 @@ namespace dd4hep { /// Reference to the main detector description object Detector& detector; -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) std::map<LocalKey, SkinSurface> skinSurfaces; std::map<LocalKey, BorderSurface> borderSurfaces; std::map<std::string, OpticalSurface> opticalSurfaces; diff --git a/DDCore/src/OpticalSurfaceManager.cpp b/DDCore/src/OpticalSurfaceManager.cpp index 51259154e5c43ad842e0a67452417644f78bbaf3..1e43b414494e0e1cc8b684ea35bd197d1f056c3e 100644 --- a/DDCore/src/OpticalSurfaceManager.cpp +++ b/DDCore/src/OpticalSurfaceManager.cpp @@ -30,7 +30,7 @@ OpticalSurfaceManager OpticalSurfaceManager::getOpticalSurfaceManager(Detector& return description.surfaceManager(); } -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// Access skin surface by its identifier SkinSurface OpticalSurfaceManager::skinSurface(DetElement de, const string& nam) const { diff --git a/DDCore/src/OpticalSurfaces.cpp b/DDCore/src/OpticalSurfaces.cpp index f459af5c8a9e646c01b18112fc0ae0f252beb058..f816c0855add0c227e81e9a50eb7e8c3212340a5 100644 --- a/DDCore/src/OpticalSurfaces.cpp +++ b/DDCore/src/OpticalSurfaces.cpp @@ -27,7 +27,7 @@ using namespace std; using namespace dd4hep; -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) DD4HEP_INSTANTIATE_HANDLE(TGeoSkinSurface); DD4HEP_INSTANTIATE_HANDLE(TGeoBorderSurface); diff --git a/DDCore/src/PropertyTable.cpp b/DDCore/src/PropertyTable.cpp index 6bc9fecaab6912103857198e5272d8cb399032ca..d42e43d6196b40c13c169af7b25eb524f9ab7dc0 100644 --- a/DDCore/src/PropertyTable.cpp +++ b/DDCore/src/PropertyTable.cpp @@ -26,7 +26,7 @@ using namespace std; using namespace dd4hep; -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) DD4HEP_INSTANTIATE_HANDLE(TGDMLMatrix); diff --git a/DDCore/src/plugins/Compact2Objects.cpp b/DDCore/src/plugins/Compact2Objects.cpp index 1c5e1fbd4a928961d82b2361bea882b45eb3f854..a83390943d938732101b0d91719bfdabee65c814 100644 --- a/DDCore/src/plugins/Compact2Objects.cpp +++ b/DDCore/src/plugins/Compact2Objects.cpp @@ -33,7 +33,7 @@ // Root/TGeo include files #include "TGeoManager.h" #include "TGeoMaterial.h" -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) #include "TGDMLMatrix.h" #endif @@ -78,7 +78,7 @@ namespace dd4hep { template <> void Converter<Property>::operator()(xml_h element) const; template <> void Converter<CartesianField>::operator()(xml_h element) const; template <> void Converter<SensitiveDetector>::operator()(xml_h element) const; -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) template <> void Converter<OpticalSurface>::operator()(xml_h element) const; template <> void Converter<PropertyTable>::operator()(xml_h element) const; #endif @@ -460,7 +460,7 @@ template <> void Converter<Material>::operator()(xml_h e) const { #if ROOT_VERSION_CODE >= ROOT_VERSION(6,12,0) mix->ComputeDerivedQuantities(); #endif -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// In case there were material properties specified: convert them here for(xml_coll_t properties(x_mat, _U(property)); properties; ++properties) { xml_elt_t p = properties; @@ -619,7 +619,7 @@ template <> void Converter<Atom>::operator()(xml_h e) const { } } -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /** Convert compact optical surface objects (defines) * * @@ -1202,7 +1202,7 @@ template <> void Converter<DetElement>::operator()(xml_h element) const { throw runtime_error("Failed to execute subdetector creation plugin. " + dbg.missingFactory(type)); } description.addDetector(det); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) description.surfaceManager().registerSurfaces(det); #endif return; @@ -1402,7 +1402,7 @@ template <> void Converter<Compact>::operator()(xml_h element) const { (Converter<Header>(description))(xml_h(compact.child(_U(info)))); xml_coll_t(compact, _U(properties)).for_each(_U(attributes), Converter<Property>(description)); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// These two must be parsed early, because they are needed by the detector constructors xml_coll_t(compact, _U(properties)).for_each(_U(matrix), Converter<PropertyTable>(description)); xml_coll_t(compact, _U(surfaces)).for_each(_U(opticalsurface), Converter<OpticalSurface>(description)); diff --git a/DDCore/src/plugins/StandardPlugins.cpp b/DDCore/src/plugins/StandardPlugins.cpp index b2971ce384d4a3559cab019a529dfcf50c9fb5f7..a0227d6dd5b18064f8392b84b881adf0417e9086 100644 --- a/DDCore/src/plugins/StandardPlugins.cpp +++ b/DDCore/src/plugins/StandardPlugins.cpp @@ -36,7 +36,7 @@ #include "TSystem.h" #include "TClass.h" #include "TRint.h" -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) #include "TGDMLMatrix.h" #endif @@ -275,7 +275,7 @@ DECLARE_APPLY(DD4hep_InteractiveUI,root_ui) static long root_dump_gdml_tables(Detector& description, int /* argc */, char** /* argv */) { size_t num_tables = 0; size_t num_elements = 0; -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) const TObjArray* c = description.manager().GetListOfGDMLMatrices(); TObjArrayIter arr(c); printout(INFO,"Dump_GDMLTables","+++ Dumping known GDML tables from TGeoManager."); @@ -307,7 +307,7 @@ DECLARE_APPLY(DD4hep_Dump_GDMLTables,root_dump_gdml_tables) static long root_dump_optical_surfaces(Detector& description, int /* argc */, char** /* argv */) { size_t num_surfaces = 0; printout(ALWAYS,"",""); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) const TObjArray* c = description.manager().GetListOfOpticalSurfaces(); TObjArrayIter arr(c); printout(ALWAYS,"Dump_OpticalSurfaces","+++ Dumping known Optical Surfaces from TGeoManager."); @@ -337,7 +337,7 @@ DECLARE_APPLY(DD4hep_Dump_OpticalSurfaces,root_dump_optical_surfaces) static long root_dump_skin_surfaces(Detector& description, int /* argc */, char** /* argv */) { size_t num_surfaces = 0; printout(ALWAYS,"",""); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) const TObjArray* c = description.manager().GetListOfSkinSurfaces(); TObjArrayIter arr(c); printout(ALWAYS,"Dump_SkinSurfaces","+++ Dumping known Skin Surfaces from TGeoManager."); @@ -367,7 +367,7 @@ DECLARE_APPLY(DD4hep_Dump_SkinSurfaces,root_dump_skin_surfaces) static long root_dump_border_surfaces(Detector& description, int /* argc */, char** /* argv */) { size_t num_surfaces = 0; printout(ALWAYS,"",""); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) const TObjArray* c = description.manager().GetListOfBorderSurfaces(); TObjArrayIter arr(c); printout(ALWAYS,"Dump_BorderSurfaces","+++ Dumping known Border Surfaces from TGeoManager."); @@ -517,7 +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) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) virtual void printProperty(elt_h, TNamed* prop, TGDMLMatrix* matrix) { if ( matrix ) ::printf(" Property: %-20s [%ld x %ld] --> %s\n", @@ -534,7 +534,7 @@ 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) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,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())); @@ -566,7 +566,7 @@ 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) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) virtual void printProperty(elt_h mat, TNamed* prop, TGDMLMatrix* /* matrix */) { elt_h elt = mat.addChild(_U(property)); elt.setAttr(_U(name),prop->GetName()); diff --git a/DDG4/include/DDG4/Geant4Converter.h b/DDG4/include/DDG4/Geant4Converter.h index 71478cff1fcd414d3f336463f58d69a4a49c6699..b3c190f65c92126ceee11f2e6e5db0cf6b5ddd90 100644 --- a/DDG4/include/DDG4/Geant4Converter.h +++ b/DDG4/include/DDG4/Geant4Converter.h @@ -68,7 +68,7 @@ namespace dd4hep { /// Create geometry conversion Geant4Converter& create(DetElement top); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// Convert the geometry type material into the corresponding Geant4 object(s). virtual void* handleMaterialProperties(TObject* matrix) const; diff --git a/DDG4/include/DDG4/Geant4GeometryInfo.h b/DDG4/include/DDG4/Geant4GeometryInfo.h index 398809e19f0600bface01be6af5f3ed925c7ccbb..c27f91e4993484eba1c91d3f9826aa301fcab198 100644 --- a/DDG4/include/DDG4/Geant4GeometryInfo.h +++ b/DDG4/include/DDG4/Geant4GeometryInfo.h @@ -106,7 +106,7 @@ namespace dd4hep { PropertyVector() = default; ~PropertyVector() = default; }; -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) std::map<PropertyTable, PropertyVector*> g4OpticalProperties; std::map<OpticalSurface, G4OpticalSurface*> g4OpticalSurfaces; std::map<SkinSurface, G4LogicalSkinSurface*> g4SkinSurfaces; diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index 1b839ef238d4b621a5c28abe181fc8439a943006..63ea9c63bec8943458f96991d8e89b9c20f6bfae 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -404,7 +404,7 @@ void* Geant4Converter::handleMaterial(const string& name, Material medium) const stringstream str; str << (*mat); printout(lvl, "Geant4Converter", "++ Created G4 %s", str.str().c_str()); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// Attach the material properties if any G4MaterialPropertiesTable* tab = 0; TListIter propIt(&material->GetProperties()); @@ -1055,7 +1055,7 @@ void Geant4Converter::handleProperties(Detector::Properties& prp) const { } } -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// Convert the geometry type material into the corresponding Geant4 object(s). void* Geant4Converter::handleMaterialProperties(TObject* matrix) const { TGDMLMatrix* m = (TGDMLMatrix*)matrix; @@ -1147,7 +1147,7 @@ static G4SurfaceType geant4_surface_type(TGeoOpticalSurface::ESurfaceType t) { TO_G4_TYPE(firsov); // for Firsov Process TO_G4_TYPE(x_ray); // for x-ray mirror process default: - printout(ERROR,"Geant4Surfaces","++ Unknown finish style: %d [%s]. Assume polished!", + printout(ERROR,"Geant4Surfaces","++ Unknown surface type: %d [%s]. Assume dielectric_metal!", int(t), TGeoOpticalSurface::TypeToString(t)); return dielectric_metal; } @@ -1157,13 +1157,13 @@ static G4SurfaceType geant4_surface_type(TGeoOpticalSurface::ESurfaceType t) { static G4OpticalSurfaceModel geant4_surface_model(TGeoOpticalSurface::ESurfaceModel m) { #define TO_G4_MODEL(x) case TGeoOpticalSurface::kM##x : return x; switch(m) { - TO_G4_MODEL(glisur); // original GEANT3 model - TO_G4_MODEL(unified); // UNIFIED model - TO_G4_MODEL(LUT); // Look-Up-Table model - TO_G4_MODEL(DAVIS); // DAVIS model + TO_G4_MODEL(glisur); // original GEANT3 model + TO_G4_MODEL(unified); // UNIFIED model + TO_G4_MODEL(LUT); // Look-Up-Table model + TO_G4_MODEL(DAVIS); // DAVIS model TO_G4_MODEL(dichroic); // dichroic filter default: - printout(ERROR,"Geant4Surfaces","++ Unknown finish style: %d [%s]. Assume polished!", + printout(ERROR,"Geant4Surfaces","++ Unknown surface model: %d [%s]. Assume glisur!", int(m), TGeoOpticalSurface::ModelToString(m)); return glisur; } @@ -1370,7 +1370,7 @@ Geant4Converter& Geant4Converter::create(DetElement top) { //outputLevel = WARNING; //setPrintLevel(VERBOSE); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) handleArray(this, geo.manager->GetListOfGDMLMatrices(), &Geant4Converter::handleMaterialProperties); handleArray(this, geo.manager->GetListOfOpticalSurfaces(), &Geant4Converter::handleOpticalSurface); #endif @@ -1389,7 +1389,7 @@ Geant4Converter& Geant4Converter::create(DetElement top) { handleRMap(this, *m_data, &Geant4Converter::handleAssembly); // Now place all this stuff appropriately handleRMap(this, *m_data, &Geant4Converter::handlePlacement); -#if ROOT_VERSION_CODE > ROOT_VERSION(6,16,0) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) /// Handle concrete surfaces handleArray(this, geo.manager->GetListOfSkinSurfaces(), &Geant4Converter::handleSkinSurface); handleArray(this, geo.manager->GetListOfBorderSurfaces(), &Geant4Converter::handleBorderSurface); diff --git a/examples/OpticalSurfaces/src/OpNovice_geo.cpp b/examples/OpticalSurfaces/src/OpNovice_geo.cpp index a54b16ba64a080e1e456714d58f488b2eb26d31e..b941516e5928c1e6071225e1eb93faf1d776dc5f 100644 --- a/examples/OpticalSurfaces/src/OpNovice_geo.cpp +++ b/examples/OpticalSurfaces/src/OpNovice_geo.cpp @@ -44,7 +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) +#if ROOT_VERSION_CODE >= ROOT_VERSION(6,17,0) // Now attach the surface OpticalSurfaceManager surfMgr = description.surfaceManager(); PlacedVolume hallPlace(description.manager().GetTopNode());