]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpMotifType.h
Compilation on Windows/Cygwin. Corrected dependences
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifType.h
index b0b30873ae3ae111d3c8f03b6844fe9660e106cb..9b636fa46bcf2f4d5a77e3e33ff7a4fccc811607 100755 (executable)
@@ -2,33 +2,58 @@
  * See cxx source for full Copyright notice                               */
 
 // $Id$
-// $MpId: AliMpMotifType.h,v 1.7 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpMotifType.h,v 1.11 2006/05/24 13:58:18 ivana Exp $
 
 /// \ingroup motif
 /// \class AliMpMotifType
 /// \brief Class that defines the motif properties.
 ///
-/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
+/// \author David Guez, Ivana Hrivnacova; IPN Orsay
 
 #ifndef ALI_MP_MOTIF_TYPE_H
 #define ALI_MP_MOTIF_TYPE_H
 
 #include <TObject.h>
-#include <TString.h>
 
-#include "AliMpMotifTypes.h"
+#include "AliMpContainers.h"
+
 #include "AliMpIntPair.h"
+#ifdef WITH_ROOT
+#include "AliMpExMap.h"
+#endif
+
+#include <TString.h>
+
+#ifdef WITH_STL
+#include <map>
+#endif
 
 class AliMpConnection;
 class AliMpVPadIterator;
 
 class AliMpMotifType : public TObject
 {
+  public:
+#ifdef WITH_STL
+    /// Connection map type
+    typedef std::map< AliMpIntPair, AliMpConnection* > ConnectionMap;
+    /// Connection map iterator type
+    typedef ConnectionMap::const_iterator     ConnectionMapCIterator;
+#endif    
+#ifdef WITH_ROOT
+    /// Connection map type
+    typedef AliMpExMap ConnectionMap;
+#endif    
+
   public:
     AliMpMotifType(const TString &id);
+    AliMpMotifType(const AliMpMotifType& rhs);
+    AliMpMotifType& operator=(const AliMpMotifType& rhs);
     AliMpMotifType();
     virtual ~AliMpMotifType();
 
+    TObject* Clone(const char* newname="") const;
+    
     virtual AliMpVPadIterator* CreateIterator() const;
 
     // find methods
@@ -48,54 +73,47 @@ class AliMpMotifType : public TObject
 
     // set methods
     void SetNofPads(Int_t nofPadsX, Int_t nofPadY);
-    void SetVerboseLevel(Int_t level){fVerboseLevel=level;}
     
     // get methods
+             /// Return unique motif ID
     TString  GetID() const        {return fID;}
+             /// Return number of pads in x direction
     Int_t    GetNofPadsX() const  {return fNofPadsX;}
+             /// Return number of pads in y direction
     Int_t    GetNofPadsY() const  {return fNofPadsY;}
     Int_t    GetNofPads() const;
     
     // Other methods
     void AddConnection(const AliMpIntPair &localIndices, 
                        AliMpConnection* connection);
-    virtual void Print(Option_t *option) const;
+    virtual void Print(Option_t *option="") const;
     Int_t   PadNum(const TString &padName) const;
     TString PadName(Int_t padNum) const;
     Bool_t  HasPad(const AliMpIntPair& localIndices) const;
     Bool_t  IsFull() const;
+    
+    Bool_t Save(const char* motifName) const;
+    Bool_t Save() const;
 
   private:
-    // static data members
-    static const Int_t   fgkPadNumForA; // the pad number for the pad "A"
-
-#ifdef WITH_ROOT
-    static const Int_t   fgkSeparator;  // the separator used for conversion
-                                        // of AliMpIntPair to Int_t
+      void Copy(TObject& o) const;
     
-    // methods
-    Int_t  GetIndex(const AliMpIntPair& pair) const;
-    AliMpIntPair  GetPair(Int_t index) const;
-#endif
+  private:
+    // static data members
+    static const Int_t  fgkPadNumForA; ///< the pad number for the pad "A"
   
     // data members
-    TString   fID;        // unique motif ID
-    Int_t     fNofPadsX;  // number of pads in x direction
-    Int_t     fNofPadsY;  // number of pads in y direction
-    Int_t     fVerboseLevel;  // verbose level
-
-#ifdef WITH_STL
-    ConnectionMap_t fConnections; //! Map (ix,iy) of connections
-#endif    
-#ifdef WITH_ROOT
-    mutable ConnectionMap_t fConnections; // Map (ix,iy) of connections
-#endif    
+    TString   fID;              ///< unique motif ID
+    Int_t     fNofPadsX;        ///< number of pads in x direction
+    Int_t     fNofPadsY;        ///< number of pads in y direction
+    ConnectionMap fConnections; ///< Map (ix,iy) of connections
     
-  ClassDef(AliMpMotifType,1)  //Motif type
+  ClassDef(AliMpMotifType,1)  // Motif type
 };
 
 // inline functions
 
+/// Return true if the motif conatins all pads
 inline Bool_t AliMpMotifType::IsFull() const 
 { return GetNofPads() == fNofPadsX*fNofPadsY; }