AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONAttPainter.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // $Id$
17 
18 #include "AliMUONAttPainter.h"
19 
20 #include <Riostream.h>
21 
39 
40 using std::cout;
41 using std::endl;
45 
46 //_____________________________________________________________________________
48 : TObject(), fName()
49 {
51  SetSingle(kTRUE);
52  SetValid(kTRUE);
53  SetCathodeAndPlaneMutuallyExclusive(kFALSE);
54  SetCathodeAndPlaneDisabled(kFALSE);
55  SetName();
56 }
57 
58 //_____________________________________________________________________________
60 {
62 }
63 
64 //_____________________________________________________________________________
66 {
68 
69  fName = "Invalid";
70 
71  if ( !IsValid() ) return;
72 
73  fName = "";
74 
75  if ( CathodeName().Length() > 0 ) fName = CathodeName();
76  if ( PlaneName().Length() > 0 )
77  {
78  if ( fName.Length() > 0 ) fName += "-";
79  fName += PlaneName();
80  }
81 
82  // if ( ViewPointName().Length() > 0 )
83  // {
84  // if ( name.Length() > 0 ) name += "-";
85  // name += ViewPointName();
86  // }
87 }
88 
89 //_____________________________________________________________________________
90 TString
92 {
94 
95  if ( IsCathode0() && IsCathode1() ) return "Both";
96  else if ( !IsCathode0() && !IsCathode1() ) return "";
97  else if ( IsCathode0() ) return "0";
98  else if ( IsCathode1() ) return "1";
99  return "";
100 }
101 
102 //_____________________________________________________________________________
103 void
105 {
107 
108  if ( IsCathodeDefined() )
109  {
110  Bool_t cath0(IsCathode0());
111  Bool_t cath1(IsCathode1());
112  SetCathode(!cath0,!cath1);
113  }
114 
115  if ( IsPlaneDefined() )
116  {
117  Bool_t b(IsBendingPlane());
118  Bool_t nb(IsNonBendingPlane());
119  SetPlane(!b,!nb);
120  }
121 
122  SetName();
123 }
124 
125 //_____________________________________________________________________________
126 TString
128 {
130  if ( IsBendingPlane() && IsNonBendingPlane() ) return "Both";
131  else if ( !IsBendingPlane() && !IsNonBendingPlane() ) return "";
132  else if ( IsBendingPlane() ) return "Bending";
133  else if ( IsNonBendingPlane() ) return "NonBending";
134  return "";
135 }
136 
137 //_____________________________________________________________________________
138 TString
140 {
142  if ( IsFrontView() ) return "Front";
143  if ( IsBackView() ) return "Back";
144  return "";
145 }
146 
147 //_____________________________________________________________________________
148 void
149 AliMUONAttPainter::Print(Option_t*) const
150 {
152 
153  if ( !IsValid() ) cout << "INVALID : ";
154 
155  if ( IsCathodeDefined() )
156  {
157  cout << "Cathode-defined " << CathodeName() << ". ";
158  }
159  if ( IsPlaneDefined() )
160  {
161  cout << "Plane-defined " << PlaneName() << ". ";
162  }
164  {
165  cout << "Cathode and Plane mutually exclusive. ";
166  }
167  cout << ViewPointName() << endl;
168 }
169 
170 //_____________________________________________________________________________
171 void
172 AliMUONAttPainter::SetCathode(Bool_t cath0, Bool_t cath1)
173 {
175  SetBit(kIsCathode0,cath0);
176  SetBit(kIsCathode1,cath1);
177  SetName();
178 }
179 
180 //_____________________________________________________________________________
181 void
182 AliMUONAttPainter::SetPlane(Bool_t bending, Bool_t nonBending)
183 {
185  SetBit(kIsBendingPlane,bending);
186  SetBit(kIsNonBendingPlane,nonBending);
187  SetName();
188 }
189 
190 //_____________________________________________________________________________
191 void
193 {
195  SetBit(kIsSinglePainter,value);
196  SetName();
197 }
198 
199 //_____________________________________________________________________________
200 void
201 AliMUONAttPainter::SetViewPoint(Bool_t front, Bool_t back)
202 {
204  SetBit(kIsFrontView,front);
205  SetBit(kIsBackView,back);
206  SetName();
207 }
208 
209 //_____________________________________________________________________________
210 void
212 {
215  SetName();
216 }
217 
218 //_____________________________________________________________________________
219 void
221 {
223  SetBit(kIsValid,value);
224  SetName();
225 }
226 
227 //_____________________________________________________________________________
228 void
230 {
232  SetBit(kIsCathodeAndPlaneDisabled,value);
233  SetName();
234 }
TBrowser b
Definition: RunAnaESD.C:12
Bool_t IsNonBendingPlane() const
Whether we are representing non bending plane.
TString CathodeName() const
TString PlaneName() const
Bool_t IsPlaneDefined() const
Whether we are defined by plane.
Bool_t IsCathodeDefined() const
Whether we are defined by cathode.
Bool_t IsBendingPlane() const
Whether we are representing bending plane.
void SetSingle(Bool_t value)
void SetViewPoint(Bool_t front, Bool_t back)
void SetCathode(Bool_t cath0, Bool_t cath1)
Bool_t IsBackView() const
Whether the painter is to be represented from back (as seen from IP)
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Bool_t IsCathodeAndPlaneMutuallyExclusive() const
Whether we can select both cathode and plane.
void SetCathodeAndPlaneDisabled(Bool_t value)
Bool_t IsCathode1() const
Whether we are representing cathode 1.
Bool_t IsFrontView() const
Whether the painter is to be represented from front (as seen from IP)
TString ViewPointName() const
Bool_t IsValid() const
Whether we are valid.
Bool_t IsCathode0() const
Whether we are representing cathode 0.
Basic attributes shared by all painters.
void SetCathodeAndPlaneMutuallyExclusive(Bool_t value)
void SetPlane(Bool_t bending, Bool_t nonBending)
void SetValid(Bool_t value)
TString fName
name of the attributes
void Print(Option_t *opt="") const
return kTRUE
Definition: AliFMDv1.cxx:97