1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONAttPainter.h"
20 #include <Riostream.h>
22 /// \class AliMUONAttPainter
24 /// Basic attributes shared by all AliMUONVPainter objects
26 /// One basic attribute is "what side" of the detector part we are representing.
27 /// Take the example of one full chamber. We can represent it as seen from the
28 /// interaction point, i.e. showing all the "cathode0" of all detection elements.
30 /// Or we might want to see only the bending (or non bending) planes of all the
31 /// detection elements.
33 /// This is governed by the SetCathode() and SetPlane() methods (and retrieved
34 /// using IsCathodeDefined() and IsPlaneDefined() methods. In the first case
35 /// above IsCathodeDefined() would be true and IsPlaneDefined() would be false.
36 /// The second case would be the contrary.
38 /// \author Laurent Aphecetche, Subatech
41 ClassImp(AliMUONAttPainter)
44 //_____________________________________________________________________________
45 AliMUONAttPainter::AliMUONAttPainter()
51 SetCathodeAndPlaneMutuallyExclusive(kFALSE);
52 SetCathodeAndPlaneDisabled(kFALSE);
55 //_____________________________________________________________________________
56 AliMUONAttPainter::~AliMUONAttPainter()
61 //_____________________________________________________________________________
63 AliMUONAttPainter::Name() const
69 if ( !IsValid() ) return "Invalid";
71 if ( CathodeName().Length() > 0 ) name = CathodeName();
72 if ( PlaneName().Length() > 0 )
74 if ( name.Length() > 0 ) name += "-";
78 // if ( ViewPointName().Length() > 0 )
80 // if ( name.Length() > 0 ) name += "-";
81 // name += ViewPointName();
87 //_____________________________________________________________________________
89 AliMUONAttPainter::CathodeName() const
91 /// Return cathode name in short form
93 if ( IsCathode0() && IsCathode1() ) return "Both";
94 else if ( !IsCathode0() && !IsCathode1() ) return "";
95 else if ( IsCathode0() ) return "0";
96 else if ( IsCathode1() ) return "1";
100 //_____________________________________________________________________________
102 AliMUONAttPainter::Invert()
104 /// Invert our cathode/plane states
106 if ( IsCathodeDefined() )
108 Bool_t cath0(IsCathode0());
109 Bool_t cath1(IsCathode1());
110 SetCathode(!cath0,!cath1);
113 if ( IsPlaneDefined() )
115 Bool_t b(IsBendingPlane());
116 Bool_t nb(IsNonBendingPlane());
122 //_____________________________________________________________________________
124 AliMUONAttPainter::PlaneName() const
126 /// Return plane name in short form
127 if ( IsBendingPlane() && IsNonBendingPlane() ) return "Both";
128 else if ( !IsBendingPlane() && !IsNonBendingPlane() ) return "";
129 else if ( IsBendingPlane() ) return "Bending";
130 else if ( IsNonBendingPlane() ) return "NonBending";
134 //_____________________________________________________________________________
136 AliMUONAttPainter::ViewPointName() const
138 /// Return name of view point
139 if ( IsFrontView() ) return "Front";
140 if ( IsBackView() ) return "Back";
144 //_____________________________________________________________________________
146 AliMUONAttPainter::Print(Option_t*) const
150 if ( !IsValid() ) cout << "INVALID : ";
152 if ( IsCathodeDefined() )
154 cout << "Cathode-defined " << CathodeName() << ". ";
156 if ( IsPlaneDefined() )
158 cout << "Plane-defined " << PlaneName() << ". ";
160 if ( IsCathodeAndPlaneMutuallyExclusive() )
162 cout << "Cathode and Plane mutually exclusive. ";
164 cout << ViewPointName() << endl;