#include "AliMUONGeometryTransformer.h"
#include "AliMUONManuContourMaker.h"
#include "AliMUONPainterEnv.h"
-#include "AliMUONPainterMatrix.h"
#include "AliMUONPainterRegistry.h"
#include "AliMUONPadStatusMaker.h"
#include "AliMUONVCalibParam.h"
#include <TLine.h>
#include <TList.h>
#include <TMap.h>
+#include <TMath.h>
#include <TObjArray.h>
#include <TObjString.h>
#include <TStyle.h>
//_____________________________________________________________________________
AliMUONPainterHelper::AliMUONPainterHelper() :
TObject(),
-fPainterMatrices(0x0),
fEnv(0x0),
fReal(0x0),
fExploded(0x0)
if ( ! AliMpCDB::LoadDDLStore() )
{
AliFatal("Could not access DDL Store from OCDB !");
- }
-
- fExploded = new AliMUONContourHandler(kTRUE);
+ }
}
//_____________________________________________________________________________
AliMUONPainterHelper::~AliMUONPainterHelper()
{
/// dtor
- delete fPainterMatrices;
delete fReal;
delete fExploded;
fEnv->Save();
fgInstance = 0;
}
+//_____________________________________________________________________________
+AliMUONContourHandler*
+AliMUONPainterHelper::Exploded() const
+{
+ /// Create exploded contour handler
+ if (!fExploded) fExploded = new AliMUONContourHandler(kTRUE);
+ return fExploded;
+}
+
+//_____________________________________________________________________________
+AliMUONContourHandler*
+AliMUONPainterHelper::Real() const
+{
+ /// Create real contour handler
+ if (!fReal) fReal = new AliMUONContourHandler(kFALSE);
+ return fReal;
+}
+
//_____________________________________________________________________________
AliMUONContour*
AliMUONPainterHelper::GetContour(const char* contourName, Bool_t explodedView) const
/// Get a contour by name
if (explodedView)
{
- return fExploded->GetContour(contourName);
+ return Exploded()->GetContour(contourName);
}
else
{
return 0x0;
}
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::GenerateDefaultMatrices()
-{
- /// Kind of bootstrap method to trigger the generation of all contours
-
- AliCodeTimerAuto("");
-
- fPainterMatrices = new TObjArray;
- fPainterMatrices->SetOwner(kFALSE);
-
- TObjArray attributes;
-
- AliMUONAttPainter att;
-
- att.SetViewPoint(kTRUE,kFALSE);
- att.SetCathode(kFALSE,kFALSE);
- att.SetPlane(kTRUE,kFALSE);
- attributes.Add(new AliMUONAttPainter(att));
-
- TIter next(&attributes);
- AliMUONAttPainter* a;
-
- while ( ( a = static_cast<AliMUONAttPainter*>(next()) ) )
- {
- AliMUONPainterMatrix* matrix = new AliMUONPainterMatrix("Tracker",5,2);
-
- for ( Int_t i = 0; i < 10; ++i )
- {
- AliMUONVPainter* painter = new AliMUONChamberPainter(*a,i);
-
- painter->SetResponder("Chamber");
-
- painter->SetOutlined("*",kFALSE);
-
- painter->SetOutlined("MANU",kTRUE);
-
- for ( Int_t j = 0; j < 3; ++j )
- {
- painter->SetLine(j,1,4-j);
- }
-
- matrix->Adopt(painter);
- }
- AliMUONPainterRegistry::Instance()->Register(matrix);
- fPainterMatrices->Add(matrix);
- }
-}
//_____________________________________________________________________________
AliMp::CathodType
if (fgInstance) return fgInstance;
- AliCodeTimerAutoClass("");
+ AliCodeTimerAutoClass("",0);
fgInstance = new AliMUONPainterHelper;
fgInstance->fEnv = new AliMUONPainterEnv;
{
/// Local to global transformation of coordinates
- TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExploded->GetTransformations()->GetValue(detElemId));
+ TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(Exploded()->GetTransformations()->GetValue(detElemId));
Double_t pg[3] = { xg, yg, zg };
Double_t pl[3] = { 0., 0., 0. };
matrix->MasterToLocal(pg, pl);
{
/// Local to (exploded) global transformation of coordinates
- TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(fExploded->GetTransformations()->GetValue(detElemId));
+ TGeoHMatrix* matrix = static_cast<TGeoHMatrix*>(Exploded()->GetTransformations()->GetValue(detElemId));
Double_t pl[3] = { xl, yl, zl };
Double_t pg[3] = { 0., 0., 0. };
matrix->LocalToMaster(pl, pg);
else if (value <= min) rv = 0;
else
{
- if ( max == min ) return gStyle->GetColorPalette(1);
+ if ( TMath::AreEqualRel(max,min,1E-6) ) return gStyle->GetColorPalette(1);
Double_t range = max - min;
Double_t offset = value - min;
rv = gStyle->GetColorPalette( 1 + int( offset*(gStyle->GetNumberOfColors()-2)/range - 0.5 ) );
{
if ( fExploded ) fExploded->Print();
if ( fReal ) fReal->Print();
- }
-
- if ( fPainterMatrices && ( sopt.Contains("MATRI") || sopt.Contains("FULL") ) )
- {
- fPainterMatrices->Print(opt);
- }
+ }
}
//_____________________________________________________________________________
AliMUONPainterHelper::RegisterContour(AliMUONContour* contour, Bool_t explodedView)
{
/// contour is adopted by contourMaker
- AliCodeTimerAuto("")
+ AliCodeTimerAuto("",0)
AliDebug(1,contour->GetName());
AliMUONContourHandler* ch = fReal;
if ( explodedView )
{
- ch = fExploded;
+ ch = Exploded();
}
if (!ch)
{
{
/// Get the contours in a specially arranged array (orderer by hierarchy level)
- if ( explodedView ) return fExploded->AllContourArray(); // fExploded should always be created
-
- if (!fReal) fReal = new AliMUONContourHandler(kFALSE); // fReal might be first asked here.
-
- return fReal->AllContourArray();
+ if ( explodedView )
+ {
+ return Exploded()->AllContourArray();
+ }
+ else
+ {
+ return Real()->AllContourArray();
+ }
}