* See cxx source for full Copyright notice */
// $Id$
-// $MpId: AliMpPad.h,v 1.6 2005/08/26 15:43:36 ivana Exp $
+// $MpId: AliMpPad.h,v 1.11 2006/05/24 13:58:07 ivana Exp $
/// \ingroup basic
/// \class AliMpPad
/// \brief Class which encapsuate all information about a pad
///
-/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
+/// \author David Guez, Ivana Hrivnacova; IPN Orsay
#ifndef ALI_MP_PAD_H
#define ALI_MP_PAD_H
+#include "AliMpEncodePair.h"
+
#include <TObject.h>
-#include <TVector2.h>
-#include "AliMpIntPair.h"
+#include <TClonesArray.h>
class AliMpPad : public TObject
{
public:
- AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices,
- const TVector2& position, const TVector2& dimensions,
- Bool_t validity = true);
+ AliMpPad(Int_t manuId, Int_t channel,
+ Int_t ix, Int_t iy,
+ Double_t x, Double_t y,
+ Double_t dx, Double_t dy,
+ Bool_t validity = true);
+ AliMpPad(Int_t manuId, Int_t channel,
+ MpPair_t indices,
+ Double_t positionX, Double_t positionY,
+ Double_t dx, Double_t dy,
+ Bool_t validity = true);
+
AliMpPad();
AliMpPad(const AliMpPad& src);
- virtual ~AliMpPad();
+ ~AliMpPad();
+ //
// operators
+ //
Bool_t operator == (const AliMpPad& pos2) const;
Bool_t operator != (const AliMpPad& pos2) const;
AliMpPad& operator = (const AliMpPad& src) ;
+ //
// methods
- virtual void Print(const char* /*option*/ = "") const;
+ //
+ void PrintOn(ostream& out) const;
+ void Print(const char* /*option*/ = "") const;
+ //
// static get methods
+ //
+ /// Return invalid pad
static AliMpPad Invalid() {return AliMpPad();}
+ //
+ // set methods
+ //
+ Bool_t AddLocation(Int_t localBoardId, Int_t localBoardChannel,
+ Bool_t warn = true);
+
+ //
// get methods
- AliMpIntPair GetLocation() const {return fLocation ;}
- AliMpIntPair GetIndices() const {return fIndices ;}
- TVector2 Position() const {return fPosition ;}
- TVector2 Dimensions() const {return fDimensions;}
- Bool_t IsValid() const {return fValidity ;}
+ //
+ /// Return pad location as encoded pair (manuId, manuChannel)
+ MpPair_t GetLocation() const { return fLLocation; }
+ Int_t GetManuId() const;
+ Int_t GetManuChannel() const;
+
+ /// Return pad indices as encoded pair (ix, iy)
+ MpPair_t GetIndices() const { return fLIndices; }
+ Int_t GetIx() const;
+ Int_t GetIy() const;
+
+ /// Return the pad x position (in cm)
+ Double_t GetPositionX() const { return fPositionX; }
+ /// Return the pad x position (in cm)
+ Double_t GetPositionY() const { return fPositionY; }
+
+ /// Return the x pad dimension - half length (in cm)
+ Double_t GetDimensionX() const {return fDimensionX;}
+ /// Return the y pad dimension - half length (in cm)
+ Double_t GetDimensionY() const {return fDimensionY;}
+
+ /// Return validity
+ Bool_t IsValid() const {return fValidity ;}
+
+ Int_t GetNofLocations() const;
+ MpPair_t GetLocation(Int_t i) const;
+ Int_t GetLocalBoardId(Int_t i) const;
+ Int_t GetLocalBoardChannel(Int_t i) const;
+
+ Bool_t HasLocation(Int_t localBoardId, Int_t localBoardChannel) const;
private:
- // unused derived functions
- // virtual void Print(const char* /*option*/) const;
+ // static data members
+ static const Int_t fgkMaxNofLocations; ///< \brief maximum number of pad locations
+ /// in the collection
// data members
- AliMpIntPair fLocation; //pad location
- AliMpIntPair fIndices; //pad indices
- TVector2 fPosition; // the pad position (in cm)
- TVector2 fDimensions;// the pad dimensions (in cm)
- Bool_t fValidity; // validity
+ UInt_t fNofLocations; ///< number of locations in fLocations
+ /// Collection of pad locations - encoded pair (localBoardId, localBoardChannel)
+ MpPair_t* fLLocations; //[fNofLocations]
+ MpPair_t fLLocation; ///< pad location as encoded pair (manuId, manuChannel)
+ MpPair_t fLIndices; ///< pad indices as encoded pair (ix, iy)
+ Double_t fPositionX; ///< the pad x position (in cm)
+ Double_t fPositionY; ///< the pad y position (in cm)
+ Double_t fDimensionX; ///< the pad x dimension - half length (in cm)
+ Double_t fDimensionY; ///< the pad y dimension - half length(in cm)
+ Bool_t fValidity; ///< validity
- ClassDef(AliMpPad,1) //utility class for the motif type
+ ClassDef(AliMpPad,4) //utility class for the motif type
};
ostream& operator << (ostream &out, const AliMpPad& op);