3 #include "TPCSectorViz.h"
5 #include <Alieve/TPCData.h>
6 #include <Alieve/TPCSectorData.h>
7 #include <AliTPCParam.h>
13 using namespace Alieve;
15 //______________________________________________________________________
18 // Base class for TPC raw-data visualization.
19 // See TPCSector2D and TPCSector3D for concrete implementations.
21 ClassImp(TPCSectorViz)
23 /**************************************************************************/
25 TPCSectorViz::TPCSectorViz(const Text_t* n, const Text_t* t) :
27 Reve::RenderElement(fFrameColor),
41 fFrameColor ((Color_t) 4),
47 TPCSectorViz::~TPCSectorViz()
49 if(fTPCData) fTPCData->DecRefCount();
52 /**************************************************************************/
54 //UInt_t TPCSectorViz::IncRTS()
60 void TPCSectorViz::SetDataSource(TPCData* data)
62 if(data == fTPCData) return;
63 if(fTPCData) fTPCData->DecRefCount();
65 if(fTPCData) fTPCData->IncRefCount();
69 void TPCSectorViz::SetSectorID(Int_t segment)
71 if(segment < 0 ) segment = 0;
72 if(segment > 35) segment = 35;
77 TPCSectorData* TPCSectorViz::GetSectorData() const
79 return fTPCData ? fTPCData->GetSectorData(fSectorID) : 0;
82 /**************************************************************************/
84 void TPCSectorViz::SetTrans(Bool_t trans)
88 for (Int_t k=0; k<16; ++k)
91 using namespace TMath;
92 Float_t c = Cos((fSectorID + 0.5)*20*Pi()/180 - PiOver2());
93 Float_t s = Sin((fSectorID + 0.5)*20*Pi()/180 - PiOver2());
94 Float_t z = TPCSectorData::GetParam().GetZLength();
95 if(fSectorID >= 18) z = -z;
108 /**************************************************************************/
110 void TPCSectorViz::SetupColor(Int_t val, UChar_t* pixel) const
112 using namespace TMath;
113 Float_t div = Max(1, fMaxVal - fThreshold);
114 Int_t nCol = gStyle->GetNumberOfColors();
115 Int_t cBin = (Int_t) Nint(nCol*(val - fThreshold)/div);
117 ColorFromIdx(gStyle->GetColorPalette(Min(nCol - 1, cBin)), pixel);