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 void TPCSectorViz::SetDataSource(TPCData* data)
56 if(data == fTPCData) return;
57 if(fTPCData) fTPCData->DecRefCount();
59 if(fTPCData) fTPCData->IncRefCount();
63 void TPCSectorViz::SetSectorID(Int_t segment)
65 if(segment < 0 ) segment = 0;
66 if(segment > 35) segment = 35;
71 TPCSectorData* TPCSectorViz::GetSectorData() const
73 return fTPCData ? fTPCData->GetSectorData(fSectorID) : 0;
76 /**************************************************************************/
78 void TPCSectorViz::SetTrans(Bool_t trans)
82 for (Int_t k=0; k<16; ++k)
85 using namespace TMath;
86 Float_t c = Cos((fSectorID + 0.5)*20*Pi()/180 - PiOver2());
87 Float_t s = Sin((fSectorID + 0.5)*20*Pi()/180 - PiOver2());
88 Float_t z = TPCSectorData::GetParam().GetZLength();
89 if(fSectorID >= 18) z = -z;
102 /**************************************************************************/
104 void TPCSectorViz::SetupColor(Int_t val, UChar_t* pixel) const
106 using namespace TMath;
107 Float_t div = Max(1, fMaxVal - fThreshold);
108 Int_t nCol = gStyle->GetNumberOfColors();
109 Int_t cBin = (Int_t) Nint(nCol*(val - fThreshold)/div);
111 ColorFromIdx(gStyle->GetColorPalette(Min(nCol - 1, cBin)), pixel);