1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // $MpId: AliMpGraphContext.h,v 1.11 2006/05/24 13:58:13 ivana Exp $
8 /// \class AliMpGraphContext
9 /// \brief Class describing the correspondance between a given area
10 /// in pad, and a zone of real (cm) position
12 /// \author David GUEZ, IPN Orsay
14 #ifndef ALI_MP_GRAPH_CONTEXT_H
15 #define ALI_MP_GRAPH_CONTEXT_H
19 #include "AliMpContainers.h"
23 #include "AliMpExMap.h"
32 class AliMpGraphContext : public TObject
36 /// GraphContextVector type
37 typedef std::vector<AliMpGraphContext*> GraphContextVector;
40 /// GraphContextVector type
41 typedef TObjArray GraphContextVector;
47 static AliMpGraphContext *Instance();
52 /// Set position of the pad area where to draw
53 void SetPadPosition(const TVector2 &position){fPadPosition=position;}
54 /// Set dimensions of the pad area where to draw
55 void SetPadDimensions(const TVector2 &dimensions){fPadDimensions=dimensions;}
56 /// Set position of the real area where to draw
57 void SetRealPosition(const TVector2 &position){fRealPosition=position;}
58 /// Set dimensions of the real area where to draw
59 void SetRealDimensions(const TVector2 &dimensions){fRealDimensions=dimensions;}
61 void SetColor(Int_t color){fColor=color;}
67 /// Return position of the pad area where to draw
68 TVector2 GetPadPosition() const {return fPadPosition;}
69 /// Return dimensions of the pad area where to draw
70 TVector2 GetPadDimensions() const {return fPadDimensions;}
71 /// Return position of the real area where to draw
72 TVector2 GetRealPosition() const{return fRealPosition;}
73 /// Return dimensions of the real area where to draw
74 TVector2 GetRealDimensions() const{return fRealDimensions;}
75 /// Return color to use
76 Int_t GetColor() const {return fColor;}
79 TVector2 RealToPad(const TVector2 &position) const;
80 void RealToPad(const TVector2 &position
81 ,const TVector2 &dimensions,
82 TVector2 &padPosition,
83 TVector2 &padDimensions) const;
84 void SetPadPosForReal(const TVector2 &position,const TVector2 &dimensions);
87 AliMpGraphContext(const AliMpGraphContext& right);
88 AliMpGraphContext& operator = (const AliMpGraphContext& right);
91 //private constructor (not instanciable from outside)
94 ///< static data members
95 static AliMpGraphContext *fgInstance; ///< the global instance
96 static GraphContextVector fgStack; ///< the object stack
98 static Int_t fgStackSize; ///< the object stack size
102 Int_t fColor; ///< color to use
103 TVector2 fPadPosition; ///< Position of the pad area where to draw
104 TVector2 fPadDimensions; ///< Dimensions of the pad area where to draw
106 TVector2 fRealPosition; ///< Position of the real area to draw
107 TVector2 fRealDimensions; ///< Dimensions of the real area to draw
109 ClassDef(AliMpGraphContext,1) // Correspondance pad area/real world
112 #endif //ALI_MP_GRAPH_CONTEXT_H