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 dynamic_cast<TAttBBox&>(fBoxSet) = dynamic_cast<TAttBBox&>(*this);
68 void TPCSector3D::Paint(Option_t* option)
71 fBoxSet.SetTrans(fTrans);
72 memcpy(fBoxSet.ArrTrans(), fMatrix, 16*sizeof(Double_t));
73 fBoxSet.Paint(option);
77 /**************************************************************************/
79 void TPCSector3D::MakeFrameBox()
81 const TPCSectorData::SegmentInfo& iSeg = TPCSectorData::GetInnSeg();
82 const TPCSectorData::SegmentInfo& o2Seg = TPCSectorData::GetOut2Seg();
84 Float_t x1, x2, y1, y2, D;
85 x1 = 0.5*TPCSectorData::GetNPadsInRow(0)*iSeg.GetPadWidth();
86 x2 = 0.5*o2Seg.GetNMaxPads()*o2Seg.GetPadWidth();
88 y2 = o2Seg.GetRLow() + o2Seg.GetNRows()*o2Seg.GetPadHeight();
91 ColorFromIdx(fFrameColor, fFrameBox.color);
92 Float_t* p = fFrameBox.vertices;
94 p[0] = -x1; p[1] = y1; p[2] = -D; p += 3;
95 p[0] = x1; p[1] = y1; p[2] = -D; p += 3;
96 p[0] = x2; p[1] = y2; p[2] = -D; p += 3;
97 p[0] = -x2; p[1] = y2; p[2] = -D; p += 3;
99 p[0] = -x1; p[1] = y1; p[2] = D; p += 3;
100 p[0] = x1; p[1] = y1; p[2] = D; p += 3;
101 p[0] = x2; p[1] = y2; p[2] = D; p += 3;
102 p[0] = -x2; p[1] = y2; p[2] = D; p += 3;
105 /**************************************************************************/
107 void TPCSector3D::LoadPadrow(TPCSectorData::RowIterator& iter,
108 Float_t xs, Float_t ys, Float_t pw, Float_t ph)
110 Short_t pad, time, val;
111 Float_t x0, x1, z0, z1;
112 Float_t ye = ys + ph;
114 while (iter.NextPad()) {
116 while (iter.Next()) {
120 if(val <= fThreshold || time < fMinTime || time > fMaxTime)
123 fBoxSet.fBoxes.push_back(Reve::Box());
124 SetupColor(val, fBoxSet.fBoxes.back().color);
127 z0 = fZStep*time/fDriftVel;
128 z1 = z0 + fZStep/fDriftVel;
129 Float_t* p = fBoxSet.fBoxes.back().vertices;
131 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
132 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
133 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
134 p[0] = x0; p[1] = ye; p[2] = z0; p += 3;
137 p[0] = x0; p[1] = ys; p[2] = z0; p += 3;
138 p[0] = x1; p[1] = ys; p[2] = z0; p += 3;
139 p[0] = x1; p[1] = ye; p[2] = z0; p += 3;
140 p[0] = x0; p[1] = ye; p[2] = z0;
145 void TPCSector3D::UpdateBoxes()
147 // Populate parent class Reve::BoxSet with digit information.
149 // printf("TPCSector3D update boxes\n");
153 TPCSectorData* data = GetSectorData();
160 // Loop over 3 main segments
161 for (Int_t sId = 0; sId <= 2; ++sId) {
162 if(isOn[sId] == kFALSE)
164 const TPCSectorData::SegmentInfo& sInfo = TPCSectorData::GetSeg(sId);
165 Float_t sy = sInfo.GetRLow();
166 for (Int_t row=sInfo.GetFirstRow(); row<=sInfo.GetLastRow(); ++row) {
167 TPCSectorData::RowIterator i = data->MakeRowIterator(row);
168 Float_t sx = -0.5*TPCSectorData::GetNPadsInRow(row)*sInfo.GetPadWidth();
169 LoadPadrow(i, sx, sy, sInfo.GetPadWidth(), sInfo.GetPadHeight());
170 sy += sInfo.GetPadHeight();
176 fBoxSet.fBoxes.push_back(fFrameBox);