]>
Commit | Line | Data |
---|---|---|
b56d8877 | 1 | // $Header$ |
2 | ||
915dabe1 | 3 | #include "TPCSector2D.h" |
5a5a1232 | 4 | |
915dabe1 | 5 | #include <Alieve/TPCData.h> |
6 | #include <Alieve/TPCSectorData.h> | |
7 | ||
8 | #include <AliTPCParam.h> | |
5a5a1232 | 9 | |
092578a7 | 10 | #include <TBuffer3D.h> |
11 | #include <TBuffer3DTypes.h> | |
12 | #include <TVirtualPad.h> | |
13 | #include <TVirtualViewer3D.h> | |
14 | ||
5a5a1232 | 15 | using namespace Reve; |
16 | using namespace Alieve; | |
17 | using namespace std; | |
18 | ||
092578a7 | 19 | //______________________________________________________________________ |
20 | // TPCSector2D | |
21 | // | |
22 | // Displays TPC raw-data in 2D. | |
23 | // | |
24 | // fShowMax: true - display maximum value for given time interval | |
25 | // false - display integral | |
26 | // fAverage: only available when fShowMax = false; divide by time window width | |
27 | // | |
28 | // fUseTexture: use OpenGL textures to display data (fast rendering, | |
29 | // updates take the same time) | |
30 | // | |
31 | ||
2aef44c1 | 32 | ClassImp(TPCSector2D) |
5a5a1232 | 33 | |
34 | /**************************************************************************/ | |
35 | ||
092578a7 | 36 | TPCSector2D::TPCSector2D(const Text_t* n, const Text_t* t) : |
37 | TPCSectorViz(n,t), | |
b56d8877 | 38 | |
092578a7 | 39 | fShowMax (kTRUE), |
40 | fAverage (kFALSE), | |
915dabe1 | 41 | |
a8600b56 | 42 | fUseTexture (kTRUE), |
43 | fPickEmpty (kFALSE), | |
44 | fPickMode (0) | |
092578a7 | 45 | {} |
5a5a1232 | 46 | |
915dabe1 | 47 | TPCSector2D::~TPCSector2D() |
092578a7 | 48 | {} |
5a5a1232 | 49 | |
50 | /**************************************************************************/ | |
51 | ||
915dabe1 | 52 | void TPCSector2D::ComputeBBox() |
5a5a1232 | 53 | { |
915dabe1 | 54 | const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg(); |
55 | const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg(); | |
5a5a1232 | 56 | |
606c4ed7 | 57 | #if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2) |
5a5a1232 | 58 | bbox_init(); |
606c4ed7 | 59 | #else |
60 | BBoxInit(); | |
61 | #endif | |
915dabe1 | 62 | Float_t w = o2Seg.GetNMaxPads()*o2Seg.GetPadWidth()/2; |
63 | fBBox[0] = -w; | |
64 | fBBox[1] = w; | |
65 | fBBox[2] = iSeg.GetRLow(); | |
66 | fBBox[3] = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight(); | |
67 | fBBox[4] = -0.5; // Fake z-width to 1 cm. | |
68 | fBBox[5] = 0.5; | |
5a5a1232 | 69 | } |
70 | ||
71 | /**************************************************************************/ | |
72 | ||
915dabe1 | 73 | void TPCSector2D::Paint(Option_t* ) |
5a5a1232 | 74 | { |
092578a7 | 75 | if(fRnrElement == kFALSE) |
76 | return; | |
77 | ||
5a5a1232 | 78 | TBuffer3D buffer(TBuffer3DTypes::kGeneric); |
79 | ||
80 | // Section kCore | |
81 | buffer.fID = this; | |
82 | buffer.fColor = 1; | |
83 | buffer.fTransparency = 0; | |
601bca51 | 84 | fHMTrans.SetBuffer3D(buffer); |
5a5a1232 | 85 | buffer.SetSectionsValid(TBuffer3D::kCore); |
86 | ||
5a5a1232 | 87 | Int_t reqSections = gPad->GetViewer3D()->AddObject(buffer); |
88 | if (reqSections == TBuffer3D::kNone) { | |
5a5a1232 | 89 | return; |
90 | } | |
915dabe1 | 91 | |
601bca51 | 92 | Error("TPCSector2D::Paint", "only direct OpenGL rendering supported."); |
5a5a1232 | 93 | } |