Draft: helpers to compare geomodel subtrees, material validation
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
Activity
requested review from @boudreau
assigned to @todorova
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?
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(){} 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 { You could let the class inherit from the AthMessaging like it's done e.g. MuonReadoutElement. This way you'll avoid the printlevel and std::cout patterns.
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) { Hi @todorova, are you still following up on this?
Best, Thomas - L2