]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpMotif.h
Fixing SECURE_CODING defects (sscanf) reported by Coverity
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotif.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId: AliMpMotif.h,v 1.8 2006/05/24 13:58:18 ivana Exp $
6
7 /// \ingroup motif
8 /// \class AliMpMotif
9 /// \brief A motif with its unique ID and the motif type.
10 ///
11 /// \author David Guez, Ivana Hrivnacova; IPN Orsay
12
13 #ifndef ALI_MP_MOTIF_H
14 #define ALI_MP_MOTIF_H
15
16 #include "AliMpVMotif.h"
17 #include "AliMpEncodePair.h"
18
19 #include <TObject.h>
20
21 class TString;
22
23 class AliMpMotif : public AliMpVMotif
24 {
25  public:
26   AliMpMotif(const TString& id,
27              AliMpMotifType* motifType, 
28              Double_t dx, Double_t dy);
29   AliMpMotif();
30   virtual ~AliMpMotif();
31
32   // Access methods
33   virtual Int_t    GetNofPadDimensions() const;
34   virtual Double_t GetPadDimensionX(Int_t /*i*/ = 0) const;
35   virtual Double_t GetPadDimensionY(Int_t /*i*/ = 0) const;
36
37   virtual void GetPadDimensionsByIndices(MpPair_t localIndices,
38                    Double_t& dx, Double_t& dy) const;
39   virtual void GetPadDimensionsByIndices(Int_t ixLocal, Int_t iyLocal,
40                    Double_t& dx, Double_t& dy) const;
41
42   // Geometry
43   virtual Double_t DimensionX() const;
44   virtual Double_t DimensionY() const;
45
46   // Other methods
47   virtual void PadPositionLocal(MpPair_t localIndices,
48                       Double_t& posx, Double_t& posy  ) const;
49   virtual void PadPositionLocal(Int_t ixLocal, Int_t iyLocal,
50                       Double_t& posx, Double_t& posy  ) const;
51
52   virtual MpPair_t PadIndicesLocal(
53                       Double_t localPosX, Double_t localPosY) const;
54
55  private:
56   // methods
57
58   // data members 
59   Double_t  fPadDimensionX; ///< pad dimensions (halflength x, y size) 
60   Double_t  fPadDimensionY; ///< pad dimensions (halflength x, y size) 
61
62   ClassDef(AliMpMotif,2) // A motif with its ID
63 };
64
65 // inline functions
66
67                             /// Return 1 as the number of pad dimensions 
68 inline Int_t    AliMpMotif::GetNofPadDimensions() const 
69 { return 1; }
70
71                             /// Return the pad x dimension
72 inline Double_t AliMpMotif::GetPadDimensionX(Int_t /*i*/) const 
73 { return fPadDimensionX; }  
74
75                             /// Return the pad y dimension
76 inline Double_t AliMpMotif::GetPadDimensionY(Int_t /*i*/) const 
77 { return fPadDimensionY; }  
78
79 #endif //ALI_MP_MOTIF_H