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.Paint(option);
70 /**************************************************************************/
72 void TPCSector3D::MakeFrameBox()
74 const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
75 const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
77 Float_t x1, x2, y1, y2, D;
78 x1 = 0.5*TPCSectorData::GetNPadsInRow(0)*iSeg.GetPadWidth();
79 x2 = 0.5*o2Seg.GetNMaxPads()*o2Seg.GetPadWidth();
81 y2 = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight();
84 ColorFromIdx(fFrameColor, fFrameBox.color);
85 Float_t* p = fFrameBox.vertices;
87 p[0] = -x1; p[1] = y1; p[2] = -D; p += 3;
88 p[0] = x1; p[1] = y1; p[2] = -D; p += 3;
89 p[0] = x2; p[1] = y2; p[2] = -D; p += 3;
90 p[0] = -x2; p[1] = y2; p[2] = -D; p += 3;
92 p[0] = -x1; p[1] = y1; p[2] = D; p += 3;
93 p[0] = x1; p[1] = y1; p[2] = D; p += 3;
94 p[0] = x2; p[1] = y2; p[2] = D; p += 3;
95 p[0] = -x2; p[1] = y2; p[2] = D; p += 3;
98 /**************************************************************************/
100 void TPCSector3D::LoadPadrow(TPCSectorData::RowIterator& iter,
101 Float_t xs, Float_t ys, Float_t pw, Float_t ph)
103 Short_t pad, time, val;
104 Float_t x0, x1, z0, z1;
105 Float_t ye = ys + ph;
107 while (iter.NextPad()) {
109 while (iter.Next()) {
113 if(val <= fThreshold || time < fMinTime || time > fMaxTime)
116 fBoxSet.fBoxes.push_back(Reve::Box());
117 SetupColor(val, fBoxSet.fBoxes.back().color);
120 z0 = fZStep*time/fDriftVel;
121 z1 = z0 + fZStep/fDriftVel;
122 Float_t* p = fBoxSet.fBoxes.back().vertices;
124 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
125 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
126 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
127 p[0] = x0; p[1] = ye; p[2] = z0; p += 3;
130 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
131 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
132 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
133 p[0] = x0; p[1] = ye; p[2] = z0;
138 void TPCSector3D::UpdateBoxes()
140 // Populate parent class Reve::BoxSet with digit information.
142 // printf("TPCSector3D update boxes\n");
146 TPCSectorData* data = GetSectorData();
153 // Loop over 3 main segments
154 for (Int_t sId = 0; sId <= 2; ++sId) {
155 if(isOn[sId] == kFALSE)
157 const TPCSectorData::SegmentInfo& sInfo = TPCSectorData::GetSeg(sId);
158 Float_t sy = sInfo.GetRLow();
159 for (Int_t row=sInfo.GetFirstRow(); row<=sInfo.GetLastRow(); ++row) {
160 TPCSectorData::RowIterator i = data->MakeRowIterator(row);
161 Float_t sx = -0.5*TPCSectorData::GetNPadsInRow(row)*sInfo.GetPadWidth();
162 LoadPadrow(i, sx, sy, sInfo.GetPadWidth(), sInfo.GetPadHeight());
163 sy += sInfo.GetPadHeight();
169 fBoxSet.fBoxes.push_back(fFrameBox);