]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New methods needed in order to srt alignment objects by their geometry level
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Mar 2006 14:54:22 +0000 (14:54 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Mar 2006 14:54:22 +0000 (14:54 +0000)
STEER/AliAlignObj.cxx
STEER/AliAlignObj.h

index ab19f9c394e1792480167f5009e09a4eb2ddd04e..1b198fa658db189fd36edefc8dce4894bd381dcc 100644 (file)
@@ -160,6 +160,32 @@ void AliAlignObj::GetVolUID(ELayerID &layerId, Int_t &modId) const
   layerId = VolUIDToLayer(fVolUID,modId);
 }
 
+//_____________________________________________________________________________
+Int_t AliAlignObj::GetLevel() const
+{
+  // Return the geometry level of
+  // the alignable volume to which
+  // the alignment object is associated
+  TString volpath = fVolPath;
+  return (volpath.CountChar('/')+1);
+}
+
+//_____________________________________________________________________________
+Int_t AliAlignObj::Compare(const TObject *obj) const
+{
+  // Compare the levels of two
+  // alignment objects
+  // Used in the sorting during
+  // the application of alignment
+  // objects to the geometry
+  Int_t level = GetLevel();
+  Int_t level2 = ((AliAlignObj *)obj)->GetLevel();
+  if (level == level2)
+    return 0;
+  else
+    return ((level > level2) ? 1 : -1);
+}
+
 //_____________________________________________________________________________
 void AliAlignObj::AnglesToMatrix(const Double_t *angles, Double_t *rot) const
 {
index c0ffdbf0257a7ad99429a7821864f9b8cd775ee8..3746ae05ff11c2ee7f50dcd695612051873eb09a 100644 (file)
@@ -59,6 +59,9 @@ class AliAlignObj : public TObject {
   virtual void GetPars(Double_t transl[], Double_t rot[]) const=0;
   virtual void GetMatrix(TGeoHMatrix& m) const=0;
 
+  Int_t         GetLevel() const;
+  virtual Int_t Compare(const TObject* obj) const;
+
   virtual AliAlignObj& Inverse() const=0;
 
   void  Transform(AliTrackPoint &p) const;