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();
54 Float_t w = o2Seg.GetNMaxPads()*o2Seg.GetPadWidth()/2;
57 fBBox[2] = iSeg.GetRLow();
58 fBBox[3] = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight();
61 dynamic_cast<TAttBBox&>(fBoxSet) = dynamic_cast<TAttBBox&>(*this);
64 void TPCSector3D::Paint(Option_t* option)
67 fBoxSet.SetTrans(fTrans);
68 memcpy(fBoxSet.ArrTrans(), fMatrix, 16*sizeof(Double_t));
69 fBoxSet.Paint(option);
73 /**************************************************************************/
75 void TPCSector3D::MakeFrameBox()
77 const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
78 const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
80 Float_t x1, x2, y1, y2, D;
81 x1 = 0.5*TPCSectorData::GetNPadsInRow(0)*iSeg.GetPadWidth();
82 x2 = 0.5*o2Seg.GetNMaxPads()*o2Seg.GetPadWidth();
84 y2 = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight();
87 ColorFromIdx(fFrameColor, fFrameBox.color);
88 Float_t* p = fFrameBox.vertices;
90 p[0] = -x1; p[1] = y1; p[2] = -D; p += 3;
91 p[0] = x1; p[1] = y1; p[2] = -D; p += 3;
92 p[0] = x2; p[1] = y2; p[2] = -D; p += 3;
93 p[0] = -x2; p[1] = y2; p[2] = -D; p += 3;
95 p[0] = -x1; p[1] = y1; p[2] = D; p += 3;
96 p[0] = x1; p[1] = y1; p[2] = D; p += 3;
97 p[0] = x2; p[1] = y2; p[2] = D; p += 3;
98 p[0] = -x2; p[1] = y2; p[2] = D; p += 3;
101 /**************************************************************************/
103 void TPCSector3D::LoadPadrow(TPCSectorData::RowIterator& iter,
104 Float_t xs, Float_t ys, Float_t pw, Float_t ph)
106 Short_t pad, time, val;
107 Float_t x0, x1, z0, z1;
108 Float_t ye = ys + ph;
110 while (iter.NextPad()) {
112 while (iter.Next()) {
116 if(val <= fThreshold || time < fMinTime || time > fMaxTime)
119 fBoxSet.fBoxes.push_back(Reve::Box());
120 SetupColor(val, fBoxSet.fBoxes.back().color);
123 z0 = fZStep*time/fDriftVel;
124 z1 = z0 + fZStep/fDriftVel;
125 Float_t* p = fBoxSet.fBoxes.back().vertices;
127 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
128 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
129 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
130 p[0] = x0; p[1] = ye; p[2] = z0; p += 3;
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;
141 void TPCSector3D::UpdateBoxes()
143 // Populate parent class Reve::BoxSet with digit information.
145 // printf("TPCSector3D update boxes\n");
149 TPCSectorData* data = GetSectorData();
156 // Loop over 3 main segments
157 for (Int_t sId = 0; sId <= 2; ++sId) {
158 if(isOn[sId] == kFALSE)
160 const TPCSectorData::SegmentInfo& sInfo = TPCSectorData::GetSeg(sId);
161 Float_t sy = sInfo.GetRLow();
162 for (Int_t row=sInfo.GetFirstRow(); row<=sInfo.GetLastRow(); ++row) {
163 TPCSectorData::RowIterator i = data->MakeRowIterator(row);
164 Float_t sx = -0.5*TPCSectorData::GetNPadsInRow(row)*sInfo.GetPadWidth();
165 LoadPadrow(i, sx, sy, sInfo.GetPadWidth(), sInfo.GetPadHeight());
166 sy += sInfo.GetPadHeight();
172 fBoxSet.fBoxes.push_back(fFrameBox);