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 **************************************************************************/
19 #include "AliMUONPainterHelper.h"
21 #include "AliMUONGeometryDetElement.h"
22 #include "AliMUONGeometryTransformer.h"
23 #include "AliMUONPainterContour.h"
24 #include "AliMUONPainterContourMaker.h"
25 #include "AliMUONPainterEnv.h"
26 #include "AliMUONPainterMatrix.h"
27 #include "AliMUONPainterPadStore.h"
28 #include "AliMUONPainterRegistry.h"
29 #include "AliMUONVCalibParam.h"
30 #include "AliMUONVDigit.h"
31 #include "AliMUONVTrackerData.h"
33 #include "AliMpConstants.h"
34 #include "AliMpDDLStore.h"
35 #include "AliMpDEIterator.h"
36 #include "AliMpDEManager.h"
37 #include "AliMpExMap.h"
38 #include "AliMpMotifMap.h"
39 #include "AliMpMotifPosition.h"
42 #include "AliMpSector.h"
43 #include "AliMpSegmentation.h"
44 #include "AliMpSlat.h"
45 #include "AliMpStationType.h"
46 #include "AliMpVPadIterator.h"
47 #include "AliCodeTimer.h"
49 #include <Riostream.h>
53 #include <TCollection.h>
56 #include <TGeoMatrix.h>
61 #include <TObjArray.h>
62 #include <TObjString.h>
67 #include <TVirtualPad.h>
68 #include <TVirtualX.h>
70 ///\class AliMUONPainterHelper
72 /// Helper class for painters
74 ///\author Laurent Aphecetche, Subatech
77 ClassImp(AliMUONPainterHelper)
80 AliMUONPainterHelper* AliMUONPainterHelper::fgInstance(0x0);
82 //_____________________________________________________________________________
83 AliMUONPainterHelper::AliMUONPainterHelper() :
86 fExplodedGlobalTransformations(0x0),
87 fRealGlobalTransformations(0x0),
90 fPainterMatrices(0x0),
94 fExplodeFactor[0] = 1.00;
95 fExplodeFactor[1] = 1.50;
97 if ( ! AliMpCDB::LoadMpSegmentation() )
99 AliFatal("Could not access mapping from OCDB !");
103 if ( ! AliMpCDB::LoadDDLStore() )
105 AliFatal("Could not access DDL Store from OCDB !");
109 //_____________________________________________________________________________
110 AliMUONPainterHelper::~AliMUONPainterHelper()
113 if ( fIsModified ) Save();
114 delete fExplodedGlobalTransformations;
115 delete fRealGlobalTransformations;
117 delete fContourMaker;
118 delete fPainterMatrices;
122 //_____________________________________________________________________________
123 AliMUONPainterContour*
124 AliMUONPainterHelper::GetContour(const char* contourName) const
126 /// Get a contour by name
132 return fContourMaker->GetContour(contourName);
137 //_____________________________________________________________________________
139 AliMUONPainterHelper::FindPadID(const TArrayI& pads, Double_t x, Double_t y) const
141 /// Find a pad by position
143 return fPadStore->FindPadID(pads,x,y);
146 //_____________________________________________________________________________
148 AliMUONPainterHelper::GenerateDefaultMatrices()
150 /// Kind of bootstrap method to trigger the generation of all contours
152 fPainterMatrices = new TObjArray;
153 fPainterMatrices->SetOwner(kFALSE);
155 TObjArray attributes;
157 AliMUONAttPainter att;
159 att.SetViewPoint(kTRUE,kFALSE);
160 att.SetPlane(kFALSE,kFALSE);
161 att.SetCathode(kTRUE,kFALSE);
163 AliWarningClass("Should generate back views as well here");
165 attributes.Add(new AliMUONAttPainter(att));
166 att.SetCathode(kFALSE,kTRUE);
167 attributes.Add(new AliMUONAttPainter(att));
168 att.SetCathode(kFALSE,kFALSE);
169 att.SetPlane(kTRUE,kFALSE);
170 attributes.Add(new AliMUONAttPainter(att));
171 att.SetPlane(kFALSE,kTRUE);
172 attributes.Add(new AliMUONAttPainter(att));
174 TIter next(&attributes);
175 AliMUONAttPainter* a;
177 while ( ( a = static_cast<AliMUONAttPainter*>(next()) ) )
179 AliMUONPainterMatrix* matrix = new AliMUONPainterMatrix("Tracker",5,2);
181 for ( Int_t i = 0; i < 10; ++i )
183 AliMUONVPainter* painter = AliMUONVPainter::CreatePainter("AliMUONChamberPainter",*a,i,-1);
185 painter->SetResponder("Chamber");
187 painter->SetOutlined("*",kFALSE);
189 painter->SetOutlined("MANU",kTRUE);
191 for ( Int_t j = 0; j < 3; ++j )
193 painter->SetLine(j,1,4-j);
196 matrix->Adopt(painter);
198 AliMUONPainterRegistry::Instance()->Register(matrix);
199 fPainterMatrices->Add(matrix);
203 //_____________________________________________________________________________
205 AliMUONPainterHelper::GenerateGeometry()
207 /// Generate the geometry (FIXME: using transform.dat for the moment)
208 /// The geometry is not the "normal" one as we "explode" it to avoid
209 /// having overlapping detection elements as in the reality, which
210 /// would be inconvenient for a display ;-)
212 AliDebug(1,Form(" with explodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]));
214 AliMUONGeometryTransformer transformer;
215 transformer.LoadGeometryData("transform.dat");
216 // transformer.LoadGeometryData("geometry.root"); //FIXME: add a protection if geometry.root file does not exist
217 fExplodedGlobalTransformations = new AliMpExMap;
218 fRealGlobalTransformations = new AliMpExMap;
219 AliMpDEIterator deIt;
221 while ( !deIt.IsDone() )
223 Int_t detElemId = deIt.CurrentDEId();
224 const AliMUONGeometryDetElement* de = transformer.GetDetElement(detElemId);
226 fRealGlobalTransformations->Add(detElemId,de->GetGlobalTransformation()->Clone());
228 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(de->GetGlobalTransformation()->Clone());
229 Double_t* translation = matrix->GetTranslation();
231 AliDebug(1,Form("Initial translation for DE %04d is %7.3f, %7.3f",
232 detElemId,translation[0],translation[1]));
234 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345 )
236 translation[0] *= fExplodeFactor[0];
237 translation[1] *= fExplodeFactor[1];
241 Double_t shift = 5; // cm
242 Double_t xshift[] = { shift, -shift, -shift, shift };
243 Double_t yshift[] = { shift, shift, -shift, -shift };
244 Int_t ishift = detElemId % 100;
246 translation[0] += xshift[ishift];
247 translation[1] += yshift[ishift];
249 matrix->SetTranslation(translation);
250 fExplodedGlobalTransformations->Add(detElemId,matrix);
255 //_____________________________________________________________________________
256 AliMUONPainterContour*
257 AliMUONPainterHelper::GenerateManuContour(Int_t detElemId,
259 AliMUONAttPainter viewType,
260 const char* contourName)
262 /// Generate the contour of the list of pads
264 if (!fContourMaker) fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
266 AliMUONPainterContour* contour =
267 fContourMaker->GenerateManuContour(contourName,detElemId,manuId,viewType);
271 RegisterContour(contour);
277 //_____________________________________________________________________________
279 AliMUONPainterHelper::GeneratePadStore()
281 /// Generate the pad store
284 AliDebugClass(1,"Generating pad store");
285 fPadStore = new AliMUONPainterPadStore();
287 AliMpDEIterator deIt;
290 while ( !deIt.IsDone() )
292 Int_t detElemId = deIt.CurrentDEId();
293 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
295 GeneratePadStore(detElemId);
301 //_____________________________________________________________________________
303 AliMUONPainterHelper::GeneratePadStore(Int_t detElemId)
305 /// Generate part of the padstore for one detection element
307 AliMp::CathodType cathode[] = { AliMp::kCath0, AliMp::kCath1 };
309 for ( Int_t i = 0; i < 2; ++i )
311 const AliMpVSegmentation* seg =
312 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode[i]);
313 AliMpVPadIterator* it = seg->CreateIterator();
316 while ( !it->IsDone() )
318 AliMpPad pad = it->CurrentItem();
320 TVector2 localPosition(pad.Position());
322 Local2Global(detElemId,localPosition.X(),localPosition.Y(),0,
324 Int_t manuId = pad.GetLocation().GetFirst();
325 Int_t manuChannel = pad.GetLocation().GetSecond();
326 AliMUONVCalibParam* param = fPadStore->Get(detElemId,manuId);
327 param->SetValueAsDouble(manuChannel,0,x);
328 param->SetValueAsDouble(manuChannel,1,y);
329 param->SetValueAsDouble(manuChannel,2,pad.Dimensions().X());
330 param->SetValueAsDouble(manuChannel,3,pad.Dimensions().Y());
337 //_____________________________________________________________________________
339 AliMUONPainterHelper::GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
340 Double_t& xmax, Double_t& ymax) const
342 /// Get the area covered by an array of pads
344 return fPadStore->GetBoundaries(pads,xmin,ymin,xmax,ymax);
347 //_____________________________________________________________________________
349 AliMUONPainterHelper::GetCathodeType(Int_t detElemId, Int_t manuId) const
351 /// Get the cathode type of a given manu
353 AliMp::PlaneType planeType(AliMp::kBendingPlane);
354 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
356 planeType = AliMp::kNonBendingPlane;
358 return AliMpDEManager::GetCathod(detElemId,planeType);
361 //_____________________________________________________________________________
362 AliMUONPainterContour*
363 AliMUONPainterHelper::GetLocalManuContour(Int_t detElemId, Int_t manuId) const
365 /// Retrieve a manu contour (in local coordinates)
366 return fContourMaker->FindLocalManuContour(detElemId,manuId);
369 //_____________________________________________________________________________
371 AliMUONPainterHelper::GetMotifPosition(Int_t detElemId, Int_t manuId) const
373 /// Get a given motif position
374 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
375 if ( stationType == AliMp::kStation345 )
377 AliMp::PlaneType planeType(AliMp::kBendingPlane);
378 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
380 planeType = AliMp::kNonBendingPlane;
382 const AliMpSlat* slat = GetSlat(detElemId,planeType);
383 return slat->FindMotifPosition(manuId);
385 else if ( stationType != AliMp::kStationTrigger )
387 AliMp::PlaneType planeType(AliMp::kBendingPlane);
388 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
390 planeType = AliMp::kNonBendingPlane;
392 const AliMpSector* sector = GetSector(detElemId,planeType);
393 return sector->GetMotifMap()->FindMotifPosition(manuId);
395 AliFatalClass("Not supposed to work with trigger");
400 //_____________________________________________________________________________
402 AliMUONPainterHelper::GetPCB(Int_t detElemId, AliMp::CathodType cathodeType,
403 Int_t pcbNumber) const
406 const AliMpSlat* slat = GetSlat(detElemId,cathodeType);
407 if ( slat ) return slat->GetPCB(pcbNumber);
411 //_____________________________________________________________________________
413 AliMUONPainterHelper::GetPCB(Int_t detElemId, AliMp::PlaneType planeType,
414 Int_t pcbNumber) const
417 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,
419 return GetPCB(detElemId,cathodeType,pcbNumber);
422 //_____________________________________________________________________________
424 AliMUONPainterHelper::GetPlaneType(Int_t manuId) const
426 /// Get the planeType of a given manu
428 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
430 return AliMp::kNonBendingPlane;
432 return AliMp::kBendingPlane;
435 //_____________________________________________________________________________
437 AliMUONPainterHelper::GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const
441 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,
444 return GetSlat(detElemId,cathodeType);
447 //_____________________________________________________________________________
449 AliMUONPainterHelper::GetSector(Int_t detElemId, AliMp::PlaneType planeType) const
451 /// Get a given sector
452 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
453 if ( stationType != AliMp::kStation1 && stationType != AliMp::kStation2 ) return 0x0;
455 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,planeType);
457 return AliMpSegmentation::Instance()->GetSector(detElemId,cathodeType);
460 //_____________________________________________________________________________
462 AliMUONPainterHelper::GetSlat(Int_t detElemId, AliMp::CathodType cathodeType) const
465 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
466 if ( stationType != AliMp::kStation345 ) return 0x0;
468 return AliMpSegmentation::Instance()->GetSlat(detElemId,cathodeType);
471 //_____________________________________________________________________________
473 AliMUONPainterHelper::GetSlat(Int_t detElemId, Int_t manuId) const
476 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
477 if ( stationType != AliMp::kStation345 ) return 0x0;
479 return AliMpSegmentation::Instance()->GetSlatByElectronics(detElemId,manuId);
482 //_____________________________________________________________________________
483 AliMUONPainterHelper*
484 AliMUONPainterHelper::Instance()
486 /// Return the global and unique instance of this class
488 if (fgInstance) return fgInstance;
490 AliMUONPainterEnv env;
492 TString fileName(gSystem->ExpandPathName(env.String("PadStoreFileName","$HOME/padstore.root")));
494 if ( gSystem->AccessPathName(fileName.Data(),kFileExists) ) // mind the strange return value of that method...
496 // file does NOT exist yet. Create it
497 AliDebugClass(1,"Generating instance");
501 new TGMsgBox(gClient->GetRoot(),gClient->GetRoot(),"",
502 Form("File %s not found.\nI will generate it, and this will take a while.\n"
503 "Click OK (and grab a cup of coffee ;-) ) to proceed,\n or Cancel to quit.",fileName.Data()),
507 if ( ret == kMBCancel ) exit(1);
509 fgInstance = new AliMUONPainterHelper;
510 fgInstance->GenerateGeometry();
511 fgInstance->GeneratePadStore();
512 fgInstance->GenerateDefaultMatrices();
513 fgInstance->Modified(kTRUE);
514 fgInstance->fEnv = new AliMUONPainterEnv;
515 fgInstance->fEnv->Set("PadStoreFileName",fileName.Data());
521 AliDebugClass(1,"Reading instance");
522 TFile f(fileName.Data());
523 fgInstance = static_cast<AliMUONPainterHelper*>(f.Get("AliMUONPainterHelper"));
525 TIter next(fgInstance->fPainterMatrices);
526 AliMUONPainterMatrix* matrix;
527 while ( ( matrix = static_cast<AliMUONPainterMatrix*>(next()) ) )
529 AliMUONPainterRegistry::Instance()->Register(matrix);
531 fgInstance->fPainterMatrices->SetOwner(kFALSE);
532 fgInstance->fEnv = new AliMUONPainterEnv;
537 //_____________________________________________________________________________
539 AliMUONPainterHelper::Global2Local(Int_t detElemId,
540 Double_t xg, Double_t yg, Double_t zg,
541 Double_t& xl, Double_t& yl, Double_t& zl) const
543 /// Local to global transformation of coordinates
545 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExplodedGlobalTransformations->GetValue(detElemId));
546 Double_t pg[3] = { xg, yg, zg };
547 Double_t pl[3] = { 0., 0., 0. };
548 matrix->MasterToLocal(pg, pl);
554 //_____________________________________________________________________________
556 AliMUONPainterHelper::Global2LocalReal(Int_t detElemId,
557 Double_t xg, Double_t yg, Double_t zg,
558 Double_t& xl, Double_t& yl, Double_t& zl) const
560 /// Local to global transformation of coordinates
562 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fRealGlobalTransformations->GetValue(detElemId));
563 Double_t pg[3] = { xg, yg, zg };
564 Double_t pl[3] = { 0., 0., 0. };
565 matrix->MasterToLocal(pg, pl);
571 //_____________________________________________________________________________
573 AliMUONPainterHelper::Local2Global(Int_t detElemId,
574 Double_t xl, Double_t yl, Double_t zl,
575 Double_t& xg, Double_t& yg, Double_t& zg) const
577 /// Local to (exploded) global transformation of coordinates
579 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExplodedGlobalTransformations->GetValue(detElemId));
580 Double_t pl[3] = { xl, yl, zl };
581 Double_t pg[3] = { 0., 0., 0. };
582 matrix->LocalToMaster(pl, pg);
588 //_____________________________________________________________________________
590 AliMUONPainterHelper::Local2GlobalReal(Int_t detElemId,
591 Double_t xl, Double_t yl, Double_t zl,
592 Double_t& xg, Double_t& yg, Double_t& zg) const
594 /// Local to (real) global transformation of coordinates
596 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fRealGlobalTransformations->GetValue(detElemId));
597 Double_t pl[3] = { xl, yl, zl };
598 Double_t pg[3] = { 0., 0., 0. };
599 matrix->LocalToMaster(pl, pg);
605 //_____________________________________________________________________________
607 AliMUONPainterHelper::ColorFromValue(Double_t value, Double_t min, Double_t max) const
609 /// Convert a value into a color, fitting within a given range
613 if (value > max) rv = 1;
614 else if (value <= min) rv = 0;
617 if ( max == min ) return gStyle->GetColorPalette(1);
618 Double_t range = max - min;
619 Double_t offset = value - min;
620 rv = gStyle->GetColorPalette( 1 + int( offset*(gStyle->GetNumberOfColors()-2)/range - 0.5 ) );
625 //_____________________________________________________________________________
626 AliMUONPainterContour*
627 AliMUONPainterHelper::MergeContours(const TObjArray& contours,
628 const char* contourName)
630 /// Merge a set of contours (delegating to the contour maker)
633 fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
636 AliMUONPainterContour* contour = fContourMaker->MergeContours(contours,
641 RegisterContour(contour);
647 //_____________________________________________________________________________
649 AliMUONPainterHelper::Print(Option_t* opt) const
655 if ( sopt.Length() == 0 )
657 cout << Form("ExplodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]) << endl;
658 cout << Form("PadStore=%x",fPadStore);
659 if ( fPadStore ) cout << Form(" with %d pads",fPadStore->GetSize());
661 cout << Form("GlobalTransformations=%x",fExplodedGlobalTransformations);
662 if ( fExplodedGlobalTransformations ) cout << Form(" with %d transformations",fExplodedGlobalTransformations->GetSize());
666 cout << Form(" with %d contours",fContourMaker->Size());
670 cout << "No contour";
685 if ( sopt.Contains("CONTOUR") || sopt.Contains("FULL") )
687 fContourMaker->Print(opt);
690 if ( sopt.Contains("MATRI") || sopt.Contains("FULL") )
692 fPainterMatrices->Print(opt);
696 //_____________________________________________________________________________
698 AliMUONPainterHelper::RegisterContour(AliMUONPainterContour* contour)
700 /// contour is adopted by contourMaker
702 AliDebug(1,contour->GetName());
703 if ( fContourMaker->HasContour(contour->GetName()) )
705 AliError(Form("Contour with name %s is already there",contour->GetName()));
709 fContourMaker->Add(contour);
713 //_____________________________________________________________________________
715 AliMUONPainterHelper::Save()
719 if (!IsModified()) return;
727 fgInstance->Env()->Save();
729 TString fileName(gSystem->ExpandPathName(fgInstance->Env()->String("PadStoreFileName")));
731 AliInfo(Form("Saving to %s",fileName.Data()));
733 TFile f(fileName,"RECREATE");
735 fgInstance->Write("");
740 //_____________________________________________________________________________
742 AliMUONPainterHelper::PadByExplodedPosition(Int_t detElemId, Int_t manuId,
743 Double_t x, Double_t y) const
745 /// Find a pad by exploded position. FIXME: not really used nor tested !
749 // Local2Global(detElemId,0.0,0.0,0.0,dummy,dummy,z); // to find z
751 AliDebug(1,Form("DE %04d ManuID %04d x %7.3f y %7.3f",detElemId,manuId,x,y));
753 Exploded2Real(detElemId,x,y,0,xr,yr,zr);
755 AliDebug(1,Form("xr %7.3f yr %7.3f zr %7.3f",xr,yr,zr));
759 Global2LocalReal(detElemId,xr,yr,zr,xl,yl,zl);
761 AliDebug(1,Form("xl %7.3f yl %7.3f zl %7.3f",xl,yl,zl));
763 const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(detElemId,manuId);
765 AliDebug(1,Form("dx,dy=%7.3f,%7.3f",seg->Dimensions().X(),seg->Dimensions().Y()));
767 return seg->PadByPosition(TVector2(xl,yl));
770 //_____________________________________________________________________________
772 AliMUONPainterHelper::Exploded2Real(Int_t detElemId,
773 Double_t xe, Double_t ye, Double_t ze,
774 Double_t& xr, Double_t& yr, Double_t& zr) const
776 /// Convert exploded coordinates into real ones. FIXME: not really used nor tested !
778 // first go back to local
782 Global2Local(detElemId,xe,ye,ze,xl,yl,zl);
784 // and then back to global but not exploded
786 Local2GlobalReal(detElemId,xl,yl,zl,xr,yr,zr);
789 //_____________________________________________________________________________
791 AliMUONPainterHelper::ChamberName(Int_t chamberId) const
793 /// Build a name for one chamber
794 return Form("Chamber%1d",chamberId);
797 //_____________________________________________________________________________
799 AliMUONPainterHelper::StationName(Int_t stationId) const
801 /// Build a name for one station
802 return Form("Station%1d",stationId+1);
805 //_____________________________________________________________________________
807 AliMUONPainterHelper::DEName(Int_t detElemId) const
809 /// Build a name for one detection element
810 return Form("DE%04d",detElemId);
813 //_____________________________________________________________________________
815 AliMUONPainterHelper::ManuName(Int_t manuId) const
817 /// Build a name for one manu
818 return Form("MANU%04d",manuId);
821 //_____________________________________________________________________________
823 AliMUONPainterHelper::BusPatchName(Int_t busPatchId) const
825 /// Build a name for one buspatch
826 return Form("BUSPATCH%04d",busPatchId);
829 //_____________________________________________________________________________
831 AliMUONPainterHelper::PCBName(Int_t pcbNumber) const
833 /// Build a name for one pcb
834 return Form("PCB%1d",pcbNumber);
837 //_____________________________________________________________________________
839 AliMUONPainterHelper::ChamberPathName(Int_t chamberId) const
841 /// Build a name for one chamber
842 return Form("%s/%s",StationName(chamberId/2).Data(),ChamberName(chamberId).Data());
845 //_____________________________________________________________________________
847 AliMUONPainterHelper::StationPathName(Int_t stationId) const
849 /// Build a name for one station
850 return StationName(stationId);
853 //_____________________________________________________________________________
855 AliMUONPainterHelper::DEPathName(Int_t detElemId) const
857 /// Build a name for one detection element
859 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
861 return Form("%s/%s/%s",
862 StationName(chamberId/2).Data(),
863 ChamberName(chamberId).Data(),
864 DEName(detElemId).Data());
867 //_____________________________________________________________________________
869 AliMUONPainterHelper::ManuPathName(Int_t detElemId, Int_t manuId) const
871 /// Build a name for one manu
872 return Form("%s/%s",DEPathName(detElemId).Data(),ManuName(manuId).Data());
875 //_____________________________________________________________________________
877 AliMUONPainterHelper::BusPatchPathName(Int_t busPatchId) const
879 /// Build a name for one buspatch
880 Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(busPatchId);
882 return Form("%s/%s",DEPathName(detElemId).Data(),BusPatchName(busPatchId).Data());
885 //_____________________________________________________________________________
887 AliMUONPainterHelper::PCBPathName(Int_t detElemId, Int_t pcbNumber) const
889 /// Build a name for one pcb
890 return Form("%s/%s",DEPathName(detElemId).Data(),PCBName(pcbNumber).Data());
893 //_____________________________________________________________________________
895 AliMUONPainterHelper::FormatValue(const char* name, Double_t value) const
897 /// Format a double value to be displayed
898 /// FIXME: should insure we have the right number of significant digits here...
900 return Form("%s = %e",name,value);