]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpPad.h
Removing useless ifs
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPad.h
CommitLineData
dee1d5f1 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
5f91c9e8 4// $Id$
dee1d5f1 5// $MpId: AliMpPad.h,v 1.6 2005/08/26 15:43:36 ivana Exp $
6
7/// \ingroup basic
8/// \class AliMpPad
9/// \brief Class which encapsuate all information about a pad
10///
11/// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
5f91c9e8 12
13#ifndef ALI_MP_PAD_H
14#define ALI_MP_PAD_H
15
2100f1c2 16#include "AliMpContainers.h"
17
18#ifdef WITH_STL
19#include <vector>
20#endif
21
22#ifdef WITH_ROOT
23#include <TClonesArray.h>
24#endif
25
5f91c9e8 26#include <TObject.h>
27#include <TVector2.h>
28
29#include "AliMpIntPair.h"
30
31class AliMpPad : public TObject
32{
2100f1c2 33 public:
34#ifdef WITH_STL
35 typedef std::vector<AliMpIntPair> IntPairVector;
36#endif
37#ifdef WITH_ROOT
38 typedef TClonesArray IntPairVector;
39#endif
40
5f91c9e8 41 public:
42 AliMpPad(const AliMpIntPair& location, const AliMpIntPair& indices,
43 const TVector2& position, const TVector2& dimensions,
2100f1c2 44 Bool_t validity = true);
5f91c9e8 45 AliMpPad();
46 AliMpPad(const AliMpPad& src);
47 virtual ~AliMpPad();
48
49 // operators
50 Bool_t operator == (const AliMpPad& pos2) const;
51 Bool_t operator != (const AliMpPad& pos2) const;
52 AliMpPad& operator = (const AliMpPad& src) ;
53
54 // methods
2100f1c2 55 void PrintOn(ostream&) const;
2998a151 56 virtual void Print(const char* /*option*/ = "") const;
5f91c9e8 57
58 // static get methods
59 static AliMpPad Invalid() {return AliMpPad();}
60
2100f1c2 61 // set methods
62 Bool_t AddLocation(const AliMpIntPair& location, Bool_t warn = true);
63
5f91c9e8 64 // get methods
2100f1c2 65 AliMpIntPair GetLocation() const {return fLocation;}
66 AliMpIntPair GetIndices() const {return fIndices;}
67 TVector2 Position() const {return fPosition ;}
68 TVector2 Dimensions() const {return fDimensions;}
69 Bool_t IsValid() const {return fValidity ;}
70
71 Int_t GetNofLocations() const;
72 AliMpIntPair GetLocation(Int_t i) const;
73 Bool_t HasLocation(const AliMpIntPair& location) const;
5f91c9e8 74
75 private:
2100f1c2 76 // static data members
77 static const Int_t fgkMaxNofLocations; // maximum number of pad locations
78 // in the collection
5f91c9e8 79 // data members
2100f1c2 80 IntPairVector* fLocations; // collection of pad locations
81 AliMpIntPair fLocation; // pad location
82 AliMpIntPair fIndices; // pad indices
83 TVector2 fPosition; // the pad position (in cm)
84 TVector2 fDimensions; // the pad dimensions (in cm)
85 Bool_t fValidity; // validity
5f91c9e8 86
87 ClassDef(AliMpPad,1) //utility class for the motif type
88};
89
90ostream& operator << (ostream &out, const AliMpPad& op);
91Bool_t operator < (const AliMpPad& left, const AliMpPad& right);
92
93#endif //ALI_MP_PAD_H