11 #include "TPolyLine3D.h" 49 fHitData.push_back(
HitData(v,p,c,tp,zp,q,t));
61 std::sort(fHitData.begin(), fHitData.end(),
comp_hitdata);
67 TPolyLine3D* polyline = 0;
69 for (i=0; i<fHitData.size(); ++
i) {
72 double pos0[3] = {0,0,0};
73 double pos1[3] = {0,0,0};
74 double dpos[3] = {0,0,0};
78 pos0[0] = hit0.
fTpos - dpos[0];
82 pos1[0] = hit0.
fTpos + dpos[0];
88 pos0[1] = hit0.
fTpos-dpos[1];
92 pos1[1] = hit0.
fTpos+dpos[1];
98 bool connectL =
false;
100 const HitData& hitL = fHitData[i-1];
104 bool sameTime = (
fabs(hit0.
fT-hitL.
fT)<tcut);
105 if (samePlane && adjaCell && sameTime) connectL =
true;
109 bool connectR =
false;
110 if (i+1<fHitData.size()) {
111 const HitData& hitR = fHitData[i+1];
115 bool sameTime = (
fabs(hit0.
fT-hitR.
fT)<tcut);
116 if (samePlane && adjaCell && sameTime) connectR =
true;
121 if (connectL ==
false) {
124 double stubfrac = 1.90;
134 x0 = x1 - stubfrac*dpos[0];
144 y0 = y1 - stubfrac*dpos[1];
155 polyline->SetPoint(ipoint,x0,y0,z0); ++ipoint;
156 polyline->SetPoint(ipoint,x1,y1,z1); ++ipoint;
163 <<
" Polyline=0? connectL=" << connectL <<
std::endl;
167 polyline->SetPoint(ipoint, pos0[0], pos0[1], pos0[2]); ++ipoint;
168 polyline->SetPoint(ipoint, pos1[0], pos1[1], pos1[2]); ++ipoint;
172 if (connectR ==
false) {
175 double stubfrac = 1.90;
185 x1 = x0 + stubfrac*dpos[0];
195 y1 = y0 + stubfrac*dpos[1];
199 polyline->SetPoint(ipoint, x0, y0, z0); ++ipoint;
200 polyline->SetPoint(ipoint, x1, y1, z1); ++ipoint;
float fQ
Charge (arb. units)
float fTpos
Transverse position (X or Y, cm)
fvar< T > fabs(const fvar< T > &x)
float fT
Time (arb. units)
Float_t y1[n_points_granero]
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
bool comp_hitdata(const HitData &h1, const HitData &h2)
Float_t x1[n_points_granero]
Vertical planes which measure X.
void Draw(evdb::View3D *view)
Horizontal planes which measure Y.
void CellInfo(unsigned int ip, unsigned int ic, View_t *view=0, double *pos=0, double *dpos=0) const
float fZpos
Longitudinal postiion (Z, cm)
TPolyLine3D & AddPolyLine3D(int n, int c, int w, int s)
double DetHalfHeight() const
double DetHalfWidth() const
Plot hits (Raw, Calib, ...) as a tower in 3D.
int fView
Which view is the hit in? (X or Y)
A collection of 3D drawable objects.
HitData(int v, int p, int c, float tp, float zp, float q, float t)
void AddHit(int v, int p, int c, float tp, float zp, float q, float t)
Some glue so that hits of various types call all use the HitTower class.
Encapsulate the geometry of one entire detector (near, far, ndos)