Skip to content

Move deduplication steering flags into the processor registries

Johannes Junggeburth requested to merge RefactorDeDuplFlags into main
  • The deduplication of Transforms mainly caused the differences in !288 (merged). My solution at that time was to switch them off all by hand in the individual class constructors. However, cases slipped through. I've just discovered that there're common processor registries. Spill over the mechanism of deduplication toggling to the registry which switches them all on or off. From C++ / Athena side the end-user can toggle the deduplication mechanisms via:
        GmxInterface gmxInterface;
        gmxInterface.enableLogVolDeDuplication(true);
        gmxInterface.enablePhysVolDeDuplication(true);
        gmxInterface.enableShapeDeDuplication(true);
        gmxInterface.enableTransformDeDuplication(true);
        /// Then pipe the interface to the gmx2Geo class
        Gmx2Geo gmx2Geo(geomodel_xml_dir + std::string("/") + f, muonEnvelope,                        
                        gmxInterface, 0, "", proc);
  • Change return type of the ElementProcessors to be GeoIntrusviePtr<RCBase>
  • Introduce helper methods for the GeoIntrusivePtr make_intrusive, const_pointer_cast, dynamic_pointer_cast
      GeoIntrusivePtr<GeoShape> myBox = make_intrusive<GeoBox>(10,10,10);
      std::cout<<dynamic_pointer_cast<GeoBox>(myBox)->getHalfLengthX()<<std::endl;
  • Change type of GeoNodeList to be a vector of GeoIntrusivePtr

Introduce environment variables to toggle the GeoDeDuplication mechanisms in the GMXPlugin

  export GMX_USE_SHAPEDEDUPL=1 # Remove equivalent instances of shapes
  export GMX_USE_LOGVOLDEDUPL=1 # Remove equivalent instances of logical volumes
  export GMX_USE_PHYSVOLDEDUPL=1 #Remove equivalent istances of physical volumes
  export GMX_USE_TRANSFDEDUPL=1 #Remove equivalent instances of transforms

Tagging : @nstyles, @pagessin, @dshope, @boudreau, @tsulaia, @ncalace, @mbandier

Edited by Johannes Junggeburth

Merge request reports