Skip to content
Snippets Groups Projects

Draft: helpers to compare geomodel subtrees, material validation

Closed Sarka Todorova requested to merge todorova/athena:main-gm_cnv into main
6 unresolved threads

Tentative implementation of algorithm to compare subsets of a GeoModel tree, or separate GM trees. Importing generic code for mass evaluation and printout from MuonTrackingGeometry.

TODO : a) find out which part of the functionality is, or should be, handled by the GeoModel b) resolve crashes occuring in the readout of GeoFullPhysVol subtree from the database b) turn helpers into AlgTools for proper initialization ?

Merge request reports

Approval is optional

Closed by Sarka TodorovaSarka Todorova 1 year ago (Nov 27, 2023 9:57am UTC)

Merge details

  • The changes were not merged into main.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
608 945 decodeShape(shA);
609 946 }
610 947 }
948
949 bool Trk::GeoShapeConverter::compareShapes( const GeoShape* sh1, const GeoShape* sh2 ) const {
  • It is possible that two shapes are actually the same shared instance; and in that case it's also quite probable that the logical volumes are also shared. And even physical volumes may be shared. I believe that you will produce much faster code if you check for these conditions before comparing member data. Did I miss these check?

  • no, you did not miss it, there is no check for shared instances yet. I'll add it, thanks for the suggestion.

  • Please register or sign in to reply
  • 12 12 #include "TrkGeometry/MaterialProperties.h"
    13 13 //Eigen
    14 14 #include "GeoPrimitives/GeoPrimitives.h"
    15 #include "GaudiKernel/IRndmGenSvc.h"
    16 #include "GaudiKernel/RndmGenerators.h"
  • 26 @class GeoPhysVolConverter
    27
    28 A helper class that browses the GeoModel tree for validation purposes
    29
    30 @author sarka.todorova@cern.ch
    31 */
    32
    33 class GeoPhysVolConverter {
    34
    35 public:
    36 /** Default constructor*/
    37 GeoPhysVolConverter()
    38 {}
    39
    40 /** Destructor*/
    41 virtual ~GeoPhysVolConverter(){}
    • Comment on lines +37 to +41
      Suggested change
      37 GeoPhysVolConverter()
      38 {}
      39
      40 /** Destructor*/
      41 virtual ~GeoPhysVolConverter(){}
      37 GeoPhysVolConverter() = default;
      38 {}
      39
      40 /** Destructor*/
      41 ~GeoPhysVolConverter() = default;
    • Please register or sign in to reply
  • 18
    19 class GeoMaterial;
    20 class GeoVPhysVol;
    21 class GeoPhysVol;
    22
    23 namespace Trk {
    24
    25 /**
    26 @class GeoPhysVolConverter
    27
    28 A helper class that browses the GeoModel tree for validation purposes
    29
    30 @author sarka.todorova@cern.ch
    31 */
    32
    33 class GeoPhysVolConverter {
  • 29
    30 @author sarka.todorova@cern.ch
    31 */
    32
    33 class GeoPhysVolConverter {
    34
    35 public:
    36 /** Default constructor*/
    37 GeoPhysVolConverter()
    38 {}
    39
    40 /** Destructor*/
    41 virtual ~GeoPhysVolConverter(){}
    42
    43 /** Evaluate mass ( of a part of GeoModel tree ) */
    44 float evaluateMass(const GeoVPhysVol* gv, const Rndm::Numbers* flatDist) const;
  • 117 Amg::RotationMatrix3D rot = transf1.rotation()*transf2.rotation().inverse();
    118 if ( fabs(rot(0,1))>1.e-6 || fabs(rot(0,2))>1.e-6 || fabs(rot(1,2))>1.e-6) return 1000*level+ic*10+7;
    119
    120 const GeoVPhysVol* cv1 = &(*(gv1->getChildVol(ic)));
    121 const GeoVPhysVol* cv2 = &(*(gv2->getChildVol(ic)));
    122
    123 int child_comp = compareGeoVolumes(cv1,cv2,level+1);
    124 if (child_comp!=0) {
    125 return 1000*level+ic*10+8;
    126 }
    127 }
    128
    129 return 0;
    130 }
    131
    132 void Trk::GeoPhysVolConverter::saveToDb(const GeoVPhysVol* pv, std::string filename) {
    • We should consider putting this routine into the GeoModel Kernel. The same applies to the code you have written to compare two Tubes, Cons, Trap, etc.
      Please think to remind us of this as we are about to cut a new release.

    • Here my question is what amount of information one wants to return for non-identical shapes : the example provides a simple encoding of depth, child, and nature of difference (not exactly a user-friendly format, but a decoding can be included as a printout)

    • Please register or sign in to reply
  • Hi @todorova, are you still following up on this?

    Best, Thomas - L2

  • This draft merge can be closed as the code has been partially imported into GeoModel in a separate thread. Some cleanup of this package may follow later on.

  • closed

  • Please register or sign in to reply
    Loading