AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONManuPainter.cxx
Go to the documentation of this file.
1 
2 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16 
17 // $Id$
18 
19 #include "AliMUONManuPainter.h"
20 
21 #include "AliMpDCSNamer.h"
22 #include "AliLog.h"
23 #include "AliMUONContour.h"
25 #include "AliMUONManuPadPainter.h"
26 #include "AliMUONPainterHelper.h"
27 #include "AliMUONVCalibParam.h"
28 #include "AliMUONVDigit.h"
29 #include "AliMUONVTrackerData.h"
30 #include "AliMpDEManager.h"
31 #include "AliMpManuUID.h"
32 #include "AliMpMotifPosition.h"
33 #include "AliMpMotifType.h"
34 #include "AliMpSlat.h"
35 #include "AliMpStationType.h"
36 #include "AliMpVMotif.h"
37 #include "AliMpVPadIterator.h"
38 #include <TArrayI.h>
39 #include <float.h>
40 
47 
51 
52 //_____________________________________________________________________________
54 : AliMUONVPainter(ioCtor),
55 fDetElemId(-1),
56 fManuId(-1)
57 {
59 }
60 
61 //_____________________________________________________________________________
63 : AliMUONVPainter(),
64 fDetElemId(-1),
65 fManuId(-1)
66 {
68 }
69 
70 //_____________________________________________________________________________
72  Int_t detElemId,
73  Int_t manuId)
74 : AliMUONVPainter("MANU"),
75  fDetElemId(detElemId),
76  fManuId(manuId)
77 {
79 
80  SetAttributes(att);
81 
83 
84  SetID(detElemId,manuId);
85  SetName(h->ManuName(manuId));
86  SetPathName(h->ManuPathName(detElemId,manuId));
87 
88 
89  AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
90 
91  if ( stationType == AliMp::kStationTrigger )
92  {
93  AliError("Hu ho. Not supposed to be used for trigger !");
94  Invalidate();
95  return;
96  }
97 
98  TString name = AliMUONManuContourMaker::ManuPathName(detElemId, manuId);
99 
100  AliMUONContour* contour = h->GetContour(name.Data());
101 
102  if (!contour)
103  {
104  AliError(Form("Could not get manuId %04d from DE %04d (name=%s)",manuId,detElemId,name.Data()));
105  }
106 
107  SetContour(contour);
108 
110 }
111 
112 //_____________________________________________________________________________
114 : AliMUONVPainter(rhs), fDetElemId(-1), fManuId(-1)
115 {
117  rhs.Copy(*this);
118 }
119 
120 //_____________________________________________________________________________
123 {
125  if ( this != &rhs )
126  {
127  rhs.Copy(*this);
128  }
129  return *this;
130 }
131 
132 //_____________________________________________________________________________
134 {
136 }
137 
138 //_____________________________________________________________________________
139 void
141  Double_t& dataMin, Double_t& dataMax) const
142 {
144  dataMin = dataMax = data.Manu(fDetElemId, fManuId, dataIndex);
145 }
146 
147 
148 //_____________________________________________________________________________
149 void
150 AliMUONManuPainter::Copy(TObject& object) const
151 {
155  ((AliMUONManuPainter&)(object)).fManuId = fManuId;
156 }
157 
158 //_____________________________________________________________________________
159 TString
161  Double_t, Double_t)
162 {
164 
165  if (!data.HasManu(fDetElemId,fManuId)) return "";
166 
167  Double_t value = data.Manu(fDetElemId,fManuId,dataIndex);
168 
169  TString rv = AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
170 
171  if ( TString(data.GetName()).Contains("HV") )
172  {
173  rv += "\n";
174 
175  AliMpDCSNamer hvNamer("TRACKER");
176 
178  {
179  Int_t sector = hvNamer.ManuId2Sector(fDetElemId,fManuId);
180 
181  rv += hvNamer.DCSNameFromAlias(hvNamer.DCSAliasName(fDetElemId,sector));
182  }
183  else
184  {
185  rv += hvNamer.DCSNameFromAlias(hvNamer.DCSAliasName(fDetElemId));
186  }
187  }
188 
189  return rv;
190 }
191 
192 //_____________________________________________________________________________
193 void
195 {
197  manuList.Add(new AliMpManuUID(fDetElemId,fManuId));
198 }
199 
200 //_____________________________________________________________________________
201 Bool_t
203 {
205  return ( InteractiveReadOutConfig()->Manu(fDetElemId,fManuId) > 0 );
206 }
207 
208 //_____________________________________________________________________________
209 void
211  Double_t min, Double_t max)
212 {
214 
215  if (!data.HasManu(fDetElemId,fManuId)) return;
216 
217  Double_t value = data.Manu(fDetElemId,fManuId,dataIndex);
218 
219  if ( value >= AliMUONVCalibParam::InvalidFloatValue() ) return;
220 
221  Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
222 
223  PaintArea(color);
224 }
225 
226 //_____________________________________________________________________________
229 {
231 
233 
234  AliMUONAttPainter norm(attributes);
235 
236  norm.SetValid(kFALSE);
237 
238  if ( norm.IsCathodeDefined() )
239  {
240  if ( norm.IsCathode0() != Attributes().IsCathode0() ) return norm;
241  }
242 
243  if ( norm.IsPlaneDefined() )
244  {
245  if ( norm.IsBendingPlane() != Attributes().IsBendingPlane() ) return norm;
246  }
247 
248  norm.SetValid(kTRUE);
249 
250  if ( norm.IsCathodeDefined() && !norm.IsPlaneDefined() )
251  {
252  // derive plane from cathode
253 
254  AliMp::CathodType cathode = ( norm.IsCathode0() ? AliMp::kCath0 : AliMp::kCath1 ) ;
255 
257 
258  Bool_t bending = ( planeType == AliMp::kBendingPlane );
259 
260  norm.SetPlane(bending,!bending);
261  }
262  else if ( norm.IsPlaneDefined() && !norm.IsCathodeDefined() )
263  {
264  // derive cathode from plane
265 
267 
269 
270  Bool_t cath0 = ( cathode == AliMp::kCath0 );
271 
272  norm.SetCathode(cath0,!cath0);
273  }
274  else if ( norm.IsPlaneDefined() && norm.IsCathodeDefined() )
275  {
276  // check that cathode and plane matches
277 
278  AliMp::CathodType cathode = ( norm.IsCathode0() ? AliMp::kCath0 : AliMp::kCath1 ) ;
279 
281 
282  Bool_t bending = ( planeType == AliMp::kBendingPlane );
283 
284  if ( bending != norm.IsBendingPlane() )
285  {
286  norm.SetValid(kFALSE);
287  }
288  }
289 
290  return norm;
291 }
292 
293 
Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const
static AliMUONPainterHelper * Instance()
Int_t fDetElemId
our detection element id
virtual AliMUONAttPainter Validate(const AliMUONAttPainter &attributes) const
Convert attributes so they are valid ones for us.
void SetID(Int_t id0, Int_t id1)
Set our IDs.
static Float_t InvalidFloatValue()
Return 1E38 as invalid float value.
station 1,2 (quadrants)
AliMUONManuPainter & operator=(const AliMUONManuPainter &rhs)
Painter for one manu (not the pads, only the manu)
virtual Bool_t IsIncluded() const
Whether or not the part of the detector represented by this painter should be included in readout...
#define TObjArray
static AliMp::CathodType GetCathod(Int_t detElemId, AliMp::PlaneType planeType)
AliMUONVTrackerData * InteractiveReadOutConfig() const
virtual void Copy(TObject &object) const
Int_t ManuId2Sector(Int_t detElemId, Int_t manuId) const
Return the HV-sector number (within a St12 quadrant) for a given manu number.
Bool_t IsPlaneDefined() const
Whether we are defined by plane.
void SetContour(AliMUONContour *contour)
Set out contour.
virtual Bool_t HasManu(Int_t detElemId, Int_t manuId) const =0
Whether we have data for a given manu.
Bool_t IsCathodeDefined() const
Whether we are defined by cathode.
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Definition: AliMpDCSNamer.h:22
Bool_t IsBendingPlane() const
Whether we are representing bending plane.
void SetCathode(Bool_t cath0, Bool_t cath1)
virtual TString DimensionName(Int_t dim) const =0
Get the name of a given (internal) dimension.
TString ManuPathName(Int_t detElemId, Int_t manuId) const
Unique ID for manus.
Definition: AliMpManuUID.h:19
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
virtual void Copy(TObject &object) const
TString DCSNameFromAlias(const char *dcsAlias) 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.
virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const =0
Get the value for a given manu and given dimension.
void Add(AliMUONVPainter *painter)
Add a painter to our list of children. We adopt this painter (i.e. we become owner).
void Invalidate()
Mark us as not valid.
void SetPathName(const char *pathName)
Set our path name (aka fullname)
AliMUONContour * GetContour(const char *contourName, Bool_t explodedGeometry=kTRUE) const
void PaintArea(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t min, Double_t max)
non-bending plane
static AliMp::StationType GetStationType(Int_t detElemId)
Utility class for the painters display.
static TString ManuPathName(Int_t detElemId, Int_t manu, Bool_t withCathodeName=kTRUE)
static AliMp::PlaneType GetPlaneType(Int_t detElemId, AliMp::CathodType cath)
Painter for the pads of one manu.
bending plane
virtual void FillManuList(TObjArray &manuList) const
Append (i.e. don't have the right to clear the array !) our list of manus to manuList.
Int_t fManuId
our manu id
2D contour
trigger stations (slats)
Bool_t IsCathode0() const
Whether we are representing cathode 0.
Basic attributes shared by all painters.
TString FormatValue(const char *name, Double_t value) const
virtual TString Describe(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t x=FLT_MAX, Double_t y=FLT_MAX)
TString ManuName(Int_t manuId) const
void SetPlane(Bool_t bending, Bool_t nonBending)
TString DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) 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...
void SetValid(Bool_t value)
virtual void ComputeDataRange(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t &dataMin, Double_t &dataMax) const