]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONAttPainter.h
Fix for the problem during PbPb run of Nov 2010 (Indra)
[u/mrichter/AliRoot.git] / MUON / AliMUONAttPainter.h
1 #ifndef ALIMUONATTPAINTER_H
2 #define ALIMUONATTPAINTER_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 /// \ingroup graphics
10 /// \class AliMUONAttPainter
11 /// \brief Basic attributes shared by all painters
12 /// 
13 // Author Laurent Aphecetche, Subatech
14
15 #ifndef ROOT_TObject
16 #  include "TObject.h"
17 #endif
18 #ifndef ROOT_TString
19 #  include "TString.h"
20 #endif
21
22 class AliMUONAttPainter : public TObject
23 {
24 public:
25   
26   /// Internal status bits
27   enum EBits {
28     kIsCathode0         = BIT(14),
29     kIsCathode1         = BIT(15),
30     kIsBendingPlane     = BIT(16),
31     kIsNonBendingPlane  = BIT(17),
32     kIsFrontView        = BIT(18),
33     kIsBackView         = BIT(19),
34     kIsCathodeAndPlaneMutuallyExclusive = BIT(20),
35     kIsValid            = BIT(21),
36     kIsSinglePainter    = BIT(22),
37     kIsCathodeAndPlaneDisabled = BIT(23)
38   };
39   
40   AliMUONAttPainter();
41   virtual ~AliMUONAttPainter();
42   
43   /// Return our name
44   virtual const char* GetName() const { return Name(); }
45   
46   TString Name() const;
47   
48   TString CathodeName() const;
49   
50   TString ViewPointName() const;
51
52   TString PlaneName() const;
53   
54   /// Whether cathode & plane are disabled
55   Bool_t IsCathodeAndPlaneDisabled() const { return TestBit(kIsCathodeAndPlaneDisabled); }
56   
57   /// Whether we are representing bending plane
58   Bool_t IsBendingPlane() const { return TestBit(kIsBendingPlane); }
59   
60   /// Whether we are representing cathode 0
61   Bool_t IsCathode0() const { return TestBit(kIsCathode0); }
62   
63   /// Whether we are representing cathode 1
64   Bool_t IsCathode1() const { return TestBit(kIsCathode1); }
65   
66   /// Whether we can select both cathode and plane
67   Bool_t IsCathodeAndPlaneMutuallyExclusive() const { return TestBit(kIsCathodeAndPlaneMutuallyExclusive); }
68   
69   /// Whether we are defined by cathode
70   Bool_t IsCathodeDefined() const { return IsCathode0() || IsCathode1(); }
71   
72   /// Whether we are representing non bending plane
73   Bool_t IsNonBendingPlane() const { return TestBit(kIsNonBendingPlane); }
74   
75   /// Whether we are defined by plane
76   Bool_t IsPlaneDefined() const { return IsBendingPlane() || IsNonBendingPlane(); }
77   
78   /// Whether we are valid
79   Bool_t IsValid() const { return TestBit(kIsValid); }
80   
81   void Invert();
82   
83   /// Set our cathode states
84   void SetCathode(Bool_t cath0, Bool_t cath1) { SetBit(kIsCathode0,cath0); SetBit(kIsCathode1,cath1); }
85   
86   /// Set our plane states
87   void SetPlane(Bool_t bending, Bool_t nonBending) { SetBit(kIsBendingPlane,bending); SetBit(kIsNonBendingPlane,nonBending); }
88   
89   /// Set single status
90   void SetSingle(Bool_t value) { SetBit(kIsSinglePainter,value); }
91   
92   /// Whether the painter is to be represented from front (as seen from IP)
93   Bool_t IsFrontView() const { return TestBit(kIsFrontView); }
94   
95   /// Whether the painter is to be represented from back (as seen from IP)
96   Bool_t IsBackView() const { return TestBit(kIsBackView); }
97   
98   /// Set view point
99   void SetViewPoint(Bool_t front, Bool_t back) { SetBit(kIsFrontView,front); SetBit(kIsBackView,back); }
100   
101   /// Set mutually exclusive flag
102   void SetCathodeAndPlaneMutuallyExclusive(Bool_t value) { SetBit(kIsCathodeAndPlaneMutuallyExclusive,value); }
103   
104   /// Set valid flag
105   void SetValid(Bool_t value) { SetBit(kIsValid,value); }
106   
107   /// Whether we represent attributes of a single painter (if false, means it's a painter group)
108   Bool_t IsSinglePainter() const { return TestBit(kIsSinglePainter); }
109   
110   /// Set cathode & plane disable flag
111   void SetCathodeAndPlaneDisabled(Bool_t value) { SetBit(kIsCathodeAndPlaneDisabled,value); }
112
113   void Print(Option_t* opt="") const;
114   
115   ClassDef(AliMUONAttPainter,1) // Basic attributes of painters
116 };
117
118 #endif