ROOT logo
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

// $Id$
// $MpId: AliMpRowSegment.h,v 1.10 2006/05/24 13:58:21 ivana Exp $

/// \ingroup sector
/// \class AliMpRowSegment
/// \brief A row segment composed of the the identic motifs.
///
/// \author David Guez, Ivana Hrivnacova; IPN Orsay

#ifndef ALI_MP_ROW_SEGMENT_H
#define ALI_MP_ROW_SEGMENT_H

#include "AliMpVRowSegment.h"

class AliMpRow;
class AliMpVMotif;

class AliMpRowSegment : public AliMpVRowSegment
{
  public:
    AliMpRowSegment(AliMpRow* row, AliMpVMotif* motif, 
                Int_t padOffsetX, Int_t padOffsetY, 
                Int_t nofMotifs, Int_t motifPositionId, Int_t motifPositionDId);
    AliMpRowSegment();
    virtual ~AliMpRowSegment();

    // methods
    virtual Double_t  LeftBorderX() const;
    virtual Double_t  RightBorderX() const;
    virtual Double_t  HalfSizeY() const;

    // find methods
    virtual AliMpVMotif*  FindMotif(Double_t x, Double_t y) const;    
    virtual Int_t     FindMotifPositionId(Double_t x, Double_t y) const;
    virtual Bool_t    HasMotifPosition(Int_t motifPositionId) const;
    virtual void      MotifCenter(Int_t motifPositionId,
                                  Double_t& x, Double_t& y) const;

    // geometry
    virtual Double_t  GetPositionX() const;
    virtual Double_t  GetPositionY() const;
    virtual Double_t  GetDimensionX() const;
    virtual Double_t  GetDimensionY() const;

    // set methods
    virtual void      SetOffset(Double_t x, Double_t y);
    virtual void      SetGlobalIndices(AliMpRow* rowBefore);
    virtual Int_t     SetIndicesToMotifPosition(Int_t i, MpPair_t indices);

    // get methods
    virtual AliMpRow*     GetRow() const;
    virtual Int_t         GetNofMotifs() const;
    virtual AliMpVMotif*  GetMotif(Int_t /*i*/) const;
    virtual Int_t         GetMotifPositionId(Int_t i) const;

  private:
    /// Not implemented
    AliMpRowSegment(const AliMpRowSegment& right);
    /// Not implemented
    AliMpRowSegment&  operator = (const AliMpRowSegment& right);

    // methods
    Double_t  FirstMotifCenterX() const;
    Double_t  LastMotifCenterX() const;
    Double_t  MotifCenterX(Int_t motifPositionId) const;
    Double_t  MotifCenterY(Int_t motifPositionId) const;
    Bool_t    IsInside(Double_t x, Double_t y, Bool_t warn = true) const;

    // data members
    Int_t         fNofMotifs;  ///< number of motifs
    MpPair_t      fLPadOffset; ///< the offset in nof pads 
    Double_t      fOffsetX;    ///< \brief the x position of the centre of the first motif
                               /// wrt to left border
    Double_t      fOffsetY;    ///< \brief the y position of the centre of the first motif
                               /// wrt to row center
    AliMpRow*     fRow;        ///< the row containing this segment 
    AliMpVMotif*  fMotif;      ///< the motif 
    Int_t   fMotifPositionId;  ///< the first motif position id
    Int_t   fMotifPositionDId; ///< +1 if ids are increasing, -1 if decreasing
    
  ClassDef(AliMpRowSegment,2)  // Row segment
};

#endif //ALI_MP_ROW_SEGMENT_H

 AliMpRowSegment.h:1
 AliMpRowSegment.h:2
 AliMpRowSegment.h:3
 AliMpRowSegment.h:4
 AliMpRowSegment.h:5
 AliMpRowSegment.h:6
 AliMpRowSegment.h:7
 AliMpRowSegment.h:8
 AliMpRowSegment.h:9
 AliMpRowSegment.h:10
 AliMpRowSegment.h:11
 AliMpRowSegment.h:12
 AliMpRowSegment.h:13
 AliMpRowSegment.h:14
 AliMpRowSegment.h:15
 AliMpRowSegment.h:16
 AliMpRowSegment.h:17
 AliMpRowSegment.h:18
 AliMpRowSegment.h:19
 AliMpRowSegment.h:20
 AliMpRowSegment.h:21
 AliMpRowSegment.h:22
 AliMpRowSegment.h:23
 AliMpRowSegment.h:24
 AliMpRowSegment.h:25
 AliMpRowSegment.h:26
 AliMpRowSegment.h:27
 AliMpRowSegment.h:28
 AliMpRowSegment.h:29
 AliMpRowSegment.h:30
 AliMpRowSegment.h:31
 AliMpRowSegment.h:32
 AliMpRowSegment.h:33
 AliMpRowSegment.h:34
 AliMpRowSegment.h:35
 AliMpRowSegment.h:36
 AliMpRowSegment.h:37
 AliMpRowSegment.h:38
 AliMpRowSegment.h:39
 AliMpRowSegment.h:40
 AliMpRowSegment.h:41
 AliMpRowSegment.h:42
 AliMpRowSegment.h:43
 AliMpRowSegment.h:44
 AliMpRowSegment.h:45
 AliMpRowSegment.h:46
 AliMpRowSegment.h:47
 AliMpRowSegment.h:48
 AliMpRowSegment.h:49
 AliMpRowSegment.h:50
 AliMpRowSegment.h:51
 AliMpRowSegment.h:52
 AliMpRowSegment.h:53
 AliMpRowSegment.h:54
 AliMpRowSegment.h:55
 AliMpRowSegment.h:56
 AliMpRowSegment.h:57
 AliMpRowSegment.h:58
 AliMpRowSegment.h:59
 AliMpRowSegment.h:60
 AliMpRowSegment.h:61
 AliMpRowSegment.h:62
 AliMpRowSegment.h:63
 AliMpRowSegment.h:64
 AliMpRowSegment.h:65
 AliMpRowSegment.h:66
 AliMpRowSegment.h:67
 AliMpRowSegment.h:68
 AliMpRowSegment.h:69
 AliMpRowSegment.h:70
 AliMpRowSegment.h:71
 AliMpRowSegment.h:72
 AliMpRowSegment.h:73
 AliMpRowSegment.h:74
 AliMpRowSegment.h:75
 AliMpRowSegment.h:76
 AliMpRowSegment.h:77
 AliMpRowSegment.h:78
 AliMpRowSegment.h:79
 AliMpRowSegment.h:80
 AliMpRowSegment.h:81
 AliMpRowSegment.h:82
 AliMpRowSegment.h:83
 AliMpRowSegment.h:84
 AliMpRowSegment.h:85
 AliMpRowSegment.h:86
 AliMpRowSegment.h:87
 AliMpRowSegment.h:88