3 #include "TPCSector3D.h"
4 #include <Alieve/TPCSectorData.h>
7 using namespace Alieve;
9 //______________________________________________________________________
15 TPCSector3D::TPCSector3D(const Text_t* n, const Text_t* t) :
27 TPCSector3D::~TPCSector3D()
30 /**************************************************************************/
32 UInt_t TPCSector3D::IncRTS()
38 void TPCSector3D::SetRnrFrame(Bool_t rf)
46 /**************************************************************************/
48 void TPCSector3D::ComputeBBox()
50 const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
51 const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
53 #if ROOT_VERSION_CODE <= ROOT_VERSION(5,11,2)
58 Float_t w = o2Seg.GetNMaxPads()*o2Seg.GetPadWidth()/2;
61 fBBox[2] = iSeg.GetRLow();
62 fBBox[3] = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight();
65 Float_t* b = fBoxSet.AssertBBox();
66 for(Int_t i=0; i<6; ++i) { b[i] = fBBox[i]; }
70 void TPCSector3D::Paint(Option_t* option)
73 fBoxSet.SetTrans(fTrans);
74 memcpy(fBoxSet.ArrTrans(), fMatrix, 16*sizeof(Double_t));
75 fBoxSet.Paint(option);
79 /**************************************************************************/
81 void TPCSector3D::MakeFrameBox()
83 const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
84 const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
86 Float_t x1, x2, y1, y2, D;
87 x1 = 0.5*TPCSectorData::GetNPadsInRow(0)*iSeg.GetPadWidth();
88 x2 = 0.5*o2Seg.GetNMaxPads()*o2Seg.GetPadWidth();
90 y2 = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight();
93 ColorFromIdx(fFrameColor, fFrameBox.color);
94 Float_t* p = fFrameBox.vertices;
96 p[0] = -x1; p[1] = y1; p[2] = -D; p += 3;
97 p[0] = x1; p[1] = y1; p[2] = -D; p += 3;
98 p[0] = x2; p[1] = y2; p[2] = -D; p += 3;
99 p[0] = -x2; p[1] = y2; p[2] = -D; p += 3;
101 p[0] = -x1; p[1] = y1; p[2] = D; p += 3;
102 p[0] = x1; p[1] = y1; p[2] = D; p += 3;
103 p[0] = x2; p[1] = y2; p[2] = D; p += 3;
104 p[0] = -x2; p[1] = y2; p[2] = D; p += 3;
107 /**************************************************************************/
109 void TPCSector3D::LoadPadrow(TPCSectorData::RowIterator& iter,
110 Float_t xs, Float_t ys, Float_t pw, Float_t ph)
112 Short_t pad, time, val;
113 Float_t x0, x1, z0, z1;
114 Float_t ye = ys + ph;
116 while (iter.NextPad()) {
118 while (iter.Next()) {
122 if(val <= fThreshold || time < fMinTime || time > fMaxTime)
125 fBoxSet.fBoxes.push_back(Reve::Box());
126 SetupColor(val, fBoxSet.fBoxes.back().color);
129 z0 = fZStep*time/fDriftVel;
130 z1 = z0 + fZStep/fDriftVel;
131 Float_t* p = fBoxSet.fBoxes.back().vertices;
133 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
134 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
135 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
136 p[0] = x0; p[1] = ye; p[2] = z0; p += 3;
139 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
140 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
141 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
142 p[0] = x0; p[1] = ye; p[2] = z0;
147 void TPCSector3D::UpdateBoxes()
149 // Populate parent class Reve::BoxSet with digit information.
151 // printf("TPCSector3D update boxes\n");
155 TPCSectorData* data = GetSectorData();
162 // Loop over 3 main segments
163 for (Int_t sId = 0; sId <= 2; ++sId) {
164 if(isOn[sId] == kFALSE)
166 const TPCSectorData::SegmentInfo& sInfo = TPCSectorData::GetSeg(sId);
167 Float_t sy = sInfo.GetRLow();
168 for (Int_t row=sInfo.GetFirstRow(); row<=sInfo.GetLastRow(); ++row) {
169 TPCSectorData::RowIterator i = data->MakeRowIterator(row);
170 Float_t sx = -0.5*TPCSectorData::GetNPadsInRow(row)*sInfo.GetPadWidth();
171 LoadPadrow(i, sx, sy, sInfo.GetPadWidth(), sInfo.GetPadHeight());
172 sy += sInfo.GetPadHeight();
178 fBoxSet.fBoxes.push_back(fFrameBox);