From 4b94e75398c8c80a27f3c86bcf8ff2c950238866 Mon Sep 17 00:00:00 2001 From: cvetan Date: Thu, 23 Mar 2006 14:54:22 +0000 Subject: [PATCH] New methods needed in order to srt alignment objects by their geometry level --- STEER/AliAlignObj.cxx | 26 ++++++++++++++++++++++++++ STEER/AliAlignObj.h | 3 +++ 2 files changed, 29 insertions(+) diff --git a/STEER/AliAlignObj.cxx b/STEER/AliAlignObj.cxx index ab19f9c394e..1b198fa658d 100644 --- a/STEER/AliAlignObj.cxx +++ b/STEER/AliAlignObj.cxx @@ -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 { diff --git a/STEER/AliAlignObj.h b/STEER/AliAlignObj.h index c0ffdbf0257..3746ae05ff1 100644 --- a/STEER/AliAlignObj.h +++ b/STEER/AliAlignObj.h @@ -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; -- 2.43.0