forked from JeffersonLab/EVe_HallC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TWire3D.cxx
57 lines (45 loc) · 1.64 KB
/
TWire3D.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
////*************************************************************************
// TWire3D.cxx - 4/14/2008
//
// by miham
//
// This class is used to create and handle one 3D wire. We use these wires in
// class MWDChamber3D.cxx
//
//
//*************************************************************************
#include "TWire3D.h"
#include "TMath.h"
#include <cstring>
#include <cstdio>
#include <iostream>
#include <sstream>
using namespace std;
TWire3D::TWire3D(double angle, double y1, double z1, double y2, double z2,
double radius, TGeoVolume *WirePlane, int wirenum)
{
//Draw a single wire for WirePlane3D class in a fixed x plane
double x0 = 0.0;
double y0 = (y1+y2)/2.0;
double z0 = (z1+z2)/2.0;
double length = sqrt((y2-y1)*(y2-y1) + (z2-z1)*(z2-z1));
Wiretube = new TGeoEltu("tube",radius, radius, length/2.05);
wire = new TGeoVolume(Form("wire_%d", wirenum),Wiretube);
wire->SetLineColor(kBlack);
TGeoRotation r1;
if(angle>=0)
r1.SetAngles(90,0, angle,90,90-angle,-90);
else
r1.SetAngles(90,0,180+angle,90,90+angle,90);
TGeoTranslation t1(x0, y0, z0);
Wirecomb = new TGeoCombiTrans(t1, r1);
WirePlane->AddNodeOverlap(wire,1,Wirecomb);
// Test code for visibility settings: when Setvisibility or InvisibleAll called here, only the wires will be invisible in 3D view.
// However if Setvisibility or InvisibleAll of wires are called in Wire3DHit() and clea() in WirePlane3D.cxx, it will make the
// whole 3D view will be blank after click 'Show this Event'.
//wire -> SetVisibility(kFALSE);
//wire -> InvisibleAll(kFALSE);
}
TWire3D::~TWire3D()
{
}