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 "AliMpSectorSegmentation.h"
44 #include "AliMpSegmentation.h"
45 #include "AliMpSlat.h"
46 #include "AliMpSlatSegmentation.h"
47 #include "AliMpStationType.h"
48 #include "AliMpVPadIterator.h"
49 #include "AliCodeTimer.h"
51 #include <Riostream.h>
55 #include <TCollection.h>
58 #include <TGeoMatrix.h>
63 #include <TObjArray.h>
64 #include <TObjString.h>
69 #include <TVirtualPad.h>
70 #include <TVirtualX.h>
72 ///\class AliMUONPainterHelper
74 /// Helper class for painters
76 ///\author Laurent Aphecetche, Subatech
79 ClassImp(AliMUONPainterHelper)
82 AliMUONPainterHelper* AliMUONPainterHelper::fgInstance(0x0);
84 //_____________________________________________________________________________
85 AliMUONPainterHelper::AliMUONPainterHelper() :
88 fExplodedGlobalTransformations(0x0),
89 fRealGlobalTransformations(0x0),
92 fPainterMatrices(0x0),
96 fExplodeFactor[0] = 1.00;
97 fExplodeFactor[1] = 1.50;
99 if ( ! AliMpCDB::LoadMpSegmentation() )
101 AliFatal("Could not access mapping from OCDB !");
105 if ( ! AliMpCDB::LoadDDLStore() )
107 AliFatal("Could not access DDL Store from OCDB !");
111 //_____________________________________________________________________________
112 AliMUONPainterHelper::~AliMUONPainterHelper()
115 if ( fIsModified ) Save();
116 delete fExplodedGlobalTransformations;
117 delete fRealGlobalTransformations;
119 delete fContourMaker;
120 delete fPainterMatrices;
124 //_____________________________________________________________________________
125 AliMUONPainterContour*
126 AliMUONPainterHelper::GetContour(const char* contourName) const
128 /// Get a contour by name
134 return fContourMaker->GetContour(contourName);
139 //_____________________________________________________________________________
141 AliMUONPainterHelper::FindPadID(const TArrayI& pads, Double_t x, Double_t y) const
143 /// Find a pad by position
145 return fPadStore->FindPadID(pads,x,y);
148 //_____________________________________________________________________________
150 AliMUONPainterHelper::GenerateDefaultMatrices()
152 /// Kind of bootstrap method to trigger the generation of all contours
154 fPainterMatrices = new TObjArray;
155 fPainterMatrices->SetOwner(kFALSE);
157 TObjArray attributes;
159 AliMUONAttPainter att;
161 att.SetViewPoint(kTRUE,kFALSE);
162 att.SetPlane(kFALSE,kFALSE);
163 att.SetCathode(kTRUE,kFALSE);
165 AliWarningClass("Should generate back views as well here");
167 attributes.Add(new AliMUONAttPainter(att));
168 att.SetCathode(kFALSE,kTRUE);
169 attributes.Add(new AliMUONAttPainter(att));
170 att.SetCathode(kFALSE,kFALSE);
171 att.SetPlane(kTRUE,kFALSE);
172 attributes.Add(new AliMUONAttPainter(att));
173 att.SetPlane(kFALSE,kTRUE);
174 attributes.Add(new AliMUONAttPainter(att));
176 TIter next(&attributes);
177 AliMUONAttPainter* a;
179 while ( ( a = static_cast<AliMUONAttPainter*>(next()) ) )
181 AliMUONPainterMatrix* matrix = new AliMUONPainterMatrix("Tracker",5,2);
183 for ( Int_t i = 0; i < 10; ++i )
185 AliMUONVPainter* painter = AliMUONVPainter::CreatePainter("AliMUONChamberPainter",*a,i,-1);
187 painter->SetResponder("Chamber");
189 painter->SetOutlined("*",kFALSE);
191 painter->SetOutlined("MANU",kTRUE);
193 for ( Int_t j = 0; j < 3; ++j )
195 painter->SetLine(j,1,4-j);
198 matrix->Adopt(painter);
200 AliMUONPainterRegistry::Instance()->Register(matrix);
201 fPainterMatrices->Add(matrix);
205 //_____________________________________________________________________________
207 AliMUONPainterHelper::GenerateGeometry()
209 /// Generate the geometry (FIXME: using transform.dat for the moment)
210 /// The geometry is not the "normal" one as we "explode" it to avoid
211 /// having overlapping detection elements as in the reality, which
212 /// would be inconvenient for a display ;-)
214 AliDebug(1,Form(" with explodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]));
216 AliMUONGeometryTransformer transformer;
217 transformer.LoadGeometryData("transform.dat");
218 // transformer.LoadGeometryData("geometry.root"); //FIXME: add a protection if geometry.root file does not exist
219 fExplodedGlobalTransformations = new AliMpExMap(true);
220 fRealGlobalTransformations = new AliMpExMap(true);
221 AliMpDEIterator deIt;
223 while ( !deIt.IsDone() )
225 Int_t detElemId = deIt.CurrentDEId();
226 const AliMUONGeometryDetElement* de = transformer.GetDetElement(detElemId);
228 fRealGlobalTransformations->Add(detElemId,de->GetGlobalTransformation()->Clone());
230 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(de->GetGlobalTransformation()->Clone());
231 Double_t* translation = matrix->GetTranslation();
233 AliDebug(1,Form("Initial translation for DE %04d is %7.3f, %7.3f",
234 detElemId,translation[0],translation[1]));
236 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStation345 )
238 translation[0] *= fExplodeFactor[0];
239 translation[1] *= fExplodeFactor[1];
243 Double_t shift = 5; // cm
244 Double_t xshift[] = { shift, -shift, -shift, shift };
245 Double_t yshift[] = { shift, shift, -shift, -shift };
246 Int_t ishift = detElemId % 100;
248 translation[0] += xshift[ishift];
249 translation[1] += yshift[ishift];
251 matrix->SetTranslation(translation);
252 fExplodedGlobalTransformations->Add(detElemId,matrix);
257 //_____________________________________________________________________________
258 AliMUONPainterContour*
259 AliMUONPainterHelper::GenerateManuContour(Int_t detElemId,
261 AliMUONAttPainter viewType,
262 const char* contourName)
264 /// Generate the contour of the list of pads
266 if (!fContourMaker) fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
268 AliMUONPainterContour* contour =
269 fContourMaker->GenerateManuContour(contourName,detElemId,manuId,viewType);
273 RegisterContour(contour);
279 //_____________________________________________________________________________
281 AliMUONPainterHelper::GeneratePadStore()
283 /// Generate the pad store
286 AliDebugClass(1,"Generating pad store");
287 fPadStore = new AliMUONPainterPadStore();
289 AliMpDEIterator deIt;
292 while ( !deIt.IsDone() )
294 Int_t detElemId = deIt.CurrentDEId();
295 if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
297 GeneratePadStore(detElemId);
303 //_____________________________________________________________________________
305 AliMUONPainterHelper::GeneratePadStore(Int_t detElemId)
307 /// Generate part of the padstore for one detection element
309 AliMp::CathodType cathode[] = { AliMp::kCath0, AliMp::kCath1 };
311 for ( Int_t i = 0; i < 2; ++i )
313 const AliMpVSegmentation* seg =
314 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode[i]);
315 AliMpVPadIterator* it = seg->CreateIterator();
318 while ( !it->IsDone() )
320 AliMpPad pad = it->CurrentItem();
322 TVector2 localPosition(pad.Position());
324 Local2Global(detElemId,localPosition.X(),localPosition.Y(),0,
326 Int_t manuId = pad.GetLocation().GetFirst();
327 Int_t manuChannel = pad.GetLocation().GetSecond();
328 AliMUONVCalibParam* param = fPadStore->Get(detElemId,manuId);
329 param->SetValueAsDouble(manuChannel,0,x);
330 param->SetValueAsDouble(manuChannel,1,y);
331 param->SetValueAsDouble(manuChannel,2,pad.Dimensions().X());
332 param->SetValueAsDouble(manuChannel,3,pad.Dimensions().Y());
339 //_____________________________________________________________________________
341 AliMUONPainterHelper::GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
342 Double_t& xmax, Double_t& ymax) const
344 /// Get the area covered by an array of pads
346 return fPadStore->GetBoundaries(pads,xmin,ymin,xmax,ymax);
349 //_____________________________________________________________________________
351 AliMUONPainterHelper::GetCathodeType(Int_t detElemId, Int_t manuId) const
353 /// Get the cathode type of a given manu
355 AliMp::PlaneType planeType(AliMp::kBendingPlane);
356 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
358 planeType = AliMp::kNonBendingPlane;
360 return AliMpDEManager::GetCathod(detElemId,planeType);
363 //_____________________________________________________________________________
364 AliMUONPainterContour*
365 AliMUONPainterHelper::GetLocalManuContour(Int_t detElemId, Int_t manuId) const
367 /// Retrieve a manu contour (in local coordinates)
368 return fContourMaker->FindLocalManuContour(detElemId,manuId);
371 //_____________________________________________________________________________
373 AliMUONPainterHelper::GetMotifPosition(Int_t detElemId, Int_t manuId) const
375 /// Get a given motif position
376 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
377 if ( stationType == AliMp::kStation345 )
379 AliMp::PlaneType planeType(AliMp::kBendingPlane);
380 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
382 planeType = AliMp::kNonBendingPlane;
384 const AliMpSlat* slat = GetSlat(detElemId,planeType);
385 return slat->FindMotifPosition(manuId);
387 else if ( stationType != AliMp::kStationTrigger )
389 AliMp::PlaneType planeType(AliMp::kBendingPlane);
390 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
392 planeType = AliMp::kNonBendingPlane;
394 const AliMpSector* sector = GetSector(detElemId,planeType);
395 return sector->GetMotifMap()->FindMotifPosition(manuId);
397 AliFatalClass("Not supposed to work with trigger");
402 //_____________________________________________________________________________
404 AliMUONPainterHelper::GetPCB(Int_t detElemId, AliMp::CathodType cathodeType,
405 Int_t pcbNumber) const
408 const AliMpSlat* slat = GetSlat(detElemId,cathodeType);
409 if ( slat ) return slat->GetPCB(pcbNumber);
413 //_____________________________________________________________________________
415 AliMUONPainterHelper::GetPCB(Int_t detElemId, AliMp::PlaneType planeType,
416 Int_t pcbNumber) const
419 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,
421 return GetPCB(detElemId,cathodeType,pcbNumber);
424 //_____________________________________________________________________________
426 AliMUONPainterHelper::GetPlaneType(Int_t manuId) const
428 /// Get the planeType of a given manu
430 if ( manuId & AliMpConstants::ManuMask(AliMp::kNonBendingPlane) )
432 return AliMp::kNonBendingPlane;
434 return AliMp::kBendingPlane;
437 //_____________________________________________________________________________
439 AliMUONPainterHelper::GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const
443 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,
446 return GetSlat(detElemId,cathodeType);
449 //_____________________________________________________________________________
451 AliMUONPainterHelper::GetSector(Int_t detElemId, AliMp::PlaneType planeType) const
453 /// Get a given sector
454 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
455 if ( stationType != AliMp::kStation1 && stationType != AliMp::kStation2 ) return 0x0;
457 AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,planeType);
459 const AliMpVSegmentation* seg =
460 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathodeType);
462 const AliMpSectorSegmentation* sectorSeg = static_cast<const AliMpSectorSegmentation*>(seg);
463 return sectorSeg->GetSector();
467 //_____________________________________________________________________________
469 AliMUONPainterHelper::GetSlat(Int_t detElemId, AliMp::CathodType cathodeType) const
472 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
473 if ( stationType != AliMp::kStation345 ) return 0x0;
475 const AliMpVSegmentation* seg =
476 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathodeType);
478 const AliMpSlatSegmentation* slatSeg = static_cast<const AliMpSlatSegmentation*>(seg);
479 return slatSeg->Slat();
482 //_____________________________________________________________________________
484 AliMUONPainterHelper::GetSlat(Int_t detElemId, Int_t manuId) const
487 const AliMpVSegmentation* seg =
488 AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(detElemId,manuId);
490 const AliMpSlatSegmentation* slatSeg = static_cast<const AliMpSlatSegmentation*>(seg);
491 return slatSeg->Slat();
494 //_____________________________________________________________________________
495 AliMUONPainterHelper*
496 AliMUONPainterHelper::Instance()
498 /// Return the global and unique instance of this class
500 if (fgInstance) return fgInstance;
502 AliMUONPainterEnv env;
504 TString fileName(gSystem->ExpandPathName(env.String("PadStoreFileName","$HOME/padstore.root")));
506 if ( gSystem->AccessPathName(fileName.Data(),kFileExists) ) // mind the strange return value of that method...
508 // file does NOT exist yet. Create it
509 AliDebugClass(1,"Generating instance");
513 new TGMsgBox(gClient->GetRoot(),gClient->GetRoot(),"",
514 Form("File %s not found.\nI will generate it, and this will take a while.\n"
515 "Click OK (and grab a cup of coffee ;-) ) to proceed,\n or Cancel to quit.",fileName.Data()),
519 if ( ret == kMBCancel ) exit(1);
521 fgInstance = new AliMUONPainterHelper;
522 fgInstance->GenerateGeometry();
523 fgInstance->GeneratePadStore();
524 fgInstance->GenerateDefaultMatrices();
525 fgInstance->Modified(kTRUE);
526 fgInstance->fEnv = new AliMUONPainterEnv;
527 fgInstance->fEnv->Set("PadStoreFileName",fileName.Data());
533 AliDebugClass(1,"Reading instance");
534 TFile f(fileName.Data());
535 fgInstance = static_cast<AliMUONPainterHelper*>(f.Get("AliMUONPainterHelper"));
537 TIter next(fgInstance->fPainterMatrices);
538 AliMUONPainterMatrix* matrix;
539 while ( ( matrix = static_cast<AliMUONPainterMatrix*>(next()) ) )
541 AliMUONPainterRegistry::Instance()->Register(matrix);
543 fgInstance->fPainterMatrices->SetOwner(kFALSE);
544 fgInstance->fEnv = new AliMUONPainterEnv;
549 //_____________________________________________________________________________
551 AliMUONPainterHelper::Global2Local(Int_t detElemId,
552 Double_t xg, Double_t yg, Double_t zg,
553 Double_t& xl, Double_t& yl, Double_t& zl) const
555 /// Local to global transformation of coordinates
557 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExplodedGlobalTransformations->GetValue(detElemId));
558 Double_t pg[3] = { xg, yg, zg };
559 Double_t pl[3] = { 0., 0., 0. };
560 matrix->MasterToLocal(pg, pl);
566 //_____________________________________________________________________________
568 AliMUONPainterHelper::Global2LocalReal(Int_t detElemId,
569 Double_t xg, Double_t yg, Double_t zg,
570 Double_t& xl, Double_t& yl, Double_t& zl) const
572 /// Local to global transformation of coordinates
574 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fRealGlobalTransformations->GetValue(detElemId));
575 Double_t pg[3] = { xg, yg, zg };
576 Double_t pl[3] = { 0., 0., 0. };
577 matrix->MasterToLocal(pg, pl);
583 //_____________________________________________________________________________
585 AliMUONPainterHelper::Local2Global(Int_t detElemId,
586 Double_t xl, Double_t yl, Double_t zl,
587 Double_t& xg, Double_t& yg, Double_t& zg) const
589 /// Local to (exploded) global transformation of coordinates
591 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExplodedGlobalTransformations->GetValue(detElemId));
592 Double_t pl[3] = { xl, yl, zl };
593 Double_t pg[3] = { 0., 0., 0. };
594 matrix->LocalToMaster(pl, pg);
600 //_____________________________________________________________________________
602 AliMUONPainterHelper::Local2GlobalReal(Int_t detElemId,
603 Double_t xl, Double_t yl, Double_t zl,
604 Double_t& xg, Double_t& yg, Double_t& zg) const
606 /// Local to (real) global transformation of coordinates
608 TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fRealGlobalTransformations->GetValue(detElemId));
609 Double_t pl[3] = { xl, yl, zl };
610 Double_t pg[3] = { 0., 0., 0. };
611 matrix->LocalToMaster(pl, pg);
617 //_____________________________________________________________________________
619 AliMUONPainterHelper::ColorFromValue(Double_t value, Double_t min, Double_t max) const
621 /// Convert a value into a color, fitting within a given range
625 if (value > max) rv = 1;
626 else if (value <= min) rv = 0;
629 if ( max == min ) return gStyle->GetColorPalette(1);
630 Double_t range = max - min;
631 Double_t offset = value - min;
632 rv = gStyle->GetColorPalette( 1 + int( offset*(gStyle->GetNumberOfColors()-2)/range - 0.5 ) );
637 //_____________________________________________________________________________
638 AliMUONPainterContour*
639 AliMUONPainterHelper::MergeContours(const TObjArray& contours,
640 const char* contourName)
642 /// Merge a set of contours (delegating to the contour maker)
645 fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
648 AliMUONPainterContour* contour = fContourMaker->MergeContours(contours,
653 RegisterContour(contour);
659 //_____________________________________________________________________________
661 AliMUONPainterHelper::Print(Option_t* opt) const
667 if ( sopt.Length() == 0 )
669 cout << Form("ExplodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]) << endl;
670 cout << Form("PadStore=%x",fPadStore);
671 if ( fPadStore ) cout << Form(" with %d pads",fPadStore->GetSize());
673 cout << Form("GlobalTransformations=%x",fExplodedGlobalTransformations);
674 if ( fExplodedGlobalTransformations ) cout << Form(" with %d transformations",fExplodedGlobalTransformations->GetSize());
678 cout << Form(" with %d contours",fContourMaker->Size());
682 cout << "No contour";
697 if ( sopt.Contains("CONTOUR") || sopt.Contains("FULL") )
699 fContourMaker->Print(opt);
702 if ( sopt.Contains("MATRI") || sopt.Contains("FULL") )
704 fPainterMatrices->Print(opt);
708 //_____________________________________________________________________________
710 AliMUONPainterHelper::RegisterContour(AliMUONPainterContour* contour)
712 /// contour is adopted by contourMaker
714 AliDebug(1,contour->GetName());
715 if ( fContourMaker->HasContour(contour->GetName()) )
717 AliError(Form("Contour with name %s is already there",contour->GetName()));
721 fContourMaker->Add(contour);
725 //_____________________________________________________________________________
727 AliMUONPainterHelper::Save()
731 if (!IsModified()) return;
739 fgInstance->Env()->Save();
741 TString fileName(gSystem->ExpandPathName(fgInstance->Env()->String("PadStoreFileName")));
743 AliInfo(Form("Saving to %s",fileName.Data()));
745 TFile f(fileName,"RECREATE");
747 fgInstance->Write("");
752 //_____________________________________________________________________________
754 AliMUONPainterHelper::PadByExplodedPosition(Int_t detElemId, Int_t manuId,
755 Double_t x, Double_t y) const
757 /// Find a pad by exploded position. FIXME: not really used nor tested !
761 // Local2Global(detElemId,0.0,0.0,0.0,dummy,dummy,z); // to find z
763 AliDebug(1,Form("DE %04d ManuID %04d x %7.3f y %7.3f",detElemId,manuId,x,y));
765 Exploded2Real(detElemId,x,y,0,xr,yr,zr);
767 AliDebug(1,Form("xr %7.3f yr %7.3f zr %7.3f",xr,yr,zr));
771 Global2LocalReal(detElemId,xr,yr,zr,xl,yl,zl);
773 AliDebug(1,Form("xl %7.3f yl %7.3f zl %7.3f",xl,yl,zl));
775 const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(detElemId,manuId);
777 AliDebug(1,Form("dx,dy=%7.3f,%7.3f",seg->Dimensions().X(),seg->Dimensions().Y()));
779 return seg->PadByPosition(TVector2(xl,yl));
782 //_____________________________________________________________________________
784 AliMUONPainterHelper::Exploded2Real(Int_t detElemId,
785 Double_t xe, Double_t ye, Double_t ze,
786 Double_t& xr, Double_t& yr, Double_t& zr) const
788 /// Convert exploded coordinates into real ones. FIXME: not really used nor tested !
790 // first go back to local
794 Global2Local(detElemId,xe,ye,ze,xl,yl,zl);
796 // and then back to global but not exploded
798 Local2GlobalReal(detElemId,xl,yl,zl,xr,yr,zr);
801 //_____________________________________________________________________________
803 AliMUONPainterHelper::ChamberName(Int_t chamberId) const
805 /// Build a name for one chamber
806 return Form("Chamber%1d",chamberId);
809 //_____________________________________________________________________________
811 AliMUONPainterHelper::StationName(Int_t stationId) const
813 /// Build a name for one station
814 return Form("Station%1d",stationId+1);
817 //_____________________________________________________________________________
819 AliMUONPainterHelper::DEName(Int_t detElemId) const
821 /// Build a name for one detection element
822 return Form("DE%04d",detElemId);
825 //_____________________________________________________________________________
827 AliMUONPainterHelper::ManuName(Int_t manuId) const
829 /// Build a name for one manu
830 return Form("MANU%04d",manuId);
833 //_____________________________________________________________________________
835 AliMUONPainterHelper::BusPatchName(Int_t busPatchId) const
837 /// Build a name for one buspatch
838 return Form("BUSPATCH%04d",busPatchId);
841 //_____________________________________________________________________________
843 AliMUONPainterHelper::PCBName(Int_t pcbNumber) const
845 /// Build a name for one pcb
846 return Form("PCB%1d",pcbNumber);
849 //_____________________________________________________________________________
851 AliMUONPainterHelper::ChamberPathName(Int_t chamberId) const
853 /// Build a name for one chamber
854 return Form("%s/%s",StationName(chamberId/2).Data(),ChamberName(chamberId).Data());
857 //_____________________________________________________________________________
859 AliMUONPainterHelper::StationPathName(Int_t stationId) const
861 /// Build a name for one station
862 return StationName(stationId);
865 //_____________________________________________________________________________
867 AliMUONPainterHelper::DEPathName(Int_t detElemId) const
869 /// Build a name for one detection element
871 Int_t chamberId = AliMpDEManager::GetChamberId(detElemId);
873 return Form("%s/%s/%s",
874 StationName(chamberId/2).Data(),
875 ChamberName(chamberId).Data(),
876 DEName(detElemId).Data());
879 //_____________________________________________________________________________
881 AliMUONPainterHelper::ManuPathName(Int_t detElemId, Int_t manuId) const
883 /// Build a name for one manu
884 return Form("%s/%s",DEPathName(detElemId).Data(),ManuName(manuId).Data());
887 //_____________________________________________________________________________
889 AliMUONPainterHelper::BusPatchPathName(Int_t busPatchId) const
891 /// Build a name for one buspatch
892 Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(busPatchId);
894 return Form("%s/%s",DEPathName(detElemId).Data(),BusPatchName(busPatchId).Data());
897 //_____________________________________________________________________________
899 AliMUONPainterHelper::PCBPathName(Int_t detElemId, Int_t pcbNumber) const
901 /// Build a name for one pcb
902 return Form("%s/%s",DEPathName(detElemId).Data(),PCBName(pcbNumber).Data());
905 //_____________________________________________________________________________
907 AliMUONPainterHelper::FormatValue(const char* name, Double_t value) const
909 /// Format a double value to be displayed
910 /// FIXME: should insure we have the right number of significant digits here...
912 return Form("%s = %e",name,value);