AliRoot Core  da88d91 (da88d91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONPCBPainter.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 
23 
24 #include "AliMUONPCBPainter.h"
25 
26 #include "AliMUONManuPainter.h"
27 #include "AliMUONContour.h"
28 #include "AliMUONPainterHelper.h"
29 #include "AliMUONVCalibParam.h"
30 #include "AliMUONVTrackerData.h"
31 #include "AliMpDEManager.h"
32 #include "AliMpMotifPosition.h"
33 #include "AliMpPCB.h"
34 #include "AliMpPlaneType.h"
35 #include "AliMpSlat.h"
36 #include "AliLog.h"
37 
41 
42 //_____________________________________________________________________________
43 AliMUONPCBPainter::AliMUONPCBPainter(TRootIOCtor* ioCtor)
44 : AliMUONVPainter(ioCtor),
45 fDetElemId(-1),
46 fPCBIndex(-1)
47 {
49 }
50 
51 //_____________________________________________________________________________
53 : AliMUONVPainter(),
54 fDetElemId(-1),
55 fPCBIndex(-1)
56 {
58 }
59 
60 //_____________________________________________________________________________
62  Int_t detElemId,
63  Int_t pcbNumber)
64 : AliMUONVPainter("PCB"),
65  fDetElemId(detElemId),
66  fPCBIndex(pcbNumber)
67 {
69 
70  SetAttributes(att);
71 
73 
75 
76  const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
77 
78  SetID(detElemId,pcbNumber);
79  SetName(h->PCBName(pcbNumber));
80  SetPathName(h->PCBPathName(detElemId,pcbNumber));
81 
82  AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
83 
84  AliMUONContour* contour = h->GetContour(ContourName());
85  TObjArray contourArray;
86 
87  for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp )
88  {
89  AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
91  Add(painter);
92  if (!contour)
93  {
94  contourArray.Add(painter->Contour());
95  }
96  }
97 
98  Double_t x,y,z;
99 
101  pcb->X()-slat->GetPositionX(),
102  pcb->Y()-slat->GetPositionY(),
103  0.0,
104  x,y,z);
105 
106  if (!contour)
107  {
108  contour = h->MergeContours(contourArray,ContourName());
109  }
110 
111  SetContour(contour);
112 }
113 
114 //_____________________________________________________________________________
116 {
118 }
119 
120 //_____________________________________________________________________________
122 : AliMUONVPainter(rhs),
123  fDetElemId(-1),
124  fPCBIndex(-1)
125 {
127  rhs.Copy(*this);
128 }
129 
130 //_____________________________________________________________________________
133 {
135  if ( this != &rhs )
136  {
137  rhs.Copy(*this);
138  }
139  return *this;
140 }
141 
142 //_____________________________________________________________________________
143 void
145  Double_t& dataMin, Double_t& dataMax) const
146 {
148  dataMin = dataMax = data.PCB(fDetElemId, fPCBIndex,dataIndex);
149 }
150 
151 //_____________________________________________________________________________
152 void
153 AliMUONPCBPainter::Copy(TObject& object) const
154 {
157  ((AliMUONPCBPainter&)(object)).fDetElemId = fDetElemId;
158  ((AliMUONPCBPainter&)(object)).fPCBIndex = fPCBIndex;
159 }
160 
161 //_____________________________________________________________________________
162 TString
164  Double_t, Double_t)
165 {
167 
168  if (!data.HasPCB(fDetElemId,fPCBIndex)) return "";
169 
170  Double_t value = data.PCB(fDetElemId,fPCBIndex,dataIndex);
171 
172  return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
173 }
174 
175 //_____________________________________________________________________________
176 Bool_t
178 {
180  return ( InteractiveReadOutConfig()->PCB(fDetElemId,fPCBIndex) > 0 );
181 }
182 
183 //_____________________________________________________________________________
184 void
186  Double_t min, Double_t max)
187 {
189  if (!data.HasPCB(fDetElemId,fPCBIndex)) return;
190 
191  Double_t value = data.PCB(fDetElemId,fPCBIndex,dataIndex);
192 
193  if ( value >= AliMUONVCalibParam::InvalidFloatValue() ) return;
194 
195  Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
196 
197  PaintArea(color);
198 }
199 
Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const
static AliMUONPainterHelper * Instance()
void SetID(Int_t id0, Int_t id1)
Set our IDs.
static Float_t InvalidFloatValue()
Return 1E38 as invalid float value.
void PaintArea(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t min, Double_t max)
Painter for one manu (not the pads, only the manu)
void Local2Global(Int_t detElemId, Double_t xl, Double_t yl, Double_t zl, Double_t &xg, Double_t &yg, Double_t &zg) const
TString PCBName(Int_t pcbNumber) const
#define TObjArray
AliMUONVTrackerData * InteractiveReadOutConfig() const
Double_t GetPositionY() const
Return y position.
Definition: AliMpSlat.h:62
void SetContour(AliMUONContour *contour)
Set out contour.
A PCB for station 3,4 or 5.
Definition: AliMpPCB.h:46
Bool_t IsBendingPlane() const
Whether we are representing bending plane.
virtual void Copy(TObject &object) const
virtual Bool_t HasPCB(Int_t detElemId, Int_t pcbIndex) const =0
Whether we have data for a given PCB.
virtual TString ContourName() const
TString Describe(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t, Double_t)
void ComputeDataRange(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t &dataMin, Double_t &dataMax) const
A slat (building block of stations 3, 4 and 5)
Definition: AliMpSlat.h:51
virtual Double_t PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim=0) const =0
Get the value for a given PCDB and given dimension.
virtual TString DimensionName(Int_t dim) const =0
Get the name of a given (internal) dimension.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual void Copy(TObject &object) const
const AliMUONAttPainter & Attributes() const
Get our attributes.
void SetName(const char *name)
Set our name.
Base class for a graphical object representing some part of the MUON tracking system.
Int_t GetID() const
Return motif position ID = manu id.
AliMUONPCBPainter & operator=(const AliMUONPCBPainter &rhs)
A placed motif.
void Add(AliMUONVPainter *painter)
Add a painter to our list of children. We adopt this painter (i.e. we become owner).
AliMUONContour * Contour() const
Return the contour representing the outline of this object.
AliMpPCB * GetPCB(Int_t i) const
Returns the i-th PCB of this slat.
Definition: AliMpSlat.cxx:435
void SetPathName(const char *pathName)
Set our path name (aka fullname)
AliMUONContour * GetContour(const char *contourName, Bool_t explodedGeometry=kTRUE) const
TString PCBPathName(Int_t detElemId, Int_t pcbNumber) const
non-bending plane
Utility class for the painters display.
AliMUONContour * MergeContours(const TObjArray &contours, const char *contourName, Bool_t explodedGeometry=kTRUE)
Implementation of AliMUONVPainter for slat's PCBs.
Double_t GetPositionX() const
Return x position.
Definition: AliMpSlat.h:60
bending plane
const AliMpSlat * GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const
2D contour
Int_t fDetElemId
Detection element this pcb is in.
Basic attributes shared by all painters.
Int_t fPCBIndex
Index of this PCB within the detection element.
TString FormatValue(const char *name, Double_t value) const
virtual void SetAttributes(const AliMUONAttPainter &attributes)
Base class for MUON data that can be presented at different levels in the hierarchy of the MUON syste...
Bool_t IsIncluded() const
Whether or not the part of the detector represented by this painter should be included in readout...