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 "AliMUONPainterHelper.h"
20 #include "AliMUONGeometryDetElement.h"
21 #include "AliMUONGeometryTransformer.h"
22 #include "AliMUONPainterContour.h"
23 #include "AliMUONPainterContourMaker.h"
24 #include "AliMUONPainterEnv.h"
25 #include "AliMUONPainterMatrix.h"
26 #include "AliMUONPainterPadStore.h"
27 #include "AliMUONPainterRegistry.h"
28 #include "AliMUONVCalibParam.h"
29 #include "AliMUONVDigit.h"
30 #include "AliMUONVTrackerData.h"
32 #include "AliMpConstants.h"
33 #include "AliMpDDLStore.h"
34 #include "AliMpDEIterator.h"
35 #include "AliMpDEManager.h"
36 #include "AliMpExMap.h"
37 #include "AliMpMotifMap.h"
38 #include "AliMpMotifPosition.h"
41 #include "AliMpSector.h"
42 #include "AliMpSectorSegmentation.h"
43 #include "AliMpSegmentation.h"
44 #include "AliMpSlat.h"
45 #include "AliMpSlatSegmentation.h"
46 #include "AliMpStationType.h"
47 #include "AliMpVPadIterator.h"
48 #include "AliCodeTimer.h"
50 #include <Riostream.h>
54 #include <TCollection.h>
57 #include <TGeoMatrix.h>
62 #include <TObjArray.h>
63 #include <TObjString.h>
68 #include <TVirtualPad.h>
69 #include <TVirtualX.h>
71 ///\class AliMUONPainterHelper
73 /// Helper class for painters
75 ///\author Laurent Aphecetche, Subatech
78 ClassImp(AliMUONPainterHelper)
81 AliMUONPainterHelper* AliMUONPainterHelper::fgInstance(0x0);
83 //_____________________________________________________________________________
84 AliMUONPainterHelper::AliMUONPainterHelper() :
87 fExplodedGlobalTransformations(0x0),
88 fRealGlobalTransformations(0x0),
91 fPainterMatrices(0x0),
95 fExplodeFactor[0] = 1.00;
96 fExplodeFactor[1] = 1.50;
98 if ( ! AliMpCDB::LoadMpSegmentation() )
100 AliFatal("Could not access mapping from OCDB !");
104 if ( ! AliMpCDB::LoadDDLStore() )
106 AliFatal("Could not access DDL Store from OCDB !");
110 //_____________________________________________________________________________
111 AliMUONPainterHelper::~AliMUONPainterHelper()
114 if ( fIsModified ) Save();
115 delete fExplodedGlobalTransformations;
116 delete fRealGlobalTransformations;
118 delete fContourMaker;
119 delete fPainterMatrices;
123 //_____________________________________________________________________________
124 AliMUONPainterContour*
125 AliMUONPainterHelper::GetContour(const char* contourName) const
127 /// Get a contour by name
133 return fContourMaker->GetContour(contourName);
138 //_____________________________________________________________________________
140 AliMUONPainterHelper::FindPadID(const TArrayI& pads, Double_t x, Double_t y) const
142 /// Find a pad by position
144 return fPadStore->FindPadID(pads,x,y);
147 //_____________________________________________________________________________
149 AliMUONPainterHelper::GenerateDefaultMatrices()
151 /// Kind of bootstrap method to trigger the generation of all contours
153 fPainterMatrices = new TObjArray;
154 fPainterMatrices->SetOwner(kFALSE);
156 TObjArray attributes;
158 AliMUONAttPainter att;
160 att.SetViewPoint(kTRUE,kFALSE);
161 att.SetPlane(kFALSE,kFALSE);
162 att.SetCathode(kTRUE,kFALSE);
164 AliWarningClass("Should generate back views as well here");
166 attributes.Add(new AliMUONAttPainter(att));
167 att.SetCathode(kFALSE,kTRUE);
168 attributes.Add(new AliMUONAttPainter(att));
169 att.SetCathode(kFALSE,kFALSE);
170 att.SetPlane(kTRUE,kFALSE);
171 attributes.Add(new AliMUONAttPainter(att));
172 att.SetPlane(kFALSE,kTRUE);
173 attributes.Add(new AliMUONAttPainter(att));
175 TIter next(&attributes);
176 AliMUONAttPainter* a;
178 while ( ( a = static_cast<AliMUONAttPainter*>(next()) ) )
180 AliMUONPainterMatrix* matrix = new AliMUONPainterMatrix("Tracker",5,2);
182 for ( Int_t i = 0; i < 10; ++i )
184 AliMUONVPainter* painter = AliMUONVPainter::CreatePainter("AliMUONChamberPainter",*a,i,-1);
186 painter->SetResponder("Chamber");
188 painter->SetOutlined("*",kFALSE);
190 painter->SetOutlined("MANU",kTRUE);
192 for ( Int_t j = 0; j < 3; ++j )
194 painter->SetLine(j,1,4-j);
197 matrix->Adopt(painter);
199 AliMUONPainterRegistry::Instance()->Register(matrix);
200 fPainterMatrices->Add(matrix);
204 //_____________________________________________________________________________
206 AliMUONPainterHelper::GenerateGeometry()
208 /// Generate the geometry (FIXME: using transform.dat for the moment)
209 /// The geometry is not the "normal" one as we "explode" it to avoid
210 /// having overlapping detection elements as in the reality, which
211 /// would be inconvenient for a display ;-)
213 AliDebug(1,Form(" with explodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]));
215 AliMUONGeometryTransformer transformer;
216 transformer.LoadGeometryData("transform.dat");
217 // transformer.LoadGeometryData("geometry.root"); //FIXME: add a protection if geometry.root file does not exist
218 fExplodedGlobalTransformations = new AliMpExMap(true);
219 fRealGlobalTransformations = new AliMpExMap(true);
220 AliMpDEIterator deIt;
222 while ( !deIt.IsDone() )
224 Int_t detElemId = deIt.CurrentDEId();
225 const AliMUONGeometryDetElement* de = transformer.GetDetElement(detElemId);
227 fRealGlobalTransformations->Add(detElemId,de->GetGlobalTransformation()->Clone());
229 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(de->GetGlobalTransformation()->Clone());
230 Double_t* translation = matrix->GetTranslation();
232 AliDebug(1,Form("Initial translation for DE %04d is %7.3f, %7.3f",
233 detElemId,translation[0],translation[1]));
235 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345 )
237 translation[0] *= fExplodeFactor[0];
238 translation[1] *= fExplodeFactor[1];
242 Double_t shift = 5; // cm
243 Double_t xshift[] = { shift, -shift, -shift, shift };
244 Double_t yshift[] = { shift, shift, -shift, -shift };
245 Int_t ishift = detElemId % 100;
247 translation[0] += xshift[ishift];
248 translation[1] += yshift[ishift];
250 matrix->SetTranslation(translation);
251 fExplodedGlobalTransformations->Add(detElemId,matrix);
256 //_____________________________________________________________________________
257 AliMUONPainterContour*
258 AliMUONPainterHelper::GenerateManuContour(Int_t detElemId,
260 AliMUONAttPainter viewType,
261 const char* contourName)
263 /// Generate the contour of the list of pads
265 if (!fContourMaker) fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
267 AliMUONPainterContour* contour =
268 fContourMaker->GenerateManuContour(contourName,detElemId,manuId,viewType);
272 RegisterContour(contour);
278 //_____________________________________________________________________________
280 AliMUONPainterHelper::GeneratePadStore()
282 /// Generate the pad store
285 AliDebugClass(1,"Generating pad store");
286 fPadStore = new AliMUONPainterPadStore();
288 AliMpDEIterator deIt;
291 while ( !deIt.IsDone() )
293 Int_t detElemId = deIt.CurrentDEId();
294 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
296 GeneratePadStore(detElemId);
302 //_____________________________________________________________________________
304 AliMUONPainterHelper::GeneratePadStore(Int_t detElemId)
306 /// Generate part of the padstore for one detection element
308 AliMp::CathodType cathode[] = { AliMp::kCath0, AliMp::kCath1 };
310 for ( Int_t i = 0; i < 2; ++i )
312 const AliMpVSegmentation* seg =
313 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode[i]);
314 AliMpVPadIterator* it = seg->CreateIterator();
317 while ( !it->IsDone() )
319 AliMpPad pad = it->CurrentItem();
321 TVector2 localPosition(pad.Position());
323 Local2Global(detElemId,localPosition.X(),localPosition.Y(),0,
325 Int_t manuId = pad.GetLocation().GetFirst();
326 Int_t manuChannel = pad.GetLocation().GetSecond();
327 AliMUONVCalibParam* param = fPadStore->Get(detElemId,manuId);
328 param->SetValueAsDouble(manuChannel,0,x);
329 param->SetValueAsDouble(manuChannel,1,y);
330 param->SetValueAsDouble(manuChannel,2,pad.Dimensions().X());
331 param->SetValueAsDouble(manuChannel,3,pad.Dimensions().Y());
338 //_____________________________________________________________________________
340 AliMUONPainterHelper::GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
341 Double_t& xmax, Double_t& ymax) const
343 /// Get the area covered by an array of pads
345 return fPadStore->GetBoundaries(pads,xmin,ymin,xmax,ymax);
348 //_____________________________________________________________________________
350 AliMUONPainterHelper::GetCathodeType(Int_t detElemId, Int_t manuId) const
352 /// Get the cathode type of a given manu
354 AliMp::PlaneType planeType(AliMp::kBendingPlane);
355 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
357 planeType = AliMp::kNonBendingPlane;
359 return AliMpDEManager::GetCathod(detElemId,planeType);
362 //_____________________________________________________________________________
363 AliMUONPainterContour*
364 AliMUONPainterHelper::GetLocalManuContour(Int_t detElemId, Int_t manuId) const
366 /// Retrieve a manu contour (in local coordinates)
367 return fContourMaker->FindLocalManuContour(detElemId,manuId);
370 //_____________________________________________________________________________
372 AliMUONPainterHelper::GetMotifPosition(Int_t detElemId, Int_t manuId) const
374 /// Get a given motif position
375 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
376 if ( stationType == AliMp::kStation345 )
378 AliMp::PlaneType planeType(AliMp::kBendingPlane);
379 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
381 planeType = AliMp::kNonBendingPlane;
383 const AliMpSlat* slat = GetSlat(detElemId,planeType);
384 return slat->FindMotifPosition(manuId);
386 else if ( stationType != AliMp::kStationTrigger )
388 AliMp::PlaneType planeType(AliMp::kBendingPlane);
389 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
391 planeType = AliMp::kNonBendingPlane;
393 const AliMpSector* sector = GetSector(detElemId,planeType);
394 return sector->GetMotifMap()->FindMotifPosition(manuId);
396 AliFatalClass("Not supposed to work with trigger");
401 //_____________________________________________________________________________
403 AliMUONPainterHelper::GetPCB(Int_t detElemId, AliMp::CathodType cathodeType,
404 Int_t pcbNumber) const
407 const AliMpSlat* slat = GetSlat(detElemId,cathodeType);
408 if ( slat ) return slat->GetPCB(pcbNumber);
412 //_____________________________________________________________________________
414 AliMUONPainterHelper::GetPCB(Int_t detElemId, AliMp::PlaneType planeType,
415 Int_t pcbNumber) const
418 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,
420 return GetPCB(detElemId,cathodeType,pcbNumber);
423 //_____________________________________________________________________________
425 AliMUONPainterHelper::GetPlaneType(Int_t manuId) const
427 /// Get the planeType of a given manu
429 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
431 return AliMp::kNonBendingPlane;
433 return AliMp::kBendingPlane;
436 //_____________________________________________________________________________
438 AliMUONPainterHelper::GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const
442 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,
445 return GetSlat(detElemId,cathodeType);
448 //_____________________________________________________________________________
450 AliMUONPainterHelper::GetSector(Int_t detElemId, AliMp::PlaneType planeType) const
452 /// Get a given sector
453 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
454 if ( stationType != AliMp::kStation1 && stationType != AliMp::kStation2 ) return 0x0;
456 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,planeType);
458 const AliMpVSegmentation* seg =
459 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathodeType);
461 const AliMpSectorSegmentation* sectorSeg = static_cast<const AliMpSectorSegmentation*>(seg);
462 return sectorSeg->GetSector();
466 //_____________________________________________________________________________
468 AliMUONPainterHelper::GetSlat(Int_t detElemId, AliMp::CathodType cathodeType) const
471 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
472 if ( stationType != AliMp::kStation345 ) return 0x0;
474 const AliMpVSegmentation* seg =
475 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathodeType);
477 const AliMpSlatSegmentation* slatSeg = static_cast<const AliMpSlatSegmentation*>(seg);
478 return slatSeg->Slat();
481 //_____________________________________________________________________________
483 AliMUONPainterHelper::GetSlat(Int_t detElemId, Int_t manuId) const
486 const AliMpVSegmentation* seg =
487 AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(detElemId,manuId);
489 const AliMpSlatSegmentation* slatSeg = static_cast<const AliMpSlatSegmentation*>(seg);
490 return slatSeg->Slat();
493 //_____________________________________________________________________________
494 AliMUONPainterHelper*
495 AliMUONPainterHelper::Instance()
497 /// Return the global and unique instance of this class
499 if (fgInstance) return fgInstance;
501 AliMUONPainterEnv env;
503 TString fileName(gSystem->ExpandPathName(env.String("PadStoreFileName","$HOME/padstore.root")));
505 if ( gSystem->AccessPathName(fileName.Data(),kFileExists) ) // mind the strange return value of that method...
507 // file does NOT exist yet. Create it
508 AliDebugClass(1,"Generating instance");
512 new TGMsgBox(gClient->GetRoot(),gClient->GetRoot(),"",
513 Form("File %s not found.\nI will generate it, and this will take a while.\n"
514 "Click OK (and grab a cup of coffee ;-) ) to proceed,\n or Cancel to quit.",fileName.Data()),
518 if ( ret == kMBCancel ) exit(1);
520 fgInstance = new AliMUONPainterHelper;
521 fgInstance->GenerateGeometry();
522 fgInstance->GeneratePadStore();
523 fgInstance->GenerateDefaultMatrices();
524 fgInstance->Modified(kTRUE);
525 fgInstance->fEnv = new AliMUONPainterEnv;
526 fgInstance->fEnv->Set("PadStoreFileName",fileName.Data());
532 AliDebugClass(1,"Reading instance");
533 TFile f(fileName.Data());
534 fgInstance = static_cast<AliMUONPainterHelper*>(f.Get("AliMUONPainterHelper"));
536 TIter next(fgInstance->fPainterMatrices);
537 AliMUONPainterMatrix* matrix;
538 while ( ( matrix = static_cast<AliMUONPainterMatrix*>(next()) ) )
540 AliMUONPainterRegistry::Instance()->Register(matrix);
542 fgInstance->fPainterMatrices->SetOwner(kFALSE);
543 fgInstance->fEnv = new AliMUONPainterEnv;
548 //_____________________________________________________________________________
550 AliMUONPainterHelper::Global2Local(Int_t detElemId,
551 Double_t xg, Double_t yg, Double_t zg,
552 Double_t& xl, Double_t& yl, Double_t& zl) const
554 /// Local to global transformation of coordinates
556 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExplodedGlobalTransformations->GetValue(detElemId));
557 Double_t pg[3] = { xg, yg, zg };
558 Double_t pl[3] = { 0., 0., 0. };
559 matrix->MasterToLocal(pg, pl);
565 //_____________________________________________________________________________
567 AliMUONPainterHelper::Global2LocalReal(Int_t detElemId,
568 Double_t xg, Double_t yg, Double_t zg,
569 Double_t& xl, Double_t& yl, Double_t& zl) const
571 /// Local to global transformation of coordinates
573 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fRealGlobalTransformations->GetValue(detElemId));
574 Double_t pg[3] = { xg, yg, zg };
575 Double_t pl[3] = { 0., 0., 0. };
576 matrix->MasterToLocal(pg, pl);
582 //_____________________________________________________________________________
584 AliMUONPainterHelper::Local2Global(Int_t detElemId,
585 Double_t xl, Double_t yl, Double_t zl,
586 Double_t& xg, Double_t& yg, Double_t& zg) const
588 /// Local to (exploded) global transformation of coordinates
590 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExplodedGlobalTransformations->GetValue(detElemId));
591 Double_t pl[3] = { xl, yl, zl };
592 Double_t pg[3] = { 0., 0., 0. };
593 matrix->LocalToMaster(pl, pg);
599 //_____________________________________________________________________________
601 AliMUONPainterHelper::Local2GlobalReal(Int_t detElemId,
602 Double_t xl, Double_t yl, Double_t zl,
603 Double_t& xg, Double_t& yg, Double_t& zg) const
605 /// Local to (real) global transformation of coordinates
607 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fRealGlobalTransformations->GetValue(detElemId));
608 Double_t pl[3] = { xl, yl, zl };
609 Double_t pg[3] = { 0., 0., 0. };
610 matrix->LocalToMaster(pl, pg);
616 //_____________________________________________________________________________
618 AliMUONPainterHelper::ColorFromValue(Double_t value, Double_t min, Double_t max) const
620 /// Convert a value into a color, fitting within a given range
624 if (value > max) rv = 1;
625 else if (value <= min) rv = 0;
628 if ( max == min ) return gStyle->GetColorPalette(1);
629 Double_t range = max - min;
630 Double_t offset = value - min;
631 rv = gStyle->GetColorPalette( 1 + int( offset*(gStyle->GetNumberOfColors()-2)/range - 0.5 ) );
636 //_____________________________________________________________________________
637 AliMUONPainterContour*
638 AliMUONPainterHelper::MergeContours(const TObjArray& contours,
639 const char* contourName)
641 /// Merge a set of contours (delegating to the contour maker)
644 fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
647 AliMUONPainterContour* contour = fContourMaker->MergeContours(contours,
652 RegisterContour(contour);
658 //_____________________________________________________________________________
660 AliMUONPainterHelper::Print(Option_t* opt) const
666 if ( sopt.Length() == 0 )
668 cout << Form("ExplodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]) << endl;
669 cout << Form("PadStore=%x",fPadStore);
670 if ( fPadStore ) cout << Form(" with %d pads",fPadStore->GetSize());
672 cout << Form("GlobalTransformations=%x",fExplodedGlobalTransformations);
673 if ( fExplodedGlobalTransformations ) cout << Form(" with %d transformations",fExplodedGlobalTransformations->GetSize());
677 cout << Form(" with %d contours",fContourMaker->Size());
681 cout << "No contour";
696 if ( sopt.Contains("CONTOUR") || sopt.Contains("FULL") )
698 fContourMaker->Print(opt);
701 if ( sopt.Contains("MATRI") || sopt.Contains("FULL") )
703 fPainterMatrices->Print(opt);
707 //_____________________________________________________________________________
709 AliMUONPainterHelper::RegisterContour(AliMUONPainterContour* contour)
711 /// contour is adopted by contourMaker
713 AliDebug(1,contour->GetName());
714 if ( fContourMaker->HasContour(contour->GetName()) )
716 AliError(Form("Contour with name %s is already there",contour->GetName()));
720 fContourMaker->Add(contour);
724 //_____________________________________________________________________________
726 AliMUONPainterHelper::Save()
730 if (!IsModified()) return;
738 fgInstance->Env()->Save();
740 TString fileName(gSystem->ExpandPathName(fgInstance->Env()->String("PadStoreFileName")));
742 AliInfo(Form("Saving to %s",fileName.Data()));
744 TFile f(fileName,"RECREATE");
746 fgInstance->Write("");
751 //_____________________________________________________________________________
753 AliMUONPainterHelper::PadByExplodedPosition(Int_t detElemId, Int_t manuId,
754 Double_t x, Double_t y) const
756 /// Find a pad by exploded position. FIXME: not really used nor tested !
760 // Local2Global(detElemId,0.0,0.0,0.0,dummy,dummy,z); // to find z
762 AliDebug(1,Form("DE %04d ManuID %04d x %7.3f y %7.3f",detElemId,manuId,x,y));
764 Exploded2Real(detElemId,x,y,0,xr,yr,zr);
766 AliDebug(1,Form("xr %7.3f yr %7.3f zr %7.3f",xr,yr,zr));
770 Global2LocalReal(detElemId,xr,yr,zr,xl,yl,zl);
772 AliDebug(1,Form("xl %7.3f yl %7.3f zl %7.3f",xl,yl,zl));
774 const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(detElemId,manuId);
776 AliDebug(1,Form("dx,dy=%7.3f,%7.3f",seg->Dimensions().X(),seg->Dimensions().Y()));
778 return seg->PadByPosition(TVector2(xl,yl));
781 //_____________________________________________________________________________
783 AliMUONPainterHelper::Exploded2Real(Int_t detElemId,
784 Double_t xe, Double_t ye, Double_t ze,
785 Double_t& xr, Double_t& yr, Double_t& zr) const
787 /// Convert exploded coordinates into real ones. FIXME: not really used nor tested !
789 // first go back to local
793 Global2Local(detElemId,xe,ye,ze,xl,yl,zl);
795 // and then back to global but not exploded
797 Local2GlobalReal(detElemId,xl,yl,zl,xr,yr,zr);
800 //_____________________________________________________________________________
802 AliMUONPainterHelper::ChamberName(Int_t chamberId) const
804 /// Build a name for one chamber
805 return Form("Chamber%1d",chamberId);
808 //_____________________________________________________________________________
810 AliMUONPainterHelper::StationName(Int_t stationId) const
812 /// Build a name for one station
813 return Form("Station%1d",stationId+1);
816 //_____________________________________________________________________________
818 AliMUONPainterHelper::DEName(Int_t detElemId) const
820 /// Build a name for one detection element
821 return Form("DE%04d",detElemId);
824 //_____________________________________________________________________________
826 AliMUONPainterHelper::ManuName(Int_t manuId) const
828 /// Build a name for one manu
829 return Form("MANU%04d",manuId);
832 //_____________________________________________________________________________
834 AliMUONPainterHelper::BusPatchName(Int_t busPatchId) const
836 /// Build a name for one buspatch
837 return Form("BUSPATCH%04d",busPatchId);
840 //_____________________________________________________________________________
842 AliMUONPainterHelper::PCBName(Int_t pcbNumber) const
844 /// Build a name for one pcb
845 return Form("PCB%1d",pcbNumber);
848 //_____________________________________________________________________________
850 AliMUONPainterHelper::ChamberPathName(Int_t chamberId) const
852 /// Build a name for one chamber
853 return Form("%s/%s",StationName(chamberId/2).Data(),ChamberName(chamberId).Data());
856 //_____________________________________________________________________________
858 AliMUONPainterHelper::StationPathName(Int_t stationId) const
860 /// Build a name for one station
861 return StationName(stationId);
864 //_____________________________________________________________________________
866 AliMUONPainterHelper::DEPathName(Int_t detElemId) const
868 /// Build a name for one detection element
870 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
872 return Form("%s/%s/%s",
873 StationName(chamberId/2).Data(),
874 ChamberName(chamberId).Data(),
875 DEName(detElemId).Data());
878 //_____________________________________________________________________________
880 AliMUONPainterHelper::ManuPathName(Int_t detElemId, Int_t manuId) const
882 /// Build a name for one manu
883 return Form("%s/%s",DEPathName(detElemId).Data(),ManuName(manuId).Data());
886 //_____________________________________________________________________________
888 AliMUONPainterHelper::BusPatchPathName(Int_t busPatchId) const
890 /// Build a name for one buspatch
891 Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(busPatchId);
893 return Form("%s/%s",DEPathName(detElemId).Data(),BusPatchName(busPatchId).Data());
896 //_____________________________________________________________________________
898 AliMUONPainterHelper::PCBPathName(Int_t detElemId, Int_t pcbNumber) const
900 /// Build a name for one pcb
901 return Form("%s/%s",DEPathName(detElemId).Data(),PCBName(pcbNumber).Data());
904 //_____________________________________________________________________________
906 AliMUONPainterHelper::FormatValue(const char* name, Double_t value) const
908 /// Format a double value to be displayed
909 /// FIXME: should insure we have the right number of significant digits here...
911 return Form("%s = %e",name,value);