LDMX Software
EveDetectorGeometry.cxx
Go to the documentation of this file.
1
9
10namespace eventdisplay {
11
13 hcal_ = new TEveElementList("HCAL");
14 sidehcal_ = new TEveElementList("Side HCAL");
15 ecal_ = new TEveElementList("ECAL");
16 recoilTracker_ = new TEveElementList("Recoil Tracker");
17 detector_ = new TEveElementList("LDMX Detector");
18
19 drawECAL();
20 drawHCAL();
22}
23
25 for (int col = 0; col < 7; ++col) {
26 TString colName;
27 colName.Form("Tower %d", col);
28 TEveGeoShape* hexCol = EveShapeDrawer::getInstance().drawHexPrism(
29 DetectorGeometry::getInstance().getHexTower(col), 0, 0, 0, kBlue, 90,
30 colName);
31
32 ecal_->AddElement(hexCol);
33 }
34
35 detector_->AddElement(ecal_);
36}
37
39 TEveGeoShape* backHcal = EveShapeDrawer::getInstance().drawRectPrism(
40 DetectorGeometry::getInstance().getBoundingBox(
41 ldmx::HcalID::HcalSection::BACK),
42 0, 0, 0, kCyan, 90, "Back HCal");
43 hcal_->AddElement(backHcal);
44
45 TEveGeoShape* sideTopHcal = EveShapeDrawer::getInstance().drawRectPrism(
46 DetectorGeometry::getInstance().getBoundingBox(
47 ldmx::HcalID::HcalSection::TOP),
48 0, 0, 0, kCyan, 90, "Module 1");
49
50 sidehcal_->AddElement(sideTopHcal);
51
52 TEveGeoShape* sideBottomHcal = EveShapeDrawer::getInstance().drawRectPrism(
53 DetectorGeometry::getInstance().getBoundingBox(
54 ldmx::HcalID::HcalSection::BOTTOM),
55 0, 0, 0, kCyan, 90, "Module 4");
56
57 sidehcal_->AddElement(sideBottomHcal);
58
59 TEveGeoShape* sideLeftHcal = EveShapeDrawer::getInstance().drawRectPrism(
60 DetectorGeometry::getInstance().getBoundingBox(
61 ldmx::HcalID::HcalSection::LEFT),
62 0, 0, 0, kCyan, 90, "Module 2");
63
64 sidehcal_->AddElement(sideLeftHcal);
65
66 TEveGeoShape* sideRightHcal = EveShapeDrawer::getInstance().drawRectPrism(
67 DetectorGeometry::getInstance().getBoundingBox(
68 ldmx::HcalID::HcalSection::RIGHT),
69 0, 0, 0, kCyan, 90, "Module 3");
70
71 sidehcal_->AddElement(sideRightHcal);
72 hcal_->AddElement(sidehcal_);
73
74 detector_->AddElement(hcal_);
75}
76
78 for (int layerID = 1; layerID < 9; layerID++) {
79 TString name;
80 name.Form("Stereo_%d", layerID);
81
82 TEveGeoShape* layer = EveShapeDrawer::getInstance().drawRectPrism(
83 DetectorGeometry::getInstance().getBoundingBox(layerID, 0), 0, 0,
84 DetectorGeometry::getInstance().getRotAngle(layerID, 0) * 180 / M_PI,
85 kRed - 10, 90, name);
86
87 recoilTracker_->AddElement(layer);
88 }
89
90 for (int layerID = 9; layerID < 11; layerID++) {
91 for (int moduleID = 0; moduleID < 10; moduleID++) {
92 TString name;
93 name.Form("Mono_%d_%d", layerID, moduleID);
94
95 TEveGeoShape* layer = EveShapeDrawer::getInstance().drawRectPrism(
96 DetectorGeometry::getInstance().getBoundingBox(layerID, moduleID), 0,
97 0,
98 DetectorGeometry::getInstance().getRotAngle(layerID, moduleID) * 180 /
99 M_PI,
100 kRed - 10, 90, name);
101
102 recoilTracker_->AddElement(layer);
103 }
104 }
105
106 detector_->AddElement(recoilTracker_);
107
108 return;
109}
110} // namespace eventdisplay
Header file for EveDetectorGeometry Class.
static const DetectorGeometry & getInstance()
Get the single instance of this class.
EveDetectorGeometry()
Constructor Builds and draws all of the detector elements.
void drawRecoilTracker()
Draw the elements of the Recoil Tracker.
void drawECAL()
Draw the elements of the ECAL.
void drawHCAL()
Draw the elements of the HCAL.
TEveGeoShape * drawRectPrism(Double_t xPos, Double_t yPos, Double_t zPos, Double_t dX, Double_t dY, Double_t dZ, Double_t xRot, Double_t yRot, Double_t zRot, Int_t color, Int_t transparency, TString name)
Draw a rectangular prism.
TEveGeoShape * drawHexPrism(Double_t xPos, Double_t yPos, Double_t zPos, Double_t xRot, Double_t yRot, Double_t zRot, Double_t h, Double_t r, Int_t color, Int_t transparency, TString name)
Draw a hexagonal prism.
static EveShapeDrawer & getInstance()
Get Instance of Drawer.